gtopt::uid_passkey class

Passkey used to gate the UidOf<Tag> value constructor.

Nothing in user code can construct a uid_passkey — its default constructor is private and the only friend is make_uid<Tag>. That makes make_uid the single sanctioned entry point for materializing a UidOf<Tag> from a raw uid_t.

Constructors, destructors, conversion operators

uid_passkey(const uid_passkey&) defaulted
uid_passkey(uid_passkey&&) defaulted
~uid_passkey() defaulted

Public functions

auto operator=(const uid_passkey&) -> uid_passkey& defaulted
auto operator=(uid_passkey&&) -> uid_passkey& defaulted

Friends

template<class Tag>
auto make_uid(uid_t value) -> auto

Function documentation

template<class Tag>
auto make_uid(uid_t value)

Sanctioned factory: construct a UidOf<Tag> from a raw uid_t.

Intended call sites are file / JSON boundaries where a raw integer crosses from external data into the type system. Inside the codebase, prefer copying an existing UID from an element rather than calling this.