26 #include <boost/lexical_cast.hpp> 39 using boost::lexical_cast;
46 typedef std::vector<uint> VecI;
54 someNumberz (uint count)
57 numbers.reserve(count);
59 numbers.push_back(count--);
80 verify_typeDetectors();
82 uint NUM_ELMS = firstVal (arg, 20);
83 VecI container = someNumberz (NUM_ELMS);
84 RangeI iterator(container.begin(), container.end());
86 verify_accessFirstLast (container, NUM_ELMS);
87 verify_accessFirstLast (iterator, NUM_ELMS);
89 verify_Min_Max (container, NUM_ELMS);
90 verify_Min_Max (iterator, NUM_ELMS);
96 verify_accessFirstLast (COL
const& col, uint lim)
101 CHECK (
first(col) == theFirst);
102 CHECK (
last(col) == theLast);
108 verify_Min_Max (COL
const& col, uint lim)
110 uint expectedMax = lim;
111 uint expectedMin = 1;
113 CHECK (max (col) == expectedMax);
114 CHECK (min (col) == expectedMin);
118 using Val =
typename COL::value_type;
120 CHECK (max (empty) == std::numeric_limits<Val>::min());
121 CHECK (min (empty) == std::numeric_limits<Val>::max());
126 verify_typeDetectors()
auto first(IT ii)
extract the first element yielded by an Lumiera Forward Iterator.
auto first(COLL const &coll)
access the first element of a STL-like container.
Helper template(s) for creating Lumiera Forward Iterators.
auto last(COLL const &coll)
access the last element of a STL-like container.
Simplistic test class runner.
Helpers for type detection, type rewriting and metaprogramming.
Accessing a STL element range through a Lumiera forward iterator, An instance of this iterator adapte...
Some small helpers and convenience shortcuts to ease working with collections and sequences (given by...