[variant.monostate.relops] (original) (raw)

22 General utilities library [utilities]

22.6 Variants [variant]

22.6.9 monostate relational operators [variant.monostate.relops]

🔗

constexpr bool operator==(monostate, monostate) noexcept { return true; } constexpr strong_ordering operator<=>(monostate, monostate) noexcept { return strong_ordering::equal; }

1

#

[Note 1:

monostate objects have only a single state; they thus always compare equal.

— _end note_]