std::scoped_allocator_adaptor::scoped_allocator_adaptor
| Defined in header <scoped_allocator> |  |  | 
|---|---|---|
| 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。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

