2 //===----------------------------------------------------------------------===//
4 // The LLVM Compiler Infrastructure
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef _LIBCPP_FUNCTIONAL_BASE
12 #define _LIBCPP_FUNCTIONAL_BASE
15 #include <type_traits>
20 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
21 #pragma GCC system_header
24 _LIBCPP_BEGIN_NAMESPACE_STD
26 template <class _Arg, class _Result>
27 struct _LIBCPP_TYPE_VIS_ONLY unary_function
29 typedef _Arg argument_type;
30 typedef _Result result_type;
33 template <class _Arg1, class _Arg2, class _Result>
34 struct _LIBCPP_TYPE_VIS_ONLY binary_function
36 typedef _Arg1 first_argument_type;
37 typedef _Arg2 second_argument_type;
38 typedef _Result result_type;
41 template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash;
44 struct __has_result_type
47 struct __two {char __lx; char __lxx;};
48 template <class _Up> static __two __test(...);
49 template <class _Up> static char __test(typename _Up::result_type* = 0);
51 static const bool value = sizeof(__test<_Tp>(0)) == 1;
54 #if _LIBCPP_STD_VER > 11
55 template <class _Tp = void>
59 struct _LIBCPP_TYPE_VIS_ONLY less : binary_function<_Tp, _Tp, bool>
61 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
62 bool operator()(const _Tp& __x, const _Tp& __y) const
66 #if _LIBCPP_STD_VER > 11
68 struct _LIBCPP_TYPE_VIS_ONLY less<void>
70 template <class _T1, class _T2>
71 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
72 auto operator()(_T1&& __t, _T2&& __u) const
73 _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u)))
74 -> decltype (_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u))
75 { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); }
76 typedef void is_transparent;
83 inline _LIBCPP_INLINE_VISIBILITY
85 addressof(_Tp& __x) _NOEXCEPT
87 return (_Tp*)&reinterpret_cast<const volatile char&>(__x);
90 #if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
91 // Objective-C++ Automatic Reference Counting uses qualified pointers
92 // that require special addressof() signatures. When
93 // _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
94 // itself is providing these definitions. Otherwise, we provide them.
96 inline _LIBCPP_INLINE_VISIBILITY
98 addressof(__strong _Tp& __x) _NOEXCEPT
103 #ifdef _LIBCPP_HAS_OBJC_ARC_WEAK
105 inline _LIBCPP_INLINE_VISIBILITY
107 addressof(__weak _Tp& __x) _NOEXCEPT
114 inline _LIBCPP_INLINE_VISIBILITY
116 addressof(__autoreleasing _Tp& __x) _NOEXCEPT
122 inline _LIBCPP_INLINE_VISIBILITY
123 __unsafe_unretained _Tp*
124 addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT
131 // __weak_result_type
134 struct __derives_from_unary_function
137 struct __two {char __lx; char __lxx;};
138 static __two __test(...);
139 template <class _Ap, class _Rp>
140 static unary_function<_Ap, _Rp>
141 __test(const volatile unary_function<_Ap, _Rp>*);
143 static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
144 typedef decltype(__test((_Tp*)0)) type;
148 struct __derives_from_binary_function
151 struct __two {char __lx; char __lxx;};
152 static __two __test(...);
153 template <class _A1, class _A2, class _Rp>
154 static binary_function<_A1, _A2, _Rp>
155 __test(const volatile binary_function<_A1, _A2, _Rp>*);
157 static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
158 typedef decltype(__test((_Tp*)0)) type;
161 template <class _Tp, bool = __derives_from_unary_function<_Tp>::value>
162 struct __maybe_derive_from_unary_function // bool is true
163 : public __derives_from_unary_function<_Tp>::type
168 struct __maybe_derive_from_unary_function<_Tp, false>
172 template <class _Tp, bool = __derives_from_binary_function<_Tp>::value>
173 struct __maybe_derive_from_binary_function // bool is true
174 : public __derives_from_binary_function<_Tp>::type
179 struct __maybe_derive_from_binary_function<_Tp, false>
183 template <class _Tp, bool = __has_result_type<_Tp>::value>
184 struct __weak_result_type_imp // bool is true
185 : public __maybe_derive_from_unary_function<_Tp>,
186 public __maybe_derive_from_binary_function<_Tp>
188 typedef typename _Tp::result_type result_type;
192 struct __weak_result_type_imp<_Tp, false>
193 : public __maybe_derive_from_unary_function<_Tp>,
194 public __maybe_derive_from_binary_function<_Tp>
199 struct __weak_result_type
200 : public __weak_result_type_imp<_Tp>
207 struct __weak_result_type<_Rp ()>
209 typedef _Rp result_type;
213 struct __weak_result_type<_Rp (&)()>
215 typedef _Rp result_type;
219 struct __weak_result_type<_Rp (*)()>
221 typedef _Rp result_type;
226 template <class _Rp, class _A1>
227 struct __weak_result_type<_Rp (_A1)>
228 : public unary_function<_A1, _Rp>
232 template <class _Rp, class _A1>
233 struct __weak_result_type<_Rp (&)(_A1)>
234 : public unary_function<_A1, _Rp>
238 template <class _Rp, class _A1>
239 struct __weak_result_type<_Rp (*)(_A1)>
240 : public unary_function<_A1, _Rp>
244 template <class _Rp, class _Cp>
245 struct __weak_result_type<_Rp (_Cp::*)()>
246 : public unary_function<_Cp*, _Rp>
250 template <class _Rp, class _Cp>
251 struct __weak_result_type<_Rp (_Cp::*)() const>
252 : public unary_function<const _Cp*, _Rp>
256 template <class _Rp, class _Cp>
257 struct __weak_result_type<_Rp (_Cp::*)() volatile>
258 : public unary_function<volatile _Cp*, _Rp>
262 template <class _Rp, class _Cp>
263 struct __weak_result_type<_Rp (_Cp::*)() const volatile>
264 : public unary_function<const volatile _Cp*, _Rp>
270 template <class _Rp, class _A1, class _A2>
271 struct __weak_result_type<_Rp (_A1, _A2)>
272 : public binary_function<_A1, _A2, _Rp>
276 template <class _Rp, class _A1, class _A2>
277 struct __weak_result_type<_Rp (*)(_A1, _A2)>
278 : public binary_function<_A1, _A2, _Rp>
282 template <class _Rp, class _A1, class _A2>
283 struct __weak_result_type<_Rp (&)(_A1, _A2)>
284 : public binary_function<_A1, _A2, _Rp>
288 template <class _Rp, class _Cp, class _A1>
289 struct __weak_result_type<_Rp (_Cp::*)(_A1)>
290 : public binary_function<_Cp*, _A1, _Rp>
294 template <class _Rp, class _Cp, class _A1>
295 struct __weak_result_type<_Rp (_Cp::*)(_A1) const>
296 : public binary_function<const _Cp*, _A1, _Rp>
300 template <class _Rp, class _Cp, class _A1>
301 struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile>
302 : public binary_function<volatile _Cp*, _A1, _Rp>
306 template <class _Rp, class _Cp, class _A1>
307 struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile>
308 : public binary_function<const volatile _Cp*, _A1, _Rp>
313 #ifndef _LIBCPP_HAS_NO_VARIADICS
314 // 3 or more arguments
316 template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
317 struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)>
319 typedef _Rp result_type;
322 template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
323 struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)>
325 typedef _Rp result_type;
328 template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
329 struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)>
331 typedef _Rp result_type;
334 template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
335 struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)>
337 typedef _Rp result_type;
340 template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
341 struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const>
343 typedef _Rp result_type;
346 template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
347 struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile>
349 typedef _Rp result_type;
352 template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
353 struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile>
355 typedef _Rp result_type;
358 #endif // _LIBCPP_HAS_NO_VARIADICS
362 #ifndef _LIBCPP_HAS_NO_VARIADICS
366 template <class _Fp, class _A0, class ..._Args,
368 inline _LIBCPP_INLINE_VISIBILITY
370 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
371 -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
373 return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
376 template <class _Fp, class _A0, class ..._Args,
378 inline _LIBCPP_INLINE_VISIBILITY
380 __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
381 -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
383 return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...);
388 template <class _Fp, class _A0,
390 inline _LIBCPP_INLINE_VISIBILITY
392 __invoke(_Fp&& __f, _A0&& __a0)
393 -> decltype(_VSTD::forward<_A0>(__a0).*__f)
395 return _VSTD::forward<_A0>(__a0).*__f;
398 template <class _Fp, class _A0,
400 inline _LIBCPP_INLINE_VISIBILITY
402 __invoke(_Fp&& __f, _A0&& __a0)
403 -> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
405 return (*_VSTD::forward<_A0>(__a0)).*__f;
410 template <class _Fp, class ..._Args>
411 inline _LIBCPP_INLINE_VISIBILITY
413 __invoke(_Fp&& __f, _Args&& ...__args)
414 -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
416 return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...);
418 template <class _Tp, class ..._Args>
419 struct __invoke_return
421 typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
424 #else // _LIBCPP_HAS_NO_VARIADICS
426 #include <__functional_base_03>
428 #endif // _LIBCPP_HAS_NO_VARIADICS
431 template <class _Ret>
432 struct __invoke_void_return_wrapper
434 #ifndef _LIBCPP_HAS_NO_VARIADICS
435 template <class ..._Args>
436 static _Ret __call(_Args&&... __args) {
437 return __invoke(_VSTD::forward<_Args>(__args)...);
441 static _Ret __call(_Fn __f) {
442 return __invoke(__f);
445 template <class _Fn, class _A0>
446 static _Ret __call(_Fn __f, _A0& __a0) {
447 return __invoke(__f, __a0);
450 template <class _Fn, class _A0, class _A1>
451 static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) {
452 return __invoke(__f, __a0, __a1);
455 template <class _Fn, class _A0, class _A1, class _A2>
456 static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2){
457 return __invoke(__f, __a0, __a1, __a2);
463 struct __invoke_void_return_wrapper<void>
465 #ifndef _LIBCPP_HAS_NO_VARIADICS
466 template <class ..._Args>
467 static void __call(_Args&&... __args) {
468 __invoke(_VSTD::forward<_Args>(__args)...);
472 static void __call(_Fn __f) {
476 template <class _Fn, class _A0>
477 static void __call(_Fn __f, _A0& __a0) {
481 template <class _Fn, class _A0, class _A1>
482 static void __call(_Fn __f, _A0& __a0, _A1& __a1) {
483 __invoke(__f, __a0, __a1);
486 template <class _Fn, class _A0, class _A1, class _A2>
487 static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) {
488 __invoke(__f, __a0, __a1, __a2);
494 class _LIBCPP_TYPE_VIS_ONLY reference_wrapper
495 : public __weak_result_type<_Tp>
504 // construct/copy/destroy
505 _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT
506 : __f_(_VSTD::addressof(__f)) {}
507 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
508 private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
512 _LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;}
513 _LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;}
515 #ifndef _LIBCPP_HAS_NO_VARIADICS
517 template <class... _ArgTypes>
518 _LIBCPP_INLINE_VISIBILITY
519 typename __invoke_of<type&, _ArgTypes...>::type
520 operator() (_ArgTypes&&... __args) const {
521 return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
525 _LIBCPP_INLINE_VISIBILITY
526 typename __invoke_return<type>::type
527 operator() () const {
528 return __invoke(get());
532 _LIBCPP_INLINE_VISIBILITY
533 typename __invoke_return0<type, _A0>::type
534 operator() (_A0& __a0) const {
535 return __invoke(get(), __a0);
539 _LIBCPP_INLINE_VISIBILITY
540 typename __invoke_return0<type, _A0 const>::type
541 operator() (_A0 const& __a0) const {
542 return __invoke(get(), __a0);
545 template <class _A0, class _A1>
546 _LIBCPP_INLINE_VISIBILITY
547 typename __invoke_return1<type, _A0, _A1>::type
548 operator() (_A0& __a0, _A1& __a1) const {
549 return __invoke(get(), __a0, __a1);
552 template <class _A0, class _A1>
553 _LIBCPP_INLINE_VISIBILITY
554 typename __invoke_return1<type, _A0 const, _A1>::type
555 operator() (_A0 const& __a0, _A1& __a1) const {
556 return __invoke(get(), __a0, __a1);
559 template <class _A0, class _A1>
560 _LIBCPP_INLINE_VISIBILITY
561 typename __invoke_return1<type, _A0, _A1 const>::type
562 operator() (_A0& __a0, _A1 const& __a1) const {
563 return __invoke(get(), __a0, __a1);
566 template <class _A0, class _A1>
567 _LIBCPP_INLINE_VISIBILITY
568 typename __invoke_return1<type, _A0 const, _A1 const>::type
569 operator() (_A0 const& __a0, _A1 const& __a1) const {
570 return __invoke(get(), __a0, __a1);
573 template <class _A0, class _A1, class _A2>
574 _LIBCPP_INLINE_VISIBILITY
575 typename __invoke_return2<type, _A0, _A1, _A2>::type
576 operator() (_A0& __a0, _A1& __a1, _A2& __a2) const {
577 return __invoke(get(), __a0, __a1, __a2);
580 template <class _A0, class _A1, class _A2>
581 _LIBCPP_INLINE_VISIBILITY
582 typename __invoke_return2<type, _A0 const, _A1, _A2>::type
583 operator() (_A0 const& __a0, _A1& __a1, _A2& __a2) const {
584 return __invoke(get(), __a0, __a1, __a2);
587 template <class _A0, class _A1, class _A2>
588 _LIBCPP_INLINE_VISIBILITY
589 typename __invoke_return2<type, _A0, _A1 const, _A2>::type
590 operator() (_A0& __a0, _A1 const& __a1, _A2& __a2) const {
591 return __invoke(get(), __a0, __a1, __a2);
594 template <class _A0, class _A1, class _A2>
595 _LIBCPP_INLINE_VISIBILITY
596 typename __invoke_return2<type, _A0, _A1, _A2 const>::type
597 operator() (_A0& __a0, _A1& __a1, _A2 const& __a2) const {
598 return __invoke(get(), __a0, __a1, __a2);
601 template <class _A0, class _A1, class _A2>
602 _LIBCPP_INLINE_VISIBILITY
603 typename __invoke_return2<type, _A0 const, _A1 const, _A2>::type
604 operator() (_A0 const& __a0, _A1 const& __a1, _A2& __a2) const {
605 return __invoke(get(), __a0, __a1, __a2);
608 template <class _A0, class _A1, class _A2>
609 _LIBCPP_INLINE_VISIBILITY
610 typename __invoke_return2<type, _A0 const, _A1, _A2 const>::type
611 operator() (_A0 const& __a0, _A1& __a1, _A2 const& __a2) const {
612 return __invoke(get(), __a0, __a1, __a2);
615 template <class _A0, class _A1, class _A2>
616 _LIBCPP_INLINE_VISIBILITY
617 typename __invoke_return2<type, _A0, _A1 const, _A2 const>::type
618 operator() (_A0& __a0, _A1 const& __a1, _A2 const& __a2) const {
619 return __invoke(get(), __a0, __a1, __a2);
622 template <class _A0, class _A1, class _A2>
623 _LIBCPP_INLINE_VISIBILITY
624 typename __invoke_return2<type, _A0 const, _A1 const, _A2 const>::type
625 operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
626 return __invoke(get(), __a0, __a1, __a2);
628 #endif // _LIBCPP_HAS_NO_VARIADICS
631 template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
632 template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
633 template <class _Tp> struct __is_reference_wrapper
634 : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};
637 inline _LIBCPP_INLINE_VISIBILITY
638 reference_wrapper<_Tp>
639 ref(_Tp& __t) _NOEXCEPT
641 return reference_wrapper<_Tp>(__t);
645 inline _LIBCPP_INLINE_VISIBILITY
646 reference_wrapper<_Tp>
647 ref(reference_wrapper<_Tp> __t) _NOEXCEPT
649 return ref(__t.get());
653 inline _LIBCPP_INLINE_VISIBILITY
654 reference_wrapper<const _Tp>
655 cref(const _Tp& __t) _NOEXCEPT
657 return reference_wrapper<const _Tp>(__t);
661 inline _LIBCPP_INLINE_VISIBILITY
662 reference_wrapper<const _Tp>
663 cref(reference_wrapper<_Tp> __t) _NOEXCEPT
665 return cref(__t.get());
668 #ifndef _LIBCPP_HAS_NO_VARIADICS
669 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
670 #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
672 template <class _Tp> void ref(const _Tp&&) = delete;
673 template <class _Tp> void cref(const _Tp&&) = delete;
675 #else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
677 template <class _Tp> void ref(const _Tp&&);// = delete;
678 template <class _Tp> void cref(const _Tp&&);// = delete;
680 #endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
682 #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
684 #endif // _LIBCPP_HAS_NO_VARIADICS
686 #if _LIBCPP_STD_VER > 11
687 template <class _Tp1, class _Tp2 = void>
688 struct __is_transparent
691 struct __two {char __lx; char __lxx;};
692 template <class _Up> static __two __test(...);
693 template <class _Up> static char __test(typename _Up::is_transparent* = 0);
695 static const bool value = sizeof(__test<_Tp1>(0)) == 1;
701 struct _LIBCPP_TYPE_VIS_ONLY allocator_arg_t { };
703 #if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
704 extern const allocator_arg_t allocator_arg;
706 constexpr allocator_arg_t allocator_arg = allocator_arg_t();
712 struct __has_allocator_type
715 struct __two {char __lx; char __lxx;};
716 template <class _Up> static __two __test(...);
717 template <class _Up> static char __test(typename _Up::allocator_type* = 0);
719 static const bool value = sizeof(__test<_Tp>(0)) == 1;
722 template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value>
723 struct __uses_allocator
724 : public integral_constant<bool,
725 is_convertible<_Alloc, typename _Tp::allocator_type>::value>
729 template <class _Tp, class _Alloc>
730 struct __uses_allocator<_Tp, _Alloc, false>
735 template <class _Tp, class _Alloc>
736 struct _LIBCPP_TYPE_VIS_ONLY uses_allocator
737 : public __uses_allocator<_Tp, _Alloc>
741 #ifndef _LIBCPP_HAS_NO_VARIADICS
743 // allocator construction
745 template <class _Tp, class _Alloc, class ..._Args>
746 struct __uses_alloc_ctor_imp
748 static const bool __ua = uses_allocator<_Tp, _Alloc>::value;
749 static const bool __ic =
750 is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
751 static const int value = __ua ? 2 - __ic : 0;
754 template <class _Tp, class _Alloc, class ..._Args>
755 struct __uses_alloc_ctor
756 : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value>
759 template <class _Tp, class _Allocator, class... _Args>
760 inline _LIBCPP_INLINE_VISIBILITY
761 void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args )
763 new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
766 template <class _Tp, class _Allocator, class... _Args>
767 inline _LIBCPP_INLINE_VISIBILITY
768 void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
770 new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
773 template <class _Tp, class _Allocator, class... _Args>
774 inline _LIBCPP_INLINE_VISIBILITY
775 void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
777 new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
780 template <class _Tp, class _Allocator, class... _Args>
781 inline _LIBCPP_INLINE_VISIBILITY
782 void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&... __args)
784 __user_alloc_construct_impl(
785 __uses_alloc_ctor<_Tp, _Allocator>(),
786 __storage, __a, _VSTD::forward<_Args>(__args)...
789 #endif // _LIBCPP_HAS_NO_VARIADICS
791 _LIBCPP_END_NAMESPACE_STD
793 #endif // _LIBCPP_FUNCTIONAL_BASE