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-04-02 21:51:01


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

 Erm, in the mailing list thread whose link is in the initial post, TONGARI
 J already suggested that changing the return type to `void` works and yes
 it does on VC 2010; I didn't know if you saw it and was unsure if I had to
 bring this up sooner, sorry.

 < useless novice thoughts >

 After reading the rationale, it seems `for_each`'s return value might be
 useful in some cases, and removing it may cause inconsistency between the
 original and lazy version of the `for_each`. Phoenix V2's `for_each`
 '''does''' return `std::foreach`'s return value but this problem doesn't
 exist there.

 By the way, does adding ''another layer of laziness'' to the return value
 help? e.g wrapping the functor returned by `std::for_each` inside another
 functor class and returning that one from `phoenix::for_each`, or
 returning a `phoenix::(c)ref` of `std::for_each`'s return value, or
 returning `phoenix::bind` of `std::for_each`'s return value, or maybe by
 wrapping `std::for_each`'s return value in some proto tags. Due to lack of
 knowledge, I wasn't successful in implementing any of the above thoughts
 and testing them (got massive template errors).

 </ useless novice thoughts >

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