Joel Falcou wrote:
I've defined some custom tag for user specific function like : struct conj_tag {};
I have made the following expression builder using make_expr :
template<class X> typename proto::result_of::make_expr< conj_tag, X const &>::type conj( X const& x ) { return proto::make_expr
(boost::cref(x)); } And I match this function using the following grammar rule : struct my_grammar : or_< // some terminal , bp::function< bp::terminal
, my_grammar> > {};
That's not right. Your conj() function is returning a unary expression
with a conj_tag tag type. Your grammar is trying to match a binary
expression with a proto::tag::function tag type. Your grammar should be:
proto::unary_expr
Now, how should I overload operator() of a callable_context to match this special tag ?
In your context, you should have an overloaded operator() like this: template<typename Expr> some-return-type operator()(conj_tag, Expr const &expr) const { ... } HTH, -- Eric Niebler BoostPro Computing http://www.boostpro.com