[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/set b/include/set
index d58455b..3a83827 100644
--- a/include/set
+++ b/include/set
@@ -450,7 +450,7 @@
typedef key_type value_type;
typedef _Compare key_compare;
typedef key_compare value_compare;
- typedef typename __identity<_Allocator>::type allocator_type;
+ typedef __identity_t<_Allocator> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;
@@ -974,11 +974,11 @@
{
public:
// types:
- typedef _Key key_type;
+ typedef _Key key_type;
typedef key_type value_type;
- typedef _Compare key_compare;
+ typedef _Compare key_compare;
typedef key_compare value_compare;
- typedef typename __identity<_Allocator>::type allocator_type;
+ typedef __identity_t<_Allocator> allocator_type;
typedef value_type& reference;
typedef const value_type& const_reference;