构造对象。
template<class Ty, class... Atypes>
void construct(Ty *ptr, Atypes&&... args);
template<class Ty1, class Ty2, class... Atypes1, class... Atypes2>
void construct(pair<Ty1, Ty2> *ptr, piecewise_construct_t,
tuple<Atypes1&&...> first, tuple<Atypes1&&...> second);
template<class Ty1, class Ty2>
void construct(pair<Ty1, Ty2> *ptr);
template<class Ty1, class Ty2, class Uy1, class Uy2>
void construct(pair<Ty1, Ty2> *ptr,
class Uy1&& first, class Uy2&& second);
template<class Ty1, class Ty2, class Uy1, class Uy2>
void construct(pair<Ty1, Ty2> *ptr, const pair<Uy1, Uy2>& right);
template<class Ty1, class Ty2, class Uy1, class Uy2>
void construct(pair<Ty1, Ty2> *ptr, pair<Uy1, Uy2>&& right);
参数
ptr
将对对象构造的内存位置的指针。args
参数列表。first
第一个输入的对象对。second
第二个输入的对象对。right
将移动或复制的现有对象。
备注
第一方法构造对象。ptr 通过调用 Outermost_traits::construct(OUTERMOST(*this), ptr, xargs...),是 xargs... 之一。
如果 uses_allocator<Ty, inner_allocator_type> 对负错误,则 xargs... 为 args...。
如果应用 uses_allocator<Ty, inner_allocator_type>,因此,应用 is_constructible<Ty, allocator_arg_t, inner_allocator_type, args...>,则 xargs... 为 allocator_arg, inner_allocator(), args...。
如果应用 uses_allocator<Ty, inner_allocator_type>,因此,应用 is_constructible<Ty, args..., inner_allocator()>,则 xargs... 为 args..., inner_allocator()。
第二个对方法构造对象。通过调用 ptrOutermost_traits::construct(OUTERMOST(*this), &ptr->first, xargs...),xargs... 是在上述列表中修改的 first... 和 Outermost_traits::construct(OUTERMOST(*this), &ptr->second, xargs...),xargs... 是在上述列表中修改的 second...。
第三种方法的行为与 this->construct(ptr, piecewise_construct, tuple<>, tuple<>)相同。
第四种方法的行为与 this->construct(ptr, piecewise_construct, forward_as_tuple(std::forward<Uy1>(first), forward_as_tuple(std::forward<Uy2>(second))相同。
第五种方法的行为与 this->construct(ptr, piecewise_construct, forward_as_tuple(right.first), forward_as_tuple(right.second))相同。
第六方法的行为与 this->construct(ptr, piecewise_construct, forward_as_tuple(std::forward<Uy1>(right.first), forward_as_tuple(std::forward<Uy2>(right.second))相同。
要求
页眉: <scoped_allocator>
命名空间: std