Boost C++ Libraries: Ticket #3289: boost::phoenix::lambda doesnt handle local variables very well. https://svn.boost.org/trac10/ticket/3289 <p> 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 </p> <p> double abc=lambda(_a=*ref(it)++)[_a*2.0]()(); <em> here 'it' is an </em>iterator </p> <p> 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: </p> <p> # include &lt;algorithm&gt; # include &lt;vector&gt; </p> <p> # include &lt;boost/spirit/include/phoenix.hpp&gt; </p> <p> using namespace boost::phoenix; using namespace boost::phoenix::arg_names; using namespace boost::phoenix::local_names; </p> <p> int main() { </p> <blockquote> <p> std::vector&lt;double&gt; u(11,1.0); std::vector&lt;double&gt; w(11,2.0); std::vector&lt;double&gt;::const_iterator it=w.begin(); <em>boost::phoenix::generate(ref(u) </em> ,lambda(_a=*ref(it)++)[_a*2.0 ] <em>)(); </em></p> </blockquote> <blockquote> <p> double abc=lambda(_a=*ref(it)++)[_a*2.0]()(); return 0; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3289 Trac 1.4.3 Thomas Heller Thu, 20 Jan 2011 08:31:00 GMT <link>https://svn.boost.org/trac10/ticket/3289#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3289#comment:1</guid> <description> <p> This is fixed in phoenix V3 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Bryce Adelstein Lelbach</dc:creator> <pubDate>Mon, 23 May 2011 15:04:22 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3289#comment:2 https://svn.boost.org/trac10/ticket/3289#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in phx v3. </p> Ticket