25 #ifndef _USES_ALLOCATOR_H 26 #define _USES_ALLOCATOR_H 1 28 #if __cplusplus < 201103L 34 namespace std _GLIBCXX_VISIBILITY(default)
36 _GLIBCXX_BEGIN_NAMESPACE_VERSION
43 template<
typename _Tp,
typename _Alloc,
typename = __
void_t<>>
44 struct __uses_allocator_helper
47 template<
typename _Tp,
typename _Alloc>
48 struct __uses_allocator_helper<_Tp, _Alloc,
49 __void_t<typename _Tp::allocator_type>>
50 : is_convertible<_Alloc, typename _Tp::allocator_type>::type
54 template<
typename _Tp,
typename _Alloc>
56 : __uses_allocator_helper<_Tp, _Alloc>::type
59 struct __uses_alloc_base { };
61 struct __uses_alloc0 : __uses_alloc_base
63 struct _Sink {
void operator=(
const void*) { } } _M_a;
66 template<
typename _Alloc>
67 struct __uses_alloc1 : __uses_alloc_base {
const _Alloc* _M_a; };
69 template<
typename _Alloc>
70 struct __uses_alloc2 : __uses_alloc_base {
const _Alloc* _M_a; };
72 template<bool,
typename _Tp,
typename _Alloc,
typename... _Args>
75 template<
typename _Tp,
typename _Alloc,
typename... _Args>
76 struct __uses_alloc<true, _Tp, _Alloc, _Args...>
78 is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value,
79 __uses_alloc1<_Alloc>,
80 __uses_alloc2<_Alloc>>::type
83 template<
typename _Tp,
typename _Alloc,
typename... _Args>
84 struct __uses_alloc<false, _Tp, _Alloc, _Args...>
87 template<
typename _Tp,
typename _Alloc,
typename... _Args>
88 using __uses_alloc_t =
89 __uses_alloc<uses_allocator<_Tp, _Alloc>::value, _Tp, _Alloc, _Args...>;
91 template<
typename _Tp,
typename _Alloc,
typename... _Args>
92 inline __uses_alloc_t<_Tp, _Alloc, _Args...>
93 __use_alloc(
const _Alloc& __a)
95 __uses_alloc_t<_Tp, _Alloc, _Args...> __ret;
100 _GLIBCXX_END_NAMESPACE_VERSION
Declare uses_allocator so it can be specialized in <queue> etc.
ISO C++ entities toplevel namespace is std.