|
| | iterator () |
| | Creates a new uninitialised iterator.
|
| | iterator (const iterator &)=default |
| | Creates a copy of the given iterator.
|
| iterator & | operator= (const iterator &)=default |
| | Makes this a copy of the given iterator.
|
| bool | operator== (const iterator &rhs) const |
| | Compares this with the given iterator for equality.
|
| iterator & | operator++ () |
| | The preincrement operator.
|
| iterator | operator++ (int) |
| | The postincrement operator.
|
| Perm< n > | __next__ () |
| | Returns the current permutation and increments this iterator.
|
| Perm< n > | operator* () const |
| | Returns the permutation that this iterator is currently pointing to.
|
| | operator bool () const |
| | Identifies whether this iterator is dereferenceable.
|
template<int n, bool cached = false>
class regina::PermGroup< n, cached >::iterator
The iterator type for this group.
Unlike most iterator types, the dereference operator for this iterator type returns by value (not by reference). This is because the individual permutations in a group are generated (not stored), based upon an internal group representation that is typically much smaller than the group itself.
For most iterator classes, Regina now uses specialisations of std::iterator_traits to provide access to their associated types (e.g., value_type). However, this is not possible for PermGroup::iterator since PermGroup is templated. Therefore, for PermGroup::iterator, we continue to provide these associated types directly as class members.
Both iterator and const_iterator are the same type, since a PermGroup only offers read-only access to its group members.
template<int n, bool cached = false>
Compares this with the given iterator for equality.
To be considered equal, two iterators must be pointing to the same permutation within the same group. (The second condition means that the underlying PermGroup pointers must be the same - it is not enough to have two distinct PermGorup objects with identical contents.)
Two past-the-end iterators will always be considered equal.
- Parameters
-
| rhs | the iterator to compare this with. |
- Returns
true if the iterators point to the same permutation, or false if they do not.