E.V.E
v2023.02.15
Loading...
Searching...
No Matches
eve::or_< C, V > Struct Template Reference

Conditional/Alternative wrapper. More...

#include <eve/conditional.hpp>

Detailed Description

template<typename C, typename V>
struct eve::or_< C, V >

Required header: #include <eve/conditional.hpp>

eve::or_ wraps any eve::conditional_expr with an alternative value to be used whenever the conditional value evaluates to false.

Template Parameters
CType of the wrapped eve::conditional_expr value
VType of the wrapped alternative eve::value

Public Types

using alternative_type = V
 The type of the alternative value.
using conditional_type = C
 The type of the wrapped conditional expression.

Public Member Functions

constexpr or_ (C const &c, V const &v)
 Wraps a eve::conditional_expr with an alternative value.
constexpr C base () const
 Returns the underlying, alternative-less conditional expression.
template<typename T>
constexpr auto rebase (T v) const
 Creates a eve::conditional_expr with a new alternative value.

Public Attributes

alternative
 Value to use as an alternative.

Friends

template<typename Ch, typename Ct>
auto & operator<< (std::basic_ostream< Ch, Ct > &os, or_ const &c)
 Inserts a conditional expression with alternative into a output stream.