Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2548: Let's fix the logical constness of value_initialized!
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-06-28 21:39:16
#2548: Let's fix the logical constness of value_initialized!
--------------------------+-------------------------------------------------
Reporter: niels_dekker | Owner: niels_dekker
Type: Bugs | Status: assigned
Milestone: Boost 1.38.0 | Component: utility
Version: Boost 1.37.0 | Severity: Problem
Keywords: |
--------------------------+-------------------------------------------------
Comment(by niels_dekker):
Daniel, thanks for your feedback. Yes, I would still like the issue to be
fixed. It's now more than four months after committing the fix to the
trunk, [51355], and I haven't heard any compaint. (I did announce the fix
at the Boost dev mailing list.) Intel 9 is the only compiler on the
regression site that doesn't compile implicit conversions from
value_initialized<T> to reference-to-T anymore, because of the fix. It's
no problem to Intel 10 and 11, and any other compiler included with the
regression tests.
There are various possible workarounds for Intel 9:
a. Do nothing. Intel 9 users can still retrieve a reference to the
value_initialized data by using {{{boost::get}}}, or
{{{value_initialized::data()}}}
b. Revert the fix, but only for Intel 9 (using BOOST_WORKAROUND). Leave
the fix in there for other compilers.
c. Offer to Intel 9 users only the const-version of the conversion
operator (using BOOST_WORKAROUND)
d. Offer to Intel 9 users only the non-const-version of the conversion
operator (using BOOST_WORKAROUND)
I do prefer workaround "d.", which allows Intel 9 users to convert from
value_initialized<T> to T&, but protects {{{const value_initialized<T>}}}
objects against such a conversion. As attached:
intel_9_value_init_conversion-operator.patch Please let me know if you
think this patch is fine to you.
PS Thanks also for reminding me to update the version number in the
documentation!
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2548#comment:5> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC