[libcxx-commits] [libcxx] [libc++][span] LWG4243: `as_bytes`/`as_writable_bytes` is broken with `span<volatile T>` (PR #200993)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 1 21:01:30 PDT 2026


================
@@ -9,12 +9,12 @@
 
 // <span>
 
-// template <class ElementType, size_t Extent>
-//     span<byte,
-//          Extent == dynamic_extent
-//              ? dynamic_extent
-//              : sizeof(ElementType) * Extent>
+// template<class ElementType, size_t Extent>
+//   span<byte, Extent == dynamic_extent ? dynamic_extent : sizeof(ElementType) * Extent>
 //     as_writable_bytes(span<ElementType, Extent> s) noexcept;
+//
+// Constraints:
+//   is_const_v<ElementType> is false and is_volatile_v<ElementType> is false.
----------------
frederick-vs-ja wrote:

Ditto. Positive test coverage with `requires`.

https://github.com/llvm/llvm-project/pull/200993


More information about the libcxx-commits mailing list