has_duplicates< Types > Struct Template Reference

CPP API: mio::has_duplicates< Types > Struct Template Reference
mio::has_duplicates< Types > Struct Template Reference

Tests whether the list Types contains any type multiple times. More...

#include <metaprogramming.h>

Static Public Attributes

static constexpr bool value = has_duplicates_impl(std::make_index_sequence<sizeof...(Types)>{})
 

Static Private Member Functions

template<std::size_t... Indices>
static constexpr bool has_duplicates_impl (std::index_sequence< Indices... >)
 Checks if Types has a duplicate entry using an index sequence. More...
 

Detailed Description

template<class... Types>
struct mio::has_duplicates< Types >

Tests whether the list Types contains any type multiple times.

Template Parameters
TypesA list of types.

Member Function Documentation

◆ has_duplicates_impl()

template<class... Types>
template<std::size_t... Indices>
static constexpr bool mio::has_duplicates< Types >::has_duplicates_impl ( std::index_sequence< Indices... >  )
inlinestaticconstexprprivate

Checks if Types has a duplicate entry using an index sequence.

Template Parameters
IndicesExactly the list '0, ... , sizeof...(Types) - 1'. Use std::make_index_sequence.
Returns
True if Types contains a duplicate type, false otherwise.

Member Data Documentation

◆ value

template<class... Types>
constexpr bool mio::has_duplicates< Types >::value = has_duplicates_impl(std::make_index_sequence<sizeof...(Types)>{})
staticconstexpr