handy invalid handle macro

This commit is contained in:
2026-09-24 23:00:45 -07:00
parent b5d28ce3eb
commit 75fc14f4ac
2 changed files with 12 additions and 6 deletions
+9
View File
@@ -24,6 +24,15 @@ struct Handle {
[[nodiscard]] auto operator<=>(const Handle&) const = default;
};
struct InvalidHandle {
template <typename T>
[[nodiscard]] constexpr operator Handle<T>() const {
return Handle<T>::invalid();
}
};
inline constexpr InvalidHandle INVALID_HANDLE{};
class Mesh;
class Panel;
class RenderTarget;