16 #include <type_traits>
69 static_assert(std::is_integral<T>::value,
"Only integral types are supported.");
81 TSeq(
T theBegin,
T theEnd,
T theStep = 1):
86 class iterator:
public std::iterator<std::random_access_iterator_tag, T, difference_type> {
178 return TSeq<T>(begin, end, step);
192 std::ostringstream ret;
193 ret <<
"A sequence of values: " << *val->
begin()
194 <<
" <= i < " << *val->
end();
195 auto step = val->
step();
197 ret <<
" in steps of " << step;
bool operator==(const iterator &other) const
T operator-(const iterator &other) const
typename std::make_signed< T >::type difference_type
T operator+(const iterator &other) const
TSeq(T theBegin, T theEnd, T theStep=1)
iterator(T start, T step)
std::string printValue(const TDatime *val)
Print a TDatime at the prompt.
A pseudo container class which is a generator of indices.
bool operator!=(const iterator &other) const