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:39:52


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

 The problem in MSVC is that it does the access check of the copy
 constructor when binding references to rvalues
 even when the check should not occur. (In C++03, the check is legal.)

 Here is a minimal code that demonstrates this.
 {{{
 class noncopyable
 {
 public:
     noncopyable()
     {}

 private:
     noncopyable(noncopyable const &);
 };

 int main (int argc, char* argv[])
 {
     noncopyable const& x = noncopyable();

     return 0;
 }
 }}}
 This code fails to compile on MSVC, but compiles fine on Comeau.

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