type_index_hash

type_index_hash (std::type_index 해시 지원)

std::type_index에 대한 std::hash 특수화를 설명하는 레퍼런스예요. 이 특수화를 통해 type_index 객체의 해시 값을 얻을 수 있어요. 멤버 함수 operator()는 hash_code()와 동일한 값을 반환해요.

출처: cppreference

본문

정의

헤더에 정의되어 있고, C++11부터 사용할 수 있어요.

template <> struct hash < std :: type_index > ;

동작

이 템플릿 특수화는 std::type_index 객체에 대한 해시를 제공해요. 멤버 함수 operator()는 내부적으로 hash_code()를 호출해서 그 결과를 그대로 반환해요. 따라서 std::type_index를 std::unordered_set이나 std::unordered_map의 키로 사용할 수 있어요.

같이 보기

멤버 함수 설명
hash_code 해시 코드를 반환하는 public 멤버 함수예요.

더 알아보기 (Learn more)

cppreference