[Boost-bugs] [Boost C++ Libraries] #3289: boost::phoenix::lambda doesnt handle local variables very well.

Subject: [Boost-bugs] [Boost C++ Libraries] #3289: boost::phoenix::lambda doesnt handle local variables very well.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-07-25 20:59:37


#3289: boost::phoenix::lambda doesnt handle local variables very well.
-------------------------------------+--------------------------------------
 Reporter: kuentang@… | Owner: djowel
     Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: spirit
  Version: Boost Development Trunk | Severity: Problem
 Keywords: spirit phoenix lambda |
-------------------------------------+--------------------------------------
 Introducing a local variable in boost::phoenix::lambda without using an
 argument names create a compiler error with boost 1.40 and msvc 2008. To
 be precise: The code

 double abc=lambda(_a=*ref(it)++)[_a*2.0]()(); // here 'it' is an
 //iterator

 create a boost::phoenix::detail::error_expecting_arguments error. The
 problem seems to be connected to the no_nullary. the following code
 reproduce the error:

 # include <algorithm>
 # include <vector>

 # include <boost/spirit/include/phoenix.hpp>

 using namespace boost::phoenix;
 using namespace boost::phoenix::arg_names;
 using namespace boost::phoenix::local_names;

 int main()
 {

     std::vector<double> u(11,1.0);
     std::vector<double> w(11,2.0);
     std::vector<double>::const_iterator it=w.begin();
     //boost::phoenix::generate(ref(u)
     // ,lambda(_a=*ref(it)++)[_a*2.0 ]
     //)();

     double abc=lambda(_a=*ref(it)++)[_a*2.0]()();
     return 0;
 }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3289>
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:00 UTC