--- boost/utility/value_init.hpp (Boost 1.46.1) +++ boost/utility/value_init.hpp (Fix) @@ -11,6 +11,7 @@ // 20 Feb 2009 (Fixed logical const-ness issues) Niels Dekker, Fernando Cacciola // 03 Apr 2010 (Added initialized, suggested by Jeffrey Hellrung, fixing #3472) Niels Dekker // 30 May 2010 (Made memset call conditional, fixing #3869) Niels Dekker +// 17 Apr 2011 (Added operator=(const&), fixing #5483) Christian Masloch // #ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP #define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP @@ -125,6 +126,14 @@ return *this; } + initialized & operator=(T const & arg) + { + // Assignment is only allowed when T is non-const. + BOOST_STATIC_ASSERT( ! is_const::value ); + *wrapper_address() = wrapper(arg); + return *this; + } + ~initialized() { wrapper_address()->wrapper::~wrapper(); @@ -214,6 +223,22 @@ { return m_data; } + + value_initialized & operator=(value_initialized const & arg) + { + // Assignment is only allowed when T is non-const. + BOOST_STATIC_ASSERT( ! is_const::value ); + m_data = arg.m_data; + return *this; + } + + value_initialized & operator=(T const & arg) + { + // Assignment is only allowed when T is non-const. + BOOST_STATIC_ASSERT( ! is_const::value ); + m_data = arg; + return *this; + } } ;