BLI: add default hash for shared_ptr and reference_wrapper
This makes it easier to use these types as keys in Map, Set and VectorSet.
This commit is contained in:
parent
4d0497bea4
commit
e2bbb5b07e
|
@ -250,6 +250,20 @@ template<typename T> struct DefaultHash<std::unique_ptr<T>> {
|
|||
}
|
||||
};
|
||||
|
||||
template<typename T> struct DefaultHash<std::shared_ptr<T>> {
|
||||
uint64_t operator()(const std::shared_ptr<T> &value) const
|
||||
{
|
||||
return get_default_hash(value.get());
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T> struct DefaultHash<std::reference_wrapper<T>> {
|
||||
uint64_t operator()(const std::reference_wrapper<T> &value) const
|
||||
{
|
||||
return get_default_hash(value.get());
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T1, typename T2> struct DefaultHash<std::pair<T1, T2>> {
|
||||
uint64_t operator()(const std::pair<T1, T2> &value) const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue