Templa 0.0.1-alpha
C++ Metaprogramming Utilities
Loading...
Searching...
No Matches
templa::index_at_type< T, List > Struct Template Reference

Get the index of a type in a type list. More...

#include <type_list.hpp>

Static Public Attributes

static constexpr auto index
 Index of type T in List.

Detailed Description

template<typename T, typename... List>
struct templa::index_at_type< T, List >

Get the index of a type in a type list.

Template Parameters
TType to find.
ListTypes in the list.
Returns
returns -1 if index is not found else returns index (0-indexed value)

Member Data Documentation

◆ index

template<typename T, typename... List>
auto templa::index_at_type< T, List >::index
staticconstexpr
Initial value:
= []()
{
{signed i = 0;
(... && (!std::is_same_v<T, List> && ++i));
return i; }() : -1);
}()
static constexpr bool value
True if T is in Ts...
Definition type_list.hpp:295

Index of type T in List.


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