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)
헤더에 정의됨 <memory>
template < class T, class Allocator >
struct hash < std :: indirect < T, Allocator >> ;
(C++26부터)

std::hash 의 부분 특수화는 std::indirect 에 대해 사용자들이 indirect 객체가 소유한 객체들의 해시 값을 얻을 수 있도록 합니다.

특수화 std:: hash < std :: indirect < T, Allocator >> 활성화됩니다 만약 std:: hash < T > 가 활성화된 경우이며, 그렇지 않으면 비활성화됩니다.

활성화된 경우, 타입이 std :: indirect < T, Allocator > 인 객체 obj 에 대해, std:: hash < std :: indirect < T, Allocator >> ( ) ( obj ) 는 다음을 평가합니다:

  • std:: hash < T > ( ) ( * obj ) , 만약 obj valueless 가 아닌 경우.
  • 구현에 정의된 값, 만약 obj 가 valueless인 경우.

이 특수화의 멤버 함수들은 noexcept 로 보장되지 않습니다. 왜냐하면 T 의 해시가 예외를 던질 수 있기 때문입니다.

예제

참고 항목

(C++11)
해시 함수 객체
(클래스 템플릿)