-
Notifications
You must be signed in to change notification settings - Fork 2
valueList::at
Igor Zarzycki edited this page Jan 23, 2022
·
7 revisions
Defined in "crap/utility.d/valuelist.h".
Defined in "crap/utility".
template <class Type, Type ... Values> struct valueList
{
/*...*/
template <std :: size_t N> constexpr const static Type at = At <N> :: value;
/*...*/
};
Member constant of valueList. Stores value 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.
. Requires C++14 or higher language version.
-
N
- possition of element to access. IfN
is larger than or equal tosize
(see valueList :: size) compilation errorIndex out of range.
will appear.
#include <crap/utility.d/valuelist.h>
#include <iostream>
int main()
{
using test = crap :: valueList<unsigned int, 0u, 1u, 42u, 4u, 5u, 6u, 7u>;
std :: cout << test :: template at<2u> << std :: endl;
return 0;
}
42