std::pointer_traits
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <memory>
|
||
template< class Ptr > struct pointer_traits; |
(1) | (dal C++11) |
template< class T > struct pointer_traits<T*>; |
(2) | (dal C++11) |
Il modello di classe
pointer_traits fornisce il modo standard per accedere alle proprietà di alcuni tipi di puntatore di tipo. Il std::allocator_traits modello standard si basa su pointer_traits per determinare le impostazioni predefinite per diversi typedef richiede da Allocator.Original:
The
pointer_traits class template provides the standardized way to access certain properties of pointer-like types. The standard template std::allocator_traits relies on pointer_traits to determine the defaults for various typedefs requires by Allocator.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.
1)
Il non specializzato
pointer_traits dichiara i seguenti tipi:Original:
The non-specialized
pointer_traits declares the following types: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.
Membri tipi
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 |
pointer
|
Ptr
|
element_type
|
Ptr::element_type se presente. In caso contrario, se T Ptr è un Template<T, Args...> istanziazione di template Original: Ptr::element_type if present. Otherwise T if Ptr is a template instantiation Template<T, Args...> The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
difference_type
|
Ptr::difference_type se presente, altrimenti std::ptrdiff_t Original: Ptr::difference_type if present, otherwise std::ptrdiff_t The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Membri alias modelli
Template
Original: Template The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
| template <class U> using rebind | Ptr::rebind<U> se esiste, altrimenti se Tempate<U, Args...> Ptr è un Template<T, Args...> istanziazione di template Original: Ptr::rebind<U> if exists, otherwise Tempate<U, Args...> if Ptr is a template instantiation Template<T, Args...> The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Membri funzioni
[statico] |
ottiene un puntatore dereferencable al suo argomento Original: obtains a dereferencable pointer to its argument The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico statico) |
2)
Una specializzazione è previsto per i tipi di puntatore,
T*, che dichiara i seguenti tipiOriginal:
A specialization is provided for pointer types,
T*, which declares the following typesThe 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.
Membri tipi
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 |
pointer
|
T*
|
element_type
|
T
|
difference_type
|
std::ptrdiff_t |
Membri alias modelli
Template
Original: Template The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
| template< class U > using rebind | U*
|
Membri funzioni
[statico] |
ottiene un puntatore dereferencable al suo argomento} Original: obtains a dereferencable pointer to its argument} The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico statico) |
Note
Le riassociare alias modello utente permette, dato un puntatore come tipo che punta a T, per ottenere lo stesso puntatore come tipo che punta a U. Per esempio,
Original:
The rebind member template alias makes it possible, given a pointer-like type that points to T, to obtain the same pointer-like type that points to U. For example,
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.
std :: is_same <std :: pointer_traits <std :: shared_ptr <int>> :: Rebind <double>, std :: unique_ptr <double>> :: valore), "")
Original:
std::is_same<std::pointer_traits< std::shared_ptr<int>>::rebind<double>, std::unique_ptr<double> >::value), "")
The text has been machine-translated via Google Translate.