Class designated_init_only

Class Documentation

class designated_init_only

Tag type used by SEQUANT_DESIGNATED_INIT_ONLY; not meant to be named directly. Its default constructor is private, so the only way to produce one is make(), which is what the macro’s default member initializer calls. That is what makes both Opts{a, b} (bool does not convert to this type) and Opts{{}, a, b} (no accessible default constructor) ill-formed.

Public Functions

constexpr designated_init_only(const designated_init_only&) noexcept = default
constexpr designated_init_only &operator=(const designated_init_only&) noexcept = default

declaring the copy constructor deprecates the implicit copy assignment (-Wdeprecated-copy, an error under this project’s -Werror), so declare it too — a guarded aggregate must stay copy-assignable

Public Static Functions

static inline constexpr designated_init_only make() noexcept

Friends

inline friend constexpr bool operator==(designated_init_only, designated_init_only) noexcept

all tags compare equal, so that a guarded aggregate can still default its comparison operators

inline friend constexpr std::strong_ordering operator<=>(designated_init_only, designated_init_only) noexcept