Namespaces
Variants

std:: hash <std::indirect>

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
Défini dans l'en-tête <memory>
template < class T, class Allocator >
struct hash < std :: indirect < T, Allocator >> ;
(depuis C++26)

La spécialisation partielle de std::hash pour std::indirect permet aux utilisateurs d'obtenir les hachages des objets détenus par les objets indirect .

La spécialisation std:: hash < std :: indirect < T, Allocator >> est activée si std:: hash < T > est activée, et est désactivée sinon.

Lorsqu'il est activé, pour un objet obj de type std :: indirect < T, Allocator > , std:: hash < std :: indirect < T, Allocator >> ( ) ( obj ) s'évalue à :

  • std:: hash < T > ( ) ( * obj ) , si obj n'est pas sans valeur .
  • Une valeur définie par l'implémentation, si obj est sans valeur.

Les fonctions membres de cette spécialisation ne sont pas garanties d'être noexcept car le hachage de T pourrait lever une exception.

Exemple

Voir aussi

(C++11)
fonction de hachage
(modèle de classe)