|
unilink
0.4.3
A simple C++ library for unified async communication
|
A C++17 compatible span-like class for safe array access. More...
#include <safe_span.hpp>
Public Types | |
| using | element_type = T |
| using | value_type = std::remove_cv_t< T > |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | pointer = T * |
| using | const_pointer = const T * |
| using | reference = T & |
| using | const_reference = const T & |
| using | iterator = T * |
| using | const_iterator = const T * |
| using | reverse_iterator = std::reverse_iterator< iterator > |
| using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
Public Member Functions | |
| constexpr | SafeSpan () noexcept |
| constexpr | SafeSpan (pointer data, size_type size) noexcept |
| template<typename Container > | |
| constexpr | SafeSpan (Container &container) noexcept |
| template<typename Container > | |
| constexpr | SafeSpan (const Container &container) noexcept |
| constexpr reference | operator[] (size_type index) const |
| constexpr reference | at (size_type index) const |
| constexpr reference | front () const |
| constexpr reference | back () const |
| constexpr pointer | data () const noexcept |
| constexpr size_type | size () const noexcept |
| constexpr size_type | size_bytes () const noexcept |
| constexpr bool | empty () const noexcept |
| constexpr iterator | begin () const noexcept |
| constexpr iterator | end () const noexcept |
| constexpr const_iterator | cbegin () const noexcept |
| constexpr const_iterator | cend () const noexcept |
| constexpr reverse_iterator | rbegin () const noexcept |
| constexpr reverse_iterator | rend () const noexcept |
| constexpr const_reverse_iterator | crbegin () const noexcept |
| constexpr const_reverse_iterator | crend () const noexcept |
| constexpr SafeSpan< T > | subspan (size_type offset, size_type count=SIZE_MAX) const |
| constexpr SafeSpan< T > | first (size_type count) const |
| constexpr SafeSpan< T > | last (size_type count) const |
A C++17 compatible span-like class for safe array access.
This provides a lightweight, non-owning view over a contiguous sequence of objects. Similar to std::span (C++20) but fully compatible with C++17 environments.
Design Intent:
Definition at line 38 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::const_iterator = const T* |
Definition at line 49 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::const_pointer = const T* |
Definition at line 45 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::const_reference = const T& |
Definition at line 47 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line 51 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::difference_type = std::ptrdiff_t |
Definition at line 43 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::element_type = T |
Definition at line 40 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::iterator = T* |
Definition at line 48 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::pointer = T* |
Definition at line 44 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::reference = T& |
Definition at line 46 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line 50 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::size_type = std::size_t |
Definition at line 42 of file safe_span.hpp.
| using unilink::memory::SafeSpan< T >::value_type = std::remove_cv_t<T> |
Definition at line 41 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 54 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 56 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 59 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 62 of file safe_span.hpp.
|
inlineconstexpr |
Definition at line 68 of file safe_span.hpp.
|
inlineconstexpr |
Definition at line 77 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 88 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 92 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 94 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 100 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 102 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 79 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 85 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 90 of file safe_span.hpp.
|
inlineconstexpr |
Definition at line 116 of file safe_span.hpp.
|
inlineconstexpr |
Definition at line 75 of file safe_span.hpp.
|
inlineconstexpr |
Definition at line 118 of file safe_span.hpp.
|
inlineconstexpr |
Definition at line 66 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 96 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 98 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 81 of file safe_span.hpp.
|
inlineconstexprnoexcept |
Definition at line 83 of file safe_span.hpp.
|
inlineconstexpr |
Definition at line 105 of file safe_span.hpp.