From eef1a08f4bd3a46b583937f2bc26a3a7bafbfb90 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 14 Jan 2026 14:30:38 -0800 Subject: [PATCH] Update `absl::Span` and `std::span` differences comment PiperOrigin-RevId: 856366482 Change-Id: I55a33a56f83ed2c0bf30bd14a08c770f18e13d32 --- absl/types/span.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/absl/types/span.h b/absl/types/span.h index 556c846c..60e1ea85 100644 --- a/absl/types/span.h +++ b/absl/types/span.h @@ -30,18 +30,17 @@ // `Span` when such types may be difficult to identify due to issues // with implicit conversion. // -// The C++20 draft standard includes a `std::span` type. As of June 2020, the +// The C++20 standard includes a `std::span` type. As of January 2026, the // differences between `absl::Span` and `std::span` are: // * `absl::Span` has `operator==` (which is likely a design bug, // per https://abseil.io/blog/20180531-regular-types) // * `absl::Span` has the factory functions `MakeSpan()` and // `MakeConstSpan()` // * bounds-checked access to `absl::Span` is accomplished with `at()` +// however `std::span` now supports the same as of the draft C++26 standard // * `absl::Span` has compiler-provided move and copy constructors and // assignment. This is due to them being specified as `constexpr`, but that // implies const in C++11. -// * A read-only `absl::Span` can be implicitly constructed from an -// initializer list. // * `absl::Span` has no `bytes()`, `size_bytes()`, `as_bytes()`, or // `as_writable_bytes()` methods // * `absl::Span` has no static extent template parameter, nor constructors