From cb204d6d9c3f2066580e606bcbe54e3383791d5f Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 12 Apr 2023 09:37:39 -0700 Subject: Replace absl::type_traits_internal::is_trivially_copyable with std::is_trivially_copyable PiperOrigin-RevId: 523724345 Change-Id: Id68c79c3bbb253d892bdef4659ac8a926e023d12 --- absl/base/casts.h | 16 ++++++++-------- absl/container/internal/btree.h | 2 +- absl/flags/internal/flag.h | 19 ++++++++++--------- absl/meta/type_traits.h | 8 -------- 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/absl/base/casts.h b/absl/base/casts.h index b99adb06..d1958885 100644 --- a/absl/base/casts.h +++ b/absl/base/casts.h @@ -149,16 +149,16 @@ using std::bit_cast; #else // defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L -template ::value && - type_traits_internal::is_trivially_copyable::value +template < + typename Dest, typename Source, + typename std::enable_if::value && + std::is_trivially_copyable::value #if !ABSL_HAVE_BUILTIN(__builtin_bit_cast) - && std::is_default_constructible::value + && std::is_default_constructible::value #endif // !ABSL_HAVE_BUILTIN(__builtin_bit_cast) - , - int>::type = 0> + , + int>::type = 0> #if ABSL_HAVE_BUILTIN(__builtin_bit_cast) inline constexpr Dest bit_cast(const Source& source) { return __builtin_bit_cast(Dest, source); diff --git a/absl/container/internal/btree.h b/absl/container/internal/btree.h index d734676a..cd1569b3 100644 --- a/absl/container/internal/btree.h +++ b/absl/container/internal/btree.h @@ -2180,7 +2180,7 @@ constexpr bool btree

::static_assert_validation() { "Key comparison must be nothrow copy constructible"); static_assert(std::is_nothrow_copy_constructible::value, "Allocator must be nothrow copy constructible"); - static_assert(type_traits_internal::is_trivially_copyable::value, + static_assert(std::is_trivially_copyable::value, "iterator not trivially copyable."); // Note: We assert that kTargetValues, which is computed from diff --git a/absl/flags/internal/flag.h b/absl/flags/internal/flag.h index 6154638c..ce891da1 100644 --- a/absl/flags/internal/flag.h +++ b/absl/flags/internal/flag.h @@ -308,19 +308,20 @@ constexpr int64_t UninitializedFlagValue() { } template -using FlagUseValueAndInitBitStorage = std::integral_constant< - bool, absl::type_traits_internal::is_trivially_copyable::value && - std::is_default_constructible::value && (sizeof(T) < 8)>; +using FlagUseValueAndInitBitStorage = + std::integral_constant::value && + std::is_default_constructible::value && + (sizeof(T) < 8)>; template -using FlagUseOneWordStorage = std::integral_constant< - bool, absl::type_traits_internal::is_trivially_copyable::value && - (sizeof(T) <= 8)>; +using FlagUseOneWordStorage = + std::integral_constant::value && + (sizeof(T) <= 8)>; template -using FlagUseSequenceLockStorage = std::integral_constant< - bool, absl::type_traits_internal::is_trivially_copyable::value && - (sizeof(T) > 8)>; +using FlagUseSequenceLockStorage = + std::integral_constant::value && + (sizeof(T) > 8)>; enum class FlagValueStorageKind : uint8_t { kValueAndInitBit = 0, diff --git a/absl/meta/type_traits.h b/absl/meta/type_traits.h index 43bed500..01a0155e 100644 --- a/absl/meta/type_traits.h +++ b/absl/meta/type_traits.h @@ -229,14 +229,6 @@ template using remove_cvref_t = typename remove_cvref::type; #endif -namespace type_traits_internal { -// An implementation of std::is_trivially_copyable was once provided for -// internal use within absl. -// TODO(absl-team): Replace absl::type_traits_internal::is_trivially_copyable -// with std::is_trivially_copyable and delete this using declaration. -using std::is_trivially_copyable; -} // namespace type_traits_internal - // ----------------------------------------------------------------------------- // C++14 "_t" trait aliases // ----------------------------------------------------------------------------- -- cgit v1.2.3