forked from boostorg/smart_ptr
Don't treat array_helper create and create_noinit for array types as a special case.
[SVN r81233]
This commit is contained in:
@ -36,12 +36,12 @@ namespace boost {
|
|||||||
template<typename T, size_t N>
|
template<typename T, size_t N>
|
||||||
struct array_helper<T[N]> {
|
struct array_helper<T[N]> {
|
||||||
static void create(T value[N]) {
|
static void create(T value[N]) {
|
||||||
void* p1 = &value;
|
array_helper<T[N-1]>::create(value);
|
||||||
::new(p1) T[N]();
|
array_helper<T>::create(value[N-1]);
|
||||||
}
|
}
|
||||||
static void create_noinit(T value[N]) {
|
static void create_noinit(T value[N]) {
|
||||||
void* p1 = &value;
|
array_helper<T[N-1]>::create_noinit(value, args);
|
||||||
::new(p1) T[N];
|
array_helper<T>::create_noinit(value[N-1], args);
|
||||||
}
|
}
|
||||||
static void destroy(T value[N]) {
|
static void destroy(T value[N]) {
|
||||||
array_helper<T>::destroy(value[N-1]);
|
array_helper<T>::destroy(value[N-1]);
|
||||||
@ -57,6 +57,10 @@ namespace boost {
|
|||||||
};
|
};
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct array_helper<T[0]> {
|
struct array_helper<T[0]> {
|
||||||
|
static void create(T[]) {
|
||||||
|
}
|
||||||
|
static void create_noinit(T[]) {
|
||||||
|
}
|
||||||
static void destroy(T[]) {
|
static void destroy(T[]) {
|
||||||
}
|
}
|
||||||
#if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
|
#if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
|
||||||
|
Reference in New Issue
Block a user