VCCC  2024.05
VisualCamp Common C++ library
span

vccc::span view More...

Detailed Description

See also
Standard library header (C++20)

Classes

class  span< T, Extent >
 a non-owning view over a contiguous sequence of objects More...
 
struct  enable_borrowed_range< span< T, Extent > >
 
struct  enable_view< span< T, Extent > >
 

Functions

template<typename T , std::size_t N>
constexpr span< const byte, detail::as_bytes_size< T, N >::valueas_bytes (span< T, N > s) noexcept
 converts a span into a view of its underlying bytes More...
 
template<typename T , std::size_t N, std::enable_if_t< std::is_const< T >::value==false, int > = 0>
constexpr span< byte, detail::as_bytes_size< T, N >::valueas_writable_bytes (span< T, N > s) noexcept
 converts a span into a view of its underlying bytes More...
 

Variables

constexpr VCCC_INLINE_OR_STATIC std::size_t dynamic_extent = (std::numeric_limits<std::size_t>::max)()
 

Function Documentation

◆ as_bytes()

constexpr span<const byte, detail::as_bytes_size<T, N>::value> vccc::as_bytes ( span< T, N >  s)
constexprnoexcept

Obtains a view to the object representation of the elements of the span s.

If N is vccc:dynamic_extent, the extent of the returned span S is also vccc::dynamic_extent; otherwise it is sizeof(T) * N.

◆ as_writable_bytes()

constexpr span<byte, detail::as_bytes_size<T, N>::value> vccc::as_writable_bytes ( span< T, N >  s)
constexprnoexcept

Variable Documentation

◆ dynamic_extent

constexpr VCCC_INLINE_OR_STATIC std::size_t dynamic_extent = (std::numeric_limits<std::size_t>::max)()
constexpr