mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
fix infinite recursion in weakref hash
Some checks failed
Build Binaries / Build Windows (push) Has been cancelled
Build Binaries / Build macOS (push) Has been cancelled
Build Binaries / Build Android (64-bit) (push) Has been cancelled
Build Binaries / Build Android (32-bit) (push) Has been cancelled
Build Binaries / Publish (push) Has been cancelled
Some checks failed
Build Binaries / Build Windows (push) Has been cancelled
Build Binaries / Build macOS (push) Has been cancelled
Build Binaries / Build Android (64-bit) (push) Has been cancelled
Build Binaries / Build Android (32-bit) (push) Has been cancelled
Build Binaries / Publish (push) Has been cancelled
This commit is contained in:
parent
b69f810dd4
commit
d68e358bdd
1 changed files with 2 additions and 1 deletions
|
@ -971,7 +971,8 @@ namespace std {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct std::hash<geode::WeakRef<T>> {
|
struct std::hash<geode::WeakRef<T>> {
|
||||||
size_t operator()(geode::WeakRef<T> const& ref) const {
|
size_t operator()(geode::WeakRef<T> const& ref) const {
|
||||||
return hash{}(ref.m_controller);
|
// the explicit template argument is needed here because it would otherwise cast to WeakRef and recurse
|
||||||
|
return hash<std::shared_ptr<geode::WeakRefController>>{}(ref.m_controller);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue