123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #pragma once
- #include <memory>
- namespace WwiseGTE
- {
-
- template <typename T>
- struct WeakPtrEQ
- {
- bool operator()(std::weak_ptr<T> const& wp0, std::weak_ptr<T> const& wp1) const
- {
- auto sp0 = wp0.lock(), sp1 = wp1.lock();
- return (sp0 ? (sp1 ? *sp0 == *sp1 : false) : !sp1);
- }
- };
-
- template <typename T>
- struct WeakPtrNEQ
- {
- bool operator()(std::weak_ptr<T> const& wp0, std::weak_ptr<T> const& wp1) const
- {
- return !WeakPtrEQ<T>()(wp0, wp1);
- }
- };
-
- template <typename T>
- struct WeakPtrLT
- {
- bool operator()(std::weak_ptr<T> const& wp0, std::weak_ptr<T> const& wp1) const
- {
- auto sp0 = wp0.lock(), sp1 = wp1.lock();
- return (sp1 ? (!sp0 || *sp0 < *sp1) : false);
- }
- };
-
- template <typename T>
- struct WeakPtrLTE
- {
- bool operator()(std::weak_ptr<T> const& wp0, std::weak_ptr<T> const& wp1) const
- {
- return !WeakPtrLT<T>()(wp1, wp0);
- }
- };
-
- template <typename T>
- struct WeakPtrGT
- {
- bool operator()(std::weak_ptr<T> const& wp0, std::weak_ptr<T> const& wp1) const
- {
- return WeakPtrLT<T>()(wp1, wp0);
- }
- };
-
- template <typename T>
- struct WeakPtrGTE
- {
- bool operator()(std::weak_ptr<T> const& wp0, std::weak_ptr<T> const& wp1) const
- {
- return !WeakPtrLT<T>()(wp0, wp1);
- }
- };
- }
|