1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef _LIBCPP___TYPE_IS_ALLOCATOR_H
10 #define _LIBCPP___TYPE_IS_ALLOCATOR_H
11 
12 #include <__config>
13 #include <__type_traits/integral_constant.h>
14 #include <__type_traits/void_t.h>
15 #include <__utility/declval.h>
16 #include <cstddef>
17 
18 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19 #  pragma GCC system_header
20 #endif
21 
22 _LIBCPP_BEGIN_NAMESPACE_STD
23 
24 template<typename _Alloc, typename = void, typename = void>
25 struct __is_allocator : false_type {};
26 
27 template<typename _Alloc>
28 struct __is_allocator<_Alloc,
29        __void_t<typename _Alloc::value_type>,
30        __void_t<decltype(std::declval<_Alloc&>().allocate(size_t(0)))>
31      >
32    : true_type {};
33 
34 _LIBCPP_END_NAMESPACE_STD
35 
36 #endif // _LIBCPP___TYPE_IS_ALLOCATOR_H
37