std::owner_less
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. |
Elemento definito nell'header <memory>
|
||
template< class T > struct owner_less; /* undefined */ |
(1) | (dal C++11) |
template< class T > struct owner_less<std::shared_ptr<T>>; |
(2) | (dal C++11) |
template< class T > struct owner_less<std::weak_ptr<T>>; |
(3) | (dal C++11) |
Questo oggetto funzione fornisce proprietario-based (in alternativa al fair-based) di tipo misto ordinamento sia std::weak_ptr e std::shared_ptr. L'ordine è tale che due puntatori intelligenti confronta equivalente solo se sono entrambi vuoti o se entrambi gestire l'oggetto stesso, anche se i valori dei puntatori prime ottenuta con
get()
sono diversi (ad esempio perché puntare sottooggetti diverse all'interno dello stesso oggetto )Original:
This function object provides owner-based (as opposed to value-based) mixed-type ordering of both std::weak_ptr and std::shared_ptr. The order is such that two smart pointers compare equivalent only if they are both empty or if they both manage the same object, even if the values of the raw pointers obtained by
get()
are different (e.g. because they point at different subobjects within the same object)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.
Questo modello di classe è il predicato di confronto preferito durante la creazione di contenitori associativi con std::shared_ptr o std::weak_ptr come chiavi, cioè,
Original:
This class template is the preferred comparison predicate when building associative containers with std::shared_ptr or std::weak_ptr as keys, that is,
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::map<std::shared_ptr<T>, U, std::owner_less<std::shared_ptr<T>>>
or
std::map<std::weak_ptr<T>, U, std::owner_less<std::weak_ptr<T>>>.
Il operator< predefinito non è definito per i puntatori deboli, e può erroneamente considerare due indicatori condivisi per lo stesso oggetto non equivalente (vedi shared_ptr::owner_before)
Original:
The default operator< is not defined for weak pointers, and may wrongly consider two shared pointers for the same object non-equivalent (see shared_ptr::owner_before)
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.
[modifica] Membri tipi
Membro tipo
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
result_type
|
bool |
first_argument_type
|
1) T 2) std::shared_ptr<T> 3) std::weak_ptr<T> |
second_argument_type
|
1) T 2) std::shared_ptr<T> 3) std::weak_ptr<T> |
[modifica] Membri funzioni
mette a confronto i suoi argomenti con proprietario a base semantica Original: compares its arguments using owner-based semantics The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |
[modifica] Vedi anche
fornisce proprietario a base di ordinazione di puntatori condivisi Original: provides owner-based ordering of shared pointers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (metodo pubblico) |