Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81750 - trunk/boost/smart_ptr/detail
From: glenfe_at_[hidden]
Date: 2012-12-07 01:45:32


Author: glenfe
Date: 2012-12-07 01:45:26 EST (Fri, 07 Dec 2012)
New Revision: 81750
URL: http://svn.boost.org/trac/boost/changeset/81750

Log:
Optimization in initialization overload of array_construct for compilers to optimize it into the equivalent of a memset
Text files modified:
   trunk/boost/smart_ptr/detail/array_utility.hpp | 3 +--
   1 files changed, 1 insertions(+), 2 deletions(-)

Modified: trunk/boost/smart_ptr/detail/array_utility.hpp
==============================================================================
--- trunk/boost/smart_ptr/detail/array_utility.hpp (original)
+++ trunk/boost/smart_ptr/detail/array_utility.hpp 2012-12-07 01:45:26 EST (Fri, 07 Dec 2012)
@@ -37,8 +37,7 @@
         template<typename T>
         inline void array_construct(T* memory, std::size_t size, boost::true_type) {
             for (std::size_t i = 0; i < size; i++) {
- void* p1 = memory + i;
- ::new(p1) T();
+ memory[i] = T();
             }
         }
         template<typename T>


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