diff options
author | Copybara-Service <copybara-worker@google.com> | 2022-09-30 09:16:42 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-09-30 09:16:42 -0700 |
commit | e8304a5c62576cdad9d9265449ab5575115fd4f2 (patch) | |
tree | 15052dbd62baa9f3751978bb9e6499c35897f263 | |
parent | ba785235738f2fd8b71000c44516740197cc5dad (diff) | |
parent | 54f3476f154c3b99f036010c62889acccddf9eb7 (diff) |
Merge pull request #1283 from pateldeev:any_inovcable_rename_true
PiperOrigin-RevId: 478009291
Change-Id: I136dffd1383e42ae499c318132e9d789f3a859b9
-rw-r--r-- | absl/functional/internal/any_invocable.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/absl/functional/internal/any_invocable.h b/absl/functional/internal/any_invocable.h index f353139c..35b389d1 100644 --- a/absl/functional/internal/any_invocable.h +++ b/absl/functional/internal/any_invocable.h @@ -683,23 +683,23 @@ using UnwrapStdReferenceWrapper = // An alias that always yields std::true_type (used with constraints) where // substitution failures happen when forming the template arguments. template <class... T> -using True = +using TrueAlias = std::integral_constant<bool, sizeof(absl::void_t<T...>*) != 0>; /*SFINAE constraints for the conversion-constructor.*/ template <class Sig, class F, class = absl::enable_if_t< !std::is_same<RemoveCVRef<F>, AnyInvocable<Sig>>::value>> -using CanConvert = - True<absl::enable_if_t<!IsInPlaceType<RemoveCVRef<F>>::value>, - absl::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, - absl::enable_if_t< - Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<F>::value>, - absl::enable_if_t<std::is_constructible<absl::decay_t<F>, F>::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< + Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<F>::value>, + absl::enable_if_t<std::is_constructible<absl::decay_t<F>, F>::value>>; /*SFINAE constraints for the std::in_place constructors.*/ template <class Sig, class F, class... Args> -using CanEmplace = True< +using CanEmplace = TrueAlias< absl::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, absl::enable_if_t< Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<F>::value>, @@ -709,19 +709,19 @@ using CanEmplace = True< template <class Sig, class F, class = absl::enable_if_t< !std::is_same<RemoveCVRef<F>, AnyInvocable<Sig>>::value>> -using CanAssign = - True<absl::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, - absl::enable_if_t< - Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<F>::value>, - absl::enable_if_t<std::is_constructible<absl::decay_t<F>, F>::value>>; +using CanAssign = TrueAlias< + absl::enable_if_t<Impl<Sig>::template CallIsValid<F>::value>, + absl::enable_if_t< + Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept<F>::value>, + absl::enable_if_t<std::is_constructible<absl::decay_t<F>, F>::value>>; /*SFINAE constraints for the reference-wrapper conversion-assign operator.*/ template <class Sig, class F> -using CanAssignReferenceWrapper = - True<absl::enable_if_t< - Impl<Sig>::template CallIsValid<std::reference_wrapper<F>>::value>, - absl::enable_if_t<Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept< - std::reference_wrapper<F>>::value>>; +using CanAssignReferenceWrapper = TrueAlias< + absl::enable_if_t< + Impl<Sig>::template CallIsValid<std::reference_wrapper<F>>::value>, + absl::enable_if_t<Impl<Sig>::template CallIsNoexceptIfSigIsNoexcept< + std::reference_wrapper<F>>::value>>; //////////////////////////////////////////////////////////////////////////////// // @@ -778,7 +778,7 @@ using CanAssignReferenceWrapper = \ /*SFINAE constraint to check if F is invocable with the proper signature*/ \ template <class F> \ - using CallIsValid = True<absl::enable_if_t<absl::disjunction< \ + using CallIsValid = TrueAlias<absl::enable_if_t<absl::disjunction< \ absl::base_internal::is_invocable_r<ReturnType, \ absl::decay_t<F> inv_quals, P...>, \ std::is_same<ReturnType, \ @@ -788,8 +788,8 @@ using CanAssignReferenceWrapper = /*SFINAE constraint to check if F is nothrow-invocable when necessary*/ \ template <class F> \ using CallIsNoexceptIfSigIsNoexcept = \ - True<ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT(inv_quals, \ - noex)>; \ + TrueAlias<ABSL_INTERNAL_ANY_INVOCABLE_NOEXCEPT_CONSTRAINT(inv_quals, \ + noex)>; \ \ /*Put the AnyInvocable into an empty state.*/ \ Impl() = default; \ |