Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-05 08:28:56

0001 /*
0002 Copyright 2020-2022 Glen Joseph Fernandes
0003 (glenjofe@gmail.com)
0004 
0005 Distributed under the Boost Software License, Version 1.0.
0006 (http://www.boost.org/LICENSE_1_0.txt)
0007 */
0008 #ifndef BOOST_CORE_ALLOCATOR_ACCESS_HPP
0009 #define BOOST_CORE_ALLOCATOR_ACCESS_HPP
0010 
0011 #include <boost/config.hpp>
0012 #include <boost/core/pointer_traits.hpp>
0013 #include <limits>
0014 #include <new>
0015 #if !defined(BOOST_NO_CXX11_ALLOCATOR)
0016 #include <type_traits>
0017 #endif
0018 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0019 #include <utility>
0020 #endif
0021 
0022 #if defined(BOOST_GCC_VERSION) && (BOOST_GCC_VERSION >= 40300)
0023 #define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T)
0024 #elif defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1500)
0025 #define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T)
0026 #elif defined(BOOST_MSVC) && (BOOST_MSVC >= 1400)
0027 #define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T)
0028 #elif defined(BOOST_CLANG) && !defined(__CUDACC__)
0029 #if __has_feature(is_empty)
0030 #define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T)
0031 #endif
0032 #elif defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)
0033 #define BOOST_DETAIL_ALLOC_EMPTY(T) __oracle_is_empty(T)
0034 #elif defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600)
0035 #define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T)
0036 #elif defined(BOOST_CODEGEARC)
0037 #define BOOST_DETAIL_ALLOC_EMPTY(T) __is_empty(T)
0038 #endif
0039 
0040 #if defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH)
0041 _LIBCPP_SUPPRESS_DEPRECATED_PUSH
0042 #endif
0043 #if defined(_STL_DISABLE_DEPRECATED_WARNING)
0044 _STL_DISABLE_DEPRECATED_WARNING
0045 #endif
0046 #if defined(__clang__) && defined(__has_warning)
0047 # if __has_warning("-Wdeprecated-declarations")
0048 #  pragma clang diagnostic push
0049 #  pragma clang diagnostic ignored "-Wdeprecated-declarations"
0050 # endif
0051 #elif defined(_MSC_VER)
0052 # pragma warning(push)
0053 # pragma warning(disable: 4996)
0054 #elif defined(BOOST_GCC) && BOOST_GCC >= 40600
0055 # pragma GCC diagnostic push
0056 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
0057 #endif
0058 
0059 namespace boost {
0060 
0061 template<class A>
0062 struct allocator_value_type {
0063     typedef typename A::value_type type;
0064 };
0065 
0066 namespace detail {
0067 
0068 template<class A, class = void>
0069 struct alloc_ptr {
0070     typedef typename boost::allocator_value_type<A>::type* type;
0071 };
0072 
0073 template<class>
0074 struct alloc_void {
0075     typedef void type;
0076 };
0077 
0078 template<class A>
0079 struct alloc_ptr<A,
0080     typename alloc_void<typename A::pointer>::type> {
0081     typedef typename A::pointer type;
0082 };
0083 
0084 } /* detail */
0085 
0086 template<class A>
0087 struct allocator_pointer {
0088     typedef typename detail::alloc_ptr<A>::type type;
0089 };
0090 
0091 namespace detail {
0092 
0093 template<class A, class = void>
0094 struct alloc_const_ptr {
0095     typedef typename boost::pointer_traits<typename
0096         boost::allocator_pointer<A>::type>::template rebind_to<const typename
0097             boost::allocator_value_type<A>::type>::type type;
0098 };
0099 
0100 template<class A>
0101 struct alloc_const_ptr<A,
0102     typename alloc_void<typename A::const_pointer>::type> {
0103     typedef typename A::const_pointer type;
0104 };
0105 
0106 } /* detail */
0107 
0108 template<class A>
0109 struct allocator_const_pointer {
0110     typedef typename detail::alloc_const_ptr<A>::type type;
0111 };
0112 
0113 namespace detail {
0114 
0115 template<class, class>
0116 struct alloc_to { };
0117 
0118 #if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0119 template<template<class> class A, class T, class U>
0120 struct alloc_to<A<U>, T> {
0121     typedef A<T> type;
0122 };
0123 
0124 template<template<class, class> class A, class T, class U, class V>
0125 struct alloc_to<A<U, V>, T> {
0126     typedef A<T, V> type;
0127 };
0128 
0129 template<template<class, class, class> class A, class T, class U, class V1,
0130     class V2>
0131 struct alloc_to<A<U, V1, V2>, T> {
0132     typedef A<T, V1, V2> type;
0133 };
0134 #else
0135 template<template<class, class...> class A, class T, class U, class... V>
0136 struct alloc_to<A<U, V...>, T> {
0137     typedef A<T, V...> type;
0138 };
0139 #endif
0140 
0141 template<class A, class T, class = void>
0142 struct alloc_rebind {
0143     typedef typename alloc_to<A, T>::type type;
0144 };
0145 
0146 template<class A, class T>
0147 struct alloc_rebind<A, T,
0148     typename alloc_void<typename A::template rebind<T>::other>::type> {
0149     typedef typename A::template rebind<T>::other type;
0150 };
0151 
0152 } /* detail */
0153 
0154 template<class A, class T>
0155 struct allocator_rebind {
0156     typedef typename detail::alloc_rebind<A, T>::type type;
0157 };
0158 
0159 namespace detail {
0160 
0161 template<class A, class = void>
0162 struct alloc_void_ptr {
0163      typedef typename boost::pointer_traits<typename
0164         boost::allocator_pointer<A>::type>::template
0165             rebind_to<void>::type type;
0166 };
0167 
0168 template<class A>
0169 struct alloc_void_ptr<A,
0170     typename alloc_void<typename A::void_pointer>::type> {
0171     typedef typename A::void_pointer type;
0172 };
0173 
0174 } /* detail */
0175 
0176 template<class A>
0177 struct allocator_void_pointer {
0178     typedef typename detail::alloc_void_ptr<A>::type type;
0179 };
0180 
0181 namespace detail {
0182 
0183 template<class A, class = void>
0184 struct alloc_const_void_ptr {
0185      typedef typename boost::pointer_traits<typename
0186         boost::allocator_pointer<A>::type>::template
0187             rebind_to<const void>::type type;
0188 };
0189 
0190 template<class A>
0191 struct alloc_const_void_ptr<A,
0192     typename alloc_void<typename A::const_void_pointer>::type> {
0193     typedef typename A::const_void_pointer type;
0194 };
0195 
0196 } /* detail */
0197 
0198 template<class A>
0199 struct allocator_const_void_pointer {
0200     typedef typename detail::alloc_const_void_ptr<A>::type type;
0201 };
0202 
0203 namespace detail {
0204 
0205 template<class A, class = void>
0206 struct alloc_diff_type {
0207     typedef typename boost::pointer_traits<typename
0208         boost::allocator_pointer<A>::type>::difference_type type;
0209 };
0210 
0211 template<class A>
0212 struct alloc_diff_type<A,
0213     typename alloc_void<typename A::difference_type>::type> {
0214     typedef typename A::difference_type type;
0215 };
0216 
0217 } /* detail */
0218 
0219 template<class A>
0220 struct allocator_difference_type {
0221     typedef typename detail::alloc_diff_type<A>::type type;
0222 };
0223 
0224 namespace detail {
0225 
0226 #if defined(BOOST_NO_CXX11_ALLOCATOR)
0227 template<class A, class = void>
0228 struct alloc_size_type {
0229     typedef std::size_t type;
0230 };
0231 #else
0232 template<class A, class = void>
0233 struct alloc_size_type {
0234     typedef typename std::make_unsigned<typename
0235         boost::allocator_difference_type<A>::type>::type type;
0236 };
0237 #endif
0238 
0239 template<class A>
0240 struct alloc_size_type<A,
0241     typename alloc_void<typename A::size_type>::type> {
0242     typedef typename A::size_type type;
0243 };
0244 
0245 } /* detail */
0246 
0247 template<class A>
0248 struct allocator_size_type {
0249     typedef typename detail::alloc_size_type<A>::type type;
0250 };
0251 
0252 namespace detail {
0253 
0254 #if defined(BOOST_NO_CXX11_ALLOCATOR)
0255 template<bool V>
0256 struct alloc_bool {
0257     typedef bool value_type;
0258     typedef alloc_bool type;
0259 
0260     static const bool value = V;
0261 
0262     operator bool() const BOOST_NOEXCEPT {
0263         return V;
0264     }
0265 
0266     bool operator()() const BOOST_NOEXCEPT {
0267         return V;
0268     }
0269 };
0270 
0271 template<bool V>
0272 const bool alloc_bool<V>::value;
0273 
0274 typedef alloc_bool<false> alloc_false;
0275 #else
0276 typedef std::false_type alloc_false;
0277 #endif
0278 
0279 template<class A, class = void>
0280 struct alloc_pocca {
0281     typedef alloc_false type;
0282 };
0283 
0284 template<class A>
0285 struct alloc_pocca<A,
0286     typename alloc_void<typename
0287         A::propagate_on_container_copy_assignment>::type> {
0288     typedef typename A::propagate_on_container_copy_assignment type;
0289 };
0290 
0291 } /* detail */
0292 
0293 template<class A, class = void>
0294 struct allocator_propagate_on_container_copy_assignment {
0295     typedef typename detail::alloc_pocca<A>::type type;
0296 };
0297 
0298 namespace detail {
0299 
0300 template<class A, class = void>
0301 struct alloc_pocma {
0302     typedef alloc_false type;
0303 };
0304 
0305 template<class A>
0306 struct alloc_pocma<A,
0307     typename alloc_void<typename
0308         A::propagate_on_container_move_assignment>::type> {
0309     typedef typename A::propagate_on_container_move_assignment type;
0310 };
0311 
0312 } /* detail */
0313 
0314 template<class A>
0315 struct allocator_propagate_on_container_move_assignment {
0316     typedef typename detail::alloc_pocma<A>::type type;
0317 };
0318 
0319 namespace detail {
0320 
0321 template<class A, class = void>
0322 struct alloc_pocs {
0323     typedef alloc_false type;
0324 };
0325 
0326 template<class A>
0327 struct alloc_pocs<A,
0328     typename alloc_void<typename A::propagate_on_container_swap>::type> {
0329     typedef typename A::propagate_on_container_swap type;
0330 };
0331 
0332 } /* detail */
0333 
0334 template<class A>
0335 struct allocator_propagate_on_container_swap {
0336     typedef typename detail::alloc_pocs<A>::type type;
0337 };
0338 
0339 namespace detail {
0340 
0341 #if !defined(BOOST_NO_CXX11_ALLOCATOR)
0342 template<class A, class = void>
0343 struct alloc_equal {
0344     typedef typename std::is_empty<A>::type type;
0345 };
0346 #elif defined(BOOST_DETAIL_ALLOC_EMPTY)
0347 template<class A, class = void>
0348 struct alloc_equal {
0349     typedef alloc_bool<BOOST_DETAIL_ALLOC_EMPTY(A)> type;
0350 };
0351 #else
0352 template<class A, class = void>
0353 struct alloc_equal {
0354     typedef alloc_false type;
0355 };
0356 #endif
0357 
0358 template<class A>
0359 struct alloc_equal<A,
0360     typename alloc_void<typename A::is_always_equal>::type> {
0361     typedef typename A::is_always_equal type;
0362 };
0363 
0364 } /* detail */
0365 
0366 template<class A>
0367 struct allocator_is_always_equal {
0368     typedef typename detail::alloc_equal<A>::type type;
0369 };
0370 
0371 template<class A>
0372 inline typename allocator_pointer<A>::type
0373 allocator_allocate(A& a, typename allocator_size_type<A>::type n)
0374 {
0375     return a.allocate(n);
0376 }
0377 
0378 template<class A>
0379 inline void
0380 allocator_deallocate(A& a, typename allocator_pointer<A>::type p,
0381     typename allocator_size_type<A>::type n)
0382 {
0383     a.deallocate(p, n);
0384 }
0385 
0386 #if defined(BOOST_NO_CXX11_ALLOCATOR)
0387 template<class A>
0388 inline typename allocator_pointer<A>::type
0389 allocator_allocate(A& a, typename allocator_size_type<A>::type n,
0390     typename allocator_const_void_pointer<A>::type h)
0391 {
0392     return a.allocate(n, h);
0393 }
0394 #else
0395 namespace detail {
0396 
0397 template<class>
0398 struct alloc_no {
0399     char x, y;
0400 };
0401 
0402 template<class A>
0403 class alloc_has_allocate {
0404     template<class O>
0405     static auto check(int)
0406     -> alloc_no<decltype(std::declval<O&>().allocate(std::declval<typename
0407         boost::allocator_size_type<A>::type>(), std::declval<typename
0408             boost::allocator_const_void_pointer<A>::type>()))>;
0409 
0410     template<class>
0411     static char check(long);
0412 
0413 public:
0414     BOOST_STATIC_CONSTEXPR bool value = sizeof(check<A>(0)) > 1;
0415 };
0416 
0417 } /* detail */
0418 
0419 template<class A>
0420 inline typename std::enable_if<detail::alloc_has_allocate<A>::value,
0421     typename allocator_pointer<A>::type>::type
0422 allocator_allocate(A& a, typename allocator_size_type<A>::type n,
0423     typename allocator_const_void_pointer<A>::type h)
0424 {
0425     return a.allocate(n, h);
0426 }
0427 
0428 template<class A>
0429 inline typename std::enable_if<!detail::alloc_has_allocate<A>::value,
0430     typename allocator_pointer<A>::type>::type
0431 allocator_allocate(A& a, typename allocator_size_type<A>::type n,
0432     typename allocator_const_void_pointer<A>::type)
0433 {
0434     return a.allocate(n);
0435 }
0436 #endif
0437 
0438 namespace detail {
0439 
0440 #if defined(BOOST_NO_CXX11_ALLOCATOR)
0441 template<class A, class = void>
0442 struct alloc_has_construct {
0443     BOOST_STATIC_CONSTEXPR bool value = false;
0444 };
0445 
0446 template<class A>
0447 struct alloc_has_construct<A,
0448     typename alloc_void<typename A::_default_construct_destroy>::type> {
0449     BOOST_STATIC_CONSTEXPR bool value = true;
0450 };
0451 #else
0452 template<class A, class T, class... Args>
0453 class alloc_has_construct {
0454     template<class O>
0455     static auto check(int)
0456     -> alloc_no<decltype(std::declval<O&>().construct(std::declval<T*>(),
0457         std::declval<Args&&>()...))>;
0458 
0459     template<class>
0460     static char check(long);
0461 
0462 public:
0463     BOOST_STATIC_CONSTEXPR bool value = sizeof(check<A>(0)) > 1;
0464 };
0465 #endif
0466 
0467 template<bool, class = void>
0468 struct alloc_if { };
0469 
0470 template<class T>
0471 struct alloc_if<true, T> {
0472     typedef T type;
0473 };
0474 
0475 } /* detail */
0476 
0477 #if defined(BOOST_NO_CXX11_ALLOCATOR)
0478 template<class A, class T>
0479 inline typename detail::alloc_if<detail::alloc_has_construct<A>::value>::type
0480 allocator_construct(A& a, T* p)
0481 {
0482     a.construct(p);
0483 }
0484 
0485 template<class A, class T>
0486 inline typename detail::alloc_if<!detail::alloc_has_construct<A>::value>::type
0487 allocator_construct(A&, T* p)
0488 {
0489     ::new((void*)p) T();
0490 }
0491 
0492 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0493 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0494 template<class A, class T, class V, class... Args>
0495 inline void
0496 allocator_construct(A&, T* p, V&& v, Args&&... args)
0497 {
0498     ::new((void*)p) T(std::forward<V>(v), std::forward<Args>(args)...);
0499 }
0500 #else
0501 template<class A, class T, class V>
0502 inline void
0503 allocator_construct(A&, T* p, V&& v)
0504 {
0505     ::new((void*)p) T(std::forward<V>(v));
0506 }
0507 #endif
0508 #else
0509 template<class A, class T, class V>
0510 inline void
0511 allocator_construct(A&, T* p, const V& v)
0512 {
0513     ::new((void*)p) T(v);
0514 }
0515 
0516 template<class A, class T, class V>
0517 inline void
0518 allocator_construct(A&, T* p, V& v)
0519 {
0520     ::new((void*)p) T(v);
0521 }
0522 #endif
0523 #else
0524 template<class A, class T, class... Args>
0525 inline typename std::enable_if<detail::alloc_has_construct<A, T,
0526     Args...>::value>::type
0527 allocator_construct(A& a, T* p, Args&&... args)
0528 {
0529     a.construct(p, std::forward<Args>(args)...);
0530 }
0531 
0532 template<class A, class T, class... Args>
0533 inline typename std::enable_if<!detail::alloc_has_construct<A, T,
0534     Args...>::value>::type
0535 allocator_construct(A&, T* p, Args&&... args)
0536 {
0537     ::new((void*)p) T(std::forward<Args>(args)...);
0538 }
0539 #endif
0540 
0541 namespace detail {
0542 
0543 #if defined(BOOST_NO_CXX11_ALLOCATOR)
0544 template<class A, class, class = void>
0545 struct alloc_has_destroy {
0546     BOOST_STATIC_CONSTEXPR bool value = false;
0547 };
0548 
0549 template<class A, class T>
0550 struct alloc_has_destroy<A, T,
0551     typename alloc_void<typename A::_default_construct_destroy>::type> {
0552     BOOST_STATIC_CONSTEXPR bool value = true;
0553 };
0554 #else
0555 template<class A, class T>
0556 class alloc_has_destroy {
0557     template<class O>
0558     static auto check(int)
0559     -> alloc_no<decltype(std::declval<O&>().destroy(std::declval<T*>()))>;
0560 
0561     template<class>
0562     static char check(long);
0563 
0564 public:
0565     BOOST_STATIC_CONSTEXPR bool value = sizeof(check<A>(0)) > 1;
0566 };
0567 #endif
0568 
0569 } /* detail */
0570 
0571 template<class A, class T>
0572 inline typename detail::alloc_if<detail::alloc_has_destroy<A, T>::value>::type
0573 allocator_destroy(A& a, T* p)
0574 {
0575     a.destroy(p);
0576 }
0577 
0578 template<class A, class T>
0579 inline typename detail::alloc_if<!detail::alloc_has_destroy<A, T>::value>::type
0580 allocator_destroy(A&, T* p)
0581 {
0582     p->~T();
0583     (void)p;
0584 }
0585 
0586 namespace detail {
0587 
0588 #if defined(BOOST_NO_CXX11_ALLOCATOR)
0589 template<class T, T>
0590 struct alloc_no {
0591     char x, y;
0592 };
0593 
0594 template<class A>
0595 class alloc_has_max_size {
0596     template<class O>
0597     static alloc_no<typename boost::allocator_size_type<O>::type(O::*)(),
0598         &O::max_size> check(int);
0599 
0600     template<class O>
0601     static alloc_no<typename boost::allocator_size_type<O>::type(O::*)() const,
0602         &O::max_size> check(int);
0603 
0604     template<class O>
0605     static alloc_no<typename boost::allocator_size_type<O>::type(*)(),
0606         &O::max_size> check(int);
0607 
0608     template<class>
0609     static char check(long);
0610 
0611 public:
0612     BOOST_STATIC_CONSTEXPR bool value = sizeof(check<A>(0)) > 1;
0613 };
0614 #else
0615 template<class A>
0616 class alloc_has_max_size {
0617     template<class O>
0618     static auto check(int)
0619     -> alloc_no<decltype(std::declval<const O&>().max_size())>;
0620 
0621     template<class>
0622     static char check(long);
0623 
0624 public:
0625     BOOST_STATIC_CONSTEXPR bool value = sizeof(check<A>(0)) > 1;
0626 };
0627 #endif
0628 
0629 } /* detail */
0630 
0631 template<class A>
0632 inline typename detail::alloc_if<detail::alloc_has_max_size<A>::value,
0633     typename allocator_size_type<A>::type>::type
0634 allocator_max_size(const A& a) BOOST_NOEXCEPT
0635 {
0636     return a.max_size();
0637 }
0638 
0639 template<class A>
0640 inline typename detail::alloc_if<!detail::alloc_has_max_size<A>::value,
0641     typename allocator_size_type<A>::type>::type
0642 allocator_max_size(const A&) BOOST_NOEXCEPT
0643 {
0644     return (std::numeric_limits<typename
0645         allocator_size_type<A>::type>::max)() /
0646             sizeof(typename allocator_value_type<A>::type);
0647 }
0648 
0649 namespace detail {
0650 
0651 #if defined(BOOST_NO_CXX11_ALLOCATOR)
0652 template<class A>
0653 class alloc_has_soccc {
0654     template<class O>
0655     static alloc_no<O(O::*)(), &O::select_on_container_copy_construction>
0656     check(int);
0657 
0658     template<class O>
0659     static alloc_no<O(O::*)() const, &O::select_on_container_copy_construction>
0660     check(int);
0661 
0662     template<class O>
0663     static alloc_no<O(*)(), &O::select_on_container_copy_construction>
0664     check(int);
0665 
0666     template<class>
0667     static char check(long);
0668 
0669 public:
0670     BOOST_STATIC_CONSTEXPR bool value = sizeof(check<A>(0)) > 1;
0671 };
0672 #else
0673 template<class A>
0674 class alloc_has_soccc {
0675     template<class O>
0676     static auto check(int) -> alloc_no<decltype(std::declval<const
0677         O&>().select_on_container_copy_construction())>;
0678 
0679     template<class>
0680     static char check(long);
0681 
0682 public:
0683     BOOST_STATIC_CONSTEXPR bool value = sizeof(check<A>(0)) > 1;
0684 };
0685 #endif
0686 
0687 } /* detail */
0688 
0689 template<class A>
0690 inline typename detail::alloc_if<detail::alloc_has_soccc<A>::value, A>::type
0691 allocator_select_on_container_copy_construction(const A& a)
0692 {
0693     return a.select_on_container_copy_construction();
0694 }
0695 
0696 template<class A>
0697 inline typename detail::alloc_if<!detail::alloc_has_soccc<A>::value, A>::type
0698 allocator_select_on_container_copy_construction(const A& a)
0699 {
0700     return a;
0701 }
0702 
0703 template<class A, class T>
0704 inline void
0705 allocator_destroy_n(A& a, T* p, std::size_t n)
0706 {
0707     while (n > 0) {
0708         boost::allocator_destroy(a, p + --n);
0709     }
0710 }
0711 
0712 namespace detail {
0713 
0714 template<class A, class T>
0715 class alloc_destroyer {
0716 public:
0717     alloc_destroyer(A& a, T* p) BOOST_NOEXCEPT
0718         : a_(a), p_(p), n_(0) { }
0719 
0720     ~alloc_destroyer() {
0721         boost::allocator_destroy_n(a_, p_, n_);
0722     }
0723 
0724     std::size_t& size() BOOST_NOEXCEPT {
0725         return n_;
0726     }
0727 
0728 private:
0729     alloc_destroyer(const alloc_destroyer&);
0730     alloc_destroyer& operator=(const alloc_destroyer&);
0731 
0732     A& a_;
0733     T* p_;
0734     std::size_t n_;
0735 };
0736 
0737 } /* detail */
0738 
0739 template<class A, class T>
0740 inline void
0741 allocator_construct_n(A& a, T* p, std::size_t n)
0742 {
0743     detail::alloc_destroyer<A, T> d(a, p);
0744     for (std::size_t& i = d.size(); i < n; ++i) {
0745         boost::allocator_construct(a, p + i);
0746     }
0747     d.size() = 0;
0748 }
0749 
0750 template<class A, class T>
0751 inline void
0752 allocator_construct_n(A& a, T* p, std::size_t n, const T* l, std::size_t m)
0753 {
0754     detail::alloc_destroyer<A, T> d(a, p);
0755     for (std::size_t& i = d.size(); i < n; ++i) {
0756         boost::allocator_construct(a, p + i, l[i % m]);
0757     }
0758     d.size() = 0;
0759 }
0760 
0761 template<class A, class T, class I>
0762 inline void
0763 allocator_construct_n(A& a, T* p, std::size_t n, I b)
0764 {
0765     detail::alloc_destroyer<A, T> d(a, p);
0766     for (std::size_t& i = d.size(); i < n; void(++i), void(++b)) {
0767         boost::allocator_construct(a, p + i, *b);
0768     }
0769     d.size() = 0;
0770 }
0771 
0772 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0773 template<class A>
0774 using allocator_value_type_t = typename allocator_value_type<A>::type;
0775 
0776 template<class A>
0777 using allocator_pointer_t = typename allocator_pointer<A>::type;
0778 
0779 template<class A>
0780 using allocator_const_pointer_t = typename allocator_const_pointer<A>::type;
0781 
0782 template<class A>
0783 using allocator_void_pointer_t = typename allocator_void_pointer<A>::type;
0784 
0785 template<class A>
0786 using allocator_const_void_pointer_t =
0787     typename allocator_const_void_pointer<A>::type;
0788 
0789 template<class A>
0790 using allocator_difference_type_t =
0791     typename allocator_difference_type<A>::type;
0792 
0793 template<class A>
0794 using allocator_size_type_t = typename allocator_size_type<A>::type;
0795 
0796 template<class A>
0797 using allocator_propagate_on_container_copy_assignment_t =
0798     typename allocator_propagate_on_container_copy_assignment<A>::type;
0799 
0800 template<class A>
0801 using allocator_propagate_on_container_move_assignment_t =
0802     typename allocator_propagate_on_container_move_assignment<A>::type;
0803 
0804 template<class A>
0805 using allocator_propagate_on_container_swap_t =
0806     typename allocator_propagate_on_container_swap<A>::type;
0807 
0808 template<class A>
0809 using allocator_is_always_equal_t =
0810     typename allocator_is_always_equal<A>::type;
0811 
0812 template<class A, class T>
0813 using allocator_rebind_t = typename allocator_rebind<A, T>::type;
0814 #endif
0815 
0816 } /* boost */
0817 
0818 #if defined(__clang__) && defined(__has_warning)
0819 # if __has_warning("-Wdeprecated-declarations")
0820 #  pragma clang diagnostic pop
0821 # endif
0822 #elif defined(_MSC_VER)
0823 # pragma warning(pop)
0824 #elif defined(BOOST_GCC) && BOOST_GCC >= 40600
0825 # pragma GCC diagnostic pop
0826 #endif  
0827 #if defined(_STL_RESTORE_DEPRECATED_WARNING)
0828 _STL_RESTORE_DEPRECATED_WARNING
0829 #endif
0830 #if defined(_LIBCPP_SUPPRESS_DEPRECATED_POP)
0831 _LIBCPP_SUPPRESS_DEPRECATED_POP
0832 #endif
0833 
0834 #endif