Fleet  0.0.9
Inference in the LOT
TypeIndex< T, Tuple > Struct Template Reference

Helpers to Find the numerical index (as a nonterminal_t) in a tuple of a given type. More...

#include <Miscellaneous.h>

Detailed Description

template<class T, class Tuple>
struct TypeIndex< T, Tuple >

Helpers to Find the numerical index (as a nonterminal_t) in a tuple of a given type.

Template magic to check if a class is iterable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
//https://stackoverflow.com/questions/13830158/check-if-a-variable-is-iterable
template <typename T, typename = void>
struct is_iterable : std::false_type {};
// this gets used only when we can call std::begin() and std::end() on that type
template <typename T>
struct is_iterable<T, std::void_t<decltype(std::begin(std::declval<T>())),
decltype(std::end(std::declval<T>()))
>
> : std::true_type {};
// Here is a helper:
template <typename T>
constexpr bool is_iterable_v = is_iterable<T>::value;
/*

Find the index of a type in variadic args ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


The documentation for this struct was generated from the following file: