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,11 +149,11 @@ 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
#endif // !ABSL_HAVE_BUILTIN(__builtin_bit_cast)
......
......@@ -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
......
......@@ -308,18 +308,19 @@ 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 &&
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 &&
using FlagUseSequenceLockStorage =
std::integral_constant<bool, std::is_trivially_copyable<T>::value &&
(sizeof(T) > 8)>;
enum class FlagValueStorageKind : uint8_t {
......
......@@ -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
// -----------------------------------------------------------------------------
......
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