34template < index_type Off, index_type N,
typename F >
35constexpr decltype( auto ) _dispatch_index( index_type
const i, F&& f )
37#define VARI_GEN_CASE( x ) \
39 if constexpr ( ( Off + ( x ) ) < N ) \
40 return ( (F&&) f ).template operator()< Off + ( x ) >();
76 if constexpr ( N > Off + 32 )
77 return _dispatch_index< Off + 32, N >( i, (F&&) f );
83#if defined( __cpp_lib_unreachable )
85#elif defined( _MSC_VER )
88 __builtin_unreachable();
92template <
typename T,
typename... Fs >
93constexpr decltype( auto ) _dispatch_fun( T&& item, Fs&&... fs )
95 auto&& f = _function_picker< T >::pick( (Fs&&) fs... );
96 return std::forward< decltype( f ) >( f )( (T&&) item );
MIT License.
Definition: dispatch.h:32