#ifndef MSP_GAME_HANDLE_H_
#define MSP_GAME_HANDLE_H_
+#include <functional>
#include <stdexcept>
#include "pool.h"
explicit operator bool() const { return ptr; }
bool operator==(const Handle &other) const = default;
+ bool operator<(const Handle &other) const { return std::less<T *const>()(ptr, other.ptr); }
};
+template<typename T, typename U>
+ requires std::is_base_of_v<U, T>
+Handle<T> dynamic_handle_cast(Handle<U> h)
+{
+ return Handle<T>::from_object(dynamic_cast<T *>(h.get()));
+}
+
} // namespace Msp::Game
#endif