#include <gtopt/uid.hpp>
template<class Tag>
UidOf class
| Template parameters | |
|---|---|
| Tag | The entity type used as a compile-time tag (e.g. struct Block, struct Scenario). Two UidOf instantiations with different tags are distinct types. |
Strong, passkey-gated UID type.
Public types
- using tag_type = Tag
-
using underlying_type = uid_
t
Constructors, destructors, conversion operators
- operator uid_t() const constexpr noexcept
- UidOf() defaulted constexpr noexcept
- Default-constructs to the "unknown" sentinel value.
-
UidOf(uid_
t value, uid_ passkey) constexpr noexcept - Passkey-gated value constructor. Callable only from
make_uid<Tag>.
Public functions
- auto is_unknown() const -> bool noexcept
-
auto value() const -> uid_
t noexcept - Read the raw underlying integer.
Friends
- auto operator<=>(const UidOf&, const UidOf&) -> std::strong_ordering defaulted noexcept
- auto operator==(const UidOf&, const UidOf&) -> bool defaulted noexcept
Function documentation
template<class Tag>
gtopt:: UidOf<Tag>:: operator uid_t() const constexpr noexcept
Implicit conversion to uid_t — preserved so that existing equality comparisons against raw integer literals in tests and log output (spdlog, std::format) keep working.