|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
A view of a contiguous sequence of elements. More...
#include <vitrio/span.hpp>
Public Types | |
| using | element_type = T |
| using | value_type = typename std::remove_cv< T >::type |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | pointer = T * |
| using | reference = T & |
| using | iterator = T * |
Public Member Functions | |
| constexpr | span () noexcept |
| Construct a span of no elements. | |
| constexpr | span (pointer data, size_type size) noexcept |
| Construct a span from its first element and its size. | |
| template<typename U , typename = typename std::enable_if< std::is_convertible<U (*)[], T (*)[]>::value >::type> | |
| constexpr | span (const span< U > &other) noexcept |
| Construct a span from one of a less qualified element type. | |
| span (const span &other)=default | |
| span & | operator= (const span &other)=default |
| constexpr pointer | data () const noexcept |
| Get the first element. | |
| constexpr size_type | size () const noexcept |
| Get the number of elements. | |
| constexpr bool | empty () const noexcept |
| Check whether the span has no elements. | |
| constexpr reference | operator[] (size_type index) const noexcept |
| Get one element. | |
| constexpr reference | front () const noexcept |
| Get the first element. | |
| constexpr reference | back () const noexcept |
| Get the last element. | |
| constexpr iterator | begin () const noexcept |
| Get an iterator to the first element. | |
| constexpr iterator | end () const noexcept |
| Get an iterator past the last element. | |
A view of a contiguous sequence of elements.
A span refers to elements it does not own, through a pointer to the first one and a count. Copying a span copies the reference and not the elements. The elements must outlive every span that refers to them.
A span of a const type gives read-only access to its elements. A span of a non-const type converts to it.
| T | Type of the elements. It may be const. |
|
constexprnoexcept |
Construct a span from its first element and its size.
| data | Pointer to the first element. |
| size | Number of elements. |
|
constexprnoexcept |
Construct a span from one of a less qualified element type.
This is what converts a span of non-const elements into one of const elements.
| U | Element type of the other span. |
| other | The span to refer to the elements of. |
Get the last element.
The span must not be empty.
Get an iterator to the first element.
Get the first element.
Check whether the span has no elements.
Get an iterator past the last element.
Get the first element.
The span must not be empty.
|
constexprnoexcept |
Get one element.
| index | Position of the element. Must be below size. |
|
constexprnoexcept |
Get the number of elements.