Sha256: 611d0e3984df07ae306de24072758bd5fb053db3616acb982922c93efa77b539

Contents?: true

Size: 1.95 KB

Versions: 12

Compression:

Stored size: 1.95 KB

Contents

/*
Copyright 2012-2019 Glen Joseph Fernandes
(glenjofe@gmail.com)

Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
#define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP

#include <boost/core/default_allocator.hpp>
#include <boost/smart_ptr/allocate_shared_array.hpp>

namespace boost {

template<class T>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared()
{
    return boost::allocate_shared<T>(boost::default_allocator<typename
        detail::sp_array_element<T>::type>());
}

template<class T>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared(const typename remove_extent<T>::type& value)
{
    return boost::allocate_shared<T>(boost::default_allocator<typename
        detail::sp_array_element<T>::type>(), value);
}

template<class T>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
make_shared(std::size_t size)
{
    return boost::allocate_shared<T>(boost::default_allocator<typename
        detail::sp_array_element<T>::type>(), size);
}

template<class T>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
make_shared(std::size_t size, const typename remove_extent<T>::type& value)
{
    return boost::allocate_shared<T>(boost::default_allocator<typename
        detail::sp_array_element<T>::type>(), size, value);
}

template<class T>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared_noinit()
{
    return boost::allocate_shared_noinit<T>(boost::default_allocator<typename
        detail::sp_array_element<T>::type>());
}

template<class T>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
make_shared_noinit(std::size_t size)
{
    return boost::allocate_shared_noinit<T>(boost::default_allocator<typename
        detail::sp_array_element<T>::type>(), size);
}

} /* boost */

#endif

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
passenger-6.0.19 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.18 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.17 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.16 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.15 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.14 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.13 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.12 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.11 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.10 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.9 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp
passenger-6.0.8 src/cxx_supportlib/vendor-modified/boost/smart_ptr/make_shared_array.hpp