mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 23:14:02 +00:00
Removed local named variable from value_initialized::operator=, as Fernando Cacciola suggested me to avoid unnecessary named variables.
[SVN r42869]
This commit is contained in:
parent
721764937f
commit
1beca24dd8
@ -5,7 +5,7 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//
|
//
|
||||||
// 21 Ago 2002 (Created) Fernando Cacciola
|
// 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
|
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
||||||
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
|
||||||
@ -49,7 +49,7 @@ class value_initialized
|
|||||||
#if _MSC_VER >= 1310
|
#if _MSC_VER >= 1310
|
||||||
// When using MSVC 7.1 or higher, the following placement new expression may trigger warning C4345:
|
// 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 ()
|
// "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)
|
#pragma warning(disable: 4345)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -66,9 +66,8 @@ class value_initialized
|
|||||||
|
|
||||||
value_initialized & operator=(value_initialized const & arg)
|
value_initialized & operator=(value_initialized const & arg)
|
||||||
{
|
{
|
||||||
T & this_data = this->data();
|
|
||||||
T const & arg_data = arg.data();
|
T const & arg_data = arg.data();
|
||||||
this_data = arg_data;
|
this->data() = arg_data;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user