35 #include <boost/lexical_cast.hpp> 48 using boost::lexical_cast;
55 typedef std::vector<uint> VecI;
65 someNumberz (uint count)
68 numbers.reserve(count);
70 numbers.push_back(count--);
92 verify_typeDetectors();
94 if (0 < arg.size()) NUM_ELMS = lexical_cast<uint> (arg[0]);
96 VecI container = someNumberz (NUM_ELMS);
97 RangeI iterator(container.begin(), container.end());
99 verify_accessFirstLast (container, NUM_ELMS);
100 verify_accessFirstLast (iterator, NUM_ELMS);
102 verify_Min_Max (container, NUM_ELMS);
103 verify_Min_Max (iterator, NUM_ELMS);
109 verify_accessFirstLast (COL
const& col, uint lim)
114 CHECK (
first(col) == theFirst);
115 CHECK (
last(col) == theLast);
121 verify_Min_Max (COL
const& col, uint lim)
123 uint expectedMax = lim;
124 uint expectedMin = 1;
126 CHECK (max (col) == expectedMax);
127 CHECK (min (col) == expectedMin);
131 using Val =
typename COL::value_type;
133 CHECK (max (empty) == std::numeric_limits<Val>::min());
134 CHECK (min (empty) == std::numeric_limits<Val>::max());
139 verify_typeDetectors()
enable_if< treat_as_LumieraIterator< IT >, typename IT::reference > first(IT ii)
extract the first element yielded by an Lumiera Forward Iterator.
Helper template(s) for creating Lumiera Forward Iterators.
enable_if< treat_as_STL_Container< COLL >, typename COLL::reference > first(COLL const &coll)
access the first element of a STL-like container.
Simple test class runner.
Helpers for type detection, type rewriting and metaprogramming.
enable_if< can_direct_access_Last< COLL >, typename COLL::reference > last(COLL const &coll)
access the last element of a STL-like container.
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...