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-21 04:12:04


#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@…>):

 Thanks for doing this.

 Considering the results, I think the error happens
 due to the incomplete implementation of C++11
 (i.e. [[http://www.open-
 std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391|DR 391]])
 in MSVC 10.
 The code should compile fine in C++11.

 The fix for `boost/foreach.hpp` could be
  A. Do nothing (BOOST_FOREACH fails with noncopyable rvalues on MSVC 10).
  B. Revert to the C++03 BOOST_FOREACH on MSVC 10.
  C. Write a special code for MSVC 10.
 I prefer A, since this does not break anything
 (noncopyable rvalues cannot be handled by the C++03 BOOST_FOREACH, IIUC).

 For `libs/foreach/test/noncopyable_rvalue_***.hpp`,
 I can change them to pass the tests on MSVC 10 by declaring copy/move
 ctors
 and copy/move assignment operators `public`.
 But, wouldn't it be better to fail the tests on MSVC 10
 to explicitly state that noncopyable rvalues are not supported?

 P.S. Will try to setup Visual Studio 2010 Express. Thanks!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5475#comment:10>
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