valueList - HaxyM/crap GitHub Wiki

crap :: valueList

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


template <class Type, Type ... Values> struct valueList;

Basic structure storing and operating on Values... of type Type.

Template parameters

  • Type - type of values being stored.
  • Values... - values being stored.

Layout

Member constants

  • size - number of values being stored (for details see valueList :: size).
  • at - value stored at passed position (for details see valueList :: at). Avaliable since C++14 language version.

Member types

  • At - give random access to elements stored in collection (for details see valueList :: At).
  • Till - creates subcollection of elements since begining till passed point (for details see valueList :: Till).
  • Since - creates subset of collection since passed point till end (for details see valueList :: Since).
  • copy - copies whole collection to passed container (for details see valueList :: copy).
  • till - copies subset of collection since begining till passed point into passed container (for details see valueList :: till).
  • since - copies subset of collection since passed point into passed container (for details see valueList :: since).

Usage example

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

#include <iostream>

int main()
{
 using test = crap :: valueList<unsigned int, 0u, 1u, 2u, 3u, 4u, 5u, 6u, 7u>;
 crap :: printer :: print(std :: cout, ", ", test{});
}

Possible output

0, 1, 2, 3, 4, 5, 6, 7,

See also

⚠️ **GitHub.com Fallback** ⚠️