diff --git a/absl/algorithm/container.h b/absl/algorithm/container.h index c0b8a10a..1b4ac925 100644 --- a/absl/algorithm/container.h +++ b/absl/algorithm/container.h @@ -1758,7 +1758,7 @@ ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 void c_iota(Sequence& sequence, // accumulation by value. // // Note: Due to a language technicality this function has return type -// absl::decay_t. As a user of this function you can casually read +// std::decay_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 ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 decay_t c_accumulate( @@ -1785,7 +1785,7 @@ ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 decay_t c_accumulate( // to compute the cumulative inner product of container element pairs. // // Note: Due to a language technicality this function has return type -// absl::decay_t. As a user of this function you can casually read +// std::decay_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 ABSL_INTERNAL_CONSTEXPR_SINCE_CXX20 decay_t c_inner_product( diff --git a/absl/base/exception_safety_testing_test.cc b/absl/base/exception_safety_testing_test.cc index 55a6fe1a..fc7e33ee 100644 --- a/absl/base/exception_safety_testing_test.cc +++ b/absl/base/exception_safety_testing_test.cc @@ -945,8 +945,8 @@ TEST(ThrowingValueTraitsTest, RelationalOperators) { } TEST(ThrowingAllocatorTraitsTest, Assignablility) { - EXPECT_TRUE(absl::is_move_assignable>::value); - EXPECT_TRUE(absl::is_copy_assignable>::value); + EXPECT_TRUE(std::is_move_assignable>::value); + EXPECT_TRUE(std::is_copy_assignable>::value); EXPECT_TRUE(std::is_nothrow_move_assignable>::value); EXPECT_TRUE(std::is_nothrow_copy_assignable>::value); } diff --git a/absl/base/internal/exception_safety_testing.h b/absl/base/internal/exception_safety_testing.h index c1061544..aef7641d 100644 --- a/absl/base/internal/exception_safety_testing.h +++ b/absl/base/internal/exception_safety_testing.h @@ -44,22 +44,22 @@ enum class TypeSpec; enum class AllocSpec; constexpr TypeSpec operator|(TypeSpec a, TypeSpec b) { - using T = absl::underlying_type_t; + using T = std::underlying_type_t; return static_cast(static_cast(a) | static_cast(b)); } constexpr TypeSpec operator&(TypeSpec a, TypeSpec b) { - using T = absl::underlying_type_t; + using T = std::underlying_type_t; return static_cast(static_cast(a) & static_cast(b)); } constexpr AllocSpec operator|(AllocSpec a, AllocSpec b) { - using T = absl::underlying_type_t; + using T = std::underlying_type_t; return static_cast(static_cast(a) | static_cast(b)); } constexpr AllocSpec operator&(AllocSpec a, AllocSpec b) { - using T = absl::underlying_type_t; + using T = std::underlying_type_t; return static_cast(static_cast(a) & static_cast(b)); } @@ -842,7 +842,7 @@ class DefaultFactory { template -using EnableIfTestable = typename absl::enable_if_t< +using EnableIfTestable = typename std::enable_if_t< LazyContractsCount != 0 && !std::is_same::value && !std::is_same::value>; @@ -994,7 +994,7 @@ class ExceptionSafetyTestBuilder { * method tester.WithInitialValue(...). */ template - ExceptionSafetyTestBuilder, Operation, Contracts...> + ExceptionSafetyTestBuilder, Operation, Contracts...> WithFactory(const NewFactory& new_factory) const { return {new_factory, operation_, contracts_}; } @@ -1005,7 +1005,7 @@ class ExceptionSafetyTestBuilder { * newly created tester. */ template - ExceptionSafetyTestBuilder, Contracts...> + ExceptionSafetyTestBuilder, Contracts...> WithOperation(const NewOperation& new_operation) const { return {factory_, new_operation, contracts_}; } @@ -1025,11 +1025,11 @@ class ExceptionSafetyTestBuilder { */ template ExceptionSafetyTestBuilder...> + std::decay_t...> WithContracts(const MoreContracts&... more_contracts) const { return { factory_, operation_, - std::tuple_cat(contracts_, std::tuple...>( + std::tuple_cat(contracts_, std::tuple...>( more_contracts...))}; } diff --git a/absl/container/fixed_array.h b/absl/container/fixed_array.h index c51a19f8..e6f1528c 100644 --- a/absl/container/fixed_array.h +++ b/absl/container/fixed_array.h @@ -96,7 +96,7 @@ class ABSL_ATTRIBUTE_WARN_UNUSED FixedArray { absl::allocator_is_nothrow::value; } static constexpr bool DefaultConstructorIsNonTrivial() { - return !absl::is_trivially_default_constructible::value; + return !std::is_trivially_default_constructible::value; } public: @@ -414,14 +414,14 @@ class ABSL_ATTRIBUTE_WARN_UNUSED FixedArray { // error: call to int __builtin___sprintf_chk(etc...) // will always overflow destination buffer [-Werror] // - template , + template , size_t InnerN = std::extent::value> struct StorageElementWrapper { InnerT array[InnerN]; }; using StorageElement = - absl::conditional_t::value, + std::conditional_t::value, StorageElementWrapper, value_type>; static pointer AsValueType(pointer ptr) { return ptr; } @@ -458,7 +458,7 @@ class ABSL_ATTRIBUTE_WARN_UNUSED FixedArray { }; using InlinedStorage = - absl::conditional_t; // Storage diff --git a/absl/container/inlined_vector.h b/absl/container/inlined_vector.h index a9c2526a..c1b5785e 100644 --- a/absl/container/inlined_vector.h +++ b/absl/container/inlined_vector.h @@ -192,7 +192,7 @@ class ABSL_ATTRIBUTE_WARN_UNUSED InlinedVector { // 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 && + if (std::is_trivially_copy_constructible::value && std::is_same>::value && !other.storage_.GetIsAllocated()) { storage_.MemcpyFrom(other.storage_); @@ -857,7 +857,7 @@ class ABSL_ATTRIBUTE_WARN_UNUSED InlinedVector { // 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, ""); + static_assert(std::is_trivially_destructible::value, ""); static_assert(std::is_same>::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 ed541e75..0fc77f8e 100644 --- a/absl/container/internal/btree.h +++ b/absl/container/internal/btree.h @@ -231,7 +231,7 @@ struct key_compare_adapter { explicit operator Compare() const { return comp(); } template >::value, int> = 0> bool operator()(const T &lhs, const U &rhs) const { @@ -247,7 +247,7 @@ struct key_compare_adapter { template < typename T, typename U, - absl::enable_if_t, + std::enable_if_t, absl::weak_ordering>::value, int> = 0> absl::weak_ordering operator()(const T &lhs, const U &rhs) const { @@ -270,7 +270,7 @@ struct key_compare_adapter { return lhs_comp_rhs; } }; - using type = absl::conditional_t< + using type = std::conditional_t< std::is_base_of::value, Compare, checked_compare>; }; @@ -377,7 +377,7 @@ struct common_params : common_policy_traits { // this, then there will be cascading compilation failures that are confusing // for users. using key_compare = - absl::conditional_t(), + std::conditional_t(), Compare, typename key_compare_adapter::type>; @@ -406,7 +406,7 @@ struct common_params : common_policy_traits { using const_reference = const value_type &; using value_compare = - absl::conditional_t, original_key_compare>; using is_map_container = std::integral_constant; @@ -438,7 +438,7 @@ struct common_params : common_policy_traits { // 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::max)()), uint16_t, uint8_t>; // NOLINT }; @@ -1119,7 +1119,7 @@ class btree_iterator : private btree_iterator_generation_info { 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, btree_iterator>; @@ -1146,7 +1146,7 @@ class btree_iterator : private btree_iterator_generation_info { // const_iterator, but it specifically avoids hiding the copy constructor so // that the trivial one will be used when possible. template , iterator>::value && std::is_same::value, int> = 0> @@ -1252,7 +1252,7 @@ class btree_iterator : private btree_iterator_generation_info { // NOTE: the const_cast is safe because this constructor is only called by // non-const methods and the container owns the nodes. template , const_iterator>::value && std::is_same::value, int> = 0> diff --git a/absl/container/internal/btree_container.h b/absl/container/internal/btree_container.h index 0ccf9d06..c11620db 100644 --- a/absl/container/internal/btree_container.h +++ b/absl/container/internal/btree_container.h @@ -412,8 +412,8 @@ class btree_set_container : public btree_container { // `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, std::is_same, std::is_same { template < typename T, - typename absl::enable_if_t< - absl::conjunction< + typename std::enable_if_t< + std::conjunction< std::is_same, std::is_same, std::is_same { typename Tree::params_type::mapped_type, M>>; template using LifetimeBoundKV = - absl::conjunction>, + std::conjunction>, LifetimeBoundV>; public: @@ -824,8 +824,8 @@ class btree_multiset_container : public btree_container { // 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, std::is_same, std::is_same { template < typename T, - typename absl::enable_if_t< - absl::conjunction< + typename std::enable_if_t< + std::conjunction< std::is_same, std::is_same, std::is_same using EnableIf = std::enable_if_t; template -using HasValue = std::conditional_t>; +using HasValue = std::conditional_t>; template struct IfRRef { diff --git a/absl/container/internal/common_policy_traits.h b/absl/container/internal/common_policy_traits.h index 86e038e1..3b0d5051 100644 --- a/absl/container/internal/common_policy_traits.h +++ b/absl/container/internal/common_policy_traits.h @@ -81,7 +81,7 @@ struct common_policy_traits { // 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 - static auto element(absl::remove_const_t* slot) + static auto element(std::remove_const_t* 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 2dd8d6c3..9d5c0555 100644 --- a/absl/container/internal/compressed_tuple.h +++ b/absl/container/internal/compressed_tuple.h @@ -166,7 +166,7 @@ struct TupleMoveConstructible : std::false_type {}; template struct TupleMoveConstructible, Vs...> : std::integral_constant< - bool, absl::conjunction< + bool, std::conjunction< TupleElementMoveConstructible...>::value> {}; template @@ -227,11 +227,11 @@ class ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple : CompressedTuple::CompressedTupleImpl(absl::in_place, base...) {} template )>>, + std::negation)>>, internal_compressed_tuple::TupleItemsMoveConstructible< CompressedTuple, First, Vs...>>::value, bool> = true> diff --git a/absl/container/internal/container_memory.h b/absl/container/internal/container_memory.h index 47064a74..dcf0bd27 100644 --- a/absl/container/internal/container_memory.h +++ b/absl/container/internal/container_memory.h @@ -350,11 +350,11 @@ union map_slot_type { ~map_slot_type() = delete; using value_type = std::pair; using mutable_value_type = - std::pair, absl::remove_const_t>; + std::pair, std::remove_const_t>; value_type value; mutable_value_type mutable_value; - absl::remove_const_t key; + std::remove_const_t key; }; template @@ -362,7 +362,7 @@ struct map_slot_policy { using slot_type = map_slot_type; using value_type = std::pair; using mutable_value_type = - std::pair, absl::remove_const_t>; + std::pair, std::remove_const_t>; 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 82eed2a9..7f5f8928 100644 --- a/absl/container/internal/hash_policy_traits.h +++ b/absl/container/internal/hash_policy_traits.h @@ -38,7 +38,7 @@ struct hash_policy_traits : common_policy_traits { private: struct ReturnKey { template ::value, int> = 0> + std::enable_if_t::value, int> = 0> static key_type& Impl(Key&& k, int) { return *std::launder( const_cast(std::addressof(std::forward(k)))); diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h index c7b709f3..42878ac4 100644 --- a/absl/container/internal/inlined_vector.h +++ b/absl/container/internal/inlined_vector.h @@ -79,7 +79,7 @@ using IsSwapOk = absl::type_traits_internal::IsSwappable>; template >::value && + std::is_trivially_destructible>::value && std::is_same>>::value> struct DestroyAdapter; @@ -288,14 +288,14 @@ class Storage { 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_destructible>, + std::conjunction>, + std::is_trivially_destructible>, std::is_same>>>::value, MemcpyPolicy, // Otherwise we use move assignment if possible. If not, we simulate @@ -304,21 +304,21 @@ class Storage { // 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::value, ElementwiseAssignPolicy, + std::conditional_t::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>, + std::conjunction>, std::is_same>>>::value, MemcpyPolicy, - absl::conditional_t::value, ElementwiseSwapPolicy, + std::conditional_t::value, ElementwiseSwapPolicy, ElementwiseConstructPolicy>>; static SizeType NextCapacity(SizeType current_capacity) { @@ -348,7 +348,7 @@ class Storage { // 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>::value && + if (std::is_trivially_destructible>::value && std::is_same>>::value) { DeallocateIfAllocated(); return; @@ -507,11 +507,11 @@ class Storage { // First case above absl::is_trivially_relocatable::value || // Second case above - (absl::is_trivially_move_assignable::value && - absl::is_trivially_destructible::value) || + (std::is_trivially_move_assignable::value && + std::is_trivially_destructible::value) || // Third case above - (absl::is_trivially_copy_constructible::value || - absl::is_trivially_copy_assignable::value)))); + (std::is_trivially_copy_constructible::value || + std::is_trivially_copy_assignable::value)))); } GetSizeAndIsAllocated() = other_storage.GetSizeAndIsAllocated(); @@ -596,7 +596,7 @@ void Storage::InitFrom(const Storage& other) { // 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>::value && + if (std::is_trivially_copy_constructible>::value && std::is_same>>::value) { std::memcpy(reinterpret_cast(dst), reinterpret_cast(src), n * sizeof(ValueType)); diff --git a/absl/container/internal/layout.h b/absl/container/internal/layout.h index 58c8d4f1..f49d272a 100644 --- a/absl/container/internal/layout.h +++ b/absl/container/internal/layout.h @@ -261,7 +261,7 @@ struct AlignOf> { // Does `Ts...` contain `T`? template -using Contains = absl::disjunction...>; +using Contains = std::disjunction...>; template using CopyConst = @@ -352,7 +352,7 @@ class LayoutImpl< absl::index_sequence> { private: static_assert(sizeof...(Elements) > 0, "At least one field is required"); - static_assert(absl::conjunction...>::value, + static_assert(std::conjunction...>::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 20b622b4..25ed1191 100644 --- a/absl/container/internal/raw_hash_map.h +++ b/absl/container/internal/raw_hash_map.h @@ -88,7 +88,7 @@ class raw_hash_map : public raw_hash_set { typename Policy::mapped_type, V>>; template using LifetimeBoundKV = - absl::conjunction>, + std::conjunction>, LifetimeBoundV>; public: diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index 1a9fa1d1..805ea303 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h @@ -1930,7 +1930,7 @@ class raw_hash_set { // An enabler for insert(T&&): T must be convertible to init_type or be the // same as [cv] value_type [ref]. template - using Insertable = absl::disjunction< + using Insertable = std::disjunction< std::is_same, absl::remove_cvref_t>, std::is_convertible>; template @@ -1970,9 +1970,9 @@ class raw_hash_set { using iterator_category = std::forward_iterator_tag; using value_type = typename raw_hash_set::value_type; using reference = - absl::conditional_t; - using pointer = absl::remove_reference_t*; + using pointer = std::remove_reference_t*; 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 285d8424..e26b2ada 100644 --- a/absl/flags/internal/flag.h +++ b/absl/flags/internal/flag.h @@ -608,7 +608,7 @@ class FlagImpl final : public CommandLineFlag { *value = ReadOneBool(); } template () == + std::enable_if_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 6dd72b6e..4ba4fe3e 100644 --- a/absl/functional/any_invocable.h +++ b/absl/functional/any_invocable.h @@ -191,7 +191,7 @@ class ABSL_NULLABILITY_COMPATIBLE ABSL_ATTRIBUTE_OWNER AnyInvocable // 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 ::value>> AnyInvocable(F&& f) // NOLINT : Impl(internal_any_invocable::ConversionConstruct(), @@ -206,25 +206,25 @@ class ABSL_NULLABILITY_COMPATIBLE ABSL_ATTRIBUTE_OWNER AnyInvocable // absl::in_place_type, arg1, arg2); // template ::value>> explicit AnyInvocable(absl::in_place_type_t, Args&&... args) - : Impl(absl::in_place_type>, + : Impl(absl::in_place_type>, std::forward(args)...) { - static_assert(std::is_same>::value, + static_assert(std::is_same>::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 &, Args...>::value>> explicit AnyInvocable(absl::in_place_type_t, std::initializer_list ilist, Args&&... args) - : Impl(absl::in_place_type>, ilist, + : Impl(absl::in_place_type>, ilist, std::forward(args)...) { - static_assert(std::is_same>::value, + static_assert(std::is_same>::value, "The explicit template argument of in_place_type is required " "to be an unqualified object type."); } @@ -248,7 +248,7 @@ class ABSL_NULLABILITY_COMPATIBLE ABSL_ATTRIBUTE_OWNER AnyInvocable // 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 ::value>> AnyInvocable& operator=(F&& f) { *this = AnyInvocable(std::forward(f)); @@ -260,7 +260,7 @@ class ABSL_NULLABILITY_COMPATIBLE ABSL_ATTRIBUTE_OWNER AnyInvocable // `AnyInvocable` instance. template < class F, - typename = absl::enable_if_t< + typename = std::enable_if_t< internal_any_invocable::CanAssignReferenceWrapper::value>> AnyInvocable& operator=(std::reference_wrapper f) noexcept { *this = AnyInvocable(f); diff --git a/absl/functional/any_invocable_test.cc b/absl/functional/any_invocable_test.cc index 7ddfcaba..9c5068a4 100644 --- a/absl/functional/any_invocable_test.cc +++ b/absl/functional/any_invocable_test.cc @@ -41,7 +41,7 @@ struct _ {}; template struct Wrapper { template ::value>> + class = std::enable_if_t::value>> Wrapper(U&&); // NOLINT }; @@ -58,7 +58,7 @@ template struct QualifiersForThisImpl { static_assert(std::is_object::value, ""); using type = - absl::conditional_t::value, const This, This>&; + std::conditional_t::value, const This, This>&; }; template @@ -69,7 +69,7 @@ template struct QualifiersForThisImpl { static_assert(std::is_object::value, ""); using type = - absl::conditional_t::value, const This, This>&&; + std::conditional_t::value, const This, This>&&; }; template @@ -84,38 +84,38 @@ struct GiveQualifiersToFunImpl; template struct GiveQualifiersToFunImpl { using type = - absl::conditional_t::value, R(P...) const, R(P...)>; + std::conditional_t::value, R(P...) const, R(P...)>; }; template struct GiveQualifiersToFunImpl { using type = - absl::conditional_t::value, R(P...) const&, R(P...)&>; + std::conditional_t::value, R(P...) const&, R(P...)&>; }; template struct GiveQualifiersToFunImpl { using type = - absl::conditional_t::value, R(P...) const&&, R(P...) &&>; + std::conditional_t::value, R(P...) const&&, R(P...) &&>; }; template struct GiveQualifiersToFunImpl { - using type = absl::conditional_t::value, + using type = std::conditional_t::value, R(P...) const noexcept, R(P...) noexcept>; }; template struct GiveQualifiersToFunImpl { using type = - absl::conditional_t::value, R(P...) const & noexcept, + std::conditional_t::value, R(P...) const & noexcept, R(P...) & noexcept>; }; template struct GiveQualifiersToFunImpl { using type = - absl::conditional_t::value, R(P...) const && noexcept, + std::conditional_t::value, R(P...) const && noexcept, R(P...) && noexcept>; }; @@ -367,14 +367,14 @@ struct TestParams { } using CompatibleAnyInvocableFunType = - absl::conditional_t::value, + std::conditional_t::value, GiveQualifiersToFun, GiveQualifiersToFun>; using CompatibleAnyInvType = AnyInvocable; using IncompatibleInvocable = - absl::conditional_t::value, + std::conditional_t::value, GiveQualifiersToFun<_&, UnqualifiedFunType>(_::*), GiveQualifiersToFun<_&&, UnqualifiedFunType>(_::*)>; }; @@ -1284,7 +1284,7 @@ TYPED_TEST_P(AnyInvTestNonRvalue, NonMoveableResultType) { // Just like plain functors, it should work fine to use an AnyInvocable that // returns the non-moveable type. using UnqualifiedFun = - absl::conditional_t; + std::conditional_t; using Fun = GiveQualifiersToFun; @@ -1364,7 +1364,7 @@ TYPED_TEST_P(AnyInvTestRvalue, NonMoveableResultType) { // Just like plain functors, it should work fine to use an AnyInvocable that // returns the non-moveable type. using UnqualifiedFun = - absl::conditional_t; + std::conditional_t; using Fun = GiveQualifiersToFun; diff --git a/absl/functional/internal/any_invocable.h b/absl/functional/internal/any_invocable.h index 597c2106..66168c65 100644 --- a/absl/functional/internal/any_invocable.h +++ b/absl/functional/internal/any_invocable.h @@ -611,39 +611,39 @@ using TrueAlias = /*SFINAE constraints for the conversion-constructor.*/ template , AnyInvocable>::value>> using CanConvert = TrueAlias< - absl::enable_if_t>::value>, - absl::enable_if_t::template CallIsValid::value>, - absl::enable_if_t< + std::enable_if_t>::value>, + std::enable_if_t::template CallIsValid::value>, + std::enable_if_t< Impl::template CallIsNoexceptIfSigIsNoexcept::value>, - absl::enable_if_t, F>::value>>; + std::enable_if_t, F>::value>>; /*SFINAE constraints for the std::in_place constructors.*/ template using CanEmplace = TrueAlias< - absl::enable_if_t::template CallIsValid::value>, - absl::enable_if_t< + std::enable_if_t::template CallIsValid::value>, + std::enable_if_t< Impl::template CallIsNoexceptIfSigIsNoexcept::value>, - absl::enable_if_t, Args...>::value>>; + std::enable_if_t, Args...>::value>>; /*SFINAE constraints for the conversion-assign operator.*/ template , AnyInvocable>::value>> using CanAssign = TrueAlias< - absl::enable_if_t::template CallIsValid::value>, - absl::enable_if_t< + std::enable_if_t::template CallIsValid::value>, + std::enable_if_t< Impl::template CallIsNoexceptIfSigIsNoexcept::value>, - absl::enable_if_t, F>::value>>; + std::enable_if_t, F>::value>>; /*SFINAE constraints for the reference-wrapper conversion-assign operator.*/ template using CanAssignReferenceWrapper = TrueAlias< - absl::enable_if_t< + std::enable_if_t< Impl::template CallIsValid>::value>, - absl::enable_if_t::template CallIsNoexceptIfSigIsNoexcept< + std::enable_if_t::template CallIsNoexceptIfSigIsNoexcept< std::reference_wrapper>::value>>; // The constraint for checking whether or not a call meets the noexcept @@ -657,17 +657,17 @@ using CanAssignReferenceWrapper = TrueAlias< // 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> inv_quals, \ + ReturnType, UnwrapStdReferenceWrapper> inv_quals, \ P...>, \ std::conjunction< \ std::is_nothrow_invocable< \ - UnwrapStdReferenceWrapper> inv_quals, P...>, \ + UnwrapStdReferenceWrapper> inv_quals, P...>, \ std::is_same< \ ReturnType, \ std::invoke_result_t< \ - UnwrapStdReferenceWrapper> inv_quals, \ + UnwrapStdReferenceWrapper> inv_quals, \ P...>>>>::value> #define ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT_false(inv_quals) @@ -696,11 +696,11 @@ using CanAssignReferenceWrapper = TrueAlias< \ /*SFINAE constraint to check if F is invocable with the proper signature*/ \ template \ - using CallIsValid = TrueAlias inv_quals, P...>, \ + using CallIsValid = TrueAlias inv_quals, P...>, \ std::is_same< \ ReturnType, \ - std::invoke_result_t inv_quals, P...>>>::value>>; \ + std::invoke_result_t inv_quals, P...>>>::value>>; \ \ /*SFINAE constraint to check if F is nothrow-invocable when necessary*/ \ template \ @@ -723,7 +723,7 @@ using CanAssignReferenceWrapper = TrueAlias< /*Forward along the in-place construction parameters.*/ \ template \ explicit Impl(absl::in_place_type_t, Args&&... args) \ - : Core(absl::in_place_type inv_quals>, \ + : Core(absl::in_place_type inv_quals>, \ std::forward(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 62f373f0..e06aaba0 100644 --- a/absl/functional/internal/front_binder.h +++ b/absl/functional/internal/front_binder.h @@ -84,7 +84,7 @@ class FrontBinder { }; template -using bind_front_t = FrontBinder, absl::decay_t...>; +using bind_front_t = FrontBinder, std::decay_t...>; } // namespace functional_internal ABSL_NAMESPACE_END diff --git a/absl/functional/internal/function_ref.h b/absl/functional/internal/function_ref.h index 543b30f6..46147e97 100644 --- a/absl/functional/internal/function_ref.h +++ b/absl/functional/internal/function_ref.h @@ -47,8 +47,8 @@ struct PassByValue : std::false_type {}; template struct PassByValue : std::integral_constant::value && - absl::is_trivially_copy_assignable< + std::is_trivially_copy_constructible::value && + std::is_trivially_copy_assignable< typename std::remove_cv::type>::value && std::is_trivially_destructible::value && sizeof(T) <= 2 * sizeof(void*)> {}; diff --git a/absl/hash/hash.h b/absl/hash/hash.h index 23f4e9d3..e2bde0c8 100644 --- a/absl/hash/hash.h +++ b/absl/hash/hash.h @@ -329,7 +329,7 @@ class HashState : public hash_internal::HashStateBase { // users should not define their own HashState types. template < typename T, - absl::enable_if_t< + std::enable_if_t< std::is_base_of, 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 039515ad..e83fcae1 100644 --- a/absl/hash/hash_test.cc +++ b/absl/hash/hash_test.cc @@ -803,8 +803,8 @@ TEST(IsHashableTest, ValidHash) { EXPECT_TRUE(std::is_default_constructible>::value); EXPECT_TRUE(std::is_copy_constructible>::value); EXPECT_TRUE(std::is_move_constructible>::value); - EXPECT_TRUE(absl::is_copy_assignable>::value); - EXPECT_TRUE(absl::is_move_assignable>::value); + EXPECT_TRUE(std::is_copy_assignable>::value); + EXPECT_TRUE(std::is_move_assignable>::value); EXPECT_TRUE(IsHashCallable::value); EXPECT_TRUE(IsAggregateInitializable>::value); } @@ -815,8 +815,8 @@ TEST(IsHashableTest, PoisonHash) { EXPECT_FALSE(std::is_default_constructible>::value); EXPECT_FALSE(std::is_copy_constructible>::value); EXPECT_FALSE(std::is_move_constructible>::value); - EXPECT_FALSE(absl::is_copy_assignable>::value); - EXPECT_FALSE(absl::is_move_assignable>::value); + EXPECT_FALSE(std::is_copy_assignable>::value); + EXPECT_FALSE(std::is_move_assignable>::value); EXPECT_FALSE(IsHashCallable::value); #if !defined(__GNUC__) || defined(__clang__) // TODO(b/144368551): As of GCC 8.4 this does not compile. @@ -891,7 +891,7 @@ struct CustomHashType { template struct EnableIfContained - : std::enable_if...>::value> {}; template < diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h index a6c83133..620fd223 100644 --- a/absl/hash/internal/hash.h +++ b/absl/hash/internal/hash.h @@ -404,7 +404,7 @@ struct HashWithSeed { // Convenience function that combines `hash_state` with the byte representation // of `value`. template ::value, int> = 0> + std::enable_if_t::value, int> = 0> H hash_bytes(H hash_state, const T& value) { const unsigned char* start = reinterpret_cast(&value); uint64_t v; @@ -421,7 +421,7 @@ H hash_bytes(H hash_state, const T& value) { return CombineRaw()(std::move(hash_state), v); } template ::value, int> = 0> + std::enable_if_t::value, int> = 0> H hash_bytes(H hash_state, const T& value) { const unsigned char* start = reinterpret_cast(&value); return H::combine_contiguous(std::move(hash_state), start, sizeof(value)); @@ -601,7 +601,7 @@ template // for now. H #else // _MSC_VER -typename std::enable_if...>::value, H>::type +typename std::enable_if...>::value, H>::type #endif // _MSC_VER AbslHashValue(H hash_state, const std::tuple& t) { return hash_internal::hash_tuple(std::move(hash_state), t, @@ -650,7 +650,7 @@ H AbslHashValue(H hash_state, absl::string_view str) { // Support std::wstring, std::u16string and std::u32string. template ::value || + typename = std::enable_if_t::value || std::is_same::value || std::is_same::value>> H AbslHashValue( @@ -661,7 +661,7 @@ H AbslHashValue( // Support std::wstring_view, std::u16string_view and std::u32string_view. template ::value || + typename = std::enable_if_t::value || std::is_same::value || std::is_same::value>> H AbslHashValue(H hash_state, std::basic_string_view str) { @@ -680,7 +680,7 @@ H AbslHashValue(H hash_state, std::basic_string_view str) { // Support std::filesystem::path. The SFINAE is required because some string // types are implicitly convertible to std::filesystem::path. template >> 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 HashSelect { struct UniquelyRepresentedProbe { template static auto Invoke(H state, const T& value) - -> absl::enable_if_t::value, H> { + -> std::enable_if_t::value, H> { return hash_internal::hash_bytes(std::move(state), value); } }; struct HashValueProbe { template - 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::value, H> { @@ -1317,7 +1317,7 @@ struct HashSelect { struct LegacyHashProbe { #if ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ template - 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()(value)), size_t>::value, @@ -1332,7 +1332,7 @@ struct HashSelect { struct StdHashProbe { template static auto Invoke(H state, const T& value) - -> absl::enable_if_t::value, H> { + -> std::enable_if_t::value, H> { return hash_internal::hash_bytes(std::move(state), std::hash{}(value)); } }; @@ -1354,7 +1354,7 @@ struct HashSelect { // Probe each implementation in order. // disjunction provides short circuiting wrt instantiation. template - using Apply = absl::disjunction< // + using Apply = std::disjunction< // Probe, // Probe, // Probe, // @@ -1399,13 +1399,13 @@ class ABSL_DLL MixingHashState : public HashStateBase { // 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 ::value, int> = 0> + template ::value, int> = 0> static size_t hash_with_seed(T value, size_t seed) { return static_cast( CombineRawImpl(seed, static_cast>(value))); } - template ::value, int> = 0> + template ::value, int> = 0> static size_t hash_with_seed(const T& value, size_t seed) { return static_cast(combine(MixingHashState{seed}, value).state_); } @@ -1527,7 +1527,7 @@ struct HashImpl { template struct Hash - : absl::conditional_t::value, HashImpl, PoisonedHash> {}; + : std::conditional_t::value, HashImpl, PoisonedHash> {}; template template diff --git a/absl/hash/internal/spy_hash_state.h b/absl/hash/internal/spy_hash_state.h index 80c97679..0eb9ffe4 100644 --- a/absl/hash/internal/spy_hash_state.h +++ b/absl/hash/internal/spy_hash_state.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "absl/hash/hash.h" @@ -269,7 +270,7 @@ bool RunOnStartup::run = (f(), true); template < typename T, typename U, // Only trigger for when (T != U), - typename = absl::enable_if_t::value>, + typename = std::enable_if_t::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 f0f7aea1..bc5d654f 100644 --- a/absl/memory/memory.h +++ b/absl/memory/memory.h @@ -134,7 +134,7 @@ typename memory_internal::MakeUniqueResult::scalar template typename memory_internal::MakeUniqueResult::array make_unique_for_overwrite(size_t n) { - return std::unique_ptr(new typename absl::remove_extent_t[n]); + return std::unique_ptr(new typename std::remove_extent_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 2c651f2a..7fc4eb78 100644 --- a/absl/meta/type_traits.h +++ b/absl/meta/type_traits.h @@ -218,7 +218,7 @@ struct IsHashable : std::false_type {}; template struct IsHashable< Key, - absl::enable_if_t&>()(std::declval())), std::size_t>::value>> : std::true_type {}; @@ -243,7 +243,7 @@ struct AssertHashEnabledHelper { static_assert( std::is_copy_constructible>::value, "std::hash must be copy constructible when it is enabled"); - static_assert(absl::is_copy_assignable>::value, + static_assert(std::is_copy_assignable>::value, "std::hash 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 @@ struct IsNothrowSwappable // // Performs the swap idiom from a namespace where valid candidates may only be // found in `std` or via ADL. -template ::value, int> = 0> +template ::value, int> = 0> void Swap(T& lhs, T& rhs) noexcept(IsNothrowSwappable::value) { swap(lhs, rhs); } @@ -475,7 +475,7 @@ template struct IsOwnerImpl< T, std::enable_if_t::value>> - : absl::negation {}; + : std::negation {}; // 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 @@ struct IsView> : std::true_type {}; // 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 -using IsLifetimeBoundAssignment = absl::conjunction< +using IsLifetimeBoundAssignment = std::conjunction< std::integral_constant::value>, IsOwner>, IsView>>; diff --git a/absl/meta/type_traits_test.cc b/absl/meta/type_traits_test.cc index 9a8262d8..6d0085c9 100644 --- a/absl/meta/type_traits_test.cc +++ b/absl/meta/type_traits_test.cc @@ -33,8 +33,8 @@ using ::testing::StaticAssertTypeEq; template using IsOwnerAndNotView = - absl::conjunction, - absl::negation>>; + std::conjunction, + std::negation>>; static_assert( IsOwnerAndNotView, std::string>>::value, @@ -70,13 +70,13 @@ struct StructC {}; struct TypeWithBarFunction { template ::value, int> = 0> + std::enable_if_t::value, int> = 0> ReturnType bar(T&&, const StructB&, StructC&&) &&; // NOLINT }; struct TypeWithBarFunctionAndConvertibleReturnType { template ::value, int> = 0> + std::enable_if_t::value, int> = 0> ConvertibleToReturnType bar(T&&, const StructB&, StructC&&) &&; // NOLINT }; @@ -160,19 +160,19 @@ enum class TypeEnum { A, B, C, D }; struct GetTypeT { template ::value, int> = 0> + std::enable_if_t::value, int> = 0> TypeEnum operator()(Wrap) const { return TypeEnum::A; } template ::value, int> = 0> + std::enable_if_t::value, int> = 0> TypeEnum operator()(Wrap) const { return TypeEnum::B; } template ::value, int> = 0> + std::enable_if_t::value, int> = 0> TypeEnum operator()(Wrap) const { return TypeEnum::C; } diff --git a/absl/numeric/int128_test.cc b/absl/numeric/int128_test.cc index 77ee63c4..336db78f 100644 --- a/absl/numeric/int128_test.cc +++ b/absl/numeric/int128_test.cc @@ -93,11 +93,11 @@ TEST(Uint128, IntrinsicTypeTraitsTest) { #endif // ABSL_HAVE_INTRINSIC_INT128 TEST(Uint128, TrivialTraitsTest) { - static_assert(absl::is_trivially_default_constructible::value, + static_assert(std::is_trivially_default_constructible::value, ""); - static_assert(absl::is_trivially_copy_constructible::value, + static_assert(std::is_trivially_copy_constructible::value, ""); - static_assert(absl::is_trivially_copy_assignable::value, ""); + static_assert(std::is_trivially_copy_assignable::value, ""); static_assert(std::is_trivially_destructible::value, ""); } @@ -619,10 +619,10 @@ TEST(Int128, IntrinsicTypeTraitsTest) { #endif // ABSL_HAVE_INTRINSIC_INT128 TEST(Int128, TrivialTraitsTest) { - static_assert(absl::is_trivially_default_constructible::value, + static_assert(std::is_trivially_default_constructible::value, ""); - static_assert(absl::is_trivially_copy_constructible::value, ""); - static_assert(absl::is_trivially_copy_assignable::value, ""); + static_assert(std::is_trivially_copy_constructible::value, ""); + static_assert(std::is_trivially_copy_assignable::value, ""); static_assert(std::is_trivially_destructible::value, ""); } diff --git a/absl/random/beta_distribution.h b/absl/random/beta_distribution.h index a3623453..bedeca6d 100644 --- a/absl/random/beta_distribution.h +++ b/absl/random/beta_distribution.h @@ -282,7 +282,7 @@ beta_distribution::AlgorithmJoehnk( using random_internal::GeneratePositiveTag; using random_internal::GenerateRealFromBits; using real_type = - absl::conditional_t::value, float, double>; + std::conditional_t::value, float, double>; // Based on Joehnk, M. D. Erzeugung von betaverteilten und gammaverteilten // Zufallszahlen. Metrika 8.1 (1964): 5-15. @@ -340,7 +340,7 @@ beta_distribution::AlgorithmCheng( using random_internal::GeneratePositiveTag; using random_internal::GenerateRealFromBits; using real_type = - absl::conditional_t::value, float, double>; + std::conditional_t::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 8ac4d933..262eb9a9 100644 --- a/absl/random/bit_gen_ref.h +++ b/absl/random/bit_gen_ref.h @@ -83,7 +83,7 @@ class BitGenRef { BitGenRef& operator=(BitGenRef&&) = default; template , - typename absl::enable_if_t< + typename std::enable_if_t< (!std::is_same::value && !std::is_base_of::value && !HasConversionOperator::value && @@ -95,7 +95,7 @@ class BitGenRef { generate_impl_fn_(ImplFn) {} template , - typename absl::enable_if_t< + typename std::enable_if_t< (!std::is_same::value && !std::is_base_of::value && !HasConversionOperator::value && diff --git a/absl/random/distributions.h b/absl/random/distributions.h index dced8950..01dc9780 100644 --- a/absl/random/distributions.h +++ b/absl/random/distributions.h @@ -117,11 +117,11 @@ inline constexpr IntervalOpenClosedTag IntervalOpenClosed = {}; // auto x = absl::Uniform(bitgen, 0, 1); // template -typename absl::enable_if_t::value, R> // +typename std::enable_if_t::value, R> // Uniform(TagType tag, URBG&& urbg, // NOLINT(runtime/references) R lo, R hi) { - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = random_internal::UniformDistributionWrapper; auto a = random_internal::uniform_lower_bound(tag, lo, hi); @@ -137,10 +137,10 @@ Uniform(TagType tag, // Overload of `Uniform()` using the default closed-open interval of [lo, hi), // and returning values of type `T` template -typename absl::enable_if_t::value, R> // +typename std::enable_if_t::value, R> // Uniform(URBG&& urbg, // NOLINT(runtime/references) R lo, R hi) { - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = random_internal::UniformDistributionWrapper; constexpr auto tag = absl::IntervalClosedOpen; @@ -159,12 +159,12 @@ Uniform(URBG&& urbg, // NOLINT(runtime/references) // correctly from the passed types. template -typename absl::enable_if_t::value, +typename std::enable_if_t::value, random_internal::uniform_inferred_return_t> Uniform(TagType tag, URBG&& urbg, // NOLINT(runtime/references) A lo, B hi) { - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using return_t = typename random_internal::uniform_inferred_return_t; using distribution_t = random_internal::UniformDistributionWrapper; @@ -183,11 +183,11 @@ Uniform(TagType tag, // 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 absl::enable_if_t::value, +typename std::enable_if_t::value, random_internal::uniform_inferred_return_t> Uniform(URBG&& urbg, // NOLINT(runtime/references) A lo, B hi) { - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using return_t = typename random_internal::uniform_inferred_return_t; using distribution_t = random_internal::UniformDistributionWrapper; @@ -206,9 +206,9 @@ Uniform(URBG&& urbg, // NOLINT(runtime/references) // 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 absl::enable_if_t::is_signed, R> // +typename std::enable_if_t::is_signed, R> // Uniform(URBG&& urbg) { // NOLINT(runtime/references) - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = random_internal::UniformDistributionWrapper; return random_internal::DistributionCaller::template Call< @@ -238,7 +238,7 @@ Uniform(URBG&& urbg) { // NOLINT(runtime/references) template bool Bernoulli(URBG&& urbg, // NOLINT(runtime/references) double p) { - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = absl::bernoulli_distribution; return random_internal::DistributionCaller::template Call< @@ -270,7 +270,7 @@ RealType Beta(URBG&& urbg, // NOLINT(runtime/references) "Template-argument 'RealType' must be a floating-point type, in " "absl::Beta(...)"); - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = typename absl::beta_distribution; return random_internal::DistributionCaller::template Call< @@ -302,7 +302,7 @@ RealType Exponential(URBG&& urbg, // NOLINT(runtime/references) "Template-argument 'RealType' must be a floating-point type, in " "absl::Exponential(...)"); - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = typename absl::exponential_distribution; return random_internal::DistributionCaller::template Call< @@ -333,7 +333,7 @@ RealType Gaussian(URBG&& urbg, // NOLINT(runtime/references) "Template-argument 'RealType' must be a floating-point type, in " "absl::Gaussian(...)"); - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = typename absl::gaussian_distribution; return random_internal::DistributionCaller::template Call< @@ -375,7 +375,7 @@ IntType LogUniform(URBG&& urbg, // NOLINT(runtime/references) "Template-argument 'IntType' must be an integral type, in " "absl::LogUniform(...)"); - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = typename absl::log_uniform_int_distribution; return random_internal::DistributionCaller::template Call< @@ -405,7 +405,7 @@ IntType Poisson(URBG&& urbg, // NOLINT(runtime/references) "Template-argument 'IntType' must be an integral type, in " "absl::Poisson(...)"); - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = typename absl::poisson_distribution; return random_internal::DistributionCaller::template Call< @@ -437,7 +437,7 @@ IntType Zipf(URBG&& urbg, // NOLINT(runtime/references) "Template-argument 'IntType' must be an integral type, in " "absl::Zipf(...)"); - using gen_t = absl::decay_t; + using gen_t = std::decay_t; using distribution_t = typename absl::zipf_distribution; return random_internal::DistributionCaller::template Call< diff --git a/absl/random/distributions_test.cc b/absl/random/distributions_test.cc index 4340aeb8..1fa3345a 100644 --- a/absl/random/distributions_test.cc +++ b/absl/random/distributions_test.cc @@ -80,13 +80,13 @@ Invalid InferredTaggedUniformReturnT(...); template void CheckArgsInferType() { static_assert( - absl::conjunction< + std::conjunction< std::is_same(0))>, std::is_same(0))>>::value, ""); static_assert( - absl::conjunction< + std::conjunction< std::is_same(0))>, std::is_same void CheckArgsReturnExpectedType() { static_assert( - absl::conjunction< + std::conjunction< std::is_same(0))>, std::is_same( 0))>>::value, ""); static_assert( - absl::conjunction< + std::conjunction< std::is_same(0))>, diff --git a/absl/random/exponential_distribution.h b/absl/random/exponential_distribution.h index 4af2fb48..f0267b25 100644 --- a/absl/random/exponential_distribution.h +++ b/absl/random/exponential_distribution.h @@ -124,7 +124,7 @@ exponential_distribution::operator()( using random_internal::GenerateNegativeTag; using random_internal::GenerateRealFromBits; using real_type = - absl::conditional_t::value, float, double>; + std::conditional_t::value, float, double>; const result_type u = GenerateRealFromBits(fast_u64_(g)); // U(-1, 0) diff --git a/absl/random/internal/distribution_caller.h b/absl/random/internal/distribution_caller.h index d712bca7..d14fa854 100644 --- a/absl/random/internal/distribution_caller.h +++ b/absl/random/internal/distribution_caller.h @@ -55,7 +55,7 @@ struct DistributionCaller { static typename DistrT::result_type Impl(std::true_type, URBG* urbg, Args&&... args) { using ResultT = typename DistrT::result_type; - using ArgTupleT = std::tuple...>; + using ArgTupleT = std::tuple...>; using KeyT = ResultT(DistrT, ArgTupleT); ArgTupleT arg_tuple(std::forward(args)...); diff --git a/absl/random/internal/fast_uniform_bits.h b/absl/random/internal/fast_uniform_bits.h index 83ee5c0f..7292d1f0 100644 --- a/absl/random/internal/fast_uniform_bits.h +++ b/absl/random/internal/fast_uniform_bits.h @@ -126,7 +126,7 @@ FastUniformBits::operator()(URBG& g) { // NOLINT(runtime/references) static_assert((URBG::max)() > (URBG::min)(), "URBG::max and URBG::min may not be equal."); - using tag = absl::conditional_t()), + using tag = std::conditional_t()), SimplifiedLoopTag, RejectionLoopTag>; return Generate(g, tag{}); } diff --git a/absl/random/internal/generate_real.h b/absl/random/internal/generate_real.h index 9a6f4005..fc352403 100644 --- a/absl/random/internal/generate_real.h +++ b/absl/random/internal/generate_real.h @@ -69,7 +69,7 @@ template inline RealType GenerateRealFromBits(uint64_t bits, int exp_bias = 0) { using real_type = RealType; - using uint_type = absl::conditional_t::value, + using uint_type = std::conditional_t::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 0f56bcb8..5556b67e 100644 --- a/absl/random/internal/iostream_state_saver.h +++ b/absl/random/internal/iostream_state_saver.h @@ -95,7 +95,7 @@ ostream_state_saver> make_ostream_state_saver( } template -typename absl::enable_if_t::value, +typename std::enable_if_t::value, null_state_saver> make_ostream_state_saver(T& is, // NOLINT(runtime/references) std::ios_base::fmtflags flags = std::ios_base::dec) { @@ -159,7 +159,7 @@ istream_state_saver> make_istream_state_saver( } template -typename absl::enable_if_t::value, +typename std::enable_if_t::value, null_state_saver> 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 ea9d2af0..3c1db21c 100644 --- a/absl/random/internal/iostream_state_saver_test.cc +++ b/absl/random/internal/iostream_state_saver_test.cc @@ -19,6 +19,7 @@ #include #include +#include #include "gtest/gtest.h" @@ -29,7 +30,7 @@ using absl::random_internal::make_ostream_state_saver; using absl::random_internal::stream_precision_helper; template -typename absl::enable_if_t::value, T> // +typename std::enable_if_t::value, T> // StreamRoundTrip(T t) { std::stringstream ss; { @@ -53,7 +54,7 @@ StreamRoundTrip(T t) { } template -typename absl::enable_if_t::value, T> // +typename std::enable_if_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 e8c2bb9f..903dbd95 100644 --- a/absl/random/internal/nonsecure_base.h +++ b/absl/random/internal/nonsecure_base.h @@ -78,7 +78,7 @@ class RandenPoolSeedSeq { // 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::value || std::is_same::iterator>::value), @@ -106,7 +106,7 @@ class NonsecureURBGBase { NonsecureURBGBase& operator=(NonsecureURBGBase&&) = default; // Constructor using a seed - template ::value>> explicit NonsecureURBGBase(SSeq&& seq) : urbg_(ConstructURBG(std::forward(seq))) {} diff --git a/absl/random/internal/nonsecure_base_test.cc b/absl/random/internal/nonsecure_base_test.cc index 6e3e712b..37955631 100644 --- a/absl/random/internal/nonsecure_base_test.cc +++ b/absl/random/internal/nonsecure_base_test.cc @@ -77,13 +77,13 @@ TEST(NonsecureURBGBase, StandardInterface) { static_assert(!std::is_copy_constructible::value, "NonsecureURBGBase should not be copy constructible"); - static_assert(!absl::is_copy_assignable::value, + static_assert(!std::is_copy_assignable::value, "NonsecureURBGBase should not be copy assignable"); static_assert(std::is_move_constructible::value, "NonsecureURBGBase should be move constructible"); - static_assert(absl::is_move_assignable::value, + static_assert(std::is_move_assignable::value, "NonsecureURBGBase should be move assignable"); static_assert(std::is_same()()), T>::value, diff --git a/absl/random/internal/pcg_engine.h b/absl/random/internal/pcg_engine.h index e1f4ef33..2f41d580 100644 --- a/absl/random/internal/pcg_engine.h +++ b/absl/random/internal/pcg_engine.h @@ -67,7 +67,7 @@ class pcg_engine { explicit pcg_engine(uint64_t seed_value = 0) { seed(seed_value); } template ::value>> explicit pcg_engine(SeedSequence&& seq) { seed(seq); @@ -90,7 +90,7 @@ class pcg_engine { } template - typename absl::enable_if_t< + typename std::enable_if_t< !std::is_convertible::value, void> seed(SeedSequence&& seq) { reseed(seq); @@ -105,7 +105,7 @@ class pcg_engine { bool operator!=(const pcg_engine& other) const { return !(*this == other); } template - friend typename absl::enable_if_t<(sizeof(state_type) == 16), + friend typename std::enable_if_t<(sizeof(state_type) == 16), std::basic_ostream&> operator<<( std::basic_ostream& os, // NOLINT(runtime/references) @@ -121,7 +121,7 @@ class pcg_engine { } template - friend typename absl::enable_if_t<(sizeof(state_type) <= 8), + friend typename std::enable_if_t<(sizeof(state_type) <= 8), std::basic_ostream&> operator<<( std::basic_ostream& os, // NOLINT(runtime/references) @@ -134,7 +134,7 @@ class pcg_engine { } template - friend typename absl::enable_if_t<(sizeof(state_type) == 16), + friend typename std::enable_if_t<(sizeof(state_type) == 16), std::basic_istream&> operator>>( std::basic_istream& is, // NOLINT(runtime/references) @@ -155,7 +155,7 @@ class pcg_engine { } template - friend typename absl::enable_if_t<(sizeof(state_type) <= 8), + friend typename std::enable_if_t<(sizeof(state_type) <= 8), std::basic_istream&> operator>>( std::basic_istream& is, // NOLINT(runtime/references) diff --git a/absl/random/internal/pcg_engine_test.cc b/absl/random/internal/pcg_engine_test.cc index 4d763e89..211a849b 100644 --- a/absl/random/internal/pcg_engine_test.cc +++ b/absl/random/internal/pcg_engine_test.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -169,13 +170,13 @@ TYPED_TEST(PCGEngineTest, RandomNumberEngineInterface) { static_assert(std::is_copy_constructible::value, "engine_type must be copy constructible"); - static_assert(absl::is_copy_assignable::value, + static_assert(std::is_copy_assignable::value, "engine_type must be copy assignable"); static_assert(std::is_move_constructible::value, "engine_type must be move constructible"); - static_assert(absl::is_move_assignable::value, + static_assert(std::is_move_assignable::value, "engine_type must be move assignable"); static_assert(std::is_same()()), T>::value, diff --git a/absl/random/internal/randen_engine.h b/absl/random/internal/randen_engine.h index 925e1bba..4e4fef90 100644 --- a/absl/random/internal/randen_engine.h +++ b/absl/random/internal/randen_engine.h @@ -63,7 +63,7 @@ class alignas(8) randen_engine { explicit randen_engine(result_type seed_value) { seed(seed_value); } template ::value>> explicit randen_engine(SeedSequence&& seq) { seed(seq); @@ -93,7 +93,7 @@ class alignas(8) randen_engine { } template - typename absl::enable_if_t< + typename std::enable_if_t< !std::is_convertible::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 122d90b8..85c0a2b3 100644 --- a/absl/random/internal/randen_engine_test.cc +++ b/absl/random/internal/randen_engine_test.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include "gmock/gmock.h" #include "gtest/gtest.h" @@ -170,13 +171,13 @@ TYPED_TEST(RandenEngineTypedTest, RandomNumberEngineInterface) { static_assert(std::is_copy_constructible::value, "randen_engine must be copy constructible"); - static_assert(absl::is_copy_assignable::value, + static_assert(std::is_copy_assignable::value, "randen_engine must be copy assignable"); static_assert(std::is_move_constructible::value, "randen_engine must be move constructible"); - static_assert(absl::is_move_assignable::value, + static_assert(std::is_move_assignable::value, "randen_engine must be move assignable"); static_assert(std::is_same()()), T>::value, diff --git a/absl/random/internal/randen_test.cc b/absl/random/internal/randen_test.cc index 92773b8d..cf949708 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 +#include #include "gtest/gtest.h" #include "absl/meta/type_traits.h" @@ -27,13 +28,13 @@ TEST(RandenTest, CopyAndMove) { static_assert(std::is_copy_constructible::value, "Randen must be copy constructible"); - static_assert(absl::is_copy_assignable::value, + static_assert(std::is_copy_assignable::value, "Randen must be copy assignable"); static_assert(std::is_move_constructible::value, "Randen must be move constructible"); - static_assert(absl::is_move_assignable::value, + static_assert(std::is_move_assignable::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 c374d930..a86c39d1 100644 --- a/absl/random/internal/salted_seed_seq.h +++ b/absl/random/internal/salted_seed_seq.h @@ -72,7 +72,7 @@ class SaltedSeedSeq { // 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::value && (std::is_pointer::value || std::is_same::value>> + typename EnableIf = std::enable_if_t::value>> SSeq MakeSaltedSeedSeq(SSeq&& seq) { return SSeq(std::forward(seq)); } template < typename SSeq, // - typename EnableIf = absl::enable_if_t::value>> + typename EnableIf = std::enable_if_t::value>> SaltedSeedSeq::type> MakeSaltedSeedSeq(SSeq&& seq) { using sseq_type = typename std::decay::type; using result_type = typename sseq_type::result_type; diff --git a/absl/random/internal/traits.h b/absl/random/internal/traits.h index d3963293..f23bcd2e 100644 --- a/absl/random/internal/traits.h +++ b/absl/random/internal/traits.h @@ -37,13 +37,13 @@ struct is_urbg : std::false_type {}; template struct is_urbg< URBG, - absl::enable_if_t::type>::value>, - absl::enable_if_t::type>::value>, - absl::enable_if_t()())>::type>::value>> : std::true_type {}; diff --git a/absl/random/internal/uniform_helper.h b/absl/random/internal/uniform_helper.h index d2300738..f50be61c 100644 --- a/absl/random/internal/uniform_helper.h +++ b/absl/random/internal/uniform_helper.h @@ -76,7 +76,7 @@ namespace random_internal { // Return-type for absl::Uniform() when the return-type is inferred. template using uniform_inferred_return_t = - absl::enable_if_t, + std::enable_if_t, is_widening_convertible>::value, typename std::conditional< is_widening_convertible::value, B, A>::type>; @@ -98,10 +98,10 @@ using uniform_inferred_return_t = // uniform_upper_bound(IntervalOpenClosed, a, b)] // template -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< IsIntegral, - absl::disjunction, + std::disjunction, std::is_same>>::value, IntType> uniform_lower_bound(Tag, IntType a, IntType) { @@ -109,10 +109,10 @@ uniform_lower_bound(Tag, IntType a, IntType) { } template -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< std::is_floating_point, - absl::disjunction, + std::disjunction, std::is_same>>::value, FloatType> uniform_lower_bound(Tag, FloatType a, FloatType b) { @@ -120,8 +120,8 @@ uniform_lower_bound(Tag, FloatType a, FloatType b) { } template -typename absl::enable_if_t< - absl::disjunction, +typename std::enable_if_t< + std::disjunction, std::is_same>::value, NumType> uniform_lower_bound(Tag, NumType a, NumType) { @@ -129,10 +129,10 @@ uniform_lower_bound(Tag, NumType a, NumType) { } template -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< IsIntegral, - absl::disjunction, + std::disjunction, std::is_same>>::value, IntType> uniform_upper_bound(Tag, IntType, IntType b) { @@ -140,10 +140,10 @@ uniform_upper_bound(Tag, IntType, IntType b) { } template -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< std::is_floating_point, - absl::disjunction, + std::disjunction, std::is_same>>::value, FloatType> uniform_upper_bound(Tag, FloatType, FloatType b) { @@ -151,10 +151,10 @@ uniform_upper_bound(Tag, FloatType, FloatType b) { } template -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< IsIntegral, - absl::disjunction, + std::disjunction, std::is_same>>::value, IntType> uniform_upper_bound(Tag, IntType, IntType b) { @@ -162,10 +162,10 @@ uniform_upper_bound(Tag, IntType, IntType b) { } template -typename absl::enable_if_t< - absl::conjunction< +typename std::enable_if_t< + std::conjunction< std::is_floating_point, - absl::disjunction, + std::disjunction, std::is_same>>::value, FloatType> uniform_upper_bound(Tag, FloatType, FloatType b) { @@ -195,13 +195,13 @@ uniform_upper_bound(Tag, FloatType, FloatType b) { // (0, 0] is not legal, but (0, 0+epsilon] is. // template -absl::enable_if_t::value, bool> +std::enable_if_t::value, bool> is_uniform_range_valid(FloatType a, FloatType b) { return a <= b && std::isfinite(b - a); } template -absl::enable_if_t::value, bool> is_uniform_range_valid( +std::enable_if_t::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 173c49b0..5b20b0bb 100644 --- a/absl/random/internal/uniform_helper_test.cc +++ b/absl/random/internal/uniform_helper_test.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include "gtest/gtest.h" @@ -214,7 +215,7 @@ Invalid InferredUniformReturnT(...); template void CheckArgsInferType() { static_assert( - absl::conjunction< + std::conjunction< std::is_same(0))>, std::is_same(0))>>::value, diff --git a/absl/random/mocking_bit_gen.h b/absl/random/mocking_bit_gen.h index 249e2d6a..74aa17d8 100644 --- a/absl/random/mocking_bit_gen.h +++ b/absl/random/mocking_bit_gen.h @@ -174,13 +174,13 @@ class MockingBitGen { using MockFnType = decltype(GetMockFnType(std::declval(), std::declval())); - using WrappedFnType = absl::conditional_t< + using WrappedFnType = std::conditional_t< std::is_same>::value, ::testing::NiceMock, - absl::conditional_t< + std::conditional_t< std::is_same>::value, ::testing::NaggyMock, - absl::conditional_t< + std::conditional_t< std::is_same>::value, ::testing::StrictMock, MockFnType>>>; diff --git a/absl/random/uniform_real_distribution.h b/absl/random/uniform_real_distribution.h index 8bef9469..e5ea6f20 100644 --- a/absl/random/uniform_real_distribution.h +++ b/absl/random/uniform_real_distribution.h @@ -159,7 +159,7 @@ uniform_real_distribution::operator()( using random_internal::GeneratePositiveTag; using random_internal::GenerateRealFromBits; using real_type = - absl::conditional_t::value, float, double>; + std::conditional_t::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 8a4e2f52..ccfdedb7 100644 --- a/absl/status/internal/statusor_internal.h +++ b/absl/status/internal/statusor_internal.h @@ -60,7 +60,7 @@ struct IsEqualityComparable< // Detects whether `T` is constructible or convertible from `StatusOr`. template using IsConstructibleOrConvertibleFromStatusOr = - absl::disjunction&>, + std::disjunction&>, std::is_constructible&>, std::is_constructible&&>, std::is_constructible&&>, @@ -73,7 +73,7 @@ using IsConstructibleOrConvertibleFromStatusOr = // `StatusOr`. template using IsConstructibleOrConvertibleOrAssignableFromStatusOr = - absl::disjunction, + std::disjunction, std::is_assignable&>, std::is_assignable&>, std::is_assignable&&>, @@ -83,7 +83,7 @@ using IsConstructibleOrConvertibleOrAssignableFromStatusOr = // when `U` is `StatusOr` and `T` is constructible or convertible from `V`. template struct IsDirectInitializationAmbiguous - : public absl::conditional_t< + : public std::conditional_t< std::is_same, U>::value, std::false_type, IsDirectInitializationAmbiguous>> {}; @@ -95,7 +95,7 @@ struct IsDirectInitializationAmbiguous> // temporaries. // REQUIRES: T and U are references. template -using IsReferenceConversionValid = absl::conjunction< // +using IsReferenceConversionValid = std::conjunction< // std::is_reference, std::is_reference, // The references are convertible. This checks for // lvalue/rvalue compatibility. @@ -108,13 +108,13 @@ using IsReferenceConversionValid = absl::conjunction< // // Checks against the constraints of the direction initialization, i.e. when // `StatusOr::StatusOr(U&&)` should participate in overload resolution. template -using IsDirectInitializationValid = absl::disjunction< +using IsDirectInitializationValid = std::disjunction< // Short circuits if T is basically U. std::is_same>, // std::conditional_t< std::is_reference_v, // IsReferenceConversionValid, - absl::negation, absl::remove_cvref_t>, std::is_same>, std::is_same>, @@ -132,7 +132,7 @@ using IsDirectInitializationValid = absl::disjunction< // s1 = s2; // ambiguous, `s1 = s2.ValueOrDie()` or `s1 = bool(s2)`? template struct IsForwardingAssignmentAmbiguous - : public absl::conditional_t< + : public std::conditional_t< std::is_same, U>::value, std::false_type, IsForwardingAssignmentAmbiguous>> {}; @@ -143,91 +143,91 @@ struct IsForwardingAssignmentAmbiguous> // Checks against the constraints of the forwarding assignment, i.e. whether // `StatusOr::operator(U&&)` should participate in overload resolution. template -using IsForwardingAssignmentValid = absl::disjunction< +using IsForwardingAssignmentValid = std::disjunction< // Short circuits if T is basically U. std::is_same>, - absl::negation, absl::remove_cvref_t>, std::is_same>, std::is_same>, IsForwardingAssignmentAmbiguous>>>; template -using Equality = std::conditional_t>; +using Equality = std::conditional_t>; template -using IsConstructionValid = absl::conjunction< +using IsConstructionValid = std::conjunction< Equality, type_traits_internal::IsLifetimeBoundAssignment>>, IsDirectInitializationValid, std::is_constructible, Equality>, - absl::disjunction< + std::disjunction< std::is_same>, - absl::conjunction< + std::conjunction< std::conditional_t< Explicit, - absl::negation>, - absl::negation>>, - absl::negation< + std::negation>, + std::negation>>, + std::negation< internal_statusor::HasConversionOperatorToStatusOr>>>>; template -using IsAssignmentValid = absl::conjunction< +using IsAssignmentValid = std::conjunction< Equality, type_traits_internal::IsLifetimeBoundAssignment>>, std::conditional_t, IsReferenceConversionValid, - absl::conjunction, + std::conjunction, std::is_assignable>>, - absl::disjunction< + std::disjunction< std::is_same>, - absl::conjunction< - absl::negation>, - absl::negation>>>, + std::conjunction< + std::negation>, + std::negation>>>, IsForwardingAssignmentValid>; template -using IsConstructionFromStatusValid = absl::conjunction< - absl::negation, absl::remove_cvref_t>>, - absl::negation>>, - absl::negation>>, +using IsConstructionFromStatusValid = std::conjunction< + std::negation, absl::remove_cvref_t>>, + std::negation>>, + std::negation>>, Equality>, std::is_constructible, - absl::negation>>; + std::negation>>; template -using IsConstructionFromStatusOrValid = absl::conjunction< - absl::negation>, +using IsConstructionFromStatusOrValid = std::conjunction< + std::negation>, // If `T` is a reference, then U must be a compatible one. - absl::disjunction>, + std::disjunction>, IsReferenceConversionValid>, Equality>, std::is_constructible, Equality>, - absl::negation>>; + std::negation>>; template -using IsStatusOrAssignmentValid = absl::conjunction< - absl::negation>>, +using IsStatusOrAssignmentValid = std::conjunction< + std::negation>>, Equality>, std::is_constructible, std::is_assignable, - absl::negation>>>; template -using IsValueOrValid = absl::conjunction< +using IsValueOrValid = std::conjunction< // If `T` is a reference, then U must be a compatible one. - absl::disjunction>, + std::disjunction>, IsReferenceConversionValid>, Equality, type_traits_internal::IsLifetimeBoundAssignment>>>; @@ -331,7 +331,7 @@ class StatusOrData { } template ::value, + std::enable_if_t::value, int> = 0> explicit StatusOrData(U&& v) : status_(std::forward(v)) { EnsureNotOk(); diff --git a/absl/status/statusor.h b/absl/status/statusor.h index b8509a8c..0af1d752 100644 --- a/absl/status/statusor.h +++ b/absl/status/statusor.h @@ -247,50 +247,50 @@ class StatusOr : private internal_statusor::OperatorBase, // 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 ::value, int> = 0> StatusOr(const StatusOr& other) // NOLINT : Base(static_cast::Base&>(other)) {} - template ::value, int> = 0> StatusOr(const StatusOr& other ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT : Base(static_cast::Base&>(other)) {} - template ::value, int> = 0> explicit StatusOr(const StatusOr& other) : Base(static_cast::Base&>(other)) {} - template ::value, int> = 0> explicit StatusOr(const StatusOr& other ABSL_ATTRIBUTE_LIFETIME_BOUND) : Base(static_cast::Base&>(other)) {} - template ::value, int> = 0> StatusOr(StatusOr&& other) // NOLINT : Base(static_cast::Base&&>(other)) {} - template ::value, int> = 0> StatusOr(StatusOr&& other ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT : Base(static_cast::Base&&>(other)) {} - template ::value, int> = 0> explicit StatusOr(StatusOr&& other) : Base(static_cast::Base&&>(other)) {} - template ::value, int> = 0> @@ -317,7 +317,7 @@ class StatusOr : private internal_statusor::OperatorBase, // assignable from `absl::StatusOr` and `StatusOr` cannot be directly // assigned from `StatusOr`. template ::value, int> = 0> StatusOr& operator=(const StatusOr& other) { @@ -325,7 +325,7 @@ class StatusOr : private internal_statusor::OperatorBase, return *this; } template ::value, int> = 0> StatusOr& operator=(const StatusOr& other ABSL_ATTRIBUTE_LIFETIME_BOUND) { @@ -333,7 +333,7 @@ class StatusOr : private internal_statusor::OperatorBase, return *this; } template ::value, int> = 0> StatusOr& operator=(StatusOr&& other) { @@ -341,7 +341,7 @@ class StatusOr : private internal_statusor::OperatorBase, return *this; } template ::value, int> = 0> StatusOr& operator=(StatusOr&& other ABSL_ATTRIBUTE_LIFETIME_BOUND) { @@ -361,18 +361,18 @@ class StatusOr : private internal_statusor::OperatorBase, // In optimized builds, passing absl::OkStatus() here will have the effect // of passing absl::StatusCode::kInternal as a fallback. template ::value, int> = 0> StatusOr(U&& v) : Base(std::forward(v)) {} template ::value, int> = 0> explicit StatusOr(U&& v) : Base(std::forward(v)) {} template ::value, int> = 0> StatusOr& operator=(U&& v) { @@ -429,26 +429,26 @@ class StatusOr : private internal_statusor::OperatorBase, // ambiguity, this constructor is disabled if `U` is a `StatusOr`, where // `J` is convertible to `T`. template ::value, int> = 0> StatusOr(U&& u) // NOLINT : StatusOr(absl::in_place, std::forward(u)) {} template ::value, int> = 0> StatusOr(U&& u ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT : StatusOr(absl::in_place, std::forward(u)) {} template ::value, int> = 0> explicit StatusOr(U&& u) // NOLINT : StatusOr(absl::in_place, std::forward(u)) {} template ::value, int> = 0> explicit StatusOr(U&& u ABSL_ATTRIBUTE_LIFETIME_BOUND) // NOLINT @@ -624,7 +624,7 @@ class StatusOr : private internal_statusor::OperatorBase, template < typename U, typename... Args, - absl::enable_if_t< + std::enable_if_t< std::is_constructible&, Args&&...>::value, int> = 0> T& emplace(std::initializer_list ilist, diff --git a/absl/strings/BUILD.bazel b/absl/strings/BUILD.bazel index 27150c23..79b66721 100644 --- a/absl/strings/BUILD.bazel +++ b/absl/strings/BUILD.bazel @@ -401,7 +401,6 @@ cc_test( 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 c49a7af3..9f7f9ef5 100644 --- a/absl/strings/CMakeLists.txt +++ b/absl/strings/CMakeLists.txt @@ -339,7 +339,6 @@ absl_cc_test( ${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 32782967..c2f1ec5d 100644 --- a/absl/strings/cord.h +++ b/absl/strings/cord.h @@ -174,7 +174,7 @@ class Cord { private: template using EnableIfString = - absl::enable_if_t::value, int>; + std::enable_if_t::value, int>; public: // Cord::Cord() Constructors. @@ -1137,7 +1137,7 @@ template CordRep* absl_nonnull NewExternalRep(absl::string_view data, Releaser&& releaser) { assert(!data.empty()); - using ReleaserType = absl::decay_t; + using ReleaserType = std::decay_t; CordRepExternal* rep = new CordRepExternalImpl( std::forward(releaser), 0); InitializeCordRepExternal(data, rep); @@ -1162,7 +1162,7 @@ Cord MakeCordFromExternal(absl::string_view data, Releaser&& releaser) { data, std::forward(releaser)), Cord::MethodIdentifier::kMakeCordFromExternal); } else { - using ReleaserType = absl::decay_t; + using ReleaserType = std::decay_t; cord_internal::InvokeReleaser( cord_internal::Rank1{}, ReleaserType(std::forward(releaser)), data); diff --git a/absl/strings/internal/stl_type_traits.h b/absl/strings/internal/stl_type_traits.h index e50468b0..9c637266 100644 --- a/absl/strings/internal/stl_type_traits.h +++ b/absl/strings/internal/stl_type_traits.h @@ -48,25 +48,25 @@ struct IsSpecializationImpl : std::false_type {}; template