42#ifndef Foam_IntRange_H
43#define Foam_IntRange_H
68template<
class IntType>
71 static_assert(std::is_integral_v<IntType>,
"Integral required");
86 inline IntType at_value(IntType idx)
const noexcept;
121 constexpr bool operator()(Int val)
const noexcept
131 constexpr bool operator()(Int val)
const noexcept
141 constexpr bool operator()(Int val)
const noexcept
191 IntType
max() const
noexcept {
return (start_ + (size_ - 1)); }
236 inline constexpr IntType
operator[](IntType i)
const noexcept;
244 inline IntType operator++(
int)
noexcept;
247 inline IntType operator+=(IntType
n)
noexcept;
250 inline IntType operator--()
noexcept;
251 inline IntType operator--(
int)
noexcept;
254 inline IntType operator-=(IntType
n)
noexcept;
257 explicit operator
bool() const
noexcept {
return (size_ > 0); }
311template<
class IntType>
312inline constexpr bool operator==
318 return (a.
start() ==
b.start() && a.
size() ==
b.size());
324template<
class IntType>
325inline constexpr bool operator<
345template<
class IntType>
346inline constexpr bool operator!=
355template<
class IntType>
356inline constexpr bool operator<=
365template<
class IntType>
366inline constexpr bool operator>
375template<
class IntType>
376inline constexpr bool operator>=
A random-access, integer-like, input iterator for integral values.
An interval of (signed) integers defined by a start and a size.
void clear() noexcept
Reset to (0,0).
IntType operator++() noexcept
Increase the size by 1.
constexpr IntType operator[](IntType i) const noexcept
Offset dereference, without bounds checking.
const_iterator begin() const noexcept
int rend_value() const noexcept
bool empty() const noexcept
IndexIterator< int > const_iterator
IntType max() const noexcept
The (inclusive) upper value of the range, same as rbegin_value(). Ill-defined for an empty range.
IntType & start() noexcept
Non-const access to start of the range.
IntType start() const noexcept
The (inclusive) lower value of the range.
bool found(int val) const noexcept
bool good() const noexcept
True if range has size greater than zero.
const_iterator end() const noexcept
A const_iterator set to 1 beyond the end of the range.
void setStart(int i) noexcept
int rbegin_value() const noexcept
IntType size() const noexcept
The size of the range.
ReverseIndexIterator< int > const_reverse_iterator
void resize(int n) noexcept
void clampSize() noexcept
bool contains(int value) const noexcept
const_iterator cend() const noexcept
A const_iterator set to 1 beyond the end of the range.
bool operator()(IntType i) const noexcept
True if the global value is located within the range.
IntType min() const noexcept
The (inclusive) lower value of the range, same as start(), begin_value().
IntType & size() noexcept
Non-const access to size of the range.
IntType begin_value() const noexcept
The value at the beginning of the range - same as min(), start().
const_reverse_iterator crbegin() const noexcept
A const_reverse_iterator set to 1 before the end of range.
constexpr IntRange() noexcept
Default construct an empty range (0,0).
const_iterator cbegin() const noexcept
A const_iterator set to the beginning of the range.
const_reverse_iterator rend() const noexcept
A const_reverse_iterator set to 1 before the begin of range.
const_reverse_iterator crend() const noexcept
A const_reverse_iterator set to 1 before the begin of range.
int end_value() const noexcept
const_iterator at(IntType i) const
Return const_iterator to a position within the range, with bounds checking.
void setSize(int n) noexcept
const_reverse_iterator rbegin() const noexcept
A const_reverse_iterator set to 1 before the end of range.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A random-access, integer-like, input iterator for integral values that behaves like a reverse iterato...
Typedefs for label/uLabel without requiring label.H.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
Unary predicate for greater-equal 0 (int values).
constexpr bool operator()(Int val) const noexcept
Unary predicate for greater than 0 (int values).
constexpr bool operator()(Int val) const noexcept
Unary predicate for less-equal 0 (int values).
constexpr bool operator()(Int val) const noexcept
Unary predicate for less than 0 (int values).
constexpr bool operator()(Int val) const noexcept