1#ifndef TZ_DATA_HANDLE_HPP
2#define TZ_DATA_HANDLE_HPP
9 enum class hanval : std::uint64_t{};
13 bool operator==(std::integral
auto num)
const
15 return std::cmp_equal(num, std::numeric_limits<std::underlying_type_t<hanval>>::max());
37 handle([[maybe_unused]] nullhand_t nh = {}):
38 value(
static_cast<hanval
>(std::numeric_limits<std::underlying_type_t<hanval>>::max())){}
40 explicit operator hanval()
const
46 std::underlying_type_t<hanval>
peek()
const
48 return static_cast<std::underlying_type_t<hanval>
>(this->value);
Represents a generic opaque handle.
Definition handle.hpp:32
handle & operator=(hanval value)
Assign a handle to the null handle, meaning it is now invalid.
Definition handle.hpp:52
std::underlying_type_t< hanval > peek() const
Disregard the concept of "opaqueness" of an opaque handle by peeking at the underlying value....
Definition handle.hpp:46
bool operator!=(nullhand_t) const
Compare a handle to the null handle. This comparison will return true if the handle is valid.
Definition handle.hpp:64
bool operator==(nullhand_t) const
Compare a handle to the null handle. This comparison will return false if the handle is valid.
Definition handle.hpp:59
constexpr nullhand_t nullhand
Definition handle.hpp:22