template<typename T>
class owning_span< T >
A contiguous storage container that manages the lifecycle of a buffer of a given size.
Similar to std::unique_ptr in that we guarantee memory safety, however owning_span points to a buffer rather than an object.
- Template Parameters
-
| T | type contained within the buffer |
Definition at line 27 of file Types.hh.
|
| | owning_span () |
| | Uninitialized buffer.
|
| |
| | owning_span (size_t count) |
| | Allocates a buffer of T elements. Does not initialize any elements.
|
| |
| | owning_span (const std::span< const T > &span) |
| | Performs a deep copy from a std::span of const T.
|
| |
| | owning_span (const owning_span &rhs) |
| | Copy constructor.
|
| |
| | owning_span (owning_span &&rhs) |
| | Move constructor.
|
| |
| owning_span & | operator= (const owning_span &rhs) |
| | Copy assignment operator.
|
| |
| owning_span & | operator= (owning_span &&rhs) |
| | Move assignment operator.
|
| |
| | ~owning_span () |
| | Destroys the underlying buffer on teardown.
|
| |
| T & | operator[] (size_t idx) |
| | Indexes into the underlying buffer.
|
| |
| const T & | operator[] (size_t idx) const |
| | Indexes into the underlying buffer.
|
| |
| T & | front () |
| | Retrieves the first element in the buffer.
|
| |
| const T & | front () const |
| | Retrieves the first element in the buffer.
|
| |
| T & | back () |
| | Retrieves the last element in the buffer.
|
| |
| const T & | back () const |
| | Retrieves the last element in the buffer.
|
| |
| T * | begin () |
| |
| T * | end () |
| |
| const T * | begin () const |
| |
| const T * | end () const |
| |
| bool | empty () const |
| | Returns true if the buffer is uninitialized.
|
| |
| size_t | size () const |
| | Returns the number of elements that fit in the buffer.
|
| |
| std::span< const T > | view () const |
| | Returns a read-only view of the entire buffer.
|
| |