CVB++ 14.0
monostate Struct Reference

Unit type intended for use as a well-behaved empty alternative in 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 variant.

In particular, a variant of non-default-constructible types may list monostate as its first alternative: this makes the 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.