Re: [Boost-bugs] [Boost C++ Libraries] #9742: for_each causes funny behavior in phoenix V3 expressions

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9742: for_each causes funny behavior in phoenix V3 expressions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-16 18:58:13


#9742: for_each causes funny behavior in phoenix V3 expressions
-------------------------------+-----------------------------------
  Reporter: Chromatix | Owner: theller
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: phoenix
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords: phoenix,for_each,lazy
-------------------------------+-----------------------------------

Comment (by John Fletcher <J.P.Fletcher@…>):

 I have done some more experiments. The following code, using for_ in place
 of for_each does work for the compilers I have tested:

 {{{
     int iii;
     int size = v.size();
     (
         std::cout << phx::val("("),
         phx::for_(phx::ref(iii) = 0, phx::ref(iii) < size, ++phx::ref(iii)
 )
         [std::cout << arg1[phx::ref(iii)] ],
         std::cout << phx::val(")")
     )(v);
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9742#comment:6>
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:15 UTC