Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types
gmx::EnumerationWrapper< EnumType, Last, Step > Class Template Referencefinal

#include <gromacs/utility/enumerationhelpers.h>

Description

template<typename EnumType, EnumType Last = EnumType::Count, unsigned int Step = 1>
class gmx::EnumerationWrapper< EnumType, Last, Step >

Allows constructing iterators for looping over sequential enumerators.

These are particularly useful for range-based for statements.

You can also provide an increment step > 1 if each constant is spaced by a larger value. Terminating constant is assumed to be a 'Count' member, which is never iterated. A different name for the terminating constant can also be specified on declaration.

See file documentation for usage example.

Template Parameters
EnumTypeThe enum (class) type.
LastLast constant or number thereof (assumes a default 'Count' member).
StepStep increment.

Public Types

using IteratorType = EnumerationIterator< EnumType, Last, Step >
 Convenience alias.
 

Public Member Functions

IteratorType begin () const
 Functions required for range-based for statements to work.
 
IteratorType end () const
 

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