#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <span>
#include <type_traits>
Go to the source code of this file.
|
| template<typename T , typename EndOrSize > |
| | Span (T *, EndOrSize) -> Span< T > |
| |
| template<typename T , std::size_t N> |
| | Span (T(&)[N]) -> Span< T > |
| |
| template<typename T > |
| | Span (T &&) -> Span< std::enable_if_t< !std::is_lvalue_reference_v< T >, const std::remove_pointer_t< decltype(std::declval< T && >().data())> > > |
| |
| template<typename T > |
| | Span (T &) -> Span< std::remove_pointer_t< decltype(std::declval< T & >().data())> > |
| |
| template<typename T > |
| T & | SpanPopBack (Span< T > &span) |
| | Pop the last element off a span, and return a reference to that element. More...
|
| |
| const std::byte * | BytePtr (const void *data) |
| | Convert a data pointer to a std::byte data pointer. More...
|
| |
| std::byte * | BytePtr (void *data) |
| |
| template<typename T > |
| Span< const std::byte > | AsBytes (Span< T > s) noexcept |
| |
| template<typename T > |
| Span< std::byte > | AsWritableBytes (Span< T > s) noexcept |
| |
| template<typename V > |
| Span< const std::byte > | MakeByteSpan (V &&v) noexcept |
| |
| template<typename V > |
| Span< std::byte > | MakeWritableByteSpan (V &&v) noexcept |
| |
| uint8_t * | UCharCast (char *c) |
| |
| uint8_t * | UCharCast (uint8_t *c) |
| |
| uint8_t * | UCharCast (signed char *c) |
| |
| uint8_t * | UCharCast (std::byte *c) |
| |
| const uint8_t * | UCharCast (const char *c) |
| |
| const uint8_t * | UCharCast (const uint8_t *c) |
| |
| const uint8_t * | UCharCast (const signed char *c) |
| |
| const uint8_t * | UCharCast (const std::byte *c) |
| |
| template<typename T > |
| constexpr auto | UCharSpanCast (Span< T > s) -> Span< typename std::remove_pointer< decltype(UCharCast(s.data()))>::type > |
| |
| template<typename V > |
| constexpr auto | MakeUCharSpan (V &&v) -> decltype(UCharSpanCast(Span{std::forward< V >(v)})) |
| | Like the Span constructor, but for (const) uint8_t member types only. More...
|
| |
◆ ASSERT_IF_DEBUG
| #define ASSERT_IF_DEBUG |
( |
|
x | ) |
|
◆ CONSTEXPR_IF_NOT_DEBUG
| #define CONSTEXPR_IF_NOT_DEBUG constexpr |
◆ SPAN_ATTR_LIFETIMEBOUND
| #define SPAN_ATTR_LIFETIMEBOUND |
◆ AsBytes()
template<typename T >
| Span< const std::byte > AsBytes |
( |
Span< T > |
s | ) |
|
|
noexcept |
◆ AsWritableBytes()
template<typename T >
| Span< std::byte > AsWritableBytes |
( |
Span< T > |
s | ) |
|
|
noexcept |
◆ BytePtr() [1/2]
| const std::byte * BytePtr |
( |
const void * |
data | ) |
|
|
inline |
Convert a data pointer to a std::byte data pointer.
Where possible, please use the safer AsBytes helpers.
Definition at line 287 of file span.h.
◆ BytePtr() [2/2]
| std::byte * BytePtr |
( |
void * |
data | ) |
|
|
inline |
◆ MakeByteSpan()
template<typename V >
| Span< const std::byte > MakeByteSpan |
( |
V && |
v | ) |
|
|
noexcept |
◆ MakeUCharSpan()
template<typename V >
| constexpr auto MakeUCharSpan |
( |
V && |
v | ) |
-> decltype(UCharSpanCast(Span{std::forward<V>(v)})) |
|
constexpr |
Like the Span constructor, but for (const) uint8_t member types only.
Only works for (un)signed char containers.
Definition at line 350 of file span.h.
◆ MakeWritableByteSpan()
template<typename V >
| Span< std::byte > MakeWritableByteSpan |
( |
V && |
v | ) |
|
|
noexcept |
◆ Span() [1/4]
template<typename T >
| Span |
( |
T && |
| ) |
-> Span< std::enable_if_t< !std::is_lvalue_reference_v< T >, const std::remove_pointer_t< decltype(std::declval< T && >().data())> > > |
◆ Span() [2/4]
template<typename T >
| Span |
( |
T & |
| ) |
-> Span< std::remove_pointer_t< decltype(std::declval< T & >().data())> > |
◆ Span() [3/4]
template<typename T , typename EndOrSize >
◆ Span() [4/4]
template<typename T , std::size_t N>
◆ SpanPopBack()
template<typename T >
| T & SpanPopBack |
( |
Span< T > & |
span | ) |
|
Pop the last element off a span, and return a reference to that element.
Definition at line 277 of file span.h.
◆ UCharCast() [1/8]
| uint8_t * UCharCast |
( |
char * |
c | ) |
|
|
inline |
◆ UCharCast() [2/8]
| const uint8_t * UCharCast |
( |
const char * |
c | ) |
|
|
inline |
◆ UCharCast() [3/8]
| const uint8_t * UCharCast |
( |
const signed char * |
c | ) |
|
|
inline |
◆ UCharCast() [4/8]
| const uint8_t * UCharCast |
( |
const std::byte * |
c | ) |
|
|
inline |
◆ UCharCast() [5/8]
| const uint8_t * UCharCast |
( |
const uint8_t * |
c | ) |
|
|
inline |
◆ UCharCast() [6/8]
| uint8_t * UCharCast |
( |
signed char * |
c | ) |
|
|
inline |
◆ UCharCast() [7/8]
| uint8_t * UCharCast |
( |
std::byte * |
c | ) |
|
|
inline |
◆ UCharCast() [8/8]
| uint8_t * UCharCast |
( |
uint8_t * |
c | ) |
|
|
inline |
◆ UCharSpanCast()
template<typename T >
| constexpr auto UCharSpanCast |
( |
Span< T > |
s | ) |
-> Span<typename std::remove_pointer<decltype(UCharCast(s.data()))>::type> |
|
constexpr |