Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:35:12

0001 /*
0002 Copyright 2019 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_ALLOC_CONSTRUCT_HPP
0009 #define BOOST_CORE_ALLOC_CONSTRUCT_HPP
0010 
0011 /*
0012 This functionality is now in <boost/core/allocator_access.hpp>.
0013 */
0014 #include <boost/core/noinit_adaptor.hpp>
0015 
0016 namespace boost {
0017 
0018 template<class A, class T>
0019 inline void
0020 alloc_destroy(A& a, T* p)
0021 {
0022     boost::allocator_destroy(a, p);
0023 }
0024 
0025 template<class A, class T>
0026 inline void
0027 alloc_destroy_n(A& a, T* p, std::size_t n)
0028 {
0029     boost::allocator_destroy_n(a, p, n);
0030 }
0031 
0032 template<class A, class T>
0033 inline void
0034 alloc_construct(A& a, T* p)
0035 {
0036     boost::allocator_construct(a, p);
0037 }
0038 
0039 #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
0040 #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
0041 template<class A, class T, class U, class... V>
0042 inline void
0043 alloc_construct(A& a, T* p, U&& u, V&&... v)
0044 {
0045     boost::allocator_construct(a, p, std::forward<U>(u),
0046         std::forward<V>(v)...);
0047 }
0048 #else
0049 template<class A, class T, class U>
0050 inline void
0051 alloc_construct(A& a, T* p, U&& u)
0052 {
0053     boost::allocator_construct(a, p, std::forward<U>(u));
0054 }
0055 #endif
0056 #else
0057 template<class A, class T, class U>
0058 inline void
0059 alloc_construct(A& a, T* p, const U& u)
0060 {
0061     boost::allocator_construct(a, p, u);
0062 }
0063 
0064 template<class A, class T, class U>
0065 inline void
0066 alloc_construct(A& a, T* p, U& u)
0067 {
0068     boost::allocator_construct(a, p, u);
0069 }
0070 #endif
0071 
0072 template<class A, class T>
0073 inline void
0074 alloc_construct_n(A& a, T* p, std::size_t n)
0075 {
0076     boost::allocator_construct_n(a, p, n);
0077 }
0078 
0079 template<class A, class T>
0080 inline void
0081 alloc_construct_n(A& a, T* p, std::size_t n, const T* l, std::size_t m)
0082 {
0083     boost::allocator_construct_n(a, p, n, l, m);
0084 }
0085 
0086 template<class A, class T, class I>
0087 inline void
0088 alloc_construct_n(A& a, T* p, std::size_t n, I b)
0089 {
0090     boost::allocator_construct_n(a, p, n, b);
0091 }
0092 
0093 } /* boost */
0094 
0095 #endif