-
Notifications
You must be signed in to change notification settings - Fork 2
valueList::Till(struct)::type
Igor Zarzycki edited this page Jan 23, 2022
·
4 revisions
Defined in "crap/utility.d/valuelist.h".
Defined in "crap/utility".
template <class Type, Type ... Values> template <std :: size_t N>
struct valueList <Type, Values...> :: Till
{
/*...*/
template <template <Type...> class Container = valueListForType <Type> :: template type>
using type = Container</*Elements form 0 till N*/>;
/*..*/
};
Member type of valueList :: Till
. Value source for subcollection created by valueList :: Till
(see valueList :: Till). Passes into Collection
subcollection of Values...
since beggining till N
-th element (not including N
-th element - that is first N
elements).
-
Container
- value container for created subcollection. In none passed, default ifvalueList
for typeType
(see valueListForType).
#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, 2u, 2u, 42u, 4u, 5u, 6u, 7u>;
using test1 = typename wholeCollection :: template Till <5u> :: template type<>;
using test2 = typename wholeCollection :: template Till <5u> :: 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;
}
0, 1, 2, 42, 4,
false