]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/smart_ptr/make_local_shared_array.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / smart_ptr / make_local_shared_array.hpp
1 /*
2 Copyright 2017 Peter Dimov
3 Copyright 2017 Glen Joseph Fernandes
4 (glenjofe@gmail.com)
5
6 Distributed under the Boost Software License, Version 1.0.
7 (http://www.boost.org/LICENSE_1_0.txt)
8 */
9 #ifndef BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP
10 #define BOOST_SMART_PTR_MAKE_LOCAL_SHARED_ARRAY_HPP
11
12 #include <boost/smart_ptr/allocate_local_shared_array.hpp>
13
14 namespace boost {
15
16 template<class T>
17 inline typename detail::lsp_if_size_array<T>::type
18 make_local_shared()
19 {
20 return boost::allocate_local_shared<T>(std::allocator<typename
21 detail::sp_array_scalar<T>::type>());
22 }
23
24 template<class T>
25 inline typename detail::lsp_if_size_array<T>::type
26 make_local_shared(const typename detail::sp_array_element<T>::type& value)
27 {
28 return boost::allocate_local_shared<T>(std::allocator<typename
29 detail::sp_array_scalar<T>::type>(), value);
30 }
31
32 template<class T>
33 inline typename detail::lsp_if_array<T>::type
34 make_local_shared(std::size_t size)
35 {
36 return boost::allocate_local_shared<T>(std::allocator<typename
37 detail::sp_array_scalar<T>::type>(), size);
38 }
39
40 template<class T>
41 inline typename detail::lsp_if_array<T>::type
42 make_local_shared(std::size_t size,
43 const typename detail::sp_array_element<T>::type& value)
44 {
45 return boost::allocate_local_shared<T>(std::allocator<typename
46 detail::sp_array_scalar<T>::type>(), size, value);
47 }
48
49 template<class T>
50 inline typename detail::lsp_if_size_array<T>::type
51 make_local_shared_noinit()
52 {
53 return allocate_local_shared_noinit<T>(std::allocator<typename
54 detail::sp_array_scalar<T>::type>());
55 }
56
57 template<class T>
58 inline typename detail::lsp_if_array<T>::type
59 make_local_shared_noinit(std::size_t size)
60 {
61 return allocate_local_shared_noinit<T>(std::allocator<typename
62 detail::sp_array_scalar<T>::type>(), size);
63 }
64
65 } /* boost */
66
67 #endif