Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/smart_ptr/make_unique_array.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | f46d142149f5 |
children |
rev | line source |
---|---|
Chris@102 | 1 /* |
Chris@102 | 2 * Copyright (c) 2014 Glen Joseph Fernandes |
Chris@102 | 3 * glenfe at live dot com |
Chris@102 | 4 * |
Chris@102 | 5 * Distributed under the Boost Software License, |
Chris@102 | 6 * Version 1.0. (See accompanying file LICENSE_1_0.txt |
Chris@102 | 7 * or copy at http://boost.org/LICENSE_1_0.txt) |
Chris@102 | 8 */ |
Chris@102 | 9 #ifndef BOOST_SMART_PTR_MAKE_UNIQUE_ARRAY_HPP |
Chris@102 | 10 #define BOOST_SMART_PTR_MAKE_UNIQUE_ARRAY_HPP |
Chris@102 | 11 |
Chris@102 | 12 #include <boost/smart_ptr/detail/up_if_array.hpp> |
Chris@102 | 13 #include <boost/smart_ptr/detail/array_traits.hpp> |
Chris@102 | 14 |
Chris@102 | 15 namespace boost { |
Chris@102 | 16 template<class T> |
Chris@102 | 17 inline typename boost::detail::up_if_array<T>::type |
Chris@102 | 18 make_unique(std::size_t size) { |
Chris@102 | 19 typedef typename boost::detail::array_inner<T>::type U; |
Chris@102 | 20 return std::unique_ptr<T>(new U[size]()); |
Chris@102 | 21 } |
Chris@102 | 22 |
Chris@102 | 23 template<class T> |
Chris@102 | 24 inline typename boost::detail::up_if_array<T>::type |
Chris@102 | 25 make_unique_noinit(std::size_t size) { |
Chris@102 | 26 typedef typename boost::detail::array_inner<T>::type U; |
Chris@102 | 27 return std::unique_ptr<T>(new U[size]); |
Chris@102 | 28 } |
Chris@102 | 29 } |
Chris@102 | 30 |
Chris@102 | 31 #endif |