2 Copyright 2012-2017 Glen Joseph Fernandes
5 Distributed under the Boost Software License, Version 1.0.
6 (http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
9 #define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
11 #include <boost/smart_ptr/allocate_shared_array.hpp>
16 inline typename detail::sp_if_size_array<T>::type
19 return boost::allocate_shared<T>(std::allocator<typename
20 detail::sp_array_scalar<T>::type>());
24 inline typename detail::sp_if_size_array<T>::type
25 make_shared(const typename detail::sp_array_element<T>::type& value)
27 return boost::allocate_shared<T>(std::allocator<typename
28 detail::sp_array_scalar<T>::type>(), value);
32 inline typename detail::sp_if_array<T>::type
33 make_shared(std::size_t size)
35 return boost::allocate_shared<T>(std::allocator<typename
36 detail::sp_array_scalar<T>::type>(), size);
40 inline typename detail::sp_if_array<T>::type
41 make_shared(std::size_t size,
42 const typename detail::sp_array_element<T>::type& value)
44 return boost::allocate_shared<T>(std::allocator<typename
45 detail::sp_array_scalar<T>::type>(), size, value);
49 inline typename detail::sp_if_size_array<T>::type
52 return allocate_shared_noinit<T>(std::allocator<typename
53 detail::sp_array_scalar<T>::type>());
57 inline typename detail::sp_if_array<T>::type
58 make_shared_noinit(std::size_t size)
60 return allocate_shared_noinit<T>(std::allocator<typename
61 detail::sp_array_scalar<T>::type>(), size);