Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5475: [Foreach] rvalue reference binding of temporary ranges
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-22 18:19:30
#5475: [Foreach] rvalue reference binding of temporary ranges
--------------------------------------+-------------------------------------
Reporter: mimomorin@⦠| Owner: eric_niebler
Type: Patches | Status: assigned
Milestone: To Be Determined | Component: foreach
Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords: foreach, C++0x
--------------------------------------+-------------------------------------
Comment (by Michel Morin <mimomorin@â¦>):
I tried Comeau Online and got compilation errors.
But it seems that Comeau doesn't recognize rvalue references...
The relevant part is 8.5.3 p5:
If the initializer expression
- is an xvalue, class prvalue, array prvalue or function lvalue and
âcv1 T1â is reference-compatible with âcv2 T2â, or
- has a class type (i.e., T2 is a class type), where T1 is not
reference-related to T2, and can be implicitly converted to an xvalue,
class prvalue, or function lvalue of type âcv3 T3â, where âcv1 T1â is
reference-compatible with âcv3 T3â,
then '''the reference is bound to the value of the initializer
expression in the first case''' and to the result of the conversion in the
second case (or, in either case, to an appropriate base class subobject).
In the second case, if the reference is an rvalue reference and the second
standard conversion sequence of the user-defined conversion sequence
includes an lvalue-to-rvalue conversion, the program is ill-formed.
See also links in this answer http://stackoverflow.com/questions/1827049/
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5475#comment:13> 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:07 UTC