38 #ifndef TFXX_RANGE_H_VERSION 40 #define TFXX_RANGE_H_VERSION \ 98 {
return this->
shift(n); }
101 {
return this->
shift(-n); }
113 template<
class T=
int>
119 const Tvalue& stepsize=1):
147 #endif // TFXX_RANGE_H_VERSION (includeguard) Tvalue operator++()
advance to next value and return current value
Tvalue Mlast
end of range.
Tvalue & last()
access end of range
const Tvalue & last() const
read end of range
Range(const Tvalue &first, const Tvalue &last)
set range
const Tvalue & first() const
read start of range
tfxx::Range< T > range(const std::string &s)
bool contains(const Tvalue &v) const
does this range contain then value v
Tvalue next()
advance to next value and return current value
Range & shift(const Tvalue &n)
shift by n
bool contains(const Range &other) const
does this range contain the other
Tvalue & first()
access start of range
Range & shrink(const Range &other)
shrink to smaller of this and the other
A class to deal with numerical ranges.
RangeStepper(const Trange &range, const Tvalue &stepsize=1)
Tvalue current() const
return current value
bool more() const
true if stepper will still be in range after next advance
Range & expand(const Range &other)
expand to larger of this and the other
Range & operator+=(const Tvalue &n)
shift by n
bool valid() const
true if stepper is still in range and can return a current value
Range & operator-=(const Tvalue &n)
shift by -n
bool isinside(const Range &other) const
is this range inside the other
Namespace containing all code of library libtfxx.
Tvalue Mfirst
start of range.
Range(const Tvalue &index)
range containing exactly one element