Implement an _is_allocator type trait for use in deduction guides.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@322306 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -5597,6 +5597,16 @@ struct __temp_value {
|
||||
};
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user