Gromacs
2021.4
|
#include <gromacs/utility/range.h>
Defines a range of integer numbers and accompanying operations.
Defines a range of integer type with begin and end. Can be used in a range loop over all integers in the range as in:
Range<int> range(2,5); for (int i : range) { printf(" %d", i); }
This will print: 2 3 4
Classes | |
struct | iterator |
An iterator that loops over a range of integers. More... | |
Public Member Functions | |
Range (const T begin, const T end) | |
Constructor, has to be called with begin <= end (is checked) | |
Range ()=default | |
Default constructor, produces an empty range. | |
iterator | begin () const |
Begin iterator/value. | |
iterator | end () const |
End iterator/value. | |
T | size () const |
Returns the length of the range. | |
bool | empty () const |
Returns whether the range is empty. | |
bool | isInRange (const T value) const |
Returns whether value is in range. | |