From b699707f0bfeae034e36cdfd909b66b0fcab696c Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 11 Aug 2021 11:57:03 -0700 Subject: Export of internal Abseil changes -- 228b5878d7a994656f383666cfaee34e33e0b09b by Abseil Team : Add element_type typedef to match std::span PiperOrigin-RevId: 390186160 -- c91d96c88c60be793c525158f76dfcaa5e32d161 by Abseil Team : Rollback change to only hide retired flags if human-readable output is requested PiperOrigin-RevId: 390183146 -- 170192c10ef8d513de80f29298ce93eeccc3712c by Abseil Team : Move alignas(16) before ABSL_CONST_INIT and ABSL_DLL. PiperOrigin-RevId: 390182845 -- 77a5ee5081c81cef625fac7bbcf993cc028b32ed by Evan Brown : Use simple SlotOffset and AllocSize logic instead of container_internal::Layout in order to save linker input size for non-opt and sanitizer builds. In opt mode, all of this logic is inlined so we don't save linker input size in opt mode. PiperOrigin-RevId: 389914594 GitOrigin-RevId: 228b5878d7a994656f383666cfaee34e33e0b09b Change-Id: I3b904068687574931d8390071b322c0c3c083283 --- absl/types/span.h | 2 +- absl/types/span_test.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'absl/types') diff --git a/absl/types/span.h b/absl/types/span.h index 41db3420..6272bb7a 100644 --- a/absl/types/span.h +++ b/absl/types/span.h @@ -40,7 +40,6 @@ // * `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. -// * `absl::Span` has no `element_type` typedef // * A read-only `absl::Span` can be implicitly constructed from an // initializer list. // * `absl::Span` has no `bytes()`, `size_bytes()`, `as_bytes()`, or @@ -170,6 +169,7 @@ class Span { typename std::enable_if::value, U>::type; public: + using element_type = T; using value_type = absl::remove_cv_t; using pointer = T*; using const_pointer = const T*; diff --git a/absl/types/span_test.cc b/absl/types/span_test.cc index 2584339b..13264aae 100644 --- a/absl/types/span_test.cc +++ b/absl/types/span_test.cc @@ -661,6 +661,8 @@ TEST(IntSpan, ExposesContainerTypesAndConsts) { CheckType::const_reverse_iterator>(slice.crend()); testing::StaticAssertTypeEq::value_type>(); testing::StaticAssertTypeEq::value_type>(); + testing::StaticAssertTypeEq::element_type>(); + testing::StaticAssertTypeEq::element_type>(); testing::StaticAssertTypeEq::pointer>(); testing::StaticAssertTypeEq::pointer>(); testing::StaticAssertTypeEq::reference>(); -- cgit v1.2.3