Update allocate_shared and make_shared to treat multidimensional array as single dimension. Remove detail array_helper. Add detail array traits. Update tests.

[SVN r81236]
This commit is contained in:
Glen Fernandes committed 2012-11-07 18:37:17 +00:00
1 parent 93b5cace12
commit 5d9312239c
6 files changed
+109 -122

No files matched your search

@@ -0,0 +1,39 @@
/*
* Copyright (c) 2012 Glen Joseph Fernandes
* glenfe at live dot com
*
* Distributed under the Boost Software License,
* Version 1.0. (See accompanying file LICENSE_1_0.txt
* or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
#define BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
#include <boost/type_traits/remove_cv.hpp>
namespace boost {
namespace detail {
template<typename T>
struct array_type {
typedef typename boost::remove_cv<T>::type type;
};
template<typename T, size_t N>
struct array_type<T[N]> {
typedef typename array_type<T>::type type;
};
template<typename T>
struct array_size {
enum {
size = 1
};
};
template<typename T, size_t N>
struct array_size<T[N]> {
enum {
size = N * array_size<T>::size
};
};
}
}
#endif