[proto] Problem using BOOST_PROTO_AUTO

I have the following program to print out the arguments of a function
call expression. It works fine when I directly call the grammar on the
expression like so : foo_tostr()(f(a,b,c)). However, if I assign the
expression to a variable pr using BOOST_PROTO_AUTO and call
foo_tostr()(pr), I get error of the form "conversion from
‘boost::fusion::... to non-scalar type .... requested". Can someone
let me know what I am doing wrong?
#include <iostream>
#include

On 2/22/2010 6:12 PM, Manjunath Kudlur wrote:
I have the following program to print out the arguments of a function call expression. It works fine when I directly call the grammar on the expression like so : foo_tostr()(f(a,b,c)). However, if I assign the expression to a variable pr using BOOST_PROTO_AUTO and call foo_tostr()(pr), I get error of the form "conversion from ‘boost::fusion::... to non-scalar type .... requested". Can someone let me know what I am doing wrong?
<snip> You're not doing anything wrong. You've uncovered a couple of const-correctness issues in proto and fusion. The big issue is that some fusion algorithms (e.g. fusion::pop_front, fusion::reverse) are not overloaded on const and non-const arguments. I've filed a bug against fusion and worked around the problem in proto. You can track the issue here: https://svn.boost.org/trac/boost/ticket/3954 -- Eric Niebler BoostPro Computing http://www.boostpro.com
participants (2)
-
Eric Niebler
-
Manjunath Kudlur