type_traits.contains - MichaelMiller-/sec21 GitHub Wiki

sec21::type_traits::contains

#include <sec21/type_traits/contains.h>

Template which checks whether an explicit type is in a type list.

Example

using type_list_t = std::tuple<int, float, double>;

static_assert(contains<int, type_list_t>::value == true);
static_assert(contains<float, type_list_t>::value == true);
static_assert(contains<double, type_list_t>::value == true);
static_assert(contains<char, type_list_t>::value == false);