|
Regina 7.4 Calculation Engine
|
The iterator type for this table view. More...
#include <utilities/tableview.h>
Public Types | |
| using | value_type = std::remove_reference_t<Subview> |
| Indicates what type the iterator points to. | |
| using | iterator_category = std::input_iterator_tag |
| Declares this to be an input iterator type. | |
| using | difference_type = ptrdiff_t |
| The type obtained by subtracting iterators. | |
| using | pointer = const value_type* |
| A pointer to value_type. | |
| using | reference = Subview |
| The type returned by the dereference operator, which could be by value (for a multi-dimensional table) or by reference (for a one-dimensional table). | |
Public Member Functions | |
| iterator ()=default | |
| 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. | |
| iterator & | operator-- () |
| The predecrement operator. | |
| iterator | operator-- (int) |
| The postdecrement operator. | |
| Subview | operator* () const |
| Returns the subarray or element of the underlying table that this iterator is currently pointing to. | |
Friends | |
| class | TableView |
The iterator type for this table view.
For a TableView t, an iterator of this type runs through the subarrays/elements t[0], t[1], ..., in order from first to last. See TableView::begin() for further details.
This iterator is, in spirit, a bidirectional multipass iterator. However, we declare it using std::input_iterator_tag here because it does not necessarily return by reference (a requirement of forward and bidirectional iterators in the C++ standard library). In particular:
const Element&.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 TableView::iterator since TableView is templated. Therefore, for TableView::iterator, we continue to provide these associated types directly as class members.
Both iterator and const_iterator are the same type, since TableView only offers read-only access to the underlying data.
| using regina::TableView< Element, dim1, dim >::iterator::difference_type = ptrdiff_t |
The type obtained by subtracting iterators.
| using regina::TableView< Element, dim1, dim >::iterator::iterator_category = std::input_iterator_tag |
Declares this to be an input iterator type.
| using regina::TableView< Element, dim1, dim >::iterator::pointer = const value_type* |
A pointer to value_type.
| using regina::TableView< Element, dim1, dim >::iterator::reference = Subview |
The type returned by the dereference operator, which could be by value (for a multi-dimensional table) or by reference (for a one-dimensional table).
See the iterator class notes for details.
| using regina::TableView< Element, dim1, dim >::iterator::value_type = std::remove_reference_t<Subview> |
Indicates what type the iterator points to.
|
default |
Creates a new uninitialised iterator.
|
default |
Creates a copy of the given iterator.
|
inline |
Returns the subarray or element of the underlying table that this iterator is currently pointing to.
The return type follows the same design as TableView::operator[]. For a one-dimensional table it returns the current table element, by const reference. For a multi-dimensional table it returns a TableView of of smaller dimension, by value, representing the slice of the overall table that is obtained when the first array index is fixed at the current iterator position.
|
inline |
The preincrement operator.
|
inline |
The postincrement operator.
|
inline |
The predecrement operator.
|
inline |
The postdecrement operator.
|
default |
Makes this a copy of the given iterator.
|
inline |
Compares this with the given iterator for equality.
| rhs | the iterator to compare this with. |
true if the iterators point to the same subarray/element of the underlying table, or false if they do not.