From 1beca24dd8c34d2dc476891d403c5d57f6a5d9e2 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Sat, 19 Jan 2008 20:52:04 +0000 Subject: [PATCH] Removed local named variable from value_initialized::operator=, as Fernando Cacciola suggested me to avoid unnecessary named variables. [SVN r42869] --- include/boost/utility/value_init.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/boost/utility/value_init.hpp b/include/boost/utility/value_init.hpp index 4e2ab85..a4e0034 100644 --- a/include/boost/utility/value_init.hpp +++ b/include/boost/utility/value_init.hpp @@ -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 @@ class value_initialized #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 @@ class value_initialized 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; }