diff options
author | Abseil Team <absl-team@google.com> | 2021-08-11 11:57:03 -0700 |
---|---|---|
committer | Derek Mauro <dmauro@google.com> | 2021-08-11 20:41:24 +0000 |
commit | b699707f0bfeae034e36cdfd909b66b0fcab696c (patch) | |
tree | c961ce4c7b9a040b47a42abbdabdec10a4d7f043 /absl/types | |
parent | 8e088c5f3c290c5ac53dd5010fd501d80b483115 (diff) |
Export of internal Abseil changes
--
228b5878d7a994656f383666cfaee34e33e0b09b by Abseil Team <absl-team@google.com>:
Add element_type typedef to match std::span<T>
PiperOrigin-RevId: 390186160
--
c91d96c88c60be793c525158f76dfcaa5e32d161 by Abseil Team <absl-team@google.com>:
Rollback change to only hide retired flags if human-readable output
is requested
PiperOrigin-RevId: 390183146
--
170192c10ef8d513de80f29298ce93eeccc3712c by Abseil Team <absl-team@google.com>:
Move alignas(16) before ABSL_CONST_INIT and ABSL_DLL.
PiperOrigin-RevId: 390182845
--
77a5ee5081c81cef625fac7bbcf993cc028b32ed by Evan Brown <ezb@google.com>:
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
Diffstat (limited to 'absl/types')
-rw-r--r-- | absl/types/span.h | 2 | ||||
-rw-r--r-- | absl/types/span_test.cc | 2 |
2 files changed, 3 insertions, 1 deletions
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<const T>` 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<!std::is_const<T>::value, U>::type; public: + using element_type = T; using value_type = absl::remove_cv_t<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<absl::Span<int>::const_reverse_iterator>(slice.crend()); testing::StaticAssertTypeEq<int, absl::Span<int>::value_type>(); testing::StaticAssertTypeEq<int, absl::Span<const int>::value_type>(); + testing::StaticAssertTypeEq<int, absl::Span<int>::element_type>(); + testing::StaticAssertTypeEq<const int, absl::Span<const int>::element_type>(); testing::StaticAssertTypeEq<int*, absl::Span<int>::pointer>(); testing::StaticAssertTypeEq<const int*, absl::Span<const int>::pointer>(); testing::StaticAssertTypeEq<int&, absl::Span<int>::reference>(); |