Share via


scoped_allocator_adaptor::construct (método)

Construye un objeto.

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);

Parámetros

  • ptr
    Un puntero a la ubicación de memoria donde se creó el objeto.

  • args
    Una lista de argumentos.

  • first
    Un objeto del primer tipo de un par.

  • second
    Un objeto del segundo tipo en un par.

  • right
    Un objeto existente que se mover o copiar.

Comentarios

El primer método construye el objeto en ptr llamando a Outermost_traits::construct(OUTERMOST(*this), ptr, xargs...), donde uno xargs... de siguiente.

  • Si uses_allocator<Ty, inner_allocator_type> se considera false, después xargs... es args...

  • Si uses_allocator<Ty, inner_allocator_type> es true, y is_constructible<Ty, allocator_arg_t, inner_allocator_type, args...> es true, el xargs... es allocator_arg, inner_allocator(), args...

  • Si uses_allocator<Ty, inner_allocator_type> es true, y is_constructible<Ty, args..., inner_allocator()> es true, el xargs... es args..., inner_allocator().

El segundo método construye el objeto de pares en ptr llamando a Outermost_traits::construct(OUTERMOST(*this), &ptr->first, xargs...), donde es first...xargs... modificado como en la lista anterior, y Outermost_traits::construct(OUTERMOST(*this), &ptr->second, xargs...), donde es second...xargs... modificado como en la lista anterior.

El tercer método se comporta igual que this->construct(ptr, piecewise_construct, tuple<>, tuple<>).

El cuarto método se comporta igual que this->construct(ptr, piecewise_construct, forward_as_tuple(std::forward<Uy1>(first), forward_as_tuple(std::forward<Uy2>(second)).

El quinto método se comporta igual que this->construct(ptr, piecewise_construct, forward_as_tuple(right.first), forward_as_tuple(right.second)).

El sexto método se comporta igual que this->construct(ptr, piecewise_construct, forward_as_tuple(std::forward<Uy1>(right.first), forward_as_tuple(std::forward<Uy2>(right.second)).

Requisitos

scoped_allocator <deEncabezado: >

Espacio de nombres: std

Vea también

Referencia

scoped_allocator_adaptor (clase)

allocator_traits::construct (método)