Gromacs  2020.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions
gmx::Range< T > Class Template Reference

#include <gromacs/utility/range.h>

Description

template<typename T>
class gmx::Range< T >

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.
 
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.
 

The documentation for this class was generated from the following file: