Skip to content

valueList::At(struct)

Igor Zarzycki edited this page Jan 23, 2022 · 4 revisions

crap :: valuList <Type, Values...> :: At

Defined in "crap/utility.d/valuelist.h".
Defined in "crap/utility".


template <class Type, Type ... Values> struct valueList
{
 /*...*/
 template <std :: size_t N> struct At;
 /*...*/
};

Member type of valueList. Gives access to element from collection present at possition N. Passing N larger than or equal to size (see valueList :: size) will cause compilation error Index out of range..

Template parameters

  • N - possition of element to access. If N is larger than or equal to size (see valueList :: size) compilation error Index out of range. will appear.

Layout

Memeber constants

Usage example

#include <crap/utility.d/valuelist.h>

#include <iostream>

int main()
{
 using test = crap :: valueList<unsigned int, 0u, 1u, 2u, 42u, 4u, 5u, 6u, 7u>;
 using test2 = typename test :: template At<3u>;
 std :: cout << test2 :: value << std :: endl;
 return 0;
}

Possible output

42

See also

Clone this wiki locally