Struct pointer_traits
Vengono fornite le informazioni necessarie a un oggetto di classe modello allocator_traits per descrivere un allocatore con tipo puntatore Ptr.
template<class Ptr>
struct pointer_traits;
Note
La stampante può essere un puntatore non elaborata di tipo Ty * o una classe con le seguenti proprietà.
template<class Ty, class... Rest>
struct Ptr
{ // describes a pointer type usable by allocators
typedef Ptr pointer;
typedef T1 element_type; // optional
typedef T2 difference_type; // optional
template<class Other>
using rebind = typename Ptr<Other, Rest...>; // optional
static pointer pointer_to(element_type& obj); // optional
};
![]() |
---|
Mentre lo standard C++ specifica il membro rebind come modello di alias, implementa Visual C++ riassociano come struct. |
Definizioni typedef
Nome |
Descrizione |
---|---|
typedef T2 difference_type |
Il tipo T2 è Ptr::difference_type se il tipo è presente in caso contrario, ptrdiff_t.Se Ptr è un puntatore non elaborato, il tipo viene ptrdiff_t. |
typedef T1 element_type |
Il tipo T1 è Ptr::element_type se il tipo è presente in caso contrario, Ty.Se Ptr è un puntatore non elaborato, il tipo viene Ty. |
typedef Ptr pointer |
Il tipo è Ptr. |
Strutture
Nome |
Descrizione |
---|---|
pointer_traits::rebind |
Tenta di convertire il tipo di puntatore sottostante a un tipo specificato. |
Metodi
Nome |
Descrizione |
---|---|
Converte un riferimento arbitrario a un oggetto di classe Ptr. |
Requisiti
intestazione: <memory>
Spazio dei nomi: deviazione standard