Files
cppdraft_translate/cppdraft/span/objectrep.md
2025-10-25 03:02:53 +03:00

1.4 KiB

[span.objectrep]

23 Containers library [containers]

23.7 Views [views]

23.7.2 Contiguous access [views.contiguous]

23.7.2.3 Views of object representation [span.objectrep]

🔗

template<class ElementType, size_t Extent> span<const byte, Extent == dynamic_extent ? dynamic_extent : sizeof(ElementType) * Extent> as_bytes(span<ElementType, Extent> s) noexcept;

1

#

Effects: Equivalent to: return R{reinterpret_cast<const byte*>(s.data()), s.size_bytes()}; where R is the return type.

🔗

template<class ElementType, size_t Extent> span<byte, Extent == dynamic_extent ? dynamic_extent : sizeof(ElementType) * Extent> as_writable_bytes(span<ElementType, Extent> s) noexcept;

2

#

Constraints: is_const_v is false.

3

#

Effects: Equivalent to: return R{reinterpret_cast<byte*>(s.data()), s.size_bytes()}; where R is the return type.