7#ifndef PXR_BASE_VT_HASH_H
8#define PXR_BASE_VT_HASH_H
11#include "pxr/base/vt/api.h"
16PXR_NAMESPACE_OPEN_SCOPE
18namespace Vt_HashDetail {
21VT_API
void _IssueUnimplementedHashError(std::type_info
const &t);
24template <class T, class = decltype(TfHash()(std::declval<T>()))>
25constexpr bool _IsHashable(
long) {
return true; }
27constexpr bool _IsHashable(...) {
return false; }
32template <class T, class = decltype(TfHash()(std::declval<T>()))>
34_HashValueImpl(T
const &val,
long)
41_HashValueImpl(T
const &val, ...)
43 Vt_HashDetail::_IssueUnimplementedHashError(
typeid(T));
55 return Vt_HashDetail::_IsHashable<T>(0);
61size_t VtHashValue(T
const &val)
63 return Vt_HashDetail::_HashValueImpl(val, 0);
66PXR_NAMESPACE_CLOSE_SCOPE
A user-extensible hashing mechanism for use with runtime hash tables.