Add final overload of make_shared and allocate_shared (array forms) for T[][N] with C++11 initializer lists.

[SVN r81275]
This commit is contained in:
Glen Fernandes committed 2012-11-10 01:33:29 +00:00
1 parent 5bdde37414
commit 980070e63f
9 files changed
+115 -27

No files matched your search

@@ -10,7 +10,6 @@
#define BOOST_SMART_PTR_DETAIL_ALLOCATE_ARRAY_HELPER_HPP
#include <boost/type_traits/alignment_of.hpp>
#include <cstddef>
namespace boost {
namespace detail {
@@ -39,12 +39,18 @@ namespace boost {
}
#endif
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
void construct(T* memory, std::size_t count, const T* list) {
void construct_list(T* memory, std::size_t count, const T* list) {
for (object = memory; size < count; size++) {
void* p1 = object + size;
::new(p1) T(list[size]);
}
}
void construct_list(T* memory, std::size_t count, const T* list, std::size_t n) {
for (object = memory; size < count; size++) {
void* p1 = object + size;
::new(p1) T(list[size % n]);
}
}
#endif
void construct_noinit(T* memory, std::size_t count) {
for (object = memory; size < count; size++) {
@@ -68,6 +68,13 @@ namespace boost {
struct array_list<T[N]> {
typedef std::initializer_list<T> type;
};
template<typename T>
struct inner_list {
};
template<typename T, size_t N>
struct inner_list<T[][N]> {
typedef std::initializer_list<T> type;
};
#endif
}
}
@@ -10,7 +10,6 @@
#define BOOST_SMART_PTR_DETAIL_MAKE_ARRAY_HELPER_HPP
#include <boost/type_traits/alignment_of.hpp>
#include <cstddef>
namespace boost {
namespace detail {