[libc++] Introduce __identity_t<T>. NFCI.
This is just a shorter synonym for `__identity<T>::type`.
Use it consistently throughout, where possible.
There is still some metaprogramming in <memory> and <variant>
where `__identity` is being used _without_ immediately calling
`::type` on it; but this is the unusual case, and it will become
even less usual as we start deliberately protecting certain types
against deduction (e.g. D97742).
Differential Revision: https://reviews.llvm.org/D97862
GitOrigin-RevId: 09fa1d0e50a3d907e8596f6ea49780b7187b727e
diff --git a/include/map b/include/map
index a27002c..6b2d419 100644
--- a/include/map
+++ b/include/map
@@ -904,8 +904,8 @@
typedef _Key key_type;
typedef _Tp mapped_type;
typedef pair<const key_type, mapped_type> value_type;
- typedef typename __identity<_Compare>::type key_compare;
- typedef typename __identity<_Allocator>::type allocator_type;
+ typedef __identity_t<_Compare> key_compare;
+ typedef __identity_t<_Allocator> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
@@ -1674,8 +1674,8 @@
typedef _Key key_type;
typedef _Tp mapped_type;
typedef pair<const key_type, mapped_type> value_type;
- typedef typename __identity<_Compare>::type key_compare;
- typedef typename __identity<_Allocator>::type allocator_type;
+ typedef __identity_t<_Compare> key_compare;
+ typedef __identity_t<_Allocator> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;