std::experimental::pmr::polymorphic_allocator<T>:: polymorphic_allocator
From cppreference.net
<
cpp
|
experimental
|
polymorphic allocator
|
polymorphic_allocator
(
)
noexcept
;
|
(1) | |
|
polymorphic_allocator
(
const
polymorphic_allocator
&
other
)
noexcept
=
default
;
|
(2) | |
|
template
<
class
U
>
polymorphic_allocator ( const polymorphic_allocator < U > & other ) noexcept ; |
(3) | |
|
polymorphic_allocator
(
memory_resource
*
r
)
;
|
(4) | |
构造一个新的
polymorphic_allocator
。
1)
构造一个
polymorphic_allocator
,使用
std::
experimental
::
pmr
::
get_default_resource
(
)
的返回值作为底层内存资源。
2,3)
使用
other.
resource
(
)
作为底层内存资源来构造一个
polymorphic_allocator
。
4)
使用
r
作为底层内存资源构造一个
polymorphic_allocator
。该构造函数提供从
memory_resource*
的隐式转换。
参数
| other | - |
要复制的另一个
polymorphic_allocator
|
| r | - | 指向要使用的内存资源的指针。不可为空 |
异常
4)
不抛出任何异常。