I have a difficult time wrapping my head around the following:
int main( int, char *[] )
{
const string test( "1 2" );
typedef string::const_iterator iterator;
auto desired = []( int a, int b )
{
};
auto working = []( boost::fusion::vector2<int,int> )
{
};
iterator i = test.begin( );
qi::phrase_parse( i, test.end( ),
(
qi::int_ >>
qi::int_
)
[ working ]
// [ ph::bind( desired, qi::_1, qi::_2 ) ]
, qi::ascii::space );
return test.end( ) - i;
}
I know it's mostly code, but I think it's self explanatory; 'working' callback is fine, but if I comment it out in favour of the desired line, compiler says no, using the following words:
/opt/local/include/boost/spirit/home/phoenix/core/detail/function_eval.hpp:115:30: 'result' following the 'template' keyword does not refer to a template
/opt/local/include/boost/mpl/eval_if.hpp:38:22: Type 'f_' (aka 'int') cannot be used prior to '::' because it has no members
/opt/local/include/boost/spirit/home/support/action_dispatch.hpp:178:13: No matching function for call to object of type 'const phoenix::actor, vector >, argument<0>, argument<1>, void_, void_, void_, void_, void_, void_, void_> > >'
I've tried phoenix::bind, boost::bind, writing my own wrapper... No success. Well, my own wrapper did work, but not templated ones, so that was useless, and I think it's phoenix' job anyway.
any help would be appreciated!