Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Proto embedding a function calls into expressions
From: Kim Kuen Tang (kuentang_at_[hidden])
Date: 2010-03-25 12:05:18


Hi Stefan,

Stefan Frehse schrieb:
> Hello Boost.Proto,
>
> firstly, thank you very much for your great work for providing such a
> powerful framework.
>
> My Setup: I defined a grammar, like grammar * grammar, a domain and so on.
> Based on the domain two evaluator for different contexts are provided.
> For standard operators that works great.
> For expression evaluation I have a function defined as follow:
>
> template<typename T, typename Expr, typename Arg0, typename Arg1, ... >
> generate (T& t, Expr const& expr, Arg0 const& arg0, ... )
> {
> call the first or the second evaluator switched by T and passes the
> value arg0, ...
> }
> Therewith, I can write for example, generate (foo, _1 * _2, a, b);
>
> Coming to my problem. I would like to write, generate (foo, _1 * func
> (_2, _3), a ,b, c); Overall I would like to embedd function
> calls into the expression and the pass them to the generate function.
>
> I tried to implement a make_expr based on func, but that does not work
> for me, i.e., compiler error for fmi::ite (_0, _1, _2) (a,b,c);
>
> error: invalid use of incomplete type 'struct
> fmi::ite_::result<fmi::ite_(boost::fusion::vector1<const fmi::bv&>,
> boost::fusion::vector1<const fmi::bv&>,
> boost::fusion::vector1<mpl_::void_&>)>'
>
> error: declaration of 'struct
> fmi::ite_::result<fmi::ite_(boost::fusion::vector1<const fmi::bv&>,
> boost::fusion::vector1<const fmi::bv&>,
> boost::fusion::vector1<mpl_::void_&>)>'
> cpp:7:
>
> Can you imaging what the problem is? Otherwise I will attach further
> cleaned code.

It will be more easier to understand if you can provide a standalone
example.

Cheers,
Kim

>
>
>
> Best wishes,
> sfrehse
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net