Stop using C++17 type traits polyfills This will let us deprecate the declarations without triggering warnings in Abseil itself. PiperOrigin-RevId: 894202105 Change-Id: I57bb2a1647be1fedf9b724a07042fd0f564ce074
diff --git a/absl/algorithm/container.h b/absl/algorithm/container.h index c0b8a10..1b4ac92 100644 --- a/absl/algorithm/container.h +++ b/absl/algorithm/container.h
@@ -1758,7 +1758,7 @@ // accumulation by value. // // Note: Due to a language technicality this function has return type -// absl::decay_t<T>. As a user of this function you can casually read +// std::decay_t<T>. As a user of this function you can casually read // this as "returns T by value" and assume it does the right thing. template <typename Sequence, typename T> ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 decay_t<T> c_accumulate( @@ -1785,7 +1785,7 @@ // to compute the cumulative inner product of container element pairs. // // Note: Due to a language technicality this function has return type -// absl::decay_t<T>. As a user of this function you can casually read +// std::decay_t<T>. As a user of this function you can casually read // this as "returns T by value" and assume it does the right thing. template <typename Sequence1, typename Sequence2, typename T> ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 decay_t<T> c_inner_product(
diff --git a/absl/base/exception_safety_testing_test.cc b/absl/base/exception_safety_testing_test.cc index 55a6fe1..fc7e33e 100644 --- a/absl/base/exception_safety_testing_test.cc +++ b/absl/base/exception_safety_testing_test.cc
@@ -945,8 +945,8 @@ } TEST(ThrowingAllocatorTraitsTest, Assignablility) { - EXPECT_TRUE(absl::is_move_assignable<ThrowingAllocator<int>>::value); - EXPECT_TRUE(absl::is_copy_assignable<ThrowingAllocator<int>>::value); + EXPECT_TRUE(std::is_move_assignable<ThrowingAllocator<int>>::value); + EXPECT_TRUE(std::is_copy_assignable<ThrowingAllocator<int>>::value); EXPECT_TRUE(std::is_nothrow_move_assignable<ThrowingAllocator<int>>::value); EXPECT_TRUE(std::is_nothrow_copy_assignable<ThrowingAllocator<int>>::value); }
diff --git a/absl/base/internal/exception_safety_testing.h b/absl/base/internal/exception_safety_testing.h index c106154..aef7641 100644 --- a/absl/base/internal/exception_safety_testing.h +++ b/absl/base/internal/exception_safety_testing.h
@@ -44,22 +44,22 @@ enum class AllocSpec; constexpr TypeSpec operator|(TypeSpec a, TypeSpec b) { - using T = absl::underlying_type_t<TypeSpec>; + using T = std::underlying_type_t<TypeSpec>; return static_cast<TypeSpec>(static_cast<T>(a) | static_cast<T>(b)); } constexpr TypeSpec operator&(TypeSpec a, TypeSpec b) { - using T = absl::underlying_type_t<TypeSpec>; + using T = std::underlying_type_t<TypeSpec>; return static_cast<TypeSpec>(static_cast<T>(a) & static_cast<T>(b)); } constexpr AllocSpec operator|(AllocSpec a, AllocSpec b) { - using T = absl::underlying_type_t<AllocSpec>; + using T = std::underlying_type_t<AllocSpec>; return static_cast<AllocSpec>(static_cast<T>(a) | static_cast<T>(b)); } constexpr AllocSpec operator&(AllocSpec a, AllocSpec b) { - using T = absl::underlying_type_t<AllocSpec>; + using T = std::underlying_type_t<AllocSpec>; return static_cast<AllocSpec>(static_cast<T>(a) & static_cast<T>(b)); } @@ -842,7 +842,7 @@ template <size_t LazyContractsCount, typename LazyFactory, typename LazyOperation> -using EnableIfTestable = typename absl::enable_if_t< +using EnableIfTestable = typename std::enable_if_t< LazyContractsCount != 0 && !std::is_same<LazyFactory, UninitializedT>::value && !std::is_same<LazyOperation, UninitializedT>::value>; @@ -994,7 +994,7 @@ * method tester.WithInitialValue(...). */ template <typename NewFactory> - ExceptionSafetyTestBuilder<absl::decay_t<NewFactory>, Operation, Contracts...> + ExceptionSafetyTestBuilder<std::decay_t<NewFactory>, Operation, Contracts...> WithFactory(const NewFactory& new_factory) const { return {new_factory, operation_, contracts_}; } @@ -1005,7 +1005,7 @@ * newly created tester. */ template <typename NewOperation> - ExceptionSafetyTestBuilder<Factory, absl::decay_t<NewOperation>, Contracts...> + ExceptionSafetyTestBuilder<Factory, std::decay_t<NewOperation>, Contracts...> WithOperation(const NewOperation& new_operation) const { return {factory_, new_operation, contracts_}; } @@ -1025,11 +1025,11 @@ */ template <typename... MoreContracts> ExceptionSafetyTestBuilder<Factory, Operation, Contracts..., - absl::decay_t<MoreContracts>...> + std::decay_t<MoreContracts>...> WithContracts(const MoreContracts&... more_contracts) const { return { factory_, operation_, - std::tuple_cat(contracts_, std::tuple<absl::decay_t<MoreContracts>...>( + std::tuple_cat(contracts_, std::tuple<std::decay_t<MoreContracts>...>( more_contracts...))}; }
diff --git a/absl/container/fixed_array.h b/absl/container/fixed_array.h index c51a19f..e6f1528 100644 --- a/absl/container/fixed_array.h +++ b/absl/container/fixed_array.h
@@ -96,7 +96,7 @@ absl::allocator_is_nothrow<allocator_type>::value; } static constexpr bool DefaultConstructorIsNonTrivial() { - return !absl::is_trivially_default_constructible<StorageElement>::value; + return !std::is_trivially_default_constructible<StorageElement>::value; } public: @@ -414,14 +414,14 @@ // error: call to int __builtin___sprintf_chk(etc...) // will always overflow destination buffer [-Werror] // - template <typename OuterT, typename InnerT = absl::remove_extent_t<OuterT>, + template <typename OuterT, typename InnerT = std::remove_extent_t<OuterT>, size_t InnerN = std::extent<OuterT>::value> struct StorageElementWrapper { InnerT array[InnerN]; }; using StorageElement = - absl::conditional_t<std::is_array<value_type>::value, + std::conditional_t<std::is_array<value_type>::value, StorageElementWrapper<value_type>, value_type>; static pointer AsValueType(pointer ptr) { return ptr; } @@ -458,7 +458,7 @@ }; using InlinedStorage = - absl::conditional_t<inline_elements == 0, EmptyInlinedStorage, + std::conditional_t<inline_elements == 0, EmptyInlinedStorage, NonEmptyInlinedStorage>; // Storage
diff --git a/absl/container/inlined_vector.h b/absl/container/inlined_vector.h index a9c2526..c1b5785 100644 --- a/absl/container/inlined_vector.h +++ b/absl/container/inlined_vector.h
@@ -192,7 +192,7 @@ // allocator doesn't do anything fancy, and there is nothing on the heap // then we know it is legal for us to simply memcpy the other vector's // inlined bytes to form our copy of its elements. - if (absl::is_trivially_copy_constructible<value_type>::value && + if (std::is_trivially_copy_constructible<value_type>::value && std::is_same<A, std::allocator<value_type>>::value && !other.storage_.GetIsAllocated()) { storage_.MemcpyFrom(other.storage_); @@ -857,7 +857,7 @@ // Assumption check: we shouldn't be told to use memcpy to implement move // assignment unless we have trivially destructible elements and an // allocator that does nothing fancy. - static_assert(absl::is_trivially_destructible<value_type>::value, ""); + static_assert(std::is_trivially_destructible<value_type>::value, ""); static_assert(std::is_same<A, std::allocator<value_type>>::value, ""); // Throw away our existing heap allocation, if any. There is no need to
diff --git a/absl/container/internal/btree.h b/absl/container/internal/btree.h index ed541e7..0fc77f8 100644 --- a/absl/container/internal/btree.h +++ b/absl/container/internal/btree.h
@@ -231,7 +231,7 @@ explicit operator Compare() const { return comp(); } template <typename T, typename U, - absl::enable_if_t< + std::enable_if_t< std::is_same<bool, compare_result_t<Compare, T, U>>::value, int> = 0> bool operator()(const T &lhs, const U &rhs) const { @@ -247,7 +247,7 @@ template < typename T, typename U, - absl::enable_if_t<std::is_convertible<compare_result_t<Compare, T, U>, + std::enable_if_t<std::is_convertible<compare_result_t<Compare, T, U>, absl::weak_ordering>::value, int> = 0> absl::weak_ordering operator()(const T &lhs, const U &rhs) const { @@ -270,7 +270,7 @@ return lhs_comp_rhs; } }; - using type = absl::conditional_t< + using type = std::conditional_t< std::is_base_of<BtreeTestOnlyCheckedCompareOptOutBase, Compare>::value, Compare, checked_compare>; }; @@ -377,7 +377,7 @@ // this, then there will be cascading compilation failures that are confusing // for users. using key_compare = - absl::conditional_t<!compare_has_valid_result_type<Compare, Key>(), + std::conditional_t<!compare_has_valid_result_type<Compare, Key>(), Compare, typename key_compare_adapter<Compare, Key>::type>; @@ -406,7 +406,7 @@ using const_reference = const value_type &; using value_compare = - absl::conditional_t<IsMap, + std::conditional_t<IsMap, map_value_compare<original_key_compare, value_type>, original_key_compare>; using is_map_container = std::integral_constant<bool, IsMap>; @@ -438,7 +438,7 @@ // This is an integral type large enough to hold as many slots as will fit a // node of TargetNodeSize bytes. using node_count_type = - absl::conditional_t<(kNodeSlotSpace / sizeof(slot_type) > + std::conditional_t<(kNodeSlotSpace / sizeof(slot_type) > (std::numeric_limits<uint8_t>::max)()), uint16_t, uint8_t>; // NOLINT }; @@ -1119,7 +1119,7 @@ using slot_type = typename params_type::slot_type; // In sets, all iterators are const. - using iterator = absl::conditional_t< + using iterator = std::conditional_t< is_map_container::value, btree_iterator<normal_node, normal_reference, normal_pointer>, btree_iterator<normal_node, const_reference, const_pointer>>; @@ -1146,7 +1146,7 @@ // const_iterator, but it specifically avoids hiding the copy constructor so // that the trivial one will be used when possible. template <typename N, typename R, typename P, - absl::enable_if_t< + std::enable_if_t< std::is_same<btree_iterator<N, R, P>, iterator>::value && std::is_same<btree_iterator, const_iterator>::value, int> = 0> @@ -1252,7 +1252,7 @@ // NOTE: the const_cast is safe because this constructor is only called by // non-const methods and the container owns the nodes. template <typename N, typename R, typename P, - absl::enable_if_t< + std::enable_if_t< std::is_same<btree_iterator<N, R, P>, const_iterator>::value && std::is_same<btree_iterator, iterator>::value, int> = 0>
diff --git a/absl/container/internal/btree_container.h b/absl/container/internal/btree_container.h index 0ccf9d0..c11620d 100644 --- a/absl/container/internal/btree_container.h +++ b/absl/container/internal/btree_container.h
@@ -412,8 +412,8 @@ // `this`, it is left unmodified in `src`. template < typename T, - typename absl::enable_if_t< - absl::conjunction< + typename std::enable_if_t< + std::conjunction< std::is_same<value_type, typename T::value_type>, std::is_same<allocator_type, typename T::allocator_type>, std::is_same<typename params_type::is_map_container, @@ -431,8 +431,8 @@ template < typename T, - typename absl::enable_if_t< - absl::conjunction< + typename std::enable_if_t< + std::conjunction< std::is_same<value_type, typename T::value_type>, std::is_same<allocator_type, typename T::allocator_type>, std::is_same<typename params_type::is_map_container, @@ -474,7 +474,7 @@ typename Tree::params_type::mapped_type, M>>; template <class K, bool KValue, class M, bool MValue, typename... Dummy> using LifetimeBoundKV = - absl::conjunction<LifetimeBoundK<K, KValue, absl::void_t<Dummy...>>, + std::conjunction<LifetimeBoundK<K, KValue, absl::void_t<Dummy...>>, LifetimeBoundV<M, MValue>>; public: @@ -824,8 +824,8 @@ // Moves all elements from `src` into `this`. template < typename T, - typename absl::enable_if_t< - absl::conjunction< + typename std::enable_if_t< + std::conjunction< std::is_same<value_type, typename T::value_type>, std::is_same<allocator_type, typename T::allocator_type>, std::is_same<typename params_type::is_map_container, @@ -840,8 +840,8 @@ template < typename T, - typename absl::enable_if_t< - absl::conjunction< + typename std::enable_if_t< + std::conjunction< std::is_same<value_type, typename T::value_type>, std::is_same<allocator_type, typename T::allocator_type>, std::is_same<typename params_type::is_map_container,
diff --git a/absl/container/internal/common.h b/absl/container/internal/common.h index 62517af..3bf0c7c 100644 --- a/absl/container/internal/common.h +++ b/absl/container/internal/common.h
@@ -58,7 +58,7 @@ using EnableIf = std::enable_if_t<Cond::value, int>; template <bool Value, class T> -using HasValue = std::conditional_t<Value, T, absl::negation<T>>; +using HasValue = std::conditional_t<Value, T, std::negation<T>>; template <class T> struct IfRRef {
diff --git a/absl/container/internal/common_policy_traits.h b/absl/container/internal/common_policy_traits.h index 86e038e..3b0d505 100644 --- a/absl/container/internal/common_policy_traits.h +++ b/absl/container/internal/common_policy_traits.h
@@ -81,7 +81,7 @@ // Note: we use remove_const_t so that the two overloads have different args // in the case of sets with explicitly const value_types. template <class P = Policy> - static auto element(absl::remove_const_t<slot_type>* slot) + static auto element(std::remove_const_t<slot_type>* slot) -> decltype(P::element(slot)) { return P::element(slot); }
diff --git a/absl/container/internal/compressed_tuple.h b/absl/container/internal/compressed_tuple.h index 2dd8d6c..9d5c055 100644 --- a/absl/container/internal/compressed_tuple.h +++ b/absl/container/internal/compressed_tuple.h
@@ -166,7 +166,7 @@ template <class... Ts, class... Vs> struct TupleMoveConstructible<true, CompressedTuple<Ts...>, Vs...> : std::integral_constant< - bool, absl::conjunction< + bool, std::conjunction< TupleElementMoveConstructible<Ts, Vs&&>...>::value> {}; template <typename T> @@ -227,11 +227,11 @@ : CompressedTuple::CompressedTupleImpl(absl::in_place, base...) {} template <typename First, typename... Vs, - absl::enable_if_t< - absl::conjunction< + std::enable_if_t< + std::conjunction< // Ensure we are not hiding default copy/move constructors. - absl::negation<std::is_same<void(CompressedTuple), - void(absl::decay_t<First>)>>, + std::negation<std::is_same<void(CompressedTuple), + void(std::decay_t<First>)>>, internal_compressed_tuple::TupleItemsMoveConstructible< CompressedTuple<Ts...>, First, Vs...>>::value, bool> = true>
diff --git a/absl/container/internal/container_memory.h b/absl/container/internal/container_memory.h index 47064a7..dcf0bd2 100644 --- a/absl/container/internal/container_memory.h +++ b/absl/container/internal/container_memory.h
@@ -350,11 +350,11 @@ ~map_slot_type() = delete; using value_type = std::pair<const K, V>; using mutable_value_type = - std::pair<absl::remove_const_t<K>, absl::remove_const_t<V>>; + std::pair<std::remove_const_t<K>, std::remove_const_t<V>>; value_type value; mutable_value_type mutable_value; - absl::remove_const_t<K> key; + std::remove_const_t<K> key; }; template <class K, class V> @@ -362,7 +362,7 @@ using slot_type = map_slot_type<K, V>; using value_type = std::pair<const K, V>; using mutable_value_type = - std::pair<absl::remove_const_t<K>, absl::remove_const_t<V>>; + std::pair<std::remove_const_t<K>, std::remove_const_t<V>>; private: static void emplace(slot_type* slot) {
diff --git a/absl/container/internal/hash_policy_traits.h b/absl/container/internal/hash_policy_traits.h index 82eed2a..7f5f892 100644 --- a/absl/container/internal/hash_policy_traits.h +++ b/absl/container/internal/hash_policy_traits.h
@@ -38,7 +38,7 @@ private: struct ReturnKey { template <class Key, - absl::enable_if_t<std::is_lvalue_reference<Key>::value, int> = 0> + std::enable_if_t<std::is_lvalue_reference<Key>::value, int> = 0> static key_type& Impl(Key&& k, int) { return *std::launder( const_cast<key_type*>(std::addressof(std::forward<Key>(k))));
diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h index c7b709f..42878ac 100644 --- a/absl/container/internal/inlined_vector.h +++ b/absl/container/internal/inlined_vector.h
@@ -79,7 +79,7 @@ template <typename A, bool IsTriviallyDestructible = - absl::is_trivially_destructible<ValueType<A>>::value && + std::is_trivially_destructible<ValueType<A>>::value && std::is_same<A, std::allocator<ValueType<A>>>::value> struct DestroyAdapter; @@ -288,14 +288,14 @@ struct ElementwiseSwapPolicy {}; struct ElementwiseConstructPolicy {}; - using MoveAssignmentPolicy = absl::conditional_t< + using MoveAssignmentPolicy = std::conditional_t< // Fast path: if the value type can be trivially move assigned and // destroyed, and we know the allocator doesn't do anything fancy, then // it's safe for us to simply adopt the contents of the storage for // `other` and remove its own reference to them. It's as if we had // individually move-assigned each value and then destroyed the original. - absl::conjunction<absl::is_trivially_move_assignable<ValueType<A>>, - absl::is_trivially_destructible<ValueType<A>>, + std::conjunction<std::is_trivially_move_assignable<ValueType<A>>, + std::is_trivially_destructible<ValueType<A>>, std::is_same<A, std::allocator<ValueType<A>>>>::value, MemcpyPolicy, // Otherwise we use move assignment if possible. If not, we simulate @@ -304,21 +304,21 @@ // Note that this is in contrast to e.g. std::vector and std::optional, // which are themselves not move-assignable when their contained type is // not. - absl::conditional_t<IsMoveAssignOk<A>::value, ElementwiseAssignPolicy, + std::conditional_t<IsMoveAssignOk<A>::value, ElementwiseAssignPolicy, ElementwiseConstructPolicy>>; // The policy to be used specifically when swapping inlined elements. - using SwapInlinedElementsPolicy = absl::conditional_t< + using SwapInlinedElementsPolicy = std::conditional_t< // Fast path: if the value type can be trivially relocated, and we // know the allocator doesn't do anything fancy, then it's safe for us // to simply swap the bytes in the inline storage. It's as if we had // relocated the first vector's elements into temporary storage, // relocated the second's elements into the (now-empty) first's, // and then relocated from temporary storage into the second. - absl::conjunction<absl::is_trivially_relocatable<ValueType<A>>, + std::conjunction<absl::is_trivially_relocatable<ValueType<A>>, std::is_same<A, std::allocator<ValueType<A>>>>::value, MemcpyPolicy, - absl::conditional_t<IsSwapOk<A>::value, ElementwiseSwapPolicy, + std::conditional_t<IsSwapOk<A>::value, ElementwiseSwapPolicy, ElementwiseConstructPolicy>>; static SizeType<A> NextCapacity(SizeType<A> current_capacity) { @@ -348,7 +348,7 @@ // Fast path: if no destructors need to be run and we know the allocator // doesn't do anything fancy, then all we need to do is deallocate (and // maybe not even that). - if (absl::is_trivially_destructible<ValueType<A>>::value && + if (std::is_trivially_destructible<ValueType<A>>::value && std::is_same<A, std::allocator<ValueType<A>>>::value) { DeallocateIfAllocated(); return; @@ -507,11 +507,11 @@ // First case above absl::is_trivially_relocatable<V>::value || // Second case above - (absl::is_trivially_move_assignable<V>::value && - absl::is_trivially_destructible<V>::value) || + (std::is_trivially_move_assignable<V>::value && + std::is_trivially_destructible<V>::value) || // Third case above - (absl::is_trivially_copy_constructible<V>::value || - absl::is_trivially_copy_assignable<V>::value)))); + (std::is_trivially_copy_constructible<V>::value || + std::is_trivially_copy_assignable<V>::value)))); } GetSizeAndIsAllocated() = other_storage.GetSizeAndIsAllocated(); @@ -596,7 +596,7 @@ // Fast path: if the value type is trivially copy constructible and we know // the allocator doesn't do anything fancy, then we know it is legal for us to // simply memcpy the other vector's elements. - if (absl::is_trivially_copy_constructible<ValueType<A>>::value && + if (std::is_trivially_copy_constructible<ValueType<A>>::value && std::is_same<A, std::allocator<ValueType<A>>>::value) { std::memcpy(reinterpret_cast<char*>(dst), reinterpret_cast<const char*>(src), n * sizeof(ValueType<A>));
diff --git a/absl/container/internal/layout.h b/absl/container/internal/layout.h index 58c8d4f..f49d272 100644 --- a/absl/container/internal/layout.h +++ b/absl/container/internal/layout.h
@@ -261,7 +261,7 @@ // Does `Ts...` contain `T`? template <class T, class... Ts> -using Contains = absl::disjunction<std::is_same<T, Ts>...>; +using Contains = std::disjunction<std::is_same<T, Ts>...>; template <class From, class To> using CopyConst = @@ -352,7 +352,7 @@ absl::index_sequence<OffsetSeq...>> { private: static_assert(sizeof...(Elements) > 0, "At least one field is required"); - static_assert(absl::conjunction<IsLegalElementType<Elements>...>::value, + static_assert(std::conjunction<IsLegalElementType<Elements>...>::value, "Invalid element type (see IsLegalElementType)"); static_assert(sizeof...(StaticSizeSeq) <= sizeof...(Elements), "Too many static sizes specified");
diff --git a/absl/container/internal/raw_hash_map.h b/absl/container/internal/raw_hash_map.h index 20b622b..25ed119 100644 --- a/absl/container/internal/raw_hash_map.h +++ b/absl/container/internal/raw_hash_map.h
@@ -88,7 +88,7 @@ typename Policy::mapped_type, V>>; template <class K, bool KValue, class V, bool VValue, typename... Dummy> using LifetimeBoundKV = - absl::conjunction<LifetimeBoundK<K, KValue, absl::void_t<Dummy...>>, + std::conjunction<LifetimeBoundK<K, KValue, absl::void_t<Dummy...>>, LifetimeBoundV<V, VValue>>; public:
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index 1a9fa1d..805ea30 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h
@@ -1930,7 +1930,7 @@ // An enabler for insert(T&&): T must be convertible to init_type or be the // same as [cv] value_type [ref]. template <class T> - using Insertable = absl::disjunction< + using Insertable = std::disjunction< std::is_same<absl::remove_cvref_t<reference>, absl::remove_cvref_t<T>>, std::is_convertible<T, init_type>>; template <class T> @@ -1970,9 +1970,9 @@ using iterator_category = std::forward_iterator_tag; using value_type = typename raw_hash_set::value_type; using reference = - absl::conditional_t<PolicyTraits::constant_iterators::value, + std::conditional_t<PolicyTraits::constant_iterators::value, const value_type&, value_type&>; - using pointer = absl::remove_reference_t<reference>*; + using pointer = std::remove_reference_t<reference>*; using difference_type = typename raw_hash_set::difference_type; iterator() {}
diff --git a/absl/flags/internal/flag.h b/absl/flags/internal/flag.h index 285d842..e26b2ad 100644 --- a/absl/flags/internal/flag.h +++ b/absl/flags/internal/flag.h
@@ -608,7 +608,7 @@ *value = ReadOneBool(); } template <typename T, - absl::enable_if_t<flags_internal::StorageKind<T>() == + std::enable_if_t<flags_internal::StorageKind<T>() == FlagValueStorageKind::kOneWordAtomic, int> = 0> void Read(T* value) const ABSL_LOCKS_EXCLUDED(DataGuard()) {
diff --git a/absl/functional/any_invocable.h b/absl/functional/any_invocable.h index 6dd72b6..4ba4fe3 100644 --- a/absl/functional/any_invocable.h +++ b/absl/functional/any_invocable.h
@@ -191,7 +191,7 @@ // Upon construction, `*this` is only empty if `f` is a function pointer or // member pointer type and is null, or if `f` is an `AnyInvocable` that is // empty. - template <class F, typename = absl::enable_if_t< + template <class F, typename = std::enable_if_t< internal_any_invocable::CanConvert<Sig, F>::value>> AnyInvocable(F&& f) // NOLINT : Impl(internal_any_invocable::ConversionConstruct(), @@ -206,25 +206,25 @@ // absl::in_place_type<PossiblyImmovableType>, arg1, arg2); // template <class T, class... Args, - typename = absl::enable_if_t< + typename = std::enable_if_t< internal_any_invocable::CanEmplace<Sig, T, Args...>::value>> explicit AnyInvocable(absl::in_place_type_t<T>, Args&&... args) - : Impl(absl::in_place_type<absl::decay_t<T>>, + : Impl(absl::in_place_type<std::decay_t<T>>, std::forward<Args>(args)...) { - static_assert(std::is_same<T, absl::decay_t<T>>::value, + static_assert(std::is_same<T, std::decay_t<T>>::value, "The explicit template argument of in_place_type is required " "to be an unqualified object type."); } // Overload of the above constructor to support list-initialization. template <class T, class U, class... Args, - typename = absl::enable_if_t<internal_any_invocable::CanEmplace< + typename = std::enable_if_t<internal_any_invocable::CanEmplace< Sig, T, std::initializer_list<U>&, Args...>::value>> explicit AnyInvocable(absl::in_place_type_t<T>, std::initializer_list<U> ilist, Args&&... args) - : Impl(absl::in_place_type<absl::decay_t<T>>, ilist, + : Impl(absl::in_place_type<std::decay_t<T>>, ilist, std::forward<Args>(args)...) { - static_assert(std::is_same<T, absl::decay_t<T>>::value, + static_assert(std::is_same<T, std::decay_t<T>>::value, "The explicit template argument of in_place_type is required " "to be an unqualified object type."); } @@ -248,7 +248,7 @@ // Upon assignment, `*this` is only empty if `f` is a function pointer or // member pointer type and is null, or if `f` is an `AnyInvocable` that is // empty. - template <class F, typename = absl::enable_if_t< + template <class F, typename = std::enable_if_t< internal_any_invocable::CanAssign<Sig, F>::value>> AnyInvocable& operator=(F&& f) { *this = AnyInvocable(std::forward<F>(f)); @@ -260,7 +260,7 @@ // `AnyInvocable` instance. template < class F, - typename = absl::enable_if_t< + typename = std::enable_if_t< internal_any_invocable::CanAssignReferenceWrapper<Sig, F>::value>> AnyInvocable& operator=(std::reference_wrapper<F> f) noexcept { *this = AnyInvocable(f);
diff --git a/absl/functional/any_invocable_test.cc b/absl/functional/any_invocable_test.cc index 7ddfcab..9c5068a 100644 --- a/absl/functional/any_invocable_test.cc +++ b/absl/functional/any_invocable_test.cc
@@ -41,7 +41,7 @@ template <class T> struct Wrapper { template <class U, - class = absl::enable_if_t<std::is_convertible<U, T>::value>> + class = std::enable_if_t<std::is_convertible<U, T>::value>> Wrapper(U&&); // NOLINT }; @@ -58,7 +58,7 @@ struct QualifiersForThisImpl { static_assert(std::is_object<This>::value, ""); using type = - absl::conditional_t<std::is_const<Qualifiers>::value, const This, This>&; + std::conditional_t<std::is_const<Qualifiers>::value, const This, This>&; }; template <class Qualifiers, class This> @@ -69,7 +69,7 @@ struct QualifiersForThisImpl<Qualifiers&&, This> { static_assert(std::is_object<This>::value, ""); using type = - absl::conditional_t<std::is_const<Qualifiers>::value, const This, This>&&; + std::conditional_t<std::is_const<Qualifiers>::value, const This, This>&&; }; template <class Qualifiers, class This> @@ -84,38 +84,38 @@ template <class T, class R, class... P> struct GiveQualifiersToFunImpl<T, R(P...)> { using type = - absl::conditional_t<std::is_const<T>::value, R(P...) const, R(P...)>; + std::conditional_t<std::is_const<T>::value, R(P...) const, R(P...)>; }; template <class T, class R, class... P> struct GiveQualifiersToFunImpl<T&, R(P...)> { using type = - absl::conditional_t<std::is_const<T>::value, R(P...) const&, R(P...)&>; + std::conditional_t<std::is_const<T>::value, R(P...) const&, R(P...)&>; }; template <class T, class R, class... P> struct GiveQualifiersToFunImpl<T&&, R(P...)> { using type = - absl::conditional_t<std::is_const<T>::value, R(P...) const&&, R(P...) &&>; + std::conditional_t<std::is_const<T>::value, R(P...) const&&, R(P...) &&>; }; template <class T, class R, class... P> struct GiveQualifiersToFunImpl<T, R(P...) noexcept> { - using type = absl::conditional_t<std::is_const<T>::value, + using type = std::conditional_t<std::is_const<T>::value, R(P...) const noexcept, R(P...) noexcept>; }; template <class T, class R, class... P> struct GiveQualifiersToFunImpl<T&, R(P...) noexcept> { using type = - absl::conditional_t<std::is_const<T>::value, R(P...) const & noexcept, + std::conditional_t<std::is_const<T>::value, R(P...) const & noexcept, R(P...) & noexcept>; }; template <class T, class R, class... P> struct GiveQualifiersToFunImpl<T&&, R(P...) noexcept> { using type = - absl::conditional_t<std::is_const<T>::value, R(P...) const && noexcept, + std::conditional_t<std::is_const<T>::value, R(P...) const && noexcept, R(P...) && noexcept>; }; @@ -367,14 +367,14 @@ } using CompatibleAnyInvocableFunType = - absl::conditional_t<std::is_rvalue_reference<Qual>::value, + std::conditional_t<std::is_rvalue_reference<Qual>::value, GiveQualifiersToFun<const _&&, UnqualifiedFunType>, GiveQualifiersToFun<const _&, UnqualifiedFunType>>; using CompatibleAnyInvType = AnyInvocable<CompatibleAnyInvocableFunType>; using IncompatibleInvocable = - absl::conditional_t<std::is_rvalue_reference<Qual>::value, + std::conditional_t<std::is_rvalue_reference<Qual>::value, GiveQualifiersToFun<_&, UnqualifiedFunType>(_::*), GiveQualifiersToFun<_&&, UnqualifiedFunType>(_::*)>; }; @@ -1284,7 +1284,7 @@ // Just like plain functors, it should work fine to use an AnyInvocable that // returns the non-moveable type. using UnqualifiedFun = - absl::conditional_t<TypeParam::kIsNoexcept, Result() noexcept, Result()>; + std::conditional_t<TypeParam::kIsNoexcept, Result() noexcept, Result()>; using Fun = GiveQualifiersToFun<typename TypeParam::Qualifiers, UnqualifiedFun>; @@ -1364,7 +1364,7 @@ // Just like plain functors, it should work fine to use an AnyInvocable that // returns the non-moveable type. using UnqualifiedFun = - absl::conditional_t<TypeParam::kIsNoexcept, Result() noexcept, Result()>; + std::conditional_t<TypeParam::kIsNoexcept, Result() noexcept, Result()>; using Fun = GiveQualifiersToFun<typename TypeParam::Qualifiers, UnqualifiedFun>;
diff --git a/absl/functional/internal/any_invocable.h b/absl/functional/internal/any_invocable.h index 597c210..66168c6 100644 --- a/absl/functional/internal/any_invocable.h +++ b/absl/functional/internal/any_invocable.h
@@ -611,39 +611,39 @@ /*SFINAE constraints for the conversion-constructor.*/ template <class Sig, class F, - class = absl::enable_if_t< + class = std::enable_if_t< !std::is_same<RemoveCVRef<F>, AnyInvocable<Sig>>::value>> using CanConvert = TrueAlias< - absl::enable_if_t<!IsInPlaceType<RemoveCVRef<F>>::value>, - absl::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, - absl::enable_if_t< + std::enable_if_t<!IsInPlaceType<RemoveCVRef<F>>::value>, + std::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, + std::enable_if_t< Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<F>::value>, - absl::enable_if_t<std::is_constructible<absl::decay_t<F>, F>::value>>; + std::enable_if_t<std::is_constructible<std::decay_t<F>, F>::value>>; /*SFINAE constraints for the std::in_place constructors.*/ template <class Sig, class F, class... Args> using CanEmplace = TrueAlias< - absl::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, - absl::enable_if_t< + std::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, + std::enable_if_t< Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<F>::value>, - absl::enable_if_t<std::is_constructible<absl::decay_t<F>, Args...>::value>>; + std::enable_if_t<std::is_constructible<std::decay_t<F>, Args...>::value>>; /*SFINAE constraints for the conversion-assign operator.*/ template <class Sig, class F, - class = absl::enable_if_t< + class = std::enable_if_t< !std::is_same<RemoveCVRef<F>, AnyInvocable<Sig>>::value>> using CanAssign = TrueAlias< - absl::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, - absl::enable_if_t< + std::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, + std::enable_if_t< Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<F>::value>, - absl::enable_if_t<std::is_constructible<absl::decay_t<F>, F>::value>>; + std::enable_if_t<std::is_constructible<std::decay_t<F>, F>::value>>; /*SFINAE constraints for the reference-wrapper conversion-assign operator.*/ template <class Sig, class F> using CanAssignReferenceWrapper = TrueAlias< - absl::enable_if_t< + std::enable_if_t< Impl<Sig>::template CallIsValid<std::reference_wrapper<F>>::value>, - absl::enable_if_t<Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept< + std::enable_if_t<Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept< std::reference_wrapper<F>>::value>>; // The constraint for checking whether or not a call meets the noexcept @@ -657,17 +657,17 @@ // don't treat non-moveable result types correctly. For example this was the // case in libc++ before commit c3a24882 (2022-05). #define ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT_true(inv_quals) \ - absl::enable_if_t<absl::disjunction< \ + std::enable_if_t<std::disjunction< \ std::is_nothrow_invocable_r< \ - ReturnType, UnwrapStdReferenceWrapper<absl::decay_t<F>> inv_quals, \ + ReturnType, UnwrapStdReferenceWrapper<std::decay_t<F>> inv_quals, \ P...>, \ std::conjunction< \ std::is_nothrow_invocable< \ - UnwrapStdReferenceWrapper<absl::decay_t<F>> inv_quals, P...>, \ + UnwrapStdReferenceWrapper<std::decay_t<F>> inv_quals, P...>, \ std::is_same< \ ReturnType, \ std::invoke_result_t< \ - UnwrapStdReferenceWrapper<absl::decay_t<F>> inv_quals, \ + UnwrapStdReferenceWrapper<std::decay_t<F>> inv_quals, \ P...>>>>::value> #define ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT_false(inv_quals) @@ -696,11 +696,11 @@ \ /*SFINAE constraint to check if F is invocable with the proper signature*/ \ template <class F> \ - using CallIsValid = TrueAlias<absl::enable_if_t<absl::disjunction< \ - std::is_invocable_r<ReturnType, absl::decay_t<F> inv_quals, P...>, \ + using CallIsValid = TrueAlias<std::enable_if_t<std::disjunction< \ + std::is_invocable_r<ReturnType, std::decay_t<F> inv_quals, P...>, \ std::is_same< \ ReturnType, \ - std::invoke_result_t<absl::decay_t<F> inv_quals, P...>>>::value>>; \ + std::invoke_result_t<std::decay_t<F> inv_quals, P...>>>::value>>; \ \ /*SFINAE constraint to check if F is nothrow-invocable when necessary*/ \ template <class F> \ @@ -723,7 +723,7 @@ /*Forward along the in-place construction parameters.*/ \ template <class T, class... Args> \ explicit Impl(absl::in_place_type_t<T>, Args&&... args) \ - : Core(absl::in_place_type<absl::decay_t<T> inv_quals>, \ + : Core(absl::in_place_type<std::decay_t<T> inv_quals>, \ std::forward<Args>(args)...) {} \ \ /*Raises a fatal error when the AnyInvocable is invoked after a move*/ \
diff --git a/absl/functional/internal/front_binder.h b/absl/functional/internal/front_binder.h index 62f373f..e06aaba 100644 --- a/absl/functional/internal/front_binder.h +++ b/absl/functional/internal/front_binder.h
@@ -84,7 +84,7 @@ }; template <class F, class... BoundArgs> -using bind_front_t = FrontBinder<decay_t<F>, absl::decay_t<BoundArgs>...>; +using bind_front_t = FrontBinder<decay_t<F>, std::decay_t<BoundArgs>...>; } // namespace functional_internal ABSL_NAMESPACE_END
diff --git a/absl/functional/internal/function_ref.h b/absl/functional/internal/function_ref.h index 543b30f..46147e9 100644 --- a/absl/functional/internal/function_ref.h +++ b/absl/functional/internal/function_ref.h
@@ -47,8 +47,8 @@ template <typename T> struct PassByValue<T, /*IsLValueReference=*/false> : std::integral_constant<bool, - absl::is_trivially_copy_constructible<T>::value && - absl::is_trivially_copy_assignable< + std::is_trivially_copy_constructible<T>::value && + std::is_trivially_copy_assignable< typename std::remove_cv<T>::type>::value && std::is_trivially_destructible<T>::value && sizeof(T) <= 2 * sizeof(void*)> {};
diff --git a/absl/hash/hash.h b/absl/hash/hash.h index 23f4e9d..e2bde0c 100644 --- a/absl/hash/hash.h +++ b/absl/hash/hash.h
@@ -329,7 +329,7 @@ // users should not define their own HashState types. template < typename T, - absl::enable_if_t< + std::enable_if_t< std::is_base_of<hash_internal::HashStateBase<T>, T>::value, int> = 0> static HashState Create(T* state) { HashState s;
diff --git a/absl/hash/hash_test.cc b/absl/hash/hash_test.cc index 039515a..e83fcae 100644 --- a/absl/hash/hash_test.cc +++ b/absl/hash/hash_test.cc
@@ -803,8 +803,8 @@ EXPECT_TRUE(std::is_default_constructible<absl::Hash<int>>::value); EXPECT_TRUE(std::is_copy_constructible<absl::Hash<int>>::value); EXPECT_TRUE(std::is_move_constructible<absl::Hash<int>>::value); - EXPECT_TRUE(absl::is_copy_assignable<absl::Hash<int>>::value); - EXPECT_TRUE(absl::is_move_assignable<absl::Hash<int>>::value); + EXPECT_TRUE(std::is_copy_assignable<absl::Hash<int>>::value); + EXPECT_TRUE(std::is_move_assignable<absl::Hash<int>>::value); EXPECT_TRUE(IsHashCallable<int>::value); EXPECT_TRUE(IsAggregateInitializable<absl::Hash<int>>::value); } @@ -815,8 +815,8 @@ EXPECT_FALSE(std::is_default_constructible<absl::Hash<X>>::value); EXPECT_FALSE(std::is_copy_constructible<absl::Hash<X>>::value); EXPECT_FALSE(std::is_move_constructible<absl::Hash<X>>::value); - EXPECT_FALSE(absl::is_copy_assignable<absl::Hash<X>>::value); - EXPECT_FALSE(absl::is_move_assignable<absl::Hash<X>>::value); + EXPECT_FALSE(std::is_copy_assignable<absl::Hash<X>>::value); + EXPECT_FALSE(std::is_move_assignable<absl::Hash<X>>::value); EXPECT_FALSE(IsHashCallable<X>::value); #if !defined(__GNUC__) || defined(__clang__) // TODO(b/144368551): As of GCC 8.4 this does not compile. @@ -891,7 +891,7 @@ template <InvokeTag allowed, InvokeTag... tags> struct EnableIfContained - : std::enable_if<absl::disjunction< + : std::enable_if<std::disjunction< std::integral_constant<bool, allowed == tags>...>::value> {}; template <
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h index a6c8313..620fd22 100644 --- a/absl/hash/internal/hash.h +++ b/absl/hash/internal/hash.h
@@ -404,7 +404,7 @@ // Convenience function that combines `hash_state` with the byte representation // of `value`. template <typename H, typename T, - absl::enable_if_t<FitsIn64Bits<T>::value, int> = 0> + std::enable_if_t<FitsIn64Bits<T>::value, int> = 0> H hash_bytes(H hash_state, const T& value) { const unsigned char* start = reinterpret_cast<const unsigned char*>(&value); uint64_t v; @@ -421,7 +421,7 @@ return CombineRaw()(std::move(hash_state), v); } template <typename H, typename T, - absl::enable_if_t<!FitsIn64Bits<T>::value, int> = 0> + std::enable_if_t<!FitsIn64Bits<T>::value, int> = 0> H hash_bytes(H hash_state, const T& value) { const unsigned char* start = reinterpret_cast<const unsigned char*>(&value); return H::combine_contiguous(std::move(hash_state), start, sizeof(value)); @@ -601,7 +601,7 @@ // for now. H #else // _MSC_VER -typename std::enable_if<absl::conjunction<is_hashable<Ts>...>::value, H>::type +typename std::enable_if<std::conjunction<is_hashable<Ts>...>::value, H>::type #endif // _MSC_VER AbslHashValue(H hash_state, const std::tuple<Ts...>& t) { return hash_internal::hash_tuple(std::move(hash_state), t, @@ -650,7 +650,7 @@ // Support std::wstring, std::u16string and std::u32string. template <typename Char, typename Alloc, typename H, - typename = absl::enable_if_t<std::is_same<Char, wchar_t>::value || + typename = std::enable_if_t<std::is_same<Char, wchar_t>::value || std::is_same<Char, char16_t>::value || std::is_same<Char, char32_t>::value>> H AbslHashValue( @@ -661,7 +661,7 @@ // Support std::wstring_view, std::u16string_view and std::u32string_view. template <typename Char, typename H, - typename = absl::enable_if_t<std::is_same<Char, wchar_t>::value || + typename = std::enable_if_t<std::is_same<Char, wchar_t>::value || std::is_same<Char, char16_t>::value || std::is_same<Char, char32_t>::value>> H AbslHashValue(H hash_state, std::basic_string_view<Char> str) { @@ -680,7 +680,7 @@ // Support std::filesystem::path. The SFINAE is required because some string // types are implicitly convertible to std::filesystem::path. template <typename Path, typename H, - typename = absl::enable_if_t< + typename = std::enable_if_t< std::is_same_v<Path, std::filesystem::path>>> H AbslHashValue(H hash_state, const Path& path) { // This is implemented by deferring to the standard library to compute the @@ -1299,14 +1299,14 @@ struct UniquelyRepresentedProbe { template <typename H, typename T> static auto Invoke(H state, const T& value) - -> absl::enable_if_t<is_uniquely_represented<T>::value, H> { + -> std::enable_if_t<is_uniquely_represented<T>::value, H> { return hash_internal::hash_bytes(std::move(state), value); } }; struct HashValueProbe { template <typename H, typename T> - static auto Invoke(H state, const T& value) -> absl::enable_if_t< + static auto Invoke(H state, const T& value) -> std::enable_if_t< std::is_same<H, decltype(AbslHashValue(std::move(state), value))>::value, H> { @@ -1317,7 +1317,7 @@ struct LegacyHashProbe { #if ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ template <typename H, typename T> - static auto Invoke(H state, const T& value) -> absl::enable_if_t< + static auto Invoke(H state, const T& value) -> std::enable_if_t< std::is_convertible< decltype(ABSL_INTERNAL_LEGACY_HASH_NAMESPACE::hash<T>()(value)), size_t>::value, @@ -1332,7 +1332,7 @@ struct StdHashProbe { template <typename H, typename T> static auto Invoke(H state, const T& value) - -> absl::enable_if_t<type_traits_internal::IsHashable<T>::value, H> { + -> std::enable_if_t<type_traits_internal::IsHashable<T>::value, H> { return hash_internal::hash_bytes(std::move(state), std::hash<T>{}(value)); } }; @@ -1354,7 +1354,7 @@ // Probe each implementation in order. // disjunction provides short circuiting wrt instantiation. template <typename T> - using Apply = absl::disjunction< // + using Apply = std::disjunction< // Probe<WeaklyMixedIntegerProbe, T>, // Probe<UniquelyRepresentedProbe, T>, // Probe<HashValueProbe, T>, // @@ -1399,13 +1399,13 @@ // Otherwise we would be instantiating and calling dozens of functions for // something that is just one multiplication and a couple xor's. // The result should be the same as running the whole algorithm, but faster. - template <typename T, absl::enable_if_t<IntegralFastPath<T>::value, int> = 0> + template <typename T, std::enable_if_t<IntegralFastPath<T>::value, int> = 0> static size_t hash_with_seed(T value, size_t seed) { return static_cast<size_t>( CombineRawImpl(seed, static_cast<std::make_unsigned_t<T>>(value))); } - template <typename T, absl::enable_if_t<!IntegralFastPath<T>::value, int> = 0> + template <typename T, std::enable_if_t<!IntegralFastPath<T>::value, int> = 0> static size_t hash_with_seed(const T& value, size_t seed) { return static_cast<size_t>(combine(MixingHashState{seed}, value).state_); } @@ -1527,7 +1527,7 @@ template <typename T> struct Hash - : absl::conditional_t<is_hashable<T>::value, HashImpl<T>, PoisonedHash> {}; + : std::conditional_t<is_hashable<T>::value, HashImpl<T>, PoisonedHash> {}; template <typename H> template <typename T, typename... Ts>
diff --git a/absl/hash/internal/spy_hash_state.h b/absl/hash/internal/spy_hash_state.h index 80c9767..0eb9ffe 100644 --- a/absl/hash/internal/spy_hash_state.h +++ b/absl/hash/internal/spy_hash_state.h
@@ -22,6 +22,7 @@ #include <optional> #include <ostream> #include <string> +#include <type_traits> #include <vector> #include "absl/hash/hash.h" @@ -269,7 +270,7 @@ template < typename T, typename U, // Only trigger for when (T != U), - typename = absl::enable_if_t<!std::is_same<T, U>::value>, + typename = std::enable_if_t<!std::is_same<T, U>::value>, // This statement works in two ways: // - First, it instantiates RunOnStartup and forces the initialization of // `run`, which set the global variable.
diff --git a/absl/memory/memory.h b/absl/memory/memory.h index f0f7aea..bc5d654 100644 --- a/absl/memory/memory.h +++ b/absl/memory/memory.h
@@ -134,7 +134,7 @@ template <typename T> typename memory_internal::MakeUniqueResult<T>::array make_unique_for_overwrite(size_t n) { - return std::unique_ptr<T>(new typename absl::remove_extent_t<T>[n]); + return std::unique_ptr<T>(new typename std::remove_extent_t<T>[n]); } // `absl::make_unique_for_overwrite` overload for an array T[N] of known bounds.
diff --git a/absl/meta/type_traits.h b/absl/meta/type_traits.h index 2c651f2..7fc4eb7 100644 --- a/absl/meta/type_traits.h +++ b/absl/meta/type_traits.h
@@ -218,7 +218,7 @@ template <typename Key> struct IsHashable< Key, - absl::enable_if_t<std::is_convertible< + std::enable_if_t<std::is_convertible< decltype(std::declval<std::hash<Key>&>()(std::declval<Key const&>())), std::size_t>::value>> : std::true_type {}; @@ -243,7 +243,7 @@ static_assert( std::is_copy_constructible<std::hash<Key>>::value, "std::hash<Key> must be copy constructible when it is enabled"); - static_assert(absl::is_copy_assignable<std::hash<Key>>::value, + static_assert(std::is_copy_assignable<std::hash<Key>>::value, "std::hash<Key> must be copy assignable when it is enabled"); // is_destructible is unchecked as it's implied by each of the // is_constructible checks. @@ -306,7 +306,7 @@ // // Performs the swap idiom from a namespace where valid candidates may only be // found in `std` or via ADL. -template <class T, absl::enable_if_t<IsSwappable<T>::value, int> = 0> +template <class T, std::enable_if_t<IsSwappable<T>::value, int> = 0> void Swap(T& lhs, T& rhs) noexcept(IsNothrowSwappable<T>::value) { swap(lhs, rhs); } @@ -475,7 +475,7 @@ struct IsOwnerImpl< T, std::enable_if_t<std::is_class<typename T::absl_internal_is_view>::value>> - : absl::negation<typename T::absl_internal_is_view> {}; + : std::negation<typename T::absl_internal_is_view> {}; // A trait to determine whether a type is an owner. // Do *not* depend on the correctness of this trait for correct code behavior. @@ -555,7 +555,7 @@ // Until then, we consider an assignment from an "owner" (such as std::string) // to a "view" (such as std::string_view) to be a lifetime-bound assignment. template <typename T, typename U> -using IsLifetimeBoundAssignment = absl::conjunction< +using IsLifetimeBoundAssignment = std::conjunction< std::integral_constant<bool, !std::is_lvalue_reference<U>::value>, IsOwner<absl::remove_cvref_t<U>>, IsView<absl::remove_cvref_t<T>>>;
diff --git a/absl/meta/type_traits_test.cc b/absl/meta/type_traits_test.cc index 9a8262d..6d0085c 100644 --- a/absl/meta/type_traits_test.cc +++ b/absl/meta/type_traits_test.cc
@@ -33,8 +33,8 @@ template <typename T> using IsOwnerAndNotView = - absl::conjunction<absl::type_traits_internal::IsOwner<T>, - absl::negation<absl::type_traits_internal::IsView<T>>>; + std::conjunction<absl::type_traits_internal::IsOwner<T>, + std::negation<absl::type_traits_internal::IsView<T>>>; static_assert( IsOwnerAndNotView<std::pair<std::vector<int>, std::string>>::value, @@ -70,13 +70,13 @@ struct TypeWithBarFunction { template <class T, - absl::enable_if_t<std::is_same<T&&, StructA&>::value, int> = 0> + std::enable_if_t<std::is_same<T&&, StructA&>::value, int> = 0> ReturnType bar(T&&, const StructB&, StructC&&) &&; // NOLINT }; struct TypeWithBarFunctionAndConvertibleReturnType { template <class T, - absl::enable_if_t<std::is_same<T&&, StructA&>::value, int> = 0> + std::enable_if_t<std::is_same<T&&, StructA&>::value, int> = 0> ConvertibleToReturnType bar(T&&, const StructB&, StructC&&) &&; // NOLINT }; @@ -160,19 +160,19 @@ struct GetTypeT { template <typename T, - absl::enable_if_t<std::is_same<T, TypeA>::value, int> = 0> + std::enable_if_t<std::is_same<T, TypeA>::value, int> = 0> TypeEnum operator()(Wrap<T>) const { return TypeEnum::A; } template <typename T, - absl::enable_if_t<std::is_same<T, TypeB>::value, int> = 0> + std::enable_if_t<std::is_same<T, TypeB>::value, int> = 0> TypeEnum operator()(Wrap<T>) const { return TypeEnum::B; } template <typename T, - absl::enable_if_t<std::is_same<T, TypeC>::value, int> = 0> + std::enable_if_t<std::is_same<T, TypeC>::value, int> = 0> TypeEnum operator()(Wrap<T>) const { return TypeEnum::C; }
diff --git a/absl/numeric/int128_test.cc b/absl/numeric/int128_test.cc index 77ee63c..336db78 100644 --- a/absl/numeric/int128_test.cc +++ b/absl/numeric/int128_test.cc
@@ -93,11 +93,11 @@ #endif // ABSL_HAVE_INTRINSIC_INT128 TEST(Uint128, TrivialTraitsTest) { - static_assert(absl::is_trivially_default_constructible<absl::uint128>::value, + static_assert(std::is_trivially_default_constructible<absl::uint128>::value, ""); - static_assert(absl::is_trivially_copy_constructible<absl::uint128>::value, + static_assert(std::is_trivially_copy_constructible<absl::uint128>::value, ""); - static_assert(absl::is_trivially_copy_assignable<absl::uint128>::value, ""); + static_assert(std::is_trivially_copy_assignable<absl::uint128>::value, ""); static_assert(std::is_trivially_destructible<absl::uint128>::value, ""); } @@ -619,10 +619,10 @@ #endif // ABSL_HAVE_INTRINSIC_INT128 TEST(Int128, TrivialTraitsTest) { - static_assert(absl::is_trivially_default_constructible<absl::int128>::value, + static_assert(std::is_trivially_default_constructible<absl::int128>::value, ""); - static_assert(absl::is_trivially_copy_constructible<absl::int128>::value, ""); - static_assert(absl::is_trivially_copy_assignable<absl::int128>::value, ""); + static_assert(std::is_trivially_copy_constructible<absl::int128>::value, ""); + static_assert(std::is_trivially_copy_assignable<absl::int128>::value, ""); static_assert(std::is_trivially_destructible<absl::int128>::value, ""); }
diff --git a/absl/random/beta_distribution.h b/absl/random/beta_distribution.h index a362345..bedeca6 100644 --- a/absl/random/beta_distribution.h +++ b/absl/random/beta_distribution.h
@@ -282,7 +282,7 @@ using random_internal::GeneratePositiveTag; using random_internal::GenerateRealFromBits; using real_type = - absl::conditional_t<std::is_same<RealType, float>::value, float, double>; + std::conditional_t<std::is_same<RealType, float>::value, float, double>; // Based on Joehnk, M. D. Erzeugung von betaverteilten und gammaverteilten // Zufallszahlen. Metrika 8.1 (1964): 5-15. @@ -340,7 +340,7 @@ using random_internal::GeneratePositiveTag; using random_internal::GenerateRealFromBits; using real_type = - absl::conditional_t<std::is_same<RealType, float>::value, float, double>; + std::conditional_t<std::is_same<RealType, float>::value, float, double>; // Based on Cheng, Russell CH. Generating beta variates with nonintegral // shape parameters. Communications of the ACM 21.4 (1978): 317-322.
diff --git a/absl/random/bit_gen_ref.h b/absl/random/bit_gen_ref.h index 8ac4d93..262eb9a 100644 --- a/absl/random/bit_gen_ref.h +++ b/absl/random/bit_gen_ref.h
@@ -83,7 +83,7 @@ BitGenRef& operator=(BitGenRef&&) = default; template <typename URBGRef, typename URBG = absl::remove_cvref_t<URBGRef>, - typename absl::enable_if_t< + typename std::enable_if_t< (!std::is_same<URBG, BitGenRef>::value && !std::is_base_of<BitGenRef, URBG>::value && !HasConversionOperator<URBG>::value && @@ -95,7 +95,7 @@ generate_impl_fn_(ImplFn<URBG>) {} template <typename URBGRef, typename URBG = absl::remove_cvref_t<URBGRef>, - typename absl::enable_if_t< + typename std::enable_if_t< (!std::is_same<URBG, BitGenRef>::value && !std::is_base_of<BitGenRef, URBG>::value && !HasConversionOperator<URBG>::value &&
diff --git a/absl/random/distributions.h b/absl/random/distributions.h index dced895..01dc978 100644 --- a/absl/random/distributions.h +++ b/absl/random/distributions.h
@@ -117,11 +117,11 @@ // auto x = absl::Uniform<float>(bitgen, 0, 1); // template <typename R = void, typename TagType, typename URBG> -typename absl::enable_if_t<!std::is_same<R, void>::value, R> // +typename std::enable_if_t<!std::is_same<R, void>::value, R> // Uniform(TagType tag, URBG&& urbg, // NOLINT(runtime/references) R lo, R hi) { - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = random_internal::UniformDistributionWrapper<R>; auto a = random_internal::uniform_lower_bound(tag, lo, hi); @@ -137,10 +137,10 @@ // Overload of `Uniform()` using the default closed-open interval of [lo, hi), // and returning values of type `T` template <typename R = void, typename URBG> -typename absl::enable_if_t<!std::is_same<R, void>::value, R> // +typename std::enable_if_t<!std::is_same<R, void>::value, R> // Uniform(URBG&& urbg, // NOLINT(runtime/references) R lo, R hi) { - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = random_internal::UniformDistributionWrapper<R>; constexpr auto tag = absl::IntervalClosedOpen; @@ -159,12 +159,12 @@ // correctly from the passed types. template <typename R = void, typename TagType, typename URBG, typename A, typename B> -typename absl::enable_if_t<std::is_same<R, void>::value, +typename std::enable_if_t<std::is_same<R, void>::value, random_internal::uniform_inferred_return_t<A, B>> Uniform(TagType tag, URBG&& urbg, // NOLINT(runtime/references) A lo, B hi) { - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using return_t = typename random_internal::uniform_inferred_return_t<A, B>; using distribution_t = random_internal::UniformDistributionWrapper<return_t>; @@ -183,11 +183,11 @@ // default closed-open interval of [lo, hi). Note that a compile-error will // result if the return type cannot be deduced correctly from the passed types. template <typename R = void, typename URBG, typename A, typename B> -typename absl::enable_if_t<std::is_same<R, void>::value, +typename std::enable_if_t<std::is_same<R, void>::value, random_internal::uniform_inferred_return_t<A, B>> Uniform(URBG&& urbg, // NOLINT(runtime/references) A lo, B hi) { - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using return_t = typename random_internal::uniform_inferred_return_t<A, B>; using distribution_t = random_internal::UniformDistributionWrapper<return_t>; @@ -206,9 +206,9 @@ // Overload of Uniform() using the minimum and maximum values of a given type // `T` (which must be unsigned), returning a value of type `unsigned T` template <typename R, typename URBG> -typename absl::enable_if_t<!std::numeric_limits<R>::is_signed, R> // +typename std::enable_if_t<!std::numeric_limits<R>::is_signed, R> // Uniform(URBG&& urbg) { // NOLINT(runtime/references) - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = random_internal::UniformDistributionWrapper<R>; return random_internal::DistributionCaller<gen_t>::template Call< @@ -238,7 +238,7 @@ template <typename URBG> bool Bernoulli(URBG&& urbg, // NOLINT(runtime/references) double p) { - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = absl::bernoulli_distribution; return random_internal::DistributionCaller<gen_t>::template Call< @@ -270,7 +270,7 @@ "Template-argument 'RealType' must be a floating-point type, in " "absl::Beta<RealType, URBG>(...)"); - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = typename absl::beta_distribution<RealType>; return random_internal::DistributionCaller<gen_t>::template Call< @@ -302,7 +302,7 @@ "Template-argument 'RealType' must be a floating-point type, in " "absl::Exponential<RealType, URBG>(...)"); - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = typename absl::exponential_distribution<RealType>; return random_internal::DistributionCaller<gen_t>::template Call< @@ -333,7 +333,7 @@ "Template-argument 'RealType' must be a floating-point type, in " "absl::Gaussian<RealType, URBG>(...)"); - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = typename absl::gaussian_distribution<RealType>; return random_internal::DistributionCaller<gen_t>::template Call< @@ -375,7 +375,7 @@ "Template-argument 'IntType' must be an integral type, in " "absl::LogUniform<IntType, URBG>(...)"); - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = typename absl::log_uniform_int_distribution<IntType>; return random_internal::DistributionCaller<gen_t>::template Call< @@ -405,7 +405,7 @@ "Template-argument 'IntType' must be an integral type, in " "absl::Poisson<IntType, URBG>(...)"); - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = typename absl::poisson_distribution<IntType>; return random_internal::DistributionCaller<gen_t>::template Call< @@ -437,7 +437,7 @@ "Template-argument 'IntType' must be an integral type, in " "absl::Zipf<IntType, URBG>(...)"); - using gen_t = absl::decay_t<URBG>; + using gen_t = std::decay_t<URBG>; using distribution_t = typename absl::zipf_distribution<IntType>; return random_internal::DistributionCaller<gen_t>::template Call<
diff --git a/absl/random/distributions_test.cc b/absl/random/distributions_test.cc index 4340aeb..1fa3345 100644 --- a/absl/random/distributions_test.cc +++ b/absl/random/distributions_test.cc
@@ -80,13 +80,13 @@ template <typename A, typename B, typename Expect> void CheckArgsInferType() { static_assert( - absl::conjunction< + std::conjunction< std::is_same<Expect, decltype(InferredUniformReturnT<A, B>(0))>, std::is_same<Expect, decltype(InferredUniformReturnT<B, A>(0))>>::value, ""); static_assert( - absl::conjunction< + std::conjunction< std::is_same<Expect, decltype(InferredTaggedUniformReturnT< absl::IntervalOpenOpenTag, A, B>(0))>, std::is_same<Expect, @@ -121,14 +121,14 @@ template <typename A, typename B, typename Expect> void CheckArgsReturnExpectedType() { static_assert( - absl::conjunction< + std::conjunction< std::is_same<Expect, decltype(ExplicitUniformReturnT<A, B, Expect>(0))>, std::is_same<Expect, decltype(ExplicitUniformReturnT<B, A, Expect>( 0))>>::value, ""); static_assert( - absl::conjunction< + std::conjunction< std::is_same<Expect, decltype(ExplicitTaggedUniformReturnT< absl::IntervalOpenOpenTag, A, B, Expect>(0))>,
diff --git a/absl/random/exponential_distribution.h b/absl/random/exponential_distribution.h index 4af2fb4..f0267b2 100644 --- a/absl/random/exponential_distribution.h +++ b/absl/random/exponential_distribution.h
@@ -124,7 +124,7 @@ using random_internal::GenerateNegativeTag; using random_internal::GenerateRealFromBits; using real_type = - absl::conditional_t<std::is_same<RealType, float>::value, float, double>; + std::conditional_t<std::is_same<RealType, float>::value, float, double>; const result_type u = GenerateRealFromBits<real_type, GenerateNegativeTag, false>(fast_u64_(g)); // U(-1, 0)
diff --git a/absl/random/internal/distribution_caller.h b/absl/random/internal/distribution_caller.h index d712bca..d14fa85 100644 --- a/absl/random/internal/distribution_caller.h +++ b/absl/random/internal/distribution_caller.h
@@ -55,7 +55,7 @@ static typename DistrT::result_type Impl(std::true_type, URBG* urbg, Args&&... args) { using ResultT = typename DistrT::result_type; - using ArgTupleT = std::tuple<absl::decay_t<Args>...>; + using ArgTupleT = std::tuple<std::decay_t<Args>...>; using KeyT = ResultT(DistrT, ArgTupleT); ArgTupleT arg_tuple(std::forward<Args>(args)...);
diff --git a/absl/random/internal/fast_uniform_bits.h b/absl/random/internal/fast_uniform_bits.h index 83ee5c0..7292d1f 100644 --- a/absl/random/internal/fast_uniform_bits.h +++ b/absl/random/internal/fast_uniform_bits.h
@@ -126,7 +126,7 @@ static_assert((URBG::max)() > (URBG::min)(), "URBG::max and URBG::min may not be equal."); - using tag = absl::conditional_t<IsPowerOfTwoOrZero(RangeSize<URBG>()), + using tag = std::conditional_t<IsPowerOfTwoOrZero(RangeSize<URBG>()), SimplifiedLoopTag, RejectionLoopTag>; return Generate(g, tag{}); }
diff --git a/absl/random/internal/generate_real.h b/absl/random/internal/generate_real.h index 9a6f400..fc35240 100644 --- a/absl/random/internal/generate_real.h +++ b/absl/random/internal/generate_real.h
@@ -69,7 +69,7 @@ bool IncludeZero = true> inline RealType GenerateRealFromBits(uint64_t bits, int exp_bias = 0) { using real_type = RealType; - using uint_type = absl::conditional_t<std::is_same<real_type, float>::value, + using uint_type = std::conditional_t<std::is_same<real_type, float>::value, uint32_t, uint64_t>; static_assert(
diff --git a/absl/random/internal/iostream_state_saver.h b/absl/random/internal/iostream_state_saver.h index 0f56bcb..5556b67 100644 --- a/absl/random/internal/iostream_state_saver.h +++ b/absl/random/internal/iostream_state_saver.h
@@ -95,7 +95,7 @@ } template <typename T> -typename absl::enable_if_t<!std::is_base_of<std::ios_base, T>::value, +typename std::enable_if_t<!std::is_base_of<std::ios_base, T>::value, null_state_saver<T>> make_ostream_state_saver(T& is, // NOLINT(runtime/references) std::ios_base::fmtflags flags = std::ios_base::dec) { @@ -159,7 +159,7 @@ } template <typename T> -typename absl::enable_if_t<!std::is_base_of<std::ios_base, T>::value, +typename std::enable_if_t<!std::is_base_of<std::ios_base, T>::value, null_state_saver<T>> make_istream_state_saver(T& is, // NOLINT(runtime/references) std::ios_base::fmtflags flags = std::ios_base::dec) {
diff --git a/absl/random/internal/iostream_state_saver_test.cc b/absl/random/internal/iostream_state_saver_test.cc index ea9d2af..3c1db21 100644 --- a/absl/random/internal/iostream_state_saver_test.cc +++ b/absl/random/internal/iostream_state_saver_test.cc
@@ -19,6 +19,7 @@ #include <sstream> #include <string> +#include <type_traits> #include "gtest/gtest.h" @@ -29,7 +30,7 @@ using absl::random_internal::stream_precision_helper; template <typename T> -typename absl::enable_if_t<std::is_integral<T>::value, T> // +typename std::enable_if_t<std::is_integral<T>::value, T> // StreamRoundTrip(T t) { std::stringstream ss; { @@ -53,7 +54,7 @@ } template <typename T> -typename absl::enable_if_t<std::is_floating_point<T>::value, T> // +typename std::enable_if_t<std::is_floating_point<T>::value, T> // StreamRoundTrip(T t) { std::stringstream ss; {
diff --git a/absl/random/internal/nonsecure_base.h b/absl/random/internal/nonsecure_base.h index e8c2bb9..903dbd9 100644 --- a/absl/random/internal/nonsecure_base.h +++ b/absl/random/internal/nonsecure_base.h
@@ -78,7 +78,7 @@ // std::contiguous_iterator_tag provides a mechanism for testing this // capability, however until Abseil's support requirements allow us to // assume C++20, limit checks to a few common cases. - using TagType = absl::conditional_t< + using TagType = std::conditional_t< (std::is_pointer<RandomAccessIterator>::value || std::is_same<RandomAccessIterator, typename std::vector<U>::iterator>::value), @@ -106,7 +106,7 @@ NonsecureURBGBase& operator=(NonsecureURBGBase&&) = default; // Constructor using a seed - template <class SSeq, typename = typename absl::enable_if_t< + template <class SSeq, typename = typename std::enable_if_t< !std::is_same<SSeq, NonsecureURBGBase>::value>> explicit NonsecureURBGBase(SSeq&& seq) : urbg_(ConstructURBG(std::forward<SSeq>(seq))) {}
diff --git a/absl/random/internal/nonsecure_base_test.cc b/absl/random/internal/nonsecure_base_test.cc index 6e3e712..3795563 100644 --- a/absl/random/internal/nonsecure_base_test.cc +++ b/absl/random/internal/nonsecure_base_test.cc
@@ -77,13 +77,13 @@ static_assert(!std::is_copy_constructible<E>::value, "NonsecureURBGBase should not be copy constructible"); - static_assert(!absl::is_copy_assignable<E>::value, + static_assert(!std::is_copy_assignable<E>::value, "NonsecureURBGBase should not be copy assignable"); static_assert(std::is_move_constructible<E>::value, "NonsecureURBGBase should be move constructible"); - static_assert(absl::is_move_assignable<E>::value, + static_assert(std::is_move_assignable<E>::value, "NonsecureURBGBase should be move assignable"); static_assert(std::is_same<decltype(std::declval<E>()()), T>::value,
diff --git a/absl/random/internal/pcg_engine.h b/absl/random/internal/pcg_engine.h index e1f4ef3..2f41d58 100644 --- a/absl/random/internal/pcg_engine.h +++ b/absl/random/internal/pcg_engine.h
@@ -67,7 +67,7 @@ explicit pcg_engine(uint64_t seed_value = 0) { seed(seed_value); } template <class SeedSequence, - typename = typename absl::enable_if_t< + typename = typename std::enable_if_t< !std::is_same<SeedSequence, pcg_engine>::value>> explicit pcg_engine(SeedSequence&& seq) { seed(seq); @@ -90,7 +90,7 @@ } template <class SeedSequence> - typename absl::enable_if_t< + typename std::enable_if_t< !std::is_convertible<SeedSequence, uint64_t>::value, void> seed(SeedSequence&& seq) { reseed(seq); @@ -105,7 +105,7 @@ bool operator!=(const pcg_engine& other) const { return !(*this == other); } template <class CharT, class Traits> - friend typename absl::enable_if_t<(sizeof(state_type) == 16), + friend typename std::enable_if_t<(sizeof(state_type) == 16), std::basic_ostream<CharT, Traits>&> operator<<( std::basic_ostream<CharT, Traits>& os, // NOLINT(runtime/references) @@ -121,7 +121,7 @@ } template <class CharT, class Traits> - friend typename absl::enable_if_t<(sizeof(state_type) <= 8), + friend typename std::enable_if_t<(sizeof(state_type) <= 8), std::basic_ostream<CharT, Traits>&> operator<<( std::basic_ostream<CharT, Traits>& os, // NOLINT(runtime/references) @@ -134,7 +134,7 @@ } template <class CharT, class Traits> - friend typename absl::enable_if_t<(sizeof(state_type) == 16), + friend typename std::enable_if_t<(sizeof(state_type) == 16), std::basic_istream<CharT, Traits>&> operator>>( std::basic_istream<CharT, Traits>& is, // NOLINT(runtime/references) @@ -155,7 +155,7 @@ } template <class CharT, class Traits> - friend typename absl::enable_if_t<(sizeof(state_type) <= 8), + friend typename std::enable_if_t<(sizeof(state_type) <= 8), std::basic_istream<CharT, Traits>&> operator>>( std::basic_istream<CharT, Traits>& is, // NOLINT(runtime/references)
diff --git a/absl/random/internal/pcg_engine_test.cc b/absl/random/internal/pcg_engine_test.cc index 4d763e8..211a849 100644 --- a/absl/random/internal/pcg_engine_test.cc +++ b/absl/random/internal/pcg_engine_test.cc
@@ -18,6 +18,7 @@ #include <bitset> #include <random> #include <sstream> +#include <type_traits> #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -169,13 +170,13 @@ static_assert(std::is_copy_constructible<E>::value, "engine_type must be copy constructible"); - static_assert(absl::is_copy_assignable<E>::value, + static_assert(std::is_copy_assignable<E>::value, "engine_type must be copy assignable"); static_assert(std::is_move_constructible<E>::value, "engine_type must be move constructible"); - static_assert(absl::is_move_assignable<E>::value, + static_assert(std::is_move_assignable<E>::value, "engine_type must be move assignable"); static_assert(std::is_same<decltype(std::declval<E>()()), T>::value,
diff --git a/absl/random/internal/randen_engine.h b/absl/random/internal/randen_engine.h index 925e1bb..4e4fef9 100644 --- a/absl/random/internal/randen_engine.h +++ b/absl/random/internal/randen_engine.h
@@ -63,7 +63,7 @@ explicit randen_engine(result_type seed_value) { seed(seed_value); } template <class SeedSequence, - typename = typename absl::enable_if_t< + typename = typename std::enable_if_t< !std::is_same<SeedSequence, randen_engine>::value>> explicit randen_engine(SeedSequence&& seq) { seed(seq); @@ -93,7 +93,7 @@ } template <class SeedSequence> - typename absl::enable_if_t< + typename std::enable_if_t< !std::is_convertible<SeedSequence, result_type>::value> seed(SeedSequence&& seq) { // Zeroes the state.
diff --git a/absl/random/internal/randen_engine_test.cc b/absl/random/internal/randen_engine_test.cc index 122d90b..85c0a2b 100644 --- a/absl/random/internal/randen_engine_test.cc +++ b/absl/random/internal/randen_engine_test.cc
@@ -18,6 +18,7 @@ #include <bitset> #include <random> #include <sstream> +#include <type_traits> #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -170,13 +171,13 @@ static_assert(std::is_copy_constructible<E>::value, "randen_engine must be copy constructible"); - static_assert(absl::is_copy_assignable<E>::value, + static_assert(std::is_copy_assignable<E>::value, "randen_engine must be copy assignable"); static_assert(std::is_move_constructible<E>::value, "randen_engine must be move constructible"); - static_assert(absl::is_move_assignable<E>::value, + static_assert(std::is_move_assignable<E>::value, "randen_engine must be move assignable"); static_assert(std::is_same<decltype(std::declval<E>()()), T>::value,
diff --git a/absl/random/internal/randen_test.cc b/absl/random/internal/randen_test.cc index 92773b8..cf94970 100644 --- a/absl/random/internal/randen_test.cc +++ b/absl/random/internal/randen_test.cc
@@ -15,6 +15,7 @@ #include "absl/random/internal/randen.h" #include <cstring> +#include <type_traits> #include "gtest/gtest.h" #include "absl/meta/type_traits.h" @@ -27,13 +28,13 @@ static_assert(std::is_copy_constructible<Randen>::value, "Randen must be copy constructible"); - static_assert(absl::is_copy_assignable<Randen>::value, + static_assert(std::is_copy_assignable<Randen>::value, "Randen must be copy assignable"); static_assert(std::is_move_constructible<Randen>::value, "Randen must be move constructible"); - static_assert(absl::is_move_assignable<Randen>::value, + static_assert(std::is_move_assignable<Randen>::value, "Randen must be move assignable"); }
diff --git a/absl/random/internal/salted_seed_seq.h b/absl/random/internal/salted_seed_seq.h index c374d93..a86c39d 100644 --- a/absl/random/internal/salted_seed_seq.h +++ b/absl/random/internal/salted_seed_seq.h
@@ -72,7 +72,7 @@ // The common case is that generate is called with ContiguousIterators // to uint arrays. Such contiguous memory regions may be optimized, // which we detect here. - using TagType = absl::conditional_t< + using TagType = std::conditional_t< (std::is_same<U, uint32_t>::value && (std::is_pointer<RandomAccessIterator>::value || std::is_same<RandomAccessIterator, @@ -142,14 +142,14 @@ // non-salted seed parameters. template < typename SSeq, // - typename EnableIf = absl::enable_if_t<is_salted_seed_seq<SSeq>::value>> + typename EnableIf = std::enable_if_t<is_salted_seed_seq<SSeq>::value>> SSeq MakeSaltedSeedSeq(SSeq&& seq) { return SSeq(std::forward<SSeq>(seq)); } template < typename SSeq, // - typename EnableIf = absl::enable_if_t<!is_salted_seed_seq<SSeq>::value>> + typename EnableIf = std::enable_if_t<!is_salted_seed_seq<SSeq>::value>> SaltedSeedSeq<typename std::decay<SSeq>::type> MakeSaltedSeedSeq(SSeq&& seq) { using sseq_type = typename std::decay<SSeq>::type; using result_type = typename sseq_type::result_type;
diff --git a/absl/random/internal/traits.h b/absl/random/internal/traits.h index d396329..f23bcd2 100644 --- a/absl/random/internal/traits.h +++ b/absl/random/internal/traits.h
@@ -37,13 +37,13 @@ template <typename URBG> struct is_urbg< URBG, - absl::enable_if_t<std::is_same< + std::enable_if_t<std::is_same< typename URBG::result_type, typename std::decay<decltype((URBG::min)())>::type>::value>, - absl::enable_if_t<std::is_same< + std::enable_if_t<std::is_same< typename URBG::result_type, typename std::decay<decltype((URBG::max)())>::type>::value>, - absl::enable_if_t<std::is_same< + std::enable_if_t<std::is_same< typename URBG::result_type, typename std::decay<decltype(std::declval<URBG>()())>::type>::value>> : std::true_type {};
diff --git a/absl/random/internal/uniform_helper.h b/absl/random/internal/uniform_helper.h index d230073..f50be61 100644 --- a/absl/random/internal/uniform_helper.h +++ b/absl/random/internal/uniform_helper.h
@@ -76,7 +76,7 @@ // Return-type for absl::Uniform() when the return-type is inferred. template <typename A, typename B> using uniform_inferred_return_t = - absl::enable_if_t<absl::disjunction<is_widening_convertible<A, B>, + std::enable_if_t<std::disjunction<is_widening_convertible<A, B>, is_widening_convertible<B, A>>::value, typename std::conditional< is_widening_convertible<A, B>::value, B, A>::type>; @@ -98,10 +98,10 @@ // uniform_upper_bound(IntervalOpenClosed, a, b)] // template <typename IntType, typename Tag> -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< IsIntegral<IntType>, - absl::disjunction<std::is_same<Tag, IntervalOpenClosedTag>, + std::disjunction<std::is_same<Tag, IntervalOpenClosedTag>, std::is_same<Tag, IntervalOpenOpenTag>>>::value, IntType> uniform_lower_bound(Tag, IntType a, IntType) { @@ -109,10 +109,10 @@ } template <typename FloatType, typename Tag> -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< std::is_floating_point<FloatType>, - absl::disjunction<std::is_same<Tag, IntervalOpenClosedTag>, + std::disjunction<std::is_same<Tag, IntervalOpenClosedTag>, std::is_same<Tag, IntervalOpenOpenTag>>>::value, FloatType> uniform_lower_bound(Tag, FloatType a, FloatType b) { @@ -120,8 +120,8 @@ } template <typename NumType, typename Tag> -typename absl::enable_if_t< - absl::disjunction<std::is_same<Tag, IntervalClosedClosedTag>, +typename std::enable_if_t< + std::disjunction<std::is_same<Tag, IntervalClosedClosedTag>, std::is_same<Tag, IntervalClosedOpenTag>>::value, NumType> uniform_lower_bound(Tag, NumType a, NumType) { @@ -129,10 +129,10 @@ } template <typename IntType, typename Tag> -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< IsIntegral<IntType>, - absl::disjunction<std::is_same<Tag, IntervalClosedOpenTag>, + std::disjunction<std::is_same<Tag, IntervalClosedOpenTag>, std::is_same<Tag, IntervalOpenOpenTag>>>::value, IntType> uniform_upper_bound(Tag, IntType, IntType b) { @@ -140,10 +140,10 @@ } template <typename FloatType, typename Tag> -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< std::is_floating_point<FloatType>, - absl::disjunction<std::is_same<Tag, IntervalClosedOpenTag>, + std::disjunction<std::is_same<Tag, IntervalClosedOpenTag>, std::is_same<Tag, IntervalOpenOpenTag>>>::value, FloatType> uniform_upper_bound(Tag, FloatType, FloatType b) { @@ -151,10 +151,10 @@ } template <typename IntType, typename Tag> -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< IsIntegral<IntType>, - absl::disjunction<std::is_same<Tag, IntervalClosedClosedTag>, + std::disjunction<std::is_same<Tag, IntervalClosedClosedTag>, std::is_same<Tag, IntervalOpenClosedTag>>>::value, IntType> uniform_upper_bound(Tag, IntType, IntType b) { @@ -162,10 +162,10 @@ } template <typename FloatType, typename Tag> -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< std::is_floating_point<FloatType>, - absl::disjunction<std::is_same<Tag, IntervalClosedClosedTag>, + std::disjunction<std::is_same<Tag, IntervalClosedClosedTag>, std::is_same<Tag, IntervalOpenClosedTag>>>::value, FloatType> uniform_upper_bound(Tag, FloatType, FloatType b) { @@ -195,13 +195,13 @@ // (0, 0] is not legal, but (0, 0+epsilon] is. // template <typename FloatType> -absl::enable_if_t<std::is_floating_point<FloatType>::value, bool> +std::enable_if_t<std::is_floating_point<FloatType>::value, bool> is_uniform_range_valid(FloatType a, FloatType b) { return a <= b && std::isfinite(b - a); } template <typename IntType> -absl::enable_if_t<IsIntegral<IntType>::value, bool> is_uniform_range_valid( +std::enable_if_t<IsIntegral<IntType>::value, bool> is_uniform_range_valid( IntType a, IntType b) { return a <= b; }
diff --git a/absl/random/internal/uniform_helper_test.cc b/absl/random/internal/uniform_helper_test.cc index 173c49b..5b20b0b 100644 --- a/absl/random/internal/uniform_helper_test.cc +++ b/absl/random/internal/uniform_helper_test.cc
@@ -17,6 +17,7 @@ #include <cmath> #include <cstdint> #include <random> +#include <type_traits> #include "gtest/gtest.h" @@ -214,7 +215,7 @@ template <typename A, typename B, typename Expect> void CheckArgsInferType() { static_assert( - absl::conjunction< + std::conjunction< std::is_same<Expect, decltype(InferredUniformReturnT<A, B>(0))>, std::is_same<Expect, decltype(InferredUniformReturnT<B, A>(0))>>::value,
diff --git a/absl/random/mocking_bit_gen.h b/absl/random/mocking_bit_gen.h index 249e2d6..74aa17d 100644 --- a/absl/random/mocking_bit_gen.h +++ b/absl/random/mocking_bit_gen.h
@@ -174,13 +174,13 @@ using MockFnType = decltype(GetMockFnType(std::declval<ResultT>(), std::declval<ArgTupleT>())); - using WrappedFnType = absl::conditional_t< + using WrappedFnType = std::conditional_t< std::is_same<SelfT, ::testing::NiceMock<MockingBitGen>>::value, ::testing::NiceMock<MockFnType>, - absl::conditional_t< + std::conditional_t< std::is_same<SelfT, ::testing::NaggyMock<MockingBitGen>>::value, ::testing::NaggyMock<MockFnType>, - absl::conditional_t< + std::conditional_t< std::is_same<SelfT, ::testing::StrictMock<MockingBitGen>>::value, ::testing::StrictMock<MockFnType>, MockFnType>>>;
diff --git a/absl/random/uniform_real_distribution.h b/absl/random/uniform_real_distribution.h index 8bef946..e5ea6f2 100644 --- a/absl/random/uniform_real_distribution.h +++ b/absl/random/uniform_real_distribution.h
@@ -159,7 +159,7 @@ using random_internal::GeneratePositiveTag; using random_internal::GenerateRealFromBits; using real_type = - absl::conditional_t<std::is_same<RealType, float>::value, float, double>; + std::conditional_t<std::is_same<RealType, float>::value, float, double>; while (true) { const result_type sample =
diff --git a/absl/status/internal/statusor_internal.h b/absl/status/internal/statusor_internal.h index 8a4e2f5..ccfdedb 100644 --- a/absl/status/internal/statusor_internal.h +++ b/absl/status/internal/statusor_internal.h
@@ -60,7 +60,7 @@ // Detects whether `T` is constructible or convertible from `StatusOr<U>`. template <typename T, typename U> using IsConstructibleOrConvertibleFromStatusOr = - absl::disjunction<std::is_constructible<T, StatusOr<U>&>, + std::disjunction<std::is_constructible<T, StatusOr<U>&>, std::is_constructible<T, const StatusOr<U>&>, std::is_constructible<T, StatusOr<U>&&>, std::is_constructible<T, const StatusOr<U>&&>, @@ -73,7 +73,7 @@ // `StatusOr<U>`. template <typename T, typename U> using IsConstructibleOrConvertibleOrAssignableFromStatusOr = - absl::disjunction<IsConstructibleOrConvertibleFromStatusOr<T, U>, + std::disjunction<IsConstructibleOrConvertibleFromStatusOr<T, U>, std::is_assignable<T&, StatusOr<U>&>, std::is_assignable<T&, const StatusOr<U>&>, std::is_assignable<T&, StatusOr<U>&&>, @@ -83,7 +83,7 @@ // when `U` is `StatusOr<V>` and `T` is constructible or convertible from `V`. template <typename T, typename U> struct IsDirectInitializationAmbiguous - : public absl::conditional_t< + : public std::conditional_t< std::is_same<absl::remove_cvref_t<U>, U>::value, std::false_type, IsDirectInitializationAmbiguous<T, absl::remove_cvref_t<U>>> {}; @@ -95,7 +95,7 @@ // temporaries. // REQUIRES: T and U are references. template <typename T, typename U> -using IsReferenceConversionValid = absl::conjunction< // +using IsReferenceConversionValid = std::conjunction< // std::is_reference<T>, std::is_reference<U>, // The references are convertible. This checks for // lvalue/rvalue compatibility. @@ -108,13 +108,13 @@ // Checks against the constraints of the direction initialization, i.e. when // `StatusOr<T>::StatusOr(U&&)` should participate in overload resolution. template <typename T, typename U> -using IsDirectInitializationValid = absl::disjunction< +using IsDirectInitializationValid = std::disjunction< // Short circuits if T is basically U. std::is_same<T, absl::remove_cvref_t<U>>, // std::conditional_t< std::is_reference_v<T>, // IsReferenceConversionValid<T, U>, - absl::negation<absl::disjunction< + std::negation<std::disjunction< std::is_same<absl::StatusOr<T>, absl::remove_cvref_t<U>>, std::is_same<absl::Status, absl::remove_cvref_t<U>>, std::is_same<absl::in_place_t, absl::remove_cvref_t<U>>, @@ -132,7 +132,7 @@ // s1 = s2; // ambiguous, `s1 = s2.ValueOrDie()` or `s1 = bool(s2)`? template <typename T, typename U> struct IsForwardingAssignmentAmbiguous - : public absl::conditional_t< + : public std::conditional_t< std::is_same<absl::remove_cvref_t<U>, U>::value, std::false_type, IsForwardingAssignmentAmbiguous<T, absl::remove_cvref_t<U>>> {}; @@ -143,91 +143,91 @@ // Checks against the constraints of the forwarding assignment, i.e. whether // `StatusOr<T>::operator(U&&)` should participate in overload resolution. template <typename T, typename U> -using IsForwardingAssignmentValid = absl::disjunction< +using IsForwardingAssignmentValid = std::disjunction< // Short circuits if T is basically U. std::is_same<T, absl::remove_cvref_t<U>>, - absl::negation<absl::disjunction< + std::negation<std::disjunction< std::is_same<absl::StatusOr<T>, absl::remove_cvref_t<U>>, std::is_same<absl::Status, absl::remove_cvref_t<U>>, std::is_same<absl::in_place_t, absl::remove_cvref_t<U>>, IsForwardingAssignmentAmbiguous<T, U>>>>; template <bool Value, typename T> -using Equality = std::conditional_t<Value, T, absl::negation<T>>; +using Equality = std::conditional_t<Value, T, std::negation<T>>; template <bool Explicit, typename T, typename U, bool Lifetimebound> -using IsConstructionValid = absl::conjunction< +using IsConstructionValid = std::conjunction< Equality<Lifetimebound, - absl::disjunction< + std::disjunction< std::is_reference<T>, type_traits_internal::IsLifetimeBoundAssignment<T, U>>>, IsDirectInitializationValid<T, U&&>, std::is_constructible<T, U&&>, Equality<!Explicit, std::is_convertible<U&&, T>>, - absl::disjunction< + std::disjunction< std::is_same<T, absl::remove_cvref_t<U>>, - absl::conjunction< + std::conjunction< std::conditional_t< Explicit, - absl::negation<std::is_constructible<absl::Status, U&&>>, - absl::negation<std::is_convertible<U&&, absl::Status>>>, - absl::negation< + std::negation<std::is_constructible<absl::Status, U&&>>, + std::negation<std::is_convertible<U&&, absl::Status>>>, + std::negation< internal_statusor::HasConversionOperatorToStatusOr<T, U&&>>>>>; template <typename T, typename U, bool Lifetimebound> -using IsAssignmentValid = absl::conjunction< +using IsAssignmentValid = std::conjunction< Equality<Lifetimebound, - absl::disjunction< + std::disjunction< std::is_reference<T>, type_traits_internal::IsLifetimeBoundAssignment<T, U>>>, std::conditional_t<std::is_reference_v<T>, IsReferenceConversionValid<T, U&&>, - absl::conjunction<std::is_constructible<T, U&&>, + std::conjunction<std::is_constructible<T, U&&>, std::is_assignable<T&, U&&>>>, - absl::disjunction< + std::disjunction< std::is_same<T, absl::remove_cvref_t<U>>, - absl::conjunction< - absl::negation<std::is_convertible<U&&, absl::Status>>, - absl::negation<HasConversionOperatorToStatusOr<T, U&&>>>>, + std::conjunction< + std::negation<std::is_convertible<U&&, absl::Status>>, + std::negation<HasConversionOperatorToStatusOr<T, U&&>>>>, IsForwardingAssignmentValid<T, U&&>>; template <bool Explicit, typename T, typename U> -using IsConstructionFromStatusValid = absl::conjunction< - absl::negation<std::is_same<absl::StatusOr<T>, absl::remove_cvref_t<U>>>, - absl::negation<std::is_same<T, absl::remove_cvref_t<U>>>, - absl::negation<std::is_same<absl::in_place_t, absl::remove_cvref_t<U>>>, +using IsConstructionFromStatusValid = std::conjunction< + std::negation<std::is_same<absl::StatusOr<T>, absl::remove_cvref_t<U>>>, + std::negation<std::is_same<T, absl::remove_cvref_t<U>>>, + std::negation<std::is_same<absl::in_place_t, absl::remove_cvref_t<U>>>, Equality<!Explicit, std::is_convertible<U, absl::Status>>, std::is_constructible<absl::Status, U>, - absl::negation<HasConversionOperatorToStatusOr<T, U>>>; + std::negation<HasConversionOperatorToStatusOr<T, U>>>; template <bool Explicit, typename T, typename U, bool Lifetimebound, typename UQ> -using IsConstructionFromStatusOrValid = absl::conjunction< - absl::negation<std::is_same<T, U>>, +using IsConstructionFromStatusOrValid = std::conjunction< + std::negation<std::is_same<T, U>>, // If `T` is a reference, then U must be a compatible one. - absl::disjunction<absl::negation<std::is_reference<T>>, + std::disjunction<std::negation<std::is_reference<T>>, IsReferenceConversionValid<T, U>>, Equality<Lifetimebound, type_traits_internal::IsLifetimeBoundAssignment<T, U>>, std::is_constructible<T, UQ>, Equality<!Explicit, std::is_convertible<UQ, T>>, - absl::negation<IsConstructibleOrConvertibleFromStatusOr<T, U>>>; + std::negation<IsConstructibleOrConvertibleFromStatusOr<T, U>>>; template <typename T, typename U, bool Lifetimebound> -using IsStatusOrAssignmentValid = absl::conjunction< - absl::negation<std::is_same<T, absl::remove_cvref_t<U>>>, +using IsStatusOrAssignmentValid = std::conjunction< + std::negation<std::is_same<T, absl::remove_cvref_t<U>>>, Equality<Lifetimebound, type_traits_internal::IsLifetimeBoundAssignment<T, U>>, std::is_constructible<T, U>, std::is_assignable<T, U>, - absl::negation<IsConstructibleOrConvertibleOrAssignableFromStatusOr< + std::negation<IsConstructibleOrConvertibleOrAssignableFromStatusOr< T, absl::remove_cvref_t<U>>>>; template <typename T, typename U, bool Lifetimebound> -using IsValueOrValid = absl::conjunction< +using IsValueOrValid = std::conjunction< // If `T` is a reference, then U must be a compatible one. - absl::disjunction<absl::negation<std::is_reference<T>>, + std::disjunction<std::negation<std::is_reference<T>>, IsReferenceConversionValid<T, U>>, Equality<Lifetimebound, - absl::disjunction< + std::disjunction< std::is_reference<T>, type_traits_internal::IsLifetimeBoundAssignment<T, U>>>>; @@ -331,7 +331,7 @@ } template <typename U, - absl::enable_if_t<std::is_constructible<absl::Status, U&&>::value, + std::enable_if_t<std::is_constructible<absl::Status, U&&>::value, int> = 0> explicit StatusOrData(U&& v) : status_(std::forward<U>(v)) { EnsureNotOk();
diff --git a/absl/status/statusor.h b/absl/status/statusor.h index b8509a8..0af1d75 100644 --- a/absl/status/statusor.h +++ b/absl/status/statusor.h
@@ -247,50 +247,50 @@ // is explicit if and only if the corresponding construction of `T` from `U` // is explicit. (This constructor inherits its explicitness from the // underlying constructor.) - template <typename U, absl::enable_if_t< + template <typename U, std::enable_if_t< internal_statusor::IsConstructionFromStatusOrValid< false, T, U, false, const U&>::value, int> = 0> StatusOr(const StatusOr<U>& other) // NOLINT : Base(static_cast<const typename StatusOr<U>::Base&>(other)) {} - template <typename U, absl::enable_if_t< + template <typename U, std::enable_if_t< internal_statusor::IsConstructionFromStatusOrValid< false, T, U, true, const U&>::value, int> = 0> StatusOr(const StatusOr<U>& other ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT : Base(static_cast<const typename StatusOr<U>::Base&>(other)) {} - template <typename U, absl::enable_if_t< + template <typename U, std::enable_if_t< internal_statusor::IsConstructionFromStatusOrValid< true, T, U, false, const U&>::value, int> = 0> explicit StatusOr(const StatusOr<U>& other) : Base(static_cast<const typename StatusOr<U>::Base&>(other)) {} - template <typename U, absl::enable_if_t< + template <typename U, std::enable_if_t< internal_statusor::IsConstructionFromStatusOrValid< true, T, U, true, const U&>::value, int> = 0> explicit StatusOr(const StatusOr<U>& other ABSL_ATTRIBUTE_LIFETIME_BOUND) : Base(static_cast<const typename StatusOr<U>::Base&>(other)) {} - template <typename U, absl::enable_if_t< + template <typename U, std::enable_if_t< internal_statusor::IsConstructionFromStatusOrValid< false, T, U, false, U&&>::value, int> = 0> StatusOr(StatusOr<U>&& other) // NOLINT : Base(static_cast<typename StatusOr<U>::Base&&>(other)) {} - template <typename U, absl::enable_if_t< + template <typename U, std::enable_if_t< internal_statusor::IsConstructionFromStatusOrValid< false, T, U, true, U&&>::value, int> = 0> StatusOr(StatusOr<U>&& other ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT : Base(static_cast<typename StatusOr<U>::Base&&>(other)) {} - template <typename U, absl::enable_if_t< + template <typename U, std::enable_if_t< internal_statusor::IsConstructionFromStatusOrValid< true, T, U, false, U&&>::value, int> = 0> explicit StatusOr(StatusOr<U>&& other) : Base(static_cast<typename StatusOr<U>::Base&&>(other)) {} - template <typename U, absl::enable_if_t< + template <typename U, std::enable_if_t< internal_statusor::IsConstructionFromStatusOrValid< true, T, U, true, U&&>::value, int> = 0> @@ -317,7 +317,7 @@ // assignable from `absl::StatusOr<U>` and `StatusOr<T>` cannot be directly // assigned from `StatusOr<U>`. template <typename U, - absl::enable_if_t<internal_statusor::IsStatusOrAssignmentValid< + std::enable_if_t<internal_statusor::IsStatusOrAssignmentValid< T, const U&, false>::value, int> = 0> StatusOr& operator=(const StatusOr<U>& other) { @@ -325,7 +325,7 @@ return *this; } template <typename U, - absl::enable_if_t<internal_statusor::IsStatusOrAssignmentValid< + std::enable_if_t<internal_statusor::IsStatusOrAssignmentValid< T, const U&, true>::value, int> = 0> StatusOr& operator=(const StatusOr<U>& other ABSL_ATTRIBUTE_LIFETIME_BOUND) { @@ -333,7 +333,7 @@ return *this; } template <typename U, - absl::enable_if_t<internal_statusor::IsStatusOrAssignmentValid< + std::enable_if_t<internal_statusor::IsStatusOrAssignmentValid< T, U&&, false>::value, int> = 0> StatusOr& operator=(StatusOr<U>&& other) { @@ -341,7 +341,7 @@ return *this; } template <typename U, - absl::enable_if_t<internal_statusor::IsStatusOrAssignmentValid< + std::enable_if_t<internal_statusor::IsStatusOrAssignmentValid< T, U&&, true>::value, int> = 0> StatusOr& operator=(StatusOr<U>&& other ABSL_ATTRIBUTE_LIFETIME_BOUND) { @@ -361,18 +361,18 @@ // In optimized builds, passing absl::OkStatus() here will have the effect // of passing absl::StatusCode::kInternal as a fallback. template <typename U = absl::Status, - absl::enable_if_t<internal_statusor::IsConstructionFromStatusValid< + std::enable_if_t<internal_statusor::IsConstructionFromStatusValid< false, T, U>::value, int> = 0> StatusOr(U&& v) : Base(std::forward<U>(v)) {} template <typename U = absl::Status, - absl::enable_if_t<internal_statusor::IsConstructionFromStatusValid< + std::enable_if_t<internal_statusor::IsConstructionFromStatusValid< true, T, U>::value, int> = 0> explicit StatusOr(U&& v) : Base(std::forward<U>(v)) {} template <typename U = absl::Status, - absl::enable_if_t<internal_statusor::IsConstructionFromStatusValid< + std::enable_if_t<internal_statusor::IsConstructionFromStatusValid< false, T, U>::value, int> = 0> StatusOr& operator=(U&& v) { @@ -429,26 +429,26 @@ // ambiguity, this constructor is disabled if `U` is a `StatusOr<J>`, where // `J` is convertible to `T`. template <typename U = T, - absl::enable_if_t<internal_statusor::IsConstructionValid< + std::enable_if_t<internal_statusor::IsConstructionValid< false, T, U, false>::value, int> = 0> StatusOr(U&& u) // NOLINT : StatusOr(absl::in_place, std::forward<U>(u)) {} template <typename U = T, - absl::enable_if_t<internal_statusor::IsConstructionValid< + std::enable_if_t<internal_statusor::IsConstructionValid< false, T, U, true>::value, int> = 0> StatusOr(U&& u ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT : StatusOr(absl::in_place, std::forward<U>(u)) {} template <typename U = T, - absl::enable_if_t<internal_statusor::IsConstructionValid< + std::enable_if_t<internal_statusor::IsConstructionValid< true, T, U, false>::value, int> = 0> explicit StatusOr(U&& u) // NOLINT : StatusOr(absl::in_place, std::forward<U>(u)) {} template <typename U = T, - absl::enable_if_t< + std::enable_if_t< internal_statusor::IsConstructionValid<true, T, U, true>::value, int> = 0> explicit StatusOr(U&& u ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT @@ -624,7 +624,7 @@ template < typename U, typename... Args, - absl::enable_if_t< + std::enable_if_t< std::is_constructible<T, std::initializer_list<U>&, Args&&...>::value, int> = 0> T& emplace(std::initializer_list<U> ilist,
diff --git a/absl/strings/BUILD.bazel b/absl/strings/BUILD.bazel index 27150c2..79b6672 100644 --- a/absl/strings/BUILD.bazel +++ b/absl/strings/BUILD.bazel
@@ -401,7 +401,6 @@ visibility = ["//visibility:private"], deps = [ ":strings", - "//absl/meta:type_traits", "@googletest//:gtest", "@googletest//:gtest_main", ],
diff --git a/absl/strings/CMakeLists.txt b/absl/strings/CMakeLists.txt index c49a7af..9f7f9ef 100644 --- a/absl/strings/CMakeLists.txt +++ b/absl/strings/CMakeLists.txt
@@ -339,7 +339,6 @@ ${ABSL_TEST_COPTS} DEPS absl::strings - absl::type_traits GTest::gmock_main )
diff --git a/absl/strings/cord.h b/absl/strings/cord.h index 3278296..c2f1ec5 100644 --- a/absl/strings/cord.h +++ b/absl/strings/cord.h
@@ -174,7 +174,7 @@ private: template <typename T> using EnableIfString = - absl::enable_if_t<std::is_same<T, std::string>::value, int>; + std::enable_if_t<std::is_same<T, std::string>::value, int>; public: // Cord::Cord() Constructors. @@ -1137,7 +1137,7 @@ CordRep* absl_nonnull NewExternalRep(absl::string_view data, Releaser&& releaser) { assert(!data.empty()); - using ReleaserType = absl::decay_t<Releaser>; + using ReleaserType = std::decay_t<Releaser>; CordRepExternal* rep = new CordRepExternalImpl<ReleaserType>( std::forward<Releaser>(releaser), 0); InitializeCordRepExternal(data, rep); @@ -1162,7 +1162,7 @@ data, std::forward<Releaser>(releaser)), Cord::MethodIdentifier::kMakeCordFromExternal); } else { - using ReleaserType = absl::decay_t<Releaser>; + using ReleaserType = std::decay_t<Releaser>; cord_internal::InvokeReleaser( cord_internal::Rank1{}, ReleaserType(std::forward<Releaser>(releaser)), data);
diff --git a/absl/strings/internal/stl_type_traits.h b/absl/strings/internal/stl_type_traits.h index e50468b..9c63726 100644 --- a/absl/strings/internal/stl_type_traits.h +++ b/absl/strings/internal/stl_type_traits.h
@@ -48,25 +48,25 @@ template <template <typename...> class T, typename... Args> struct IsSpecializationImpl<T<Args...>, T> : std::true_type {}; template <typename C, template <typename...> class T> -using IsSpecialization = IsSpecializationImpl<absl::decay_t<C>, T>; +using IsSpecialization = IsSpecializationImpl<std::decay_t<C>, T>; template <typename C> struct IsArrayImpl : std::false_type {}; template <template <typename, size_t> class A, typename T, size_t N> struct IsArrayImpl<A<T, N>> : std::is_same<A<T, N>, std::array<T, N>> {}; template <typename C> -using IsArray = IsArrayImpl<absl::decay_t<C>>; +using IsArray = IsArrayImpl<std::decay_t<C>>; template <typename C> struct IsBitsetImpl : std::false_type {}; template <template <size_t> class B, size_t N> struct IsBitsetImpl<B<N>> : std::is_same<B<N>, std::bitset<N>> {}; template <typename C> -using IsBitset = IsBitsetImpl<absl::decay_t<C>>; +using IsBitset = IsBitsetImpl<std::decay_t<C>>; template <typename C> struct IsSTLContainer - : absl::disjunction< + : std::disjunction< IsArray<C>, IsBitset<C>, IsSpecialization<C, std::deque>, IsSpecialization<C, std::forward_list>, IsSpecialization<C, std::list>, IsSpecialization<C, std::map>, @@ -123,7 +123,7 @@ typename C::hasher, typename C::key_equal, typename C::allocator_type>> {}; template <typename C, template <typename...> class T> -using IsBaseOfSpecialization = IsBaseOfSpecializationImpl<absl::decay_t<C>, T>; +using IsBaseOfSpecialization = IsBaseOfSpecializationImpl<std::decay_t<C>, T>; template <typename C> struct IsBaseOfArrayImpl : std::false_type {}; @@ -131,18 +131,18 @@ struct IsBaseOfArrayImpl<A<T, N>> : std::is_base_of<A<T, N>, std::array<T, N>> { }; template <typename C> -using IsBaseOfArray = IsBaseOfArrayImpl<absl::decay_t<C>>; +using IsBaseOfArray = IsBaseOfArrayImpl<std::decay_t<C>>; template <typename C> struct IsBaseOfBitsetImpl : std::false_type {}; template <template <size_t> class B, size_t N> struct IsBaseOfBitsetImpl<B<N>> : std::is_base_of<B<N>, std::bitset<N>> {}; template <typename C> -using IsBaseOfBitset = IsBaseOfBitsetImpl<absl::decay_t<C>>; +using IsBaseOfBitset = IsBaseOfBitsetImpl<std::decay_t<C>>; template <typename C> struct IsBaseOfSTLContainer - : absl::disjunction<IsBaseOfArray<C>, IsBaseOfBitset<C>, + : std::disjunction<IsBaseOfArray<C>, IsBaseOfBitset<C>, IsBaseOfSpecialization<C, std::deque>, IsBaseOfSpecialization<C, std::forward_list>, IsBaseOfSpecialization<C, std::list>, @@ -201,7 +201,7 @@ typename C::allocator_type>> {}; template <typename C, template <typename...> class T> using IsConvertibleToSpecialization = - IsConvertibleToSpecializationImpl<absl::decay_t<C>, T>; + IsConvertibleToSpecializationImpl<std::decay_t<C>, T>; template <typename C> struct IsConvertibleToArrayImpl : std::false_type {}; @@ -209,7 +209,7 @@ struct IsConvertibleToArrayImpl<A<T, N>> : std::is_convertible<A<T, N>, std::array<T, N>> {}; template <typename C> -using IsConvertibleToArray = IsConvertibleToArrayImpl<absl::decay_t<C>>; +using IsConvertibleToArray = IsConvertibleToArrayImpl<std::decay_t<C>>; template <typename C> struct IsConvertibleToBitsetImpl : std::false_type {}; @@ -217,11 +217,11 @@ struct IsConvertibleToBitsetImpl<B<N>> : std::is_convertible<B<N>, std::bitset<N>> {}; template <typename C> -using IsConvertibleToBitset = IsConvertibleToBitsetImpl<absl::decay_t<C>>; +using IsConvertibleToBitset = IsConvertibleToBitsetImpl<std::decay_t<C>>; template <typename C> struct IsConvertibleToSTLContainer - : absl::disjunction< + : std::disjunction< IsConvertibleToArray<C>, IsConvertibleToBitset<C>, IsConvertibleToSpecialization<C, std::deque>, IsConvertibleToSpecialization<C, std::forward_list>, @@ -238,7 +238,7 @@ template <typename C> struct IsStrictlyBaseOfAndConvertibleToSTLContainer - : absl::conjunction<absl::negation<IsSTLContainer<C>>, + : std::conjunction<std::negation<IsSTLContainer<C>>, IsBaseOfSTLContainer<C>, IsConvertibleToSTLContainer<C>> {};
diff --git a/absl/strings/internal/str_format/arg.h b/absl/strings/internal/str_format/arg.h index 021013f..884c8a7 100644 --- a/absl/strings/internal/str_format/arg.h +++ b/absl/strings/internal/str_format/arg.h
@@ -133,9 +133,9 @@ std::declval<const FormatConversionSpec&>(), std::declval<FormatSink*>())) { using FormatConversionSpecT = - absl::enable_if_t<sizeof(const T& (*)()) != 0, FormatConversionSpec>; + std::enable_if_t<sizeof(const T& (*)()) != 0, FormatConversionSpec>; using FormatSinkT = - absl::enable_if_t<sizeof(const T& (*)()) != 0, FormatSink>; + std::enable_if_t<sizeof(const T& (*)()) != 0, FormatSink>; auto fcs = conv.Wrap<FormatConversionSpecT>(); auto fs = sink->Wrap<FormatSinkT>(); return AbslFormatConvert(v, fcs, &fs); @@ -150,7 +150,7 @@ IntegralConvertResult> { if (conv.conversion_char() == FormatConversionCharInternal::v) { using FormatSinkT = - absl::enable_if_t<sizeof(const T& (*)()) != 0, FormatSink>; + std::enable_if_t<sizeof(const T& (*)()) != 0, FormatSink>; auto fs = sink->Wrap<FormatSinkT>(); AbslStringify(fs, v); return {true}; @@ -169,7 +169,7 @@ std::declval<FormatSink&>(), v))>::value, ArgConvertResult<FormatConversionCharSetInternal::v>> { using FormatSinkT = - absl::enable_if_t<sizeof(const T& (*)()) != 0, FormatSink>; + std::enable_if_t<sizeof(const T& (*)()) != 0, FormatSink>; auto fs = sink->Wrap<FormatSinkT>(); AbslStringify(fs, v); return {true}; @@ -381,7 +381,7 @@ static ArgConvertResult<FormatConversionCharSetInternal::n> ConvertHelper( const FormatCountCapture& v, FormatConversionSpecImpl conv, FormatSinkImpl* sink) { - const absl::enable_if_t<sizeof(T) != 0, FormatCountCapture>& v2 = v; + const std::enable_if_t<sizeof(T) != 0, FormatCountCapture>& v2 = v; if (conv.conversion_char() != str_format_internal::FormatConversionCharInternal::n) {
diff --git a/absl/strings/internal/str_format/float_conversion.cc b/absl/strings/internal/str_format/float_conversion.cc index 89275d4..265c53d 100644 --- a/absl/strings/internal/str_format/float_conversion.cc +++ b/absl/strings/internal/str_format/float_conversion.cc
@@ -25,6 +25,7 @@ #include <limits> #include <optional> #include <string> +#include <type_traits> #include "absl/base/attributes.h" #include "absl/base/config.h" @@ -100,7 +101,7 @@ // Requires: `0 <= carry <= 9` template <typename Int> inline char MultiplyBy10WithCarry(Int* v, char carry) { - using BiggerInt = absl::conditional_t<sizeof(Int) == 4, uint64_t, uint128>; + using BiggerInt = std::conditional_t<sizeof(Int) == 4, uint64_t, uint128>; BiggerInt tmp = 10 * static_cast<BiggerInt>(*v) + static_cast<BiggerInt>(carry); *v = static_cast<Int>(tmp); @@ -1184,8 +1185,8 @@ template <typename Float> struct Decomposed { using MantissaType = - absl::conditional_t<std::is_same<long double, Float>::value, uint128, - uint64_t>; + std::conditional_t<std::is_same<long double, Float>::value, uint128, + uint64_t>; static_assert(std::numeric_limits<Float>::digits <= sizeof(MantissaType) * 8, ""); MantissaType mantissa;
diff --git a/absl/strings/internal/str_split_internal.h b/absl/strings/internal/str_split_internal.h index 31f1d65..9bda311 100644 --- a/absl/strings/internal/str_split_internal.h +++ b/absl/strings/internal/str_split_internal.h
@@ -224,7 +224,7 @@ template <typename C> struct SplitterIsConvertibleToImpl<C, true, true> - : absl::conjunction< + : std::conjunction< std::is_constructible<typename C::key_type, absl::string_view>, std::is_constructible<typename C::mapped_type, absl::string_view>> {}; @@ -494,7 +494,7 @@ // Inserts the key and an empty value into the map, returning an iterator to // the inserted item. We use emplace() if available, otherwise insert(). template <typename M> - static absl::enable_if_t<HasEmplace<M>::value, iterator> InsertOrEmplace( + static std::enable_if_t<HasEmplace<M>::value, iterator> InsertOrEmplace( M* m, absl::string_view key) { // Use piecewise_construct to support old versions of gcc in which pair // constructor can't otherwise construct string from string_view. @@ -502,7 +502,7 @@ std::tuple<>())); } template <typename M> - static absl::enable_if_t<!HasEmplace<M>::value, iterator> InsertOrEmplace( + static std::enable_if_t<!HasEmplace<M>::value, iterator> InsertOrEmplace( M* m, absl::string_view key) { return ToIter(m->insert(std::make_pair(First(key), Second("")))); }
diff --git a/absl/strings/internal/string_constant_test.cc b/absl/strings/internal/string_constant_test.cc index 392833c..c8b3591 100644 --- a/absl/strings/internal/string_constant_test.cc +++ b/absl/strings/internal/string_constant_test.cc
@@ -14,7 +14,8 @@ #include "absl/strings/internal/string_constant.h" -#include "absl/meta/type_traits.h" +#include <type_traits> + #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -34,10 +35,10 @@ EXPECT_TRUE(std::is_empty<T>::value); EXPECT_TRUE(std::is_trivial<T>::value); - EXPECT_TRUE(absl::is_trivially_default_constructible<T>::value); - EXPECT_TRUE(absl::is_trivially_copy_constructible<T>::value); - EXPECT_TRUE(absl::is_trivially_move_constructible<T>::value); - EXPECT_TRUE(absl::is_trivially_destructible<T>::value); + EXPECT_TRUE(std::is_trivially_default_constructible<T>::value); + EXPECT_TRUE(std::is_trivially_copy_constructible<T>::value); + EXPECT_TRUE(std::is_trivially_move_constructible<T>::value); + EXPECT_TRUE(std::is_trivially_destructible<T>::value); } TEST(StringConstant, MakeFromCallable) {
diff --git a/absl/types/compare.h b/absl/types/compare.h index edf1039..abc8616 100644 --- a/absl/types/compare.h +++ b/absl/types/compare.h
@@ -449,7 +449,7 @@ // or three-way comparator. // SFINAE prevents implicit conversions to bool (such as from int). template <typename BoolT, - absl::enable_if_t<std::is_same<bool, BoolT>::value, int> = 0> + std::enable_if_t<std::is_same<bool, BoolT>::value, int> = 0> constexpr bool compare_result_as_less_than(const BoolT r) { return r; } @@ -467,7 +467,7 @@ // three-way comparator. // SFINAE prevents implicit conversions to int (such as from bool). template <typename Int, - absl::enable_if_t<std::is_same<int, Int>::value, int> = 0> + std::enable_if_t<std::is_same<int, Int>::value, int> = 0> constexpr absl::weak_ordering compare_result_as_ordering(const Int c) { return c < 0 ? absl::weak_ordering::less : c == 0 ? absl::weak_ordering::equivalent @@ -479,7 +479,7 @@ } template <typename Compare, typename K, typename LK, - absl::enable_if_t< + std::enable_if_t< !std::is_same< bool, absl::result_of_t<Compare(const K&, const LK&)>>::value, int> = 0> @@ -488,7 +488,7 @@ return compare_result_as_ordering(compare(x, y)); } template <typename Compare, typename K, typename LK, - absl::enable_if_t< + std::enable_if_t< std::is_same< bool, absl::result_of_t<Compare(const K&, const LK&)>>::value, int> = 0>
diff --git a/absl/types/internal/any_span.h b/absl/types/internal/any_span.h index ae26d95..50843bf 100644 --- a/absl/types/internal/any_span.h +++ b/absl/types/internal/any_span.h
@@ -152,7 +152,7 @@ // references to support mutable -> const conversion of spans without additional // indirection. template <typename T> -using GetterFunctionResult = absl::remove_const_t<T>&; +using GetterFunctionResult = std::remove_const_t<T>&; // A type of function pointer that can return an element of a // TransformedContainer. This is used so that we can type-erase with a simple @@ -262,8 +262,8 @@ // Handle mutable -> const conversion. template <typename LazyT = T, typename = typename std::enable_if< std::is_const<LazyT>::value>::type> - explicit Getter(const Getter<absl::remove_const_t<T>>& other) { - using MutableT = absl::remove_const_t<T>; + explicit Getter(const Getter<std::remove_const_t<T>>& other) { + using MutableT = std::remove_const_t<T>; if (other.fun == &ArrayTag<MutableT>) { ABSL_RAW_DCHECK(other.offset == 0u, "offset must be zero"); fun = &ArrayTag<T>;
diff --git a/absl/types/internal/span.h b/absl/types/internal/span.h index 9e8e418..8448cd7 100644 --- a/absl/types/internal/span.h +++ b/absl/types/internal/span.h
@@ -54,7 +54,7 @@ // Detection idioms for size() and data(). template <typename C> using HasSize = - std::is_integral<absl::decay_t<decltype(std::declval<C&>().size())>>; + std::is_integral<std::decay_t<decltype(std::declval<C&>().size())>>; // We want to enable conversion from vector<T*> to Span<const T* const> but // disable conversion from vector<Derived> to Span<Base>. Here we use @@ -64,13 +64,13 @@ // which returns a reference. template <typename T, typename C> using HasData = - std::is_convertible<absl::decay_t<decltype(GetData(std::declval<C&>()))>*, + std::is_convertible<std::decay_t<decltype(GetData(std::declval<C&>()))>*, T* const*>; // Extracts value type from a Container template <typename C> struct ElementType { - using type = typename absl::remove_reference_t<C>::value_type; + using type = typename std::remove_reference_t<C>::value_type; }; template <typename T, size_t N>
diff --git a/absl/types/span.h b/absl/types/span.h index b9f6b74..8c5736c 100644 --- a/absl/types/span.h +++ b/absl/types/span.h
@@ -204,7 +204,7 @@ public: using element_type = T; - using value_type = absl::remove_cv_t<T>; + using value_type = std::remove_cv_t<T>; // TODO(b/316099902) - pointer should be absl_nullable, but this makes it hard // to recognize foreach loops as safe. absl_nullability_unknown is currently // used to suppress -Wnullability-completeness warnings.