Non-owning range of elements in contiguous memory.
More...
#include <staticlib/io/span.hpp>
Public Member Functions |
| template<typename IntType > |
| | span (T *buffer, IntType length) |
| | Constructor.
|
| template<typename Convertible , size_t Length> |
| | span (std::array< Convertible, Length > &buffer) |
| | Constructor from array.
|
| | span (std::vector< T > &buffer) |
| | Constructor from vector.
|
| template<typename Convertible > |
| | span (std::vector< Convertible > &buffer) |
| | Constructor from vector.
|
| | span (std::string &buffer) |
| | Constructor from string, for char and const charspans only.
|
| | span (const std::string &buffer) |
| | Constructor from string, for const charspans only.
|
| template<size_t Size> |
| | span (const char(&buffer)[Size]) |
| | Constructor from string literal.
|
| | span (const span< T > &other) |
| | Copy constructor.
|
| span< T > & | operator= (const span< T > &other) |
| | Copy assignment operator.
|
| T & | operator[] (size_t index) const |
| | Element access checked operation.
|
| T * | data () const STATICLIB_NOEXCEPT |
| | Data accessor.
|
| bool | empty () const STATICLIB_NOEXCEPT |
| | Emptiness check.
|
| bool | is_empty () const STATICLIB_NOEXCEPT |
| | Emptiness check.
|
| bool | is_null () const STATICLIB_NOEXCEPT |
| | NULL check.
|
| size_t | size () const STATICLIB_NOEXCEPT |
| | Size accessor.
|
| std::streamsize | size_signed () const STATICLIB_NOEXCEPT |
| | Size accessor.
|
| int | size_int () const STATICLIB_NOEXCEPT |
| | Size accessor.
|
| size_t | size_bytes () const STATICLIB_NOEXCEPT |
| | Size in bytes accessor.
|
| T * | begin () const STATICLIB_NOEXCEPT |
| | Begin iterator.
|
| T * | end () const STATICLIB_NOEXCEPT |
| | End iterator.
|
Detailed Description
template<typename T>
class staticlib::io::span< T >
Non-owning range of elements in contiguous memory.
Constructor & Destructor Documentation
template<typename T>
template<typename IntType >
Constructor.
- Parameters
-
| buffer | span start pointer |
| length | number of elements |
- Exceptions
-
template<typename T>
template<typename Convertible , size_t Length>
Constructor from array.
- Parameters
-
| buffer | array of type convertible into T |
Constructor from vector.
- Parameters
-
template<typename T>
template<typename Convertible >
Constructor from vector.
- Parameters
-
| buffer | array of type convertible into T |
Constructor from string, for char and const charspans only.
- Parameters
-
Constructor from string, for const charspans only.
- Parameters
-
template<typename T>
template<size_t Size>
Constructor from string literal.
- Parameters
-
Copy constructor.
- Parameters
-
Member Function Documentation
Begin iterator.
- Returns
- begin iterator
Data accessor.
- Returns
- pointer to span start
Emptiness check.
- Returns
- true, if this span empty, false otherwise
End iterator.
- Returns
- end iterator
Emptiness check.
- Returns
- true, if this span empty, false otherwise
NULL check.
- Returns
- true, if this span contains NULL buffer, false otherwise
Copy assignment operator.
- Parameters
-
Element access checked operation.
- Parameters
-
| index | index to access element at |
- Returns
- reference to element
- Exceptions
-
Size accessor.
- Returns
- span size
Size in bytes accessor.
- Returns
- size in bytes
Size accessor.
- Returns
- span size as int
Size accessor.
- Returns
- span size as signed
The documentation for this class was generated from the following file: