diff options
author | Derek Mauro <dmauro@google.com> | 2023-04-12 09:37:39 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-04-12 09:38:31 -0700 |
commit | cb204d6d9c3f2066580e606bcbe54e3383791d5f (patch) | |
tree | 2b6d16c4467b7df00c03b2bdf4d0cdd000f179d0 /absl | |
parent | 3a46229c3cdd945ccc8bae1458148115ff8f88e7 (diff) |
Replace absl::type_traits_internal::is_trivially_copyable with
std::is_trivially_copyable
PiperOrigin-RevId: 523724345
Change-Id: Id68c79c3bbb253d892bdef4659ac8a926e023d12
Diffstat (limited to 'absl')
-rw-r--r-- | absl/base/casts.h | 16 | ||||
-rw-r--r-- | absl/container/internal/btree.h | 2 | ||||
-rw-r--r-- | absl/flags/internal/flag.h | 19 | ||||
-rw-r--r-- | 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 <typename Dest, typename Source, - typename std::enable_if< - sizeof(Dest) == sizeof(Source) && - type_traits_internal::is_trivially_copyable<Source>::value && - type_traits_internal::is_trivially_copyable<Dest>::value +template < + typename Dest, typename Source, + typename std::enable_if<sizeof(Dest) == sizeof(Source) && + std::is_trivially_copyable<Source>::value && + std::is_trivially_copyable<Dest>::value #if !ABSL_HAVE_BUILTIN(__builtin_bit_cast) - && std::is_default_constructible<Dest>::value + && std::is_default_constructible<Dest>::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<P>::static_assert_validation() { "Key comparison must be nothrow copy constructible"); static_assert(std::is_nothrow_copy_constructible<allocator_type>::value, "Allocator must be nothrow copy constructible"); - static_assert(type_traits_internal::is_trivially_copyable<iterator>::value, + static_assert(std::is_trivially_copyable<iterator>::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 <typename T> -using FlagUseValueAndInitBitStorage = std::integral_constant< - bool, absl::type_traits_internal::is_trivially_copyable<T>::value && - std::is_default_constructible<T>::value && (sizeof(T) < 8)>; +using FlagUseValueAndInitBitStorage = + std::integral_constant<bool, std::is_trivially_copyable<T>::value && + std::is_default_constructible<T>::value && + (sizeof(T) < 8)>; template <typename T> -using FlagUseOneWordStorage = std::integral_constant< - bool, absl::type_traits_internal::is_trivially_copyable<T>::value && - (sizeof(T) <= 8)>; +using FlagUseOneWordStorage = + std::integral_constant<bool, std::is_trivially_copyable<T>::value && + (sizeof(T) <= 8)>; template <class T> -using FlagUseSequenceLockStorage = std::integral_constant< - bool, absl::type_traits_internal::is_trivially_copyable<T>::value && - (sizeof(T) > 8)>; +using FlagUseSequenceLockStorage = + std::integral_constant<bool, std::is_trivially_copyable<T>::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 <typename T> using remove_cvref_t = typename remove_cvref<T>::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 // ----------------------------------------------------------------------------- |