valueList::Since(struct) - HaxyM/crap GitHub Wiki
Defined in "crap/utility.d/valuelist.h".
Defined in "crap/utility".
template <class Type, Type ... Values> struct valueList
{
/*...*/
template <std :: size_t N> struct Since;
/*...*/
};
Member type of valueList
(see valueList). Creates subcollection of elements since N
-th element till end (including N
-th element). Giving N
equal to size
(see valueList :: size) represents empty collection. Giving N
equal to 0 passes whole collection. If N
is larger than size
(see valueList :: size) compiler error Index out of range.
will appear.
-
N
- position of first element present in subcollection. Marks begining of subcollection.
-
type
- source (see value source) for subcollection being created (for details see valueList :: Since :: type).
#include <crap/utility.d/valuelist.h>
#include <crap/utility.d/printer.h>
#include <crap/algorithm.d/issortedfortype.h>
#include <iostream>
int main()
{
using wholeCollection = crap :: valueList<unsigned int, 0u, 1u, 2u, 42u, 4u, 5u, 6u, 7u>;
using test1 = typename wholeCollection :: template Since <3u> :: template type<>;
using test2 = typename wholeCollection :: template Since <3u> :: template type<crap :: isSortedForType <unsigned int> :: template type>;
crap :: printer :: print(std :: cout, ", ", test1{});
std :: cout << "\n" << std :: boolalpha << test2 :: value << std :: endl;
return 0;
}
42, 4, 5, 6, 7
false