16 #include <type_traits> 69 static_assert(std::is_integral<T>::value,
"Only integral types are supported.");
78 TSeq(
T theEnd): fBegin(), fEnd(theEnd), fStep(1) {
81 TSeq(
T theBegin,
T theEnd,
T theStep = 1):
82 fBegin(theBegin), fEnd(theEnd), fStep(theStep) {
86 class iterator:
public std::iterator<std::random_access_iterator_tag, T, difference_type> {
137 auto isStepMultiple = (fEnd -
fBegin) % fStep == 0;
138 auto theEnd = isStepMultiple ?
fEnd : fStep * ((
T)((fEnd - fBegin) /
fStep) + 1) +
fBegin;
147 return s * fStep +
fBegin;
192 std::ostringstream ret;
193 ret <<
"A sequence of values: " << *val->
begin()
194 <<
" <= i < " << *val->
end();
197 ret <<
" in steps of " <<
step;
typename std::make_signed< T >::type difference_type
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
std::string printValue(ROOT::TSeq< T > *val)
T operator-(const iterator &other) const
T operator+(const iterator &other) const
TSeq(T theBegin, T theEnd, T theStep=1)
iterator(T start, T step)
bool operator!=(const iterator &other) const
A pseudo container class which is a generator of indices.
Print a TSeq at the prompt:
bool operator==(const iterator &other) const