std::scoped_allocator_adaptor::scoped_allocator_adaptor
STD:范围[医]分配器[医]适配器::作用域[医]分配器[医]适配器
Defined in header | | |
---|---|---|
scoped_allocator_adaptor( | (1) | (since C++11) |
template< class OuterA2 > scoped_allocator_adaptor( OuterA2&& outerAlloc, const InnerAllocs&... innerAllocs) noexcept; | (2) | (since C++11) |
scoped_allocator_adaptor( const scoped_allocator_adaptor& other ) noexcept; | (3) | (since C++11) |
scoped_allocator_adaptor( scoped_allocator_adaptor&& other ) noexcept; | (4) | (since C++11) |
template< class OuterA2 > scoped_allocator_adaptor( const scoped_allocator_adaptor<OuterA2, InnerAllocs...>& other ) noexcept; | (5) | (since C++11) |
template< class OuterA2 > scoped_allocator_adaptor( scoped_allocator_adaptor<OuterA2, InnerAllocs...>&& other ) noexcept; | (6) | (since C++11) |
1%29默认构造函数:值-初始化OuterAlloc
基类和内部分配器成员对象(如果由实现使用)。
2%29构造基类。OuterAlloc从std::forward<OuterA2>(outerAlloc),以及内部分配器innerAllocs...。此重载只参与以下情况下的过载解决方案:std::is_constructible<OuterAlloc, OuterA2>::value是true...
3%29复制构造函数:从other
...
other
进*this
...
other。此重载只参与以下情况下的过载解决方案:std::is_constructible<OuterAlloc, const OuterA2&>::value是true...
other,使用移动语义。此重载只参与在下列情况下的重载解决方案:std::is_constructible<OuterAlloc, OuterA2>::value是true...
参数
outerAlloc | - | constructor argument for the outer allocator |
---|---|---|
innerAllocs... | - | constructor arguments for the inner allocators |
other | - | another std::scoped_allocator_adaptor |
例外
2-6%29
noexcept
规格:
noexcept
缺陷报告
以下行为更改缺陷报告追溯应用于先前发布的C++标准。
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 2782 | C++11 | constructors taking OuterA2 weren't constrained, interfering with metaprogramming | constraint added |
另见
allocate | allocates uninitialized storage using the outer allocator (public member function) |
---|---|
construct | constructs an object in allocated storage, passing the inner allocator to its constructor if appropriate (public member function) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
http://en.cppreference.com/w/cpp/Memory/作用域[医]分配器[医]适配器/作用域[医]分配器[医]适配器