Re: [Boost-bugs] [Boost C++ Libraries] #5475: [Foreach] rvalue reference binding of temporary ranges

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