##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::pmr::polymorphic_allocator::polymorphic_allocator

From cppreference.com
< cpp‎ | experimental‎ | polymorphic allocator

polymorphic_allocator(); | (1) |
polymorphic_allocator( const polymorphic_allocator& other ) = default; | (2) |
template< class U > polymorphic_allocator( const polymorphic_allocator<U>& other ); | (3) |
polymorphic_allocator( memory_resource* r); | (4) |

Constructs a new `polymorphic_allocator`.

1) Constructs a `polymorphic_allocator` using the return value of std::experimental::pmr::get_default_resource() as the underlying memory resource.
2-3) Constructs a `polymorphic_allocator` using other.resource() as the underlying memory resource.
4) Constructs a `polymorphic_allocator` using `r` as the underlying memory resource. This constructor provides an implicit conversion from `memory_resource*`.

### [edit] Parameters

other | - | another `polymorphic_allocator` to copy from
r | - | pointer to the memory resource to use. May not be null.

### [edit] Exceptions

1,3)
`noexcept` specification:
noexcept
4) Throws nothing.
Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/polymorphic_allocator/polymorphic_allocator&oldid=91348"
Category:

- unconditionally noexcept

Hidden categories:

- Pages with unreviewed unconditional noexcept template
- Pages with unreviewed noexcept template