forked from boostorg/smart_ptr
Use const T (&)[N] for fixed size arrays instead of std::initializer<T> in overloads of make_shared and allocate_shared for arrays. ........ Use BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX instead for certain overloads of make_shared and allocate_shared ........ Code consistency: Use the same style of #if conditional compilation checks in allocate_shared_array.hpp and make_shared_array.hpp. ........ Change make_shared and allocate_shared array form overload for size and inner array initialization list to use const T(&)[N] instead of std::initializer_list<T>. ........ Move two tests for allocate_shared and make_shared within check for BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX ........ Make specializations of detail array_deleter consistent. ........ [SVN r81682]
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
/*
|
|
* 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_base {
|
|
typedef typename boost::remove_cv<T>::type type;
|
|
};
|
|
template<typename T, std::size_t N>
|
|
struct array_base<T[N]> {
|
|
typedef typename array_base<T>::type type;
|
|
};
|
|
template<typename T>
|
|
struct array_size;
|
|
template<typename T, std::size_t N>
|
|
struct array_size<T[N]> {
|
|
enum {
|
|
size = N
|
|
};
|
|
};
|
|
template<typename T>
|
|
struct array_total {
|
|
enum {
|
|
size = 1
|
|
};
|
|
};
|
|
template<typename T, std::size_t N>
|
|
struct array_total<T[N]> {
|
|
enum {
|
|
size = N * array_total<T>::size
|
|
};
|
|
};
|
|
template<typename T>
|
|
struct array_inner;
|
|
template<typename T>
|
|
struct array_inner<T[]> {
|
|
typedef T type;
|
|
};
|
|
template<typename T, std::size_t N>
|
|
struct array_inner<T[N]> {
|
|
typedef T type;
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif
|