首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

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构造基类。OuterAllocstd::forward<OuterA2>(outerAlloc),以及内部分配器innerAllocs...。此重载只参与以下情况下的过载解决方案:std::is_constructible<OuterAlloc, OuterA2>::valuetrue...

3%29复制构造函数:从other...

other*this...

other。此重载只参与以下情况下的过载解决方案:std::is_constructible<OuterAlloc, const OuterA2&>::valuetrue...

other,使用移动语义。此重载只参与在下列情况下的重载解决方案:std::is_constructible<OuterAlloc, OuterA2>::valuetrue...

参数

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)

代码语言:txt
复制
 © cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券