id summary reporter owner description type status milestone component version severity resolution keywords cc 2246 Phoenix2 lazy function compilation error François Barel Joel de Guzman "I get a compilation error when trying to do a lazy Phoenix function. By that I mean a Phoenix function (for use in a Spirit action) which is in fact the result of calling another Phoenix actor (in my case a phoenix::bind) -- as the implementation of {{{function}}}, {{{compose}}} and {{{function_eval}}} seems to allow (IIUC the function can be any Phoenix actor, just like its arguments). [[BR]] Repro: {{{ #include using namespace ::boost::spirit; using namespace ::boost::spirit::qi; #include #include #include using namespace ::boost::phoenix; template< typename F > function< F > make_function(const F& f) { return function< F >(f); } struct Actor { typedef void result_type; template< typename T = unused_type > struct result { typedef result_type type; }; void operator()(int) const { assert( this != NULL ); } }; struct Context { const Actor* pa; }; int main() { Context c = { NULL }; Actor a; rule< const wchar_t* > r; // Not lazy, fine. r = eps[ make_function( a )(42) ]; // Lazy, compilation error. r = eps[ make_function( *bind( &Context::pa, c ) )(42) ]; c.pa = &a; const wchar_t* x = L""""; parse(x, x, r); return 0; } }}} The error is (note the '{{{&}}}'): {{{ boost/spirit/home/phoenix/core/detail/function_eval.hpp:108: error: ‘const Actor&’ is not a class, struct, or union type }}} [[BR]] The attached patch ({{{remove_reference}}} when getting function type) solved it for me. Francois " Bugs closed Boost 1.37.0 spirit Boost 1.36.0 Problem fixed phoenix lazy function