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-10-20 23:37:41


#5475: [Foreach] rvalue reference binding of temporary ranges
--------------------------------------+-------------------------------------
  Reporter: mimomorin@… | Owner: eric_niebler
      Type: Patches | Status: closed
 Milestone: To Be Determined | Component: foreach
   Version: Boost Development Trunk | Severity: Problem
Resolution: fixed | Keywords: foreach, C++0x
--------------------------------------+-------------------------------------

Comment (by Michel Morin <mimomorin@…>):

 To support the C++11 BOOST_FOREACH, we need to address the following:
 * **Extending test cases**
     Especially, use BOOST_FOREACH in function templates and use
 BOOST_FOREACH with C++11 lambda.
 * **Workaround gcc's `auto` declaration bugs in function templates**
     Except gcc 4.7, gcc's `auto` declarations in function templates do not
 work correctly.
     Even with gcc 4.6.1,
     {{{
         auto&& rng = add_const_if_rvalue(std::vector<int>(3, 0));
     }}}
     fails to compile (in function templates).

 It is possible that compilers have other unkown bugs on `auto`
 declarations,
 and so it might be reasonable to have a way to avoid regressions:
 * **Adding configuration macro BOOST_FOREACH_USE_AUTO_DECLARATIONS**
     The C++11 BOOST_FOREACH gets enabled on compilers with rvalue
 references and `auto` support,
     only if BOOST_FOREACH_USE_AUTO_DECLARATIONS is defined by users.

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