21 Containers library [containers]

21.7 Views [views]

21.7.3 Class template span [views.span]

21.7.3.8 Views of object representation [span.objectrep]

template<class ElementType, ptrdiff_t Extent> span<const byte, Extent == dynamic_extent ? dynamic_extent : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent> as_bytes(span<ElementType, Extent> s) noexcept;
Effects: Equivalent to: return {reinterpret_­cast<const byte*>(s.data()), s.size_­bytes()};
template<class ElementType, ptrdiff_t Extent> span<byte, Extent == dynamic_extent ? dynamic_extent : static_cast<ptrdiff_t>(sizeof(ElementType)) * Extent> as_writable_bytes(span<ElementType, Extent> s) noexcept;
Effects: Equivalent to: return {reinterpret_­cast<byte*>(s.data()), s.size_­bytes()};
Remarks: This function shall not participate in overload resolution unless is_­const_­v<ElementType> is false.