CVB++ 15.0
monostate Struct Reference

Unit type intended for use as a well-behaved empty alternative in Shims::variant. More...

#include <variant.hpp>

Related Functions

(Note that these are not member functions.)

constexpr bool operator< (monostate, monostate) noexcept
 
constexpr bool operator> (monostate, monostate) noexcept
 
constexpr bool operator<= (monostate, monostate) noexcept
 
constexpr bool operator>= (monostate, monostate) noexcept
 
constexpr bool operator== (monostate, monostate) noexcept
 
constexpr bool operator!= (monostate, monostate) noexcept
 

Detailed Description

Unit type intended for use as a well-behaved empty alternative in Shims::variant.

In particular, a Shims::variant of non-default-constructible types may list monostate as its first alternative: this makes the Shims::variant itself default-constructible.

Friends And Related Function Documentation

◆ operator!=()

constexpr bool operator!= ( monostate  ,
monostate   
)
related

Always compares to false.

◆ operator<()

constexpr bool operator< ( monostate  ,
monostate   
)
related

Always compares to false.

◆ operator<=()

constexpr bool operator<= ( monostate  ,
monostate   
)
related

Always compares to true.

◆ operator==()

constexpr bool operator== ( monostate  ,
monostate   
)
related

Always compares to true.

◆ operator>()

constexpr bool operator> ( monostate  ,
monostate   
)
related

Always compares to false.

◆ operator>=()

constexpr bool operator>= ( monostate  ,
monostate   
)
related

Always compares to true.