|
Regina 7.0 Calculation Engine
|
A specialisation of ListView for working with lists stored in a C-style array. More...
#include <utilities/listview.h>
Public Types | |
| using | value_type = Element |
| The type of element that is stored in this list. More... | |
| using | size_type = size_t |
| The type used for indexing into this list. More... | |
| using | reference = const Element & |
| A reference to a list element. More... | |
| using | const_reference = const Element & |
| A reference to a list element. More... | |
| using | iterator = const Element * |
| The iterator type for this list view. More... | |
| using | const_iterator = const Element * |
| The iterator type for this list view. More... | |
Public Member Functions | |
| ListView (const Element *array, size_t size) | |
| Returns a view for the given C-style array, presented as an array with size. More... | |
| ListView (const Element *begin, const Element *end) | |
| Returns a view for the given C-style array, presented as an iterator pair. More... | |
| ListView (const ListView &)=default | |
| Creates a new copy of the given list view. More... | |
| ListView & | operator= (const ListView &)=default |
| Sets this to be a copy of the given list view. More... | |
| bool | empty () const |
| Determines if this list is empty. More... | |
| size_type | size () const |
| Returns the number of elements in this list. More... | |
| const_reference | operator[] (size_type index) const |
| Returns the requested element of this list. More... | |
| const_reference | front () const |
| Returns the first element of this list. More... | |
| const_reference | back () const |
| Returns the last element of this list. More... | |
| const_iterator | begin () const |
| Returns an iterator pointing to the first element. More... | |
| const_iterator | end () const |
| Returns an iterator pointing beyond the last element. More... | |
A specialisation of ListView for working with lists stored in a C-style array.
See the generic ListView class documentation for full details on how this class works and how to use it.
| Element | the type of element stored in the C-style array. |
| using regina::ListView< Element * >::const_iterator = const Element* |
The iterator type for this list view.
Both iterator and const_iterator are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::const_reference = const Element& |
A reference to a list element.
Both reference and const_reference are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::iterator = const Element* |
The iterator type for this list view.
Both iterator and const_iterator are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::reference = const Element& |
A reference to a list element.
Both reference and const_reference are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::size_type = size_t |
The type used for indexing into this list.
| using regina::ListView< Element * >::value_type = Element |
The type of element that is stored in this list.
| regina::ListView< Element * >::ListView | ( | const Element * | array, |
| size_t | size | ||
| ) |
Returns a view for the given C-style array, presented as an array with size.
Internally, this object will store a pointer to the array, which means the array needs to exist for at least as long as this object.
| array | the pointer to the C-style array. |
| size | the number of elements in the C-style array. |
| regina::ListView< Element * >::ListView | ( | const Element * | begin, |
| const Element * | end | ||
| ) |
Returns a view for the given C-style array, presented as an iterator pair.
Internally, this object will store a pointer to the array, which means the array needs to exist for at least as long as this object.
| begin | the beginning of the C-style array (that is, a pointer to the first element). |
| end | a pointer past the end of the C-style array (that is, a pointer immediately after the last element). |
|
default |
Creates a new copy of the given list view.
| ListView< Element * >::const_reference regina::ListView< Element * >::back |
Returns the last element of this list.
| ListView< Element * >::const_iterator regina::ListView< Element * >::begin |
Returns an iterator pointing to the first element.
| bool regina::ListView< Element * >::empty |
Determines if this list is empty.
true if and only if this list is empty. | ListView< Element * >::const_iterator regina::ListView< Element * >::end |
Returns an iterator pointing beyond the last element.
| ListView< Element * >::const_reference regina::ListView< Element * >::front |
Returns the first element of this list.
|
default |
Sets this to be a copy of the given list view.
| ListView< Element * >::const_reference regina::ListView< Element * >::operator[] | ( | size_type | index | ) | const |
Returns the requested element of this list.
| index | indicates which element to return; this must be between 0 and size()-1 inclusive. |
| ListView< Element * >::size_type regina::ListView< Element * >::size |
Returns the number of elements in this list.