24 Containers library [containers]

24.7 Views [views]

24.7.2 Contiguous access [views.contiguous]

24.7.2.1 Header <span> synopsis [span.syn]

#include <initializer_list> // see [initializer.list.syn] // mostly freestanding namespace std { // constants inline constexpr size_t dynamic_extent = numeric_limits<size_t>::max(); template<class T> concept integral-constant-like = // exposition only is_integral_v<decltype(T::value)> && !is_same_v<bool, remove_const_t<decltype(T::value)>> && convertible_to<T, decltype(T::value)> && equality_comparable_with<T, decltype(T::value)> && bool_constant<T() == T::value>::value && bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value; template<class T> constexpr size_t maybe-static-ext = dynamic_extent; // exposition only template<integral-constant-like T> constexpr size_t maybe-static-ext<T> = {T::value}; // [views.span], class template span template<class ElementType, size_t Extent = dynamic_extent> class span; // partially freestanding template<class ElementType, size_t Extent> constexpr bool ranges::enable_view<span<ElementType, Extent>> = true; template<class ElementType, size_t Extent> constexpr bool ranges::enable_borrowed_range<span<ElementType, Extent>> = true; // [span.objectrep], views of object representation template<class ElementType, size_t Extent> span<const byte, Extent == dynamic_extent ? dynamic_extent : sizeof(ElementType) * Extent> as_bytes(span<ElementType, Extent> s) noexcept; template<class ElementType, size_t Extent> span<byte, Extent == dynamic_extent ? dynamic_extent : sizeof(ElementType) * Extent> as_writable_bytes(span<ElementType, Extent> s) noexcept; }