std::uses_allocator<std::tuple>
De cppreference.com
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <tuple>
|
||
template< class... Types, class Alloc > struct uses_allocator< std::tuple<Types...>, Alloc > : std::true_type { }; |
(desde C++11) | |
Esta especialização de std::uses_allocator informa que outros componentes da biblioteca tuplas apoio' usos alocador-construção, mesmo que eles não têm um
allocator_type aninhada.Original:
This specialization of std::uses_allocator informs other library components that tuples support uses-allocator construction, even though they do not have a nested
allocator_type.The text has been machine-translated via Google Translate.
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.
Herdado de std::integral_constant
Member constants
value [estática] |
true (membro estático público constante) |
Member functions
operator bool |
converte o objeto em bool, retorna value Original: converts the object to bool, returns value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função pública membro) |
Member types
Tipo
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
value_type
|
bool
|
type
|
std::integral_constant<bool, value>
|
Exemplo
// myalloc is a stateful Allocator with a single-argument constructor
// that takes an int. It has no default constructor.
typedef std::vector<int, myalloc<int>> innervector_t;
typedef std::tuple<int, innervector_t> elem_t;
typedef std::scoped_allocator_adaptor< myalloc<elem_t>, myalloc<int>> Alloc;
Alloc a(1,2);
std::vector<elem_t, Alloc> v(a);
v.resize(1); // uses allocator #1 for elements of v
std::get<1>(v[0]).resize(10); // uses allocator #2 for innervector_t
