Boost logo

Boost-Commit :

From: nielsdekker_at_[hidden]
Date: 2008-01-19 15:52:04


Author: niels_dekker
Date: 2008-01-19 15:52:04 EST (Sat, 19 Jan 2008)
New Revision: 42869
URL: http://svn.boost.org/trac/boost/changeset/42869

Log:
Removed local named variable from value_initialized::operator=, as Fernando Cacciola suggested me to avoid unnecessary named variables.
Text files modified:
   trunk/boost/utility/value_init.hpp | 7 +++----
   1 files changed, 3 insertions(+), 4 deletions(-)

Modified: trunk/boost/utility/value_init.hpp
==============================================================================
--- trunk/boost/utility/value_init.hpp (original)
+++ trunk/boost/utility/value_init.hpp 2008-01-19 15:52:04 EST (Sat, 19 Jan 2008)
@@ -5,7 +5,7 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 // 21 Ago 2002 (Created) Fernando Cacciola
-// 16 Jan 2008 (Worked around compiler bugs, added initialized_value) Fernando Cacciola, Niels Dekker
+// 19 Jan 2008 (Worked around compiler bugs, added initialized_value) Fernando Cacciola, Niels Dekker
 //
 #ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
 #define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
@@ -49,7 +49,7 @@
 #if _MSC_VER >= 1310
 // When using MSVC 7.1 or higher, the following placement new expression may trigger warning C4345:
 // "behavior change: an object of POD type constructed with an initializer of the form ()
-// will be default-initialized". There is no need to worry about this, though.
+// will be default-initialized". It is safe to ignore this warning when using value_initialized.
 #pragma warning(disable: 4345)
 #endif
 #endif
@@ -66,9 +66,8 @@
 
     value_initialized & operator=(value_initialized const & arg)
     {
- T & this_data = this->data();
       T const & arg_data = arg.data();
- this_data = arg_data;
+ this->data() = arg_data;
       return *this;
     }
 


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