eswitch-v5
Advanced counterpart for switch statement in C++
eswitch_v5::extension::Any_from_impl< T, Sz > Struct Template Reference

Description

template<typename T, std::size_t Sz>
struct eswitch_v5::extension::Any_from_impl< T, Sz >

Definition at line 104 of file eswitch_v5.hpp.

Friends

template<typename T_ >
constexpr friend bool operator== (const T_ &value, const Any_from_impl &st)
 

Public Member Functions

template<typename ... Args>
constexpr Any_from_impl (Args &&... args)
 

Public Attributes

std::array< T, Sz > anythings
 

Methods

◆ operator==

template<typename T , std::size_t Sz>
template<typename T_ >
constexpr friend bool operator== ( const T_ &  value,
const Any_from_impl< T, Sz > &  st 
)
friend

Definition at line 115 of file eswitch_v5.hpp.

116  {
117  #ifdef __cpp_lib_ranges
118  return std::ranges::find( st.anythings, value ) != std::end( st.anythings );
119  #else
120  return std::find( std::begin( st.anythings ), std::end( st.anythings ), value ) != std::end( st.anythings );
121  #endif
122  }

Member Data Documentation

◆ anythings

template<typename T , std::size_t Sz>
std::array< T, Sz > eswitch_v5::extension::Any_from_impl< T, Sz >::anythings

Definition at line 106 of file eswitch_v5.hpp.

Constructor & Destructor Documentation

◆ Any_from_impl()

template<typename T , std::size_t Sz>
template<typename ... Args>
constexpr eswitch_v5::extension::Any_from_impl< T, Sz >::Any_from_impl ( Args &&...  args)
constexpr

Definition at line 109 of file eswitch_v5.hpp.

110  : anythings{ std::forward< Args >( args )... }
111  {
112  }
std::find
T find(T... args)
eswitch_v5::extension::Any_from_impl::anythings
std::array< T, Sz > anythings
Definition: eswitch_v5.hpp:106
std::begin
T begin(T... args)
std::end
T end(T... args)