diff options
author | Lawrence Wolf-Sonkin <lawrencews@google.com> | 2023-12-28 14:26:18 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-12-28 14:27:14 -0800 |
commit | 6a19ff47352a2112e953f4ab813d820e0ecfe1e3 (patch) | |
tree | d0b376cb1109364175b38d300069bafb618e5cdd /absl/synchronization | |
parent | 1ac355bbb7e1e3c7916d812976127cf15c411bd3 (diff) |
[absl] Rename `absl::internal::identity` to `absl::internal::type_identity`
* Also does this for `absl::internal::identity_t` which is now `absl::internal::type_identity_t`
* This is clearer naming as this is a backfill of `std::type_identity` (the identity type), and not `std::identity` (the identity function)
PiperOrigin-RevId: 594316002
Change-Id: I5fb8cf7e3d07c1bc736cbecd202e7d556b6ea33e
Diffstat (limited to 'absl/synchronization')
-rw-r--r-- | absl/synchronization/mutex.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/absl/synchronization/mutex.h b/absl/synchronization/mutex.h index 85e8d0e0..d53a22bb 100644 --- a/absl/synchronization/mutex.h +++ b/absl/synchronization/mutex.h @@ -740,23 +740,25 @@ class Condition { // a function template is passed as `func`. Also, the dummy `typename = void` // template parameter exists just to work around a MSVC mangling bug. template <typename T, typename = void> - Condition(bool (*func)(T*), typename absl::internal::identity<T>::type* arg); + Condition(bool (*func)(T*), + typename absl::internal::type_identity<T>::type* arg); // Templated version for invoking a method that returns a `bool`. // // `Condition(object, &Class::Method)` constructs a `Condition` that evaluates // `object->Method()`. // - // Implementation Note: `absl::internal::identity` is used to allow methods to - // come from base classes. A simpler signature like + // Implementation Note: `absl::internal::type_identity` is used to allow + // methods to come from base classes. A simpler signature like // `Condition(T*, bool (T::*)())` does not suffice. template <typename T> - Condition(T* object, bool (absl::internal::identity<T>::type::*method)()); + Condition(T* object, + bool (absl::internal::type_identity<T>::type::*method)()); // Same as above, for const members template <typename T> Condition(const T* object, - bool (absl::internal::identity<T>::type::*method)() const); + bool (absl::internal::type_identity<T>::type::*method)() const); // A Condition that returns the value of `*cond` explicit Condition(const bool* cond); @@ -1107,14 +1109,14 @@ inline Condition::Condition(bool (*func)(T*), T* arg) } template <typename T, typename> -inline Condition::Condition(bool (*func)(T*), - typename absl::internal::identity<T>::type* arg) +inline Condition::Condition( + bool (*func)(T*), typename absl::internal::type_identity<T>::type* arg) // Just delegate to the overload above. : Condition(func, arg) {} template <typename T> -inline Condition::Condition(T* object, - bool (absl::internal::identity<T>::type::*method)()) +inline Condition::Condition( + T* object, bool (absl::internal::type_identity<T>::type::*method)()) : eval_(&CastAndCallMethod<T, decltype(method)>), arg_(object) { static_assert(sizeof(&method) <= sizeof(callback_), "An overlarge method pointer was passed to Condition."); @@ -1122,9 +1124,9 @@ inline Condition::Condition(T* object, } template <typename T> -inline Condition::Condition(const T* object, - bool (absl::internal::identity<T>::type::*method)() - const) +inline Condition::Condition( + const T* object, + bool (absl::internal::type_identity<T>::type::*method)() const) : eval_(&CastAndCallMethod<const T, decltype(method)>), arg_(reinterpret_cast<void*>(const_cast<T*>(object))) { StoreCallback(method); |