std::scoped_allocator_adaptor::construct
![]() | This page has been machine-translated from the English version of the wiki using Google Translate. The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Definido no cabeçalho <scoped_allocator> | ||
template<class T, class... Args> void construct( T* p, Args&&... args) | (1) | |
template<class T1, class T2, class... Args1, class... Args2> void construct(std::pair<T1, T2>* p, | (2) | |
template<class T1, class T2 > void construct(std::pair<T1, T2>* p ) | (3) | |
template<class T1, class T2, class U, class V > void construct(std::pair<T1, T2>* p, U&& x, V&& y ) | (4) | |
(5) | ||
(6) | ||
p
usando OuterAllocator e os argumentos do construtor prestados. Se o objeto é do tipo que se usa alocadores, ou se é std :: pair, passa InnerAllocator até o objeto construído.p
using OuterAllocator and the provided constructor arguments. If the object is of type that itself uses allocators, or if it is std::pair, passes InnerAllocator down to the constructed object.You can help to correct and verify the translation. Click here for instructions.
OUTERMOST
: é o tipo que seria devolvido chamando this->outer_allocator(), e em seguida, chamar a função membro outer_allocator()
recursivamente sobre o resultado dessa chamada até atingir o tipo que não tem função de membro de tal. Esse tipo é o alocador externa.OUTERMOST
: it is the type that would be returned by calling this->outer_allocator(), and then calling the outer_allocator()
member function recursively on the result of this call until reaching the type that has no such member function. That type is the outermost allocator.You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
T
tipo não use alocadores) e se std::is_constructible<T, Args...>::value==true, então chamaT
does not use allocators) and if std::is_constructible<T, Args...>::value==true, then callsYou can help to correct and verify the translation. Click here for instructions.
std::allocator_traits<OUTERMOST>::construct( OUTERMOST(*this),
p,
std::forward<Args>(args)... );
T
tipo usa alocadores, por exemplo, é um recipiente) e se std::is_constructible<T, std::allocator_arg_t, inner_allocator_type, Args...>::value==true, então chama T
uses allocators, e.g. it is a container) and if std::is_constructible<T, std::allocator_arg_t, inner_allocator_type, Args...>::value==true, then calls You can help to correct and verify the translation. Click here for instructions.
std::allocator_traits<OUTERMOST>::construct( OUTERMOST(*this),
p,
std::allocator_arg,
inner_allocator(),
std::forward<Args>(args)... );
T
tipo usa alocadores, por exemplo, é um recipiente) e se std::is_constructible<T, Args..., inner_allocator_type>::value==true, então chamaT
uses allocators, e.g. it is a container) and if std::is_constructible<T, Args..., inner_allocator_type>::value==true, then callsYou can help to correct and verify the translation. Click here for instructions.
std::allocator_traits<OUTERMOST>::construct( OUTERMOST(*this),
p,
std::forward<Args>(args)...,
inner_allocator());
std::uses_allocator<T>
afirmou que T
é alocador-consciente, que carece de qualquer forma de alocador de aceitação de construtores.std::uses_allocator<T>
claimed that T
is allocator-aware, it lacks either form of allocator-accepting constructors.You can help to correct and verify the translation. Click here for instructions.
T1
T2
é alocador-ciente, modifica os tuplos x
e y
para incluir o alocador apropriado interior, resultando em dois tuplos novos xprime
yprime
e, de acordo com as seguintes três regras:T1
or T2
is allocator-aware, modifies the tuples x
and y
to include the appropriate inner allocator, resulting in the two new tuples xprime
and yprime
, according to the following three rules:You can help to correct and verify the translation. Click here for instructions.
T1
não é alocador-aware (std::uses_allocator<T1, inner_allocator_type>::value==false, então xprime
é x
, sem modificações. (Também é necessário que std::is_constructible<T1, Args1...>::value==true)T1
is not allocator-aware (std::uses_allocator<T1, inner_allocator_type>::value==false, then xprime
is x
, unmodified. (it is also required that std::is_constructible<T1, Args1...>::value==true)You can help to correct and verify the translation. Click here for instructions.
T1
é alocador-aware (std::uses_allocator<T1, inner_allocator_type>::value==true), e seu construtor tem uma tag alocador ( std::is_constructible<T1, std::allocator_arg_t, inner_allocator_type, Args1...>::value==true, então é xprime
T1
is allocator-aware (std::uses_allocator<T1, inner_allocator_type>::value==true), and its constructor takes an allocator tag (std::is_constructible<T1, std::allocator_arg_t, inner_allocator_type, Args1...>::value==true, then xprime
isYou can help to correct and verify the translation. Click here for instructions.
std::tuple_cat(std::tuple<std::allocator_arg_t, inner_allocator_type&>(std::allocator_arg,
inner_allocator_type()
), x)
T1
é alocador-aware (std::uses_allocator<T1, inner_allocator_type>::value==true), e seu construtor tem o alocador como último argumento (std::is_constructible<T1, Args1..., inner_allocator_type>::value==true), então é xprime
std::tuple_cat(x, std::tuple<inner_allocator_type&>(inner_allocator_type())).T1
is allocator-aware (std::uses_allocator<T1, inner_allocator_type>::value==true), and its constructor takes the allocator as the last argument (std::is_constructible<T1, Args1..., inner_allocator_type>::value==true), then xprime
is std::tuple_cat(x, std::tuple<inner_allocator_type&>(inner_allocator_type())).You can help to correct and verify the translation. Click here for instructions.
T2
ea substituição de y
com yprime
T2
and the replacement of y
with yprime
You can help to correct and verify the translation. Click here for instructions.
xprime
e yprime
são construídos (isto também requer que todos os tipos de Args1... e Args2... são CopyConstructible
), constrói a p
par de armazenamento alocado chamandoxprime
and yprime
are constructed (this also requires that all types in Args1... and Args2... are CopyConstructible
), constructs the pair p
in allocated storage by callingYou can help to correct and verify the translation. Click here for instructions.
std::allocator_traits<OUTERMOST>::construct( OUTERMOST(*this),
p,
std::piecewise_construct,
xprime,
yprime);
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
construct(p, std::piecewise_construct, std::forward_as_tuple(std::forward<U>(x)),
std::forward_as_tuple(std::forward<V>(y)))
You can help to correct and verify the translation. Click here for instructions.
construct(p, std::piecewise_construct, std::forward_as_tuple(xy.first),
std::forward_as_tuple(xy.second))
You can help to correct and verify the translation. Click here for instructions.
construct(p, std::piecewise_construct, std::forward_as_tuple(std::forward<U>(xy.first)),
std::forward_as_tuple(std::forward<V>(xy.second)))
Índice |
[editar]Parâmetros
p | - | ponteiro para alocada, mas não inicializada armazenamento Original: pointer to allocated, but not initialized storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
args... | - | o construtor argumentos para passar para o construtor de T Original: the constructor arguments to pass to the constructor of T The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
x | - | o construtor argumentos para passar para o construtor de T1 Original: the constructor arguments to pass to the constructor of T1 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
y | - | o construtor argumentos para passar para o construtor de T2 Original: the constructor arguments to pass to the constructor of T2 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
xy | - | o par cujos membros são dois os argumentos do construtor para T1 e T2 Original: the pair whose two members are the constructor arguments for T1 and T2 The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar]Valor de retorno
You can help to correct and verify the translation. Click here for instructions.
[editar]Notas
inner_allocator
é por si só uma instância de std::scoped_allocator_adaptor, esta função também será chamado quando os objetos alocador-aware construídos através desta função começar a construir seus próprios membros.inner_allocator
is itself an instance of std::scoped_allocator_adaptor, this function will also be called when the allocator-aware objects constructed through this function start constructing their own members.You can help to correct and verify the translation. Click here for instructions.
[editar]Veja também
[estática] | constrói um objeto no armazenamento alocado Original: constructs an object in the allocated storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de função) |
constrói um objeto no armazenamento alocado Original: constructs an object in allocated storage The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (of std::allocator função pública membro) |