|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51355 - trunk/boost/utility
From: nielsdekker_at_[hidden]
Date: 2009-02-20 15:28:54
Author: niels_dekker
Date: 2009-02-20 15:28:54 EST (Fri, 20 Feb 2009)
New Revision: 51355
URL: http://svn.boost.org/trac/boost/changeset/51355
Log:
Fixed const issue of value_initialized according to ticket #2548. See also http://lists.boost.org/Archives/boost/2009/02/148489.php
Text files modified:
trunk/boost/utility/value_init.hpp | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
Modified: trunk/boost/utility/value_init.hpp
==============================================================================
--- trunk/boost/utility/value_init.hpp (original)
+++ trunk/boost/utility/value_init.hpp 2009-02-20 15:28:54 EST (Fri, 20 Feb 2009)
@@ -8,6 +8,7 @@
// 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker
// 23 May 2008 (Fixed operator= const issue, added initialized_value) Niels Dekker, Fernando Cacciola
// 21 Ago 2008 (Added swap) Niels Dekker, Fernando Cacciola
+// 20 Feb 2009 (Fixed logical const-ness issues) Niels Dekker, Fernando Cacciola
//
#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
@@ -90,7 +91,12 @@
wrapper_address()->wrapper::~wrapper();
}
- T& data() const
+ T const & data() const
+ {
+ return wrapper_address()->data;
+ }
+
+ T& data()
{
return wrapper_address()->data;
}
@@ -100,7 +106,9 @@
::boost::swap( this->data(), arg.data() );
}
- operator T&() const { return this->data(); }
+ operator T const &() const { return this->data(); }
+
+ operator T&() { return this->data(); }
} ;
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