diff options
author | Dino Radakovic <dinor@google.com> | 2023-06-02 11:57:32 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-06-02 11:58:17 -0700 |
commit | 55de7357c7f0e1af6bb7d61b924a9a9315cc1e81 (patch) | |
tree | 189783ff5c337ea2d62a221b4d7cc12a8772c781 | |
parent | e9bb35cea3d3b18bdaaa273f6e1746d9334aa324 (diff) |
`absl`: Replace `absl::remove_cv_t<absl::remove_reference_t<T>>` with `absl::remove_cvref_t<T>`
PiperOrigin-RevId: 537372070
Change-Id: I46ff6e42856aea2cd8da6ff7105cf58613603dd4
-rw-r--r-- | absl/status/internal/statusor_internal.h | 36 | ||||
-rw-r--r-- | absl/status/statusor.h | 8 |
2 files changed, 15 insertions, 29 deletions
diff --git a/absl/status/internal/statusor_internal.h b/absl/status/internal/statusor_internal.h index eaac2c0b..49cead7a 100644 --- a/absl/status/internal/statusor_internal.h +++ b/absl/status/internal/statusor_internal.h @@ -69,11 +69,8 @@ using IsConstructibleOrConvertibleOrAssignableFromStatusOr = template <typename T, typename U> struct IsDirectInitializationAmbiguous : public absl::conditional_t< - std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>, - U>::value, - std::false_type, - IsDirectInitializationAmbiguous< - T, absl::remove_cv_t<absl::remove_reference_t<U>>>> {}; + std::is_same<absl::remove_cvref_t<U>, U>::value, std::false_type, + IsDirectInitializationAmbiguous<T, absl::remove_cvref_t<U>>> {}; template <typename T, typename V> struct IsDirectInitializationAmbiguous<T, absl::StatusOr<V>> @@ -84,14 +81,11 @@ struct IsDirectInitializationAmbiguous<T, absl::StatusOr<V>> template <typename T, typename U> using IsDirectInitializationValid = absl::disjunction< // Short circuits if T is basically U. - std::is_same<T, absl::remove_cv_t<absl::remove_reference_t<U>>>, + std::is_same<T, absl::remove_cvref_t<U>>, absl::negation<absl::disjunction< - std::is_same<absl::StatusOr<T>, - absl::remove_cv_t<absl::remove_reference_t<U>>>, - std::is_same<absl::Status, - absl::remove_cv_t<absl::remove_reference_t<U>>>, - std::is_same<absl::in_place_t, - absl::remove_cv_t<absl::remove_reference_t<U>>>, + 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>>, IsDirectInitializationAmbiguous<T, U>>>>; // This trait detects whether `StatusOr<T>::operator=(U&&)` is ambiguous, which @@ -107,11 +101,8 @@ using IsDirectInitializationValid = absl::disjunction< template <typename T, typename U> struct IsForwardingAssignmentAmbiguous : public absl::conditional_t< - std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>, - U>::value, - std::false_type, - IsForwardingAssignmentAmbiguous< - T, absl::remove_cv_t<absl::remove_reference_t<U>>>> {}; + std::is_same<absl::remove_cvref_t<U>, U>::value, std::false_type, + IsForwardingAssignmentAmbiguous<T, absl::remove_cvref_t<U>>> {}; template <typename T, typename U> struct IsForwardingAssignmentAmbiguous<T, absl::StatusOr<U>> @@ -122,14 +113,11 @@ struct IsForwardingAssignmentAmbiguous<T, absl::StatusOr<U>> template <typename T, typename U> using IsForwardingAssignmentValid = absl::disjunction< // Short circuits if T is basically U. - std::is_same<T, absl::remove_cv_t<absl::remove_reference_t<U>>>, + std::is_same<T, absl::remove_cvref_t<U>>, absl::negation<absl::disjunction< - std::is_same<absl::StatusOr<T>, - absl::remove_cv_t<absl::remove_reference_t<U>>>, - std::is_same<absl::Status, - absl::remove_cv_t<absl::remove_reference_t<U>>>, - std::is_same<absl::in_place_t, - absl::remove_cv_t<absl::remove_reference_t<U>>>, + 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>>>>; class Helper { diff --git a/absl/status/statusor.h b/absl/status/statusor.h index 935366d5..54c7ce02 100644 --- a/absl/status/statusor.h +++ b/absl/status/statusor.h @@ -411,7 +411,7 @@ class StatusOr : private internal_statusor::StatusOrData<T>, typename = typename std::enable_if<absl::conjunction< std::is_constructible<T, U&&>, std::is_assignable<T&, U&&>, absl::disjunction< - std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>, T>, + std::is_same<absl::remove_cvref_t<U>, T>, absl::conjunction< absl::negation<std::is_convertible<U&&, absl::Status>>, absl::negation<internal_statusor:: @@ -444,8 +444,7 @@ class StatusOr : private internal_statusor::StatusOrData<T>, internal_statusor::IsDirectInitializationValid<T, U&&>, std::is_constructible<T, U&&>, std::is_convertible<U&&, T>, absl::disjunction< - std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>, - T>, + std::is_same<absl::remove_cvref_t<U>, T>, absl::conjunction< absl::negation<std::is_convertible<U&&, absl::Status>>, absl::negation< @@ -461,8 +460,7 @@ class StatusOr : private internal_statusor::StatusOrData<T>, absl::conjunction< internal_statusor::IsDirectInitializationValid<T, U&&>, absl::disjunction< - std::is_same<absl::remove_cv_t<absl::remove_reference_t<U>>, - T>, + std::is_same<absl::remove_cvref_t<U>, T>, absl::conjunction< absl::negation<std::is_constructible<absl::Status, U&&>>, absl::negation< |