|
Boost : |
From: shunsuke (pstade.mb_at_[hidden])
Date: 2008-04-02 12:40:59
Giovanni Piero Deretta wrote:
> I'm not saying that egg should support optionally-lazy functions [1],
> it is ok if the lazy and non lazy variant have the same name. I just
> want to be sure it is easy to define them.
I did't adopt "optionally-lazy" functions.
As you show, many functions take FunctionObjects as arguments
so that protect or unlambda is needed everywhere.
(I always follow the rationale "one name, one functionality".)
Anyway, egg::unfuse with "contains_bind_expression<FusionSeq>" trait
can easily implement such a optionally-lazy adaptor.
>> After all, Boost.Lambda bind and placeholders are not usable here.
>
> Why? Detail please :)
A functional call of `static_< always<F> >::type`
is expanded to
F()(a1,...,aN);
If F is a function pointer type, this will clearly crash.
A "regular"ized Boost.Lambda functor also will crash because of uninitialized error.
After all, we need a lambda functor such that default-constructed one is callable.
Egg secretly has one. (I wrote it for unit testing.)
See: http://tinyurl.com/yuumdv
T_bind is Egg's own binder.
TT_1 is Egg's own placeholder, whereas T_bll_1 is type of boost::lambda::_1.
Regards,
-- Shunsuke Sogame
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk