1// -*- C++ -*- 2//===----------------------------------------------------------------------===// 3// 4// The LLVM Compiler Infrastructure 5// 6// This file is dual licensed under the MIT and the University of Illinois Open 7// Source Licenses. See LICENSE.TXT for details. 8// 9//===----------------------------------------------------------------------===// 10 11#ifndef _LIBCPP_FUNCTIONAL_BASE 12#define _LIBCPP_FUNCTIONAL_BASE 13 14#include <__config> 15#include <type_traits> 16#include <typeinfo> 17#include <exception> 18#include <new> 19 20#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 21#pragma GCC system_header 22#endif 23 24_LIBCPP_BEGIN_NAMESPACE_STD 25 26template <class _Arg, class _Result> 27struct _LIBCPP_TYPE_VIS_ONLY unary_function 28{ 29 typedef _Arg argument_type; 30 typedef _Result result_type; 31}; 32 33template <class _Arg1, class _Arg2, class _Result> 34struct _LIBCPP_TYPE_VIS_ONLY binary_function 35{ 36 typedef _Arg1 first_argument_type; 37 typedef _Arg2 second_argument_type; 38 typedef _Result result_type; 39}; 40 41template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash; 42 43template <class _Tp> 44struct __has_result_type 45{ 46private: 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); 50public: 51 static const bool value = sizeof(__test<_Tp>(0)) == 1; 52}; 53 54#if _LIBCPP_STD_VER > 11 55template <class _Tp = void> 56#else 57template <class _Tp> 58#endif 59struct _LIBCPP_TYPE_VIS_ONLY less : binary_function<_Tp, _Tp, bool> 60{ 61 _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY 62 bool operator()(const _Tp& __x, const _Tp& __y) const 63 {return __x < __y;} 64}; 65 66#if _LIBCPP_STD_VER > 11 67template <> 68struct _LIBCPP_TYPE_VIS_ONLY less<void> 69{ 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; 77}; 78#endif 79 80// addressof 81 82template <class _Tp> 83inline _LIBCPP_INLINE_VISIBILITY 84_Tp* 85addressof(_Tp& __x) _NOEXCEPT 86{ 87 return (_Tp*)&reinterpret_cast<const volatile char&>(__x); 88} 89 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. 95template <class _Tp> 96inline _LIBCPP_INLINE_VISIBILITY 97__strong _Tp* 98addressof(__strong _Tp& __x) _NOEXCEPT 99{ 100 return &__x; 101} 102 103#ifdef _LIBCPP_HAS_OBJC_ARC_WEAK 104template <class _Tp> 105inline _LIBCPP_INLINE_VISIBILITY 106__weak _Tp* 107addressof(__weak _Tp& __x) _NOEXCEPT 108{ 109 return &__x; 110} 111#endif 112 113template <class _Tp> 114inline _LIBCPP_INLINE_VISIBILITY 115__autoreleasing _Tp* 116addressof(__autoreleasing _Tp& __x) _NOEXCEPT 117{ 118 return &__x; 119} 120 121template <class _Tp> 122inline _LIBCPP_INLINE_VISIBILITY 123__unsafe_unretained _Tp* 124addressof(__unsafe_unretained _Tp& __x) _NOEXCEPT 125{ 126 return &__x; 127} 128#endif 129 130 131// __weak_result_type 132 133template <class _Tp> 134struct __derives_from_unary_function 135{ 136private: 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>*); 142public: 143 static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; 144 typedef decltype(__test((_Tp*)0)) type; 145}; 146 147template <class _Tp> 148struct __derives_from_binary_function 149{ 150private: 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>*); 156public: 157 static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value; 158 typedef decltype(__test((_Tp*)0)) type; 159}; 160 161template <class _Tp, bool = __derives_from_unary_function<_Tp>::value> 162struct __maybe_derive_from_unary_function // bool is true 163 : public __derives_from_unary_function<_Tp>::type 164{ 165}; 166 167template <class _Tp> 168struct __maybe_derive_from_unary_function<_Tp, false> 169{ 170}; 171 172template <class _Tp, bool = __derives_from_binary_function<_Tp>::value> 173struct __maybe_derive_from_binary_function // bool is true 174 : public __derives_from_binary_function<_Tp>::type 175{ 176}; 177 178template <class _Tp> 179struct __maybe_derive_from_binary_function<_Tp, false> 180{ 181}; 182 183template <class _Tp, bool = __has_result_type<_Tp>::value> 184struct __weak_result_type_imp // bool is true 185 : public __maybe_derive_from_unary_function<_Tp>, 186 public __maybe_derive_from_binary_function<_Tp> 187{ 188 typedef typename _Tp::result_type result_type; 189}; 190 191template <class _Tp> 192struct __weak_result_type_imp<_Tp, false> 193 : public __maybe_derive_from_unary_function<_Tp>, 194 public __maybe_derive_from_binary_function<_Tp> 195{ 196}; 197 198template <class _Tp> 199struct __weak_result_type 200 : public __weak_result_type_imp<_Tp> 201{ 202}; 203 204// 0 argument case 205 206template <class _Rp> 207struct __weak_result_type<_Rp ()> 208{ 209 typedef _Rp result_type; 210}; 211 212template <class _Rp> 213struct __weak_result_type<_Rp (&)()> 214{ 215 typedef _Rp result_type; 216}; 217 218template <class _Rp> 219struct __weak_result_type<_Rp (*)()> 220{ 221 typedef _Rp result_type; 222}; 223 224// 1 argument case 225 226template <class _Rp, class _A1> 227struct __weak_result_type<_Rp (_A1)> 228 : public unary_function<_A1, _Rp> 229{ 230}; 231 232template <class _Rp, class _A1> 233struct __weak_result_type<_Rp (&)(_A1)> 234 : public unary_function<_A1, _Rp> 235{ 236}; 237 238template <class _Rp, class _A1> 239struct __weak_result_type<_Rp (*)(_A1)> 240 : public unary_function<_A1, _Rp> 241{ 242}; 243 244template <class _Rp, class _Cp> 245struct __weak_result_type<_Rp (_Cp::*)()> 246 : public unary_function<_Cp*, _Rp> 247{ 248}; 249 250template <class _Rp, class _Cp> 251struct __weak_result_type<_Rp (_Cp::*)() const> 252 : public unary_function<const _Cp*, _Rp> 253{ 254}; 255 256template <class _Rp, class _Cp> 257struct __weak_result_type<_Rp (_Cp::*)() volatile> 258 : public unary_function<volatile _Cp*, _Rp> 259{ 260}; 261 262template <class _Rp, class _Cp> 263struct __weak_result_type<_Rp (_Cp::*)() const volatile> 264 : public unary_function<const volatile _Cp*, _Rp> 265{ 266}; 267 268// 2 argument case 269 270template <class _Rp, class _A1, class _A2> 271struct __weak_result_type<_Rp (_A1, _A2)> 272 : public binary_function<_A1, _A2, _Rp> 273{ 274}; 275 276template <class _Rp, class _A1, class _A2> 277struct __weak_result_type<_Rp (*)(_A1, _A2)> 278 : public binary_function<_A1, _A2, _Rp> 279{ 280}; 281 282template <class _Rp, class _A1, class _A2> 283struct __weak_result_type<_Rp (&)(_A1, _A2)> 284 : public binary_function<_A1, _A2, _Rp> 285{ 286}; 287 288template <class _Rp, class _Cp, class _A1> 289struct __weak_result_type<_Rp (_Cp::*)(_A1)> 290 : public binary_function<_Cp*, _A1, _Rp> 291{ 292}; 293 294template <class _Rp, class _Cp, class _A1> 295struct __weak_result_type<_Rp (_Cp::*)(_A1) const> 296 : public binary_function<const _Cp*, _A1, _Rp> 297{ 298}; 299 300template <class _Rp, class _Cp, class _A1> 301struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile> 302 : public binary_function<volatile _Cp*, _A1, _Rp> 303{ 304}; 305 306template <class _Rp, class _Cp, class _A1> 307struct __weak_result_type<_Rp (_Cp::*)(_A1) const volatile> 308 : public binary_function<const volatile _Cp*, _A1, _Rp> 309{ 310}; 311 312 313#ifndef _LIBCPP_HAS_NO_VARIADICS 314// 3 or more arguments 315 316template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> 317struct __weak_result_type<_Rp (_A1, _A2, _A3, _A4...)> 318{ 319 typedef _Rp result_type; 320}; 321 322template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> 323struct __weak_result_type<_Rp (&)(_A1, _A2, _A3, _A4...)> 324{ 325 typedef _Rp result_type; 326}; 327 328template <class _Rp, class _A1, class _A2, class _A3, class ..._A4> 329struct __weak_result_type<_Rp (*)(_A1, _A2, _A3, _A4...)> 330{ 331 typedef _Rp result_type; 332}; 333 334template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> 335struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...)> 336{ 337 typedef _Rp result_type; 338}; 339 340template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> 341struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const> 342{ 343 typedef _Rp result_type; 344}; 345 346template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> 347struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) volatile> 348{ 349 typedef _Rp result_type; 350}; 351 352template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3> 353struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> 354{ 355 typedef _Rp result_type; 356}; 357 358#endif // _LIBCPP_HAS_NO_VARIADICS 359 360// __invoke 361 362#ifndef _LIBCPP_HAS_NO_VARIADICS 363 364// bullets 1 and 2 365 366template <class _Fp, class _A0, class ..._Args, 367 class> 368inline _LIBCPP_INLINE_VISIBILITY 369auto 370__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) 371 -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...)) 372{ 373 return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...); 374} 375 376template <class _Fp, class _A0, class ..._Args, 377 class> 378inline _LIBCPP_INLINE_VISIBILITY 379auto 380__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) 381 -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...)) 382{ 383 return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...); 384} 385 386// bullets 3 and 4 387 388template <class _Fp, class _A0, 389 class> 390inline _LIBCPP_INLINE_VISIBILITY 391auto 392__invoke(_Fp&& __f, _A0&& __a0) 393 -> decltype(_VSTD::forward<_A0>(__a0).*__f) 394{ 395 return _VSTD::forward<_A0>(__a0).*__f; 396} 397 398template <class _Fp, class _A0, 399 class> 400inline _LIBCPP_INLINE_VISIBILITY 401auto 402__invoke(_Fp&& __f, _A0&& __a0) 403 -> decltype((*_VSTD::forward<_A0>(__a0)).*__f) 404{ 405 return (*_VSTD::forward<_A0>(__a0)).*__f; 406} 407 408// bullet 5 409 410template <class _Fp, class ..._Args> 411inline _LIBCPP_INLINE_VISIBILITY 412auto 413__invoke(_Fp&& __f, _Args&& ...__args) 414 -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...)) 415{ 416 return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...); 417} 418template <class _Tp, class ..._Args> 419struct __invoke_return 420{ 421 typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type; 422}; 423 424#else // _LIBCPP_HAS_NO_VARIADICS 425 426#include <__functional_base_03> 427 428#endif // _LIBCPP_HAS_NO_VARIADICS 429 430 431template <class _Ret> 432struct __invoke_void_return_wrapper 433{ 434#ifndef _LIBCPP_HAS_NO_VARIADICS 435 template <class ..._Args> 436 static _Ret __call(_Args&&... __args) { 437 return __invoke(_VSTD::forward<_Args>(__args)...); 438 } 439#else 440 template <class _Fn> 441 static _Ret __call(_Fn __f) { 442 return __invoke(__f); 443 } 444 445 template <class _Fn, class _A0> 446 static _Ret __call(_Fn __f, _A0& __a0) { 447 return __invoke(__f, __a0); 448 } 449 450 template <class _Fn, class _A0, class _A1> 451 static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) { 452 return __invoke(__f, __a0, __a1); 453 } 454 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); 458 } 459#endif 460}; 461 462template <> 463struct __invoke_void_return_wrapper<void> 464{ 465#ifndef _LIBCPP_HAS_NO_VARIADICS 466 template <class ..._Args> 467 static void __call(_Args&&... __args) { 468 __invoke(_VSTD::forward<_Args>(__args)...); 469 } 470#else 471 template <class _Fn> 472 static void __call(_Fn __f) { 473 __invoke(__f); 474 } 475 476 template <class _Fn, class _A0> 477 static void __call(_Fn __f, _A0& __a0) { 478 __invoke(__f, __a0); 479 } 480 481 template <class _Fn, class _A0, class _A1> 482 static void __call(_Fn __f, _A0& __a0, _A1& __a1) { 483 __invoke(__f, __a0, __a1); 484 } 485 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); 489 } 490#endif 491}; 492 493template <class _Tp> 494class _LIBCPP_TYPE_VIS_ONLY reference_wrapper 495 : public __weak_result_type<_Tp> 496{ 497public: 498 // types 499 typedef _Tp type; 500private: 501 type* __f_; 502 503public: 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 509#endif 510 511 // access 512 _LIBCPP_INLINE_VISIBILITY operator type& () const _NOEXCEPT {return *__f_;} 513 _LIBCPP_INLINE_VISIBILITY type& get() const _NOEXCEPT {return *__f_;} 514 515#ifndef _LIBCPP_HAS_NO_VARIADICS 516 // invoke 517 template <class... _ArgTypes> 518 _LIBCPP_INLINE_VISIBILITY 519 typename __invoke_of<type&, _ArgTypes...>::type 520 operator() (_ArgTypes&&... __args) const 521 { 522 return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...); 523 } 524#else 525 526 _LIBCPP_INLINE_VISIBILITY 527 typename __invoke_return<type>::type 528 operator() () const 529 { 530 return __invoke(get()); 531 } 532 533 template <class _A0> 534 _LIBCPP_INLINE_VISIBILITY 535 typename __invoke_return0<type&, _A0>::type 536 operator() (_A0& __a0) const 537 { 538 return __invoke<type&, _A0>(get(), __a0); 539 } 540 541 template <class _A0, class _A1> 542 _LIBCPP_INLINE_VISIBILITY 543 typename __invoke_return1<type&, _A0, _A1>::type 544 operator() (_A0& __a0, _A1& __a1) const 545 { 546 return __invoke<type&, _A0, _A1>(get(), __a0, __a1); 547 } 548 549 template <class _A0, class _A1, class _A2> 550 _LIBCPP_INLINE_VISIBILITY 551 typename __invoke_return2<type&, _A0, _A1, _A2>::type 552 operator() (_A0& __a0, _A1& __a1, _A2& __a2) const 553 { 554 return __invoke<type&, _A0, _A1, _A2>(get(), __a0, __a1, __a2); 555 } 556#endif // _LIBCPP_HAS_NO_VARIADICS 557}; 558 559template <class _Tp> struct __is_reference_wrapper_impl : public false_type {}; 560template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {}; 561template <class _Tp> struct __is_reference_wrapper 562 : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {}; 563 564template <class _Tp> 565inline _LIBCPP_INLINE_VISIBILITY 566reference_wrapper<_Tp> 567ref(_Tp& __t) _NOEXCEPT 568{ 569 return reference_wrapper<_Tp>(__t); 570} 571 572template <class _Tp> 573inline _LIBCPP_INLINE_VISIBILITY 574reference_wrapper<_Tp> 575ref(reference_wrapper<_Tp> __t) _NOEXCEPT 576{ 577 return ref(__t.get()); 578} 579 580template <class _Tp> 581inline _LIBCPP_INLINE_VISIBILITY 582reference_wrapper<const _Tp> 583cref(const _Tp& __t) _NOEXCEPT 584{ 585 return reference_wrapper<const _Tp>(__t); 586} 587 588template <class _Tp> 589inline _LIBCPP_INLINE_VISIBILITY 590reference_wrapper<const _Tp> 591cref(reference_wrapper<_Tp> __t) _NOEXCEPT 592{ 593 return cref(__t.get()); 594} 595 596#ifndef _LIBCPP_HAS_NO_VARIADICS 597#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 598#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS 599 600template <class _Tp> void ref(const _Tp&&) = delete; 601template <class _Tp> void cref(const _Tp&&) = delete; 602 603#else // _LIBCPP_HAS_NO_DELETED_FUNCTIONS 604 605template <class _Tp> void ref(const _Tp&&);// = delete; 606template <class _Tp> void cref(const _Tp&&);// = delete; 607 608#endif // _LIBCPP_HAS_NO_DELETED_FUNCTIONS 609 610#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 611 612#endif // _LIBCPP_HAS_NO_VARIADICS 613 614#if _LIBCPP_STD_VER > 11 615template <class _Tp1, class _Tp2 = void> 616struct __is_transparent 617{ 618private: 619 struct __two {char __lx; char __lxx;}; 620 template <class _Up> static __two __test(...); 621 template <class _Up> static char __test(typename _Up::is_transparent* = 0); 622public: 623 static const bool value = sizeof(__test<_Tp1>(0)) == 1; 624}; 625#endif 626 627// allocator_arg_t 628 629struct _LIBCPP_TYPE_VIS_ONLY allocator_arg_t { }; 630 631#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY) 632extern const allocator_arg_t allocator_arg; 633#else 634constexpr allocator_arg_t allocator_arg = allocator_arg_t(); 635#endif 636 637// uses_allocator 638 639template <class _Tp> 640struct __has_allocator_type 641{ 642private: 643 struct __two {char __lx; char __lxx;}; 644 template <class _Up> static __two __test(...); 645 template <class _Up> static char __test(typename _Up::allocator_type* = 0); 646public: 647 static const bool value = sizeof(__test<_Tp>(0)) == 1; 648}; 649 650template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value> 651struct __uses_allocator 652 : public integral_constant<bool, 653 is_convertible<_Alloc, typename _Tp::allocator_type>::value> 654{ 655}; 656 657template <class _Tp, class _Alloc> 658struct __uses_allocator<_Tp, _Alloc, false> 659 : public false_type 660{ 661}; 662 663template <class _Tp, class _Alloc> 664struct _LIBCPP_TYPE_VIS_ONLY uses_allocator 665 : public __uses_allocator<_Tp, _Alloc> 666{ 667}; 668 669#ifndef _LIBCPP_HAS_NO_VARIADICS 670 671// allocator construction 672 673template <class _Tp, class _Alloc, class ..._Args> 674struct __uses_alloc_ctor_imp 675{ 676 static const bool __ua = uses_allocator<_Tp, _Alloc>::value; 677 static const bool __ic = 678 is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value; 679 static const int value = __ua ? 2 - __ic : 0; 680}; 681 682template <class _Tp, class _Alloc, class ..._Args> 683struct __uses_alloc_ctor 684 : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value> 685 {}; 686 687template <class _Tp, class _Allocator, class... _Args> 688inline _LIBCPP_INLINE_VISIBILITY 689void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args ) 690{ 691 new (__storage) _Tp (_VSTD::forward<_Args>(__args)...); 692} 693 694template <class _Tp, class _Allocator, class... _Args> 695inline _LIBCPP_INLINE_VISIBILITY 696void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) 697{ 698 new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...); 699} 700 701template <class _Tp, class _Allocator, class... _Args> 702inline _LIBCPP_INLINE_VISIBILITY 703void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args ) 704{ 705 new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a); 706} 707 708template <class _Tp, class _Allocator, class... _Args> 709inline _LIBCPP_INLINE_VISIBILITY 710void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&... __args) 711{ 712 __user_alloc_construct_impl( 713 __uses_alloc_ctor<_Tp, _Allocator>(), 714 __storage, __a, _VSTD::forward<_Args>(__args)... 715 ); 716} 717#endif // _LIBCPP_HAS_NO_VARIADICS 718 719_LIBCPP_END_NAMESPACE_STD 720 721#endif // _LIBCPP_FUNCTIONAL_BASE 722