Commit cb204d6d by Derek Mauro Committed by Copybara-Service

Replace absl::type_traits_internal::is_trivially_copyable with

std::is_trivially_copyable

PiperOrigin-RevId: 523724345
Change-Id: Id68c79c3bbb253d892bdef4659ac8a926e023d12
parent 3a46229c
...@@ -149,16 +149,16 @@ using std::bit_cast; ...@@ -149,16 +149,16 @@ using std::bit_cast;
#else // defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L #else // defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
template <typename Dest, typename Source, template <
typename std::enable_if< typename Dest, typename Source,
sizeof(Dest) == sizeof(Source) && typename std::enable_if<sizeof(Dest) == sizeof(Source) &&
type_traits_internal::is_trivially_copyable<Source>::value && std::is_trivially_copyable<Source>::value &&
type_traits_internal::is_trivially_copyable<Dest>::value std::is_trivially_copyable<Dest>::value
#if !ABSL_HAVE_BUILTIN(__builtin_bit_cast) #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) #endif // !ABSL_HAVE_BUILTIN(__builtin_bit_cast)
, ,
int>::type = 0> int>::type = 0>
#if ABSL_HAVE_BUILTIN(__builtin_bit_cast) #if ABSL_HAVE_BUILTIN(__builtin_bit_cast)
inline constexpr Dest bit_cast(const Source& source) { inline constexpr Dest bit_cast(const Source& source) {
return __builtin_bit_cast(Dest, source); return __builtin_bit_cast(Dest, source);
......
...@@ -2180,7 +2180,7 @@ constexpr bool btree<P>::static_assert_validation() { ...@@ -2180,7 +2180,7 @@ constexpr bool btree<P>::static_assert_validation() {
"Key comparison must be nothrow copy constructible"); "Key comparison must be nothrow copy constructible");
static_assert(std::is_nothrow_copy_constructible<allocator_type>::value, static_assert(std::is_nothrow_copy_constructible<allocator_type>::value,
"Allocator must be nothrow copy constructible"); "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."); "iterator not trivially copyable.");
// Note: We assert that kTargetValues, which is computed from // Note: We assert that kTargetValues, which is computed from
......
...@@ -308,19 +308,20 @@ constexpr int64_t UninitializedFlagValue() { ...@@ -308,19 +308,20 @@ constexpr int64_t UninitializedFlagValue() {
} }
template <typename T> template <typename T>
using FlagUseValueAndInitBitStorage = std::integral_constant< using FlagUseValueAndInitBitStorage =
bool, absl::type_traits_internal::is_trivially_copyable<T>::value && std::integral_constant<bool, std::is_trivially_copyable<T>::value &&
std::is_default_constructible<T>::value && (sizeof(T) < 8)>; std::is_default_constructible<T>::value &&
(sizeof(T) < 8)>;
template <typename T> template <typename T>
using FlagUseOneWordStorage = std::integral_constant< using FlagUseOneWordStorage =
bool, absl::type_traits_internal::is_trivially_copyable<T>::value && std::integral_constant<bool, std::is_trivially_copyable<T>::value &&
(sizeof(T) <= 8)>; (sizeof(T) <= 8)>;
template <class T> template <class T>
using FlagUseSequenceLockStorage = std::integral_constant< using FlagUseSequenceLockStorage =
bool, absl::type_traits_internal::is_trivially_copyable<T>::value && std::integral_constant<bool, std::is_trivially_copyable<T>::value &&
(sizeof(T) > 8)>; (sizeof(T) > 8)>;
enum class FlagValueStorageKind : uint8_t { enum class FlagValueStorageKind : uint8_t {
kValueAndInitBit = 0, kValueAndInitBit = 0,
......
...@@ -229,14 +229,6 @@ template <typename T> ...@@ -229,14 +229,6 @@ template <typename T>
using remove_cvref_t = typename remove_cvref<T>::type; using remove_cvref_t = typename remove_cvref<T>::type;
#endif #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 // C++14 "_t" trait aliases
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment