eswitch-v5
Advanced counterpart for switch statement in C++
eswitch_v5::Index_< Idx > Struct Template Reference

Description

template<std::size_t Idx>
struct eswitch_v5::Index_< Idx >

This structure is used as a reference to a specific parameter inside eswitch.

Definition at line 141 of file eswitch_v5.hpp.

Public Member Functions

auto between (const std::size_t start, const std::size_t end) const
 Helper method which defines open set of integers. Then this set is used to determine whether certain value is in that set. More...
 
auto within (const std::size_t start, const std::size_t end) const
 Helper method which defines close set of integers. Then this set is used to determine whether certain value is within that set. More...
 

Static Public Attributes

static constexpr std::size_t eswitch_index = Idx
 Refer to some element in std::tuple( where eswitch keep all the parameters ). More...
 

Member Function Documentation

◆ between()

template<std::size_t Idx>
auto eswitch_v5::Index_< Idx >::between ( const std::size_t  start,
const std::size_t  end 
) const

Helper method which defines open set of integers. Then this set is used to determine whether certain value is in that set.

Definition at line 150 of file eswitch_v5.hpp.

151  {
152  using namespace extension;
153 
154  using Rng_t = Range< range::open >;
155  return condition< Comparison_operators::equal, Index_< Idx >, Rng_t >( Rng_t( start, end ) );
156  }

◆ within()

template<std::size_t Idx>
auto eswitch_v5::Index_< Idx >::within ( const std::size_t  start,
const std::size_t  end 
) const

Helper method which defines close set of integers. Then this set is used to determine whether certain value is within that set.

Definition at line 161 of file eswitch_v5.hpp.

162  {
163  using namespace extension;
164 
165  using Rng_t = Range< range::close >;
166  return condition< Comparison_operators::equal, Index_< Idx >, Rng_t >( Rng_t( start, end ) );
167  }

Member Data Documentation

◆ eswitch_index

template<std::size_t Idx>
constexpr std::size_t eswitch_v5::Index_< Idx >::eswitch_index = Idx
staticconstexpr

Refer to some element in std::tuple( where eswitch keep all the parameters ).

Definition at line 145 of file eswitch_v5.hpp.