Implement an _is_allocator type trait for use in deduction guides.

llvm-svn: 322306
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 0e22bf8cb963d34439c8aef38acf626c29f0f804
diff --git a/include/memory b/include/memory
index d6b427b..56502e2 100644
--- a/include/memory
+++ b/include/memory
@@ -5597,6 +5597,16 @@
     };
 #endif
 
+#if _LIBCPP_STD_VER > 14
+template<typename _Alloc, typename = void>
+struct __is_allocator : false_type {};
+
+template<typename _Alloc>
+struct __is_allocator<_Alloc,
+     void_t<typename _Alloc::value_type, decltype(_VSTD::declval<_Alloc&>().allocate(size_t{}))>>
+   : true_type {};
+#endif
+
 _LIBCPP_END_NAMESPACE_STD
 
 _LIBCPP_POP_MACROS