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. |
<metanoindex/>
<tbody> </tbody>| Déclaré dans l'en-tête <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, std::piecewise_construct_t, std::tuple<Args1...> x, std::tuple<Args2...> y ) |
(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) | |
template< class T1, class T2, class U, class V > void construct( std::pair<T1, T2>* p, const std::pair<U, V>& xy ) |
(5) | |
template< class T1, class T2, class U, class V > void construct( std::pair<T1, T2>* p, std::pair<U, V>&& xy ); |
(6) | |
p utilisant OuterAllocator et les arguments du constructeur fournis. Si l'objet est de type que lui-même utilise les répartiteurs, ou si elle est std :: pair, passe InnerAllocator vers l'objet construit .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: c'est le type qui doit être retourné en appelant this->outer_allocator(), puis en appelant la fonction membre outer_allocator() récursivement sur le résultat de cet appel jusqu'à ce qu'il atteigne le type qui n'a pas de fonction membre. Ce type est l'allocateur extérieur .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.
1)
std::uses_allocator<T, inner_allocator_type>::value==false (le type de T ne pas utiliser les répartiteurs) et si std::is_constructible<T, Args...>::value==true, puis appellestd::uses_allocator<T, inner_allocator_type>::value==false (the type T 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)... );
std::uses_allocator<T, inner_allocator_type>::value==true (le T type utilise les répartiteurs, par exemple, il s'agit d'un conteneur) et si std::is_constructible<T, std::allocator_arg_t, inner_allocator_type, Args...>::value==true, puis appelle std::uses_allocator<T, inner_allocator_type>::value==true (the type 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)... );
std::uses_allocator<T, inner_allocator_type>::value==true (le T type utilise les répartiteurs, par exemple, il s'agit d'un conteneur) et si std::is_constructible<T, Args..., inner_allocator_type>::value==true, puis appellestd::uses_allocator<T, inner_allocator_type>::value==true (the type T 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> affirmé que T est allocateur-conscient, il lui manque les deux formes de l'allocateur acceptant les constructeurs .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.
2)
T1 T2 est allocateur-courant, modifie les tuples x et y d'inclure l'allocation appropriée intérieure, résultant dans les deux nouveaux tuples xprime et yprime, selon les trois règles suivantes: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'est pas d'allocation-aware (std::uses_allocator<T1, inner_allocator_type>::value==false, puis xprime est x, non modifié. (Il est également nécessaire 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 est allocateur-aware (std::uses_allocator<T1, inner_allocator_type>::value==true), et son constructeur prend un tag allocateur ( std::is_constructible<T1, std::allocator_arg_t, inner_allocator_type, Args1...>::value==true, puis xprime estT1 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 est allocateur-aware (std::uses_allocator<T1, inner_allocator_type>::value==true), et son constructeur prend l'allocateur comme dernier argument (std::is_constructible<T1, Args1..., inner_allocator_type>::value==true), puis xprime est 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 et le remplacement de y avec yprimeT2 and the replacement of y with yprimeYou can help to correct and verify the translation. Click here for instructions.
xprime et yprime sont construits (ce qui exige aussi que tous les types de args1 ... et ... Args2 sont CopyConstructible), construit le p paire de stockage alloué par téléphonexprime 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);
3)
construct(p, std::piecewise_construct, std::tuple<>(), std::tuple<>()), c'est-à-passe interne sur le dispositif d'attribution de types de membres de la paire s'ils les acceptent .construct(p, std::piecewise_construct, std::tuple<>(), std::tuple<>()), that is, passes the inner allocator on to the pair's member types if they accept them.You can help to correct and verify the translation. Click here for instructions.
4)
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)))
5)
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))
6)
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)))
Paramètres
| p | - | pointeur alloué, mais non initialisé stockage
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... | - | le constructeur arguments à passer au constructeur 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 | - | le constructeur arguments à passer au constructeur 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 | - | le constructeur arguments à passer au constructeur 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 | - | la paire dont les deux membres sont les arguments du constructeur pour
T1 et 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. |
Retourne la valeur
You can help to correct and verify the translation. Click here for instructions.
Notes
inner_allocator est elle-même une instance de std::scoped_allocator_adaptor, cette fonction sera également appelée lorsque l'objet allocateur-aware construits par cette fonction démarre la construction de leurs propres membres .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.
Voir aussi
[ statique ]Original: static The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
construit un objet à l'emplacement alloué 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. (fonction générique) |
construit un objet de stockage alloué 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. (fonction membre publique de std::allocator)
| |