Gromacs
2025-dev-20241002-88a4191
|
#include <gromacs/utility/enumerationhelpers.h>
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.
EnumType | The enum (class) type. |
Last | Last constant or number thereof (assumes a default 'Count' member). |
Step | Step increment. |
Public Types | |
using | IteratorType = EnumerationIterator< EnumType, Last, Step > |
Convenience alias. | |
using | value_type = EnumType |
Convenience alias. | |
Public Member Functions | |
IteratorType | begin () const |
Functions required for range-based for statements to work. | |
IteratorType | end () const |