|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81233 - trunk/boost/smart_ptr/detail
From: glenfe_at_[hidden]
Date: 2012-11-07 10:25:56
Author: glenfe
Date: 2012-11-07 10:25:55 EST (Wed, 07 Nov 2012)
New Revision: 81233
URL: http://svn.boost.org/trac/boost/changeset/81233
Log:
Don't treat array_helper create and create_noinit for array types as a special case.
Text files modified:
trunk/boost/smart_ptr/detail/array_helper.hpp | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
Modified: trunk/boost/smart_ptr/detail/array_helper.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/array_helper.hpp (original)
+++ trunk/boost/smart_ptr/detail/array_helper.hpp 2012-11-07 10:25:55 EST (Wed, 07 Nov 2012)
@@ -36,12 +36,12 @@
template<typename T, size_t N>
struct array_helper<T[N]> {
static void create(T value[N]) {
- void* p1 = &value;
- ::new(p1) T[N]();
+ array_helper<T[N-1]>::create(value);
+ array_helper<T>::create(value[N-1]);
}
static void create_noinit(T value[N]) {
- void* p1 = &value;
- ::new(p1) T[N];
+ array_helper<T[N-1]>::create_noinit(value, args);
+ array_helper<T>::create_noinit(value[N-1], args);
}
static void destroy(T value[N]) {
array_helper<T>::destroy(value[N-1]);
@@ -57,6 +57,10 @@
};
template<typename T>
struct array_helper<T[0]> {
+ static void create(T[]) {
+ }
+ static void create_noinit(T[]) {
+ }
static void destroy(T[]) {
}
#if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk