Namespaces
Variants

std:: hash <std::shared_ptr>

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)
template < class T >
struct hash < std:: shared_ptr < T >> ;
(начиная с C++11)

Специализация шаблона std::hash для std:: shared_ptr < T > позволяет пользователям получать хеши объектов типа std:: shared_ptr < T > .

Для заданного std:: shared_ptr < T > p данная специализация гарантирует, что std:: hash < std:: shared_ptr < T >> ( ) ( p ) == std:: hash < decltype ( p. get ( ) ) > ( ) ( p. get ( ) ) .

Пример

Смотрите также

(C++11)
функциональный объект хеш-функции
(шаблон класса)