Boost logo

Boost :

From: shunsuke (pstade.mb_at_[hidden])
Date: 2007-03-20 15:34:43


Hi,

Daniel Walker wrote:
> #include <boost/lambda/lambda.hpp>
> #include <boost/utility/result_of.hpp>
> using namespace boost;
>
> template<class Functor, class Arg1, class Arg2>
> void f(Functor const&, Arg1 const&, Arg2 const&)
> {
> typedef typename result_of<
> Functor(Arg1, Arg2)
> >::type result_type;
> }
>
> int main()
> {
> using namespace lambda;
> int x = 0, y = 0;
> f(ret<int>(_1 + _2), x, y);
> }

In fact, this code works without that patch using
something like this: http://tinyurl.com/2xw4s2

> 2) Boost.Lambda instructs users to expose a template sig<tuple<ARG1,
> ..., ARGN>, and it also uses this convention internally.

How about introduce a converter function like this?:
http://tinyurl.com/2f5hn6

Anyway I'm hoping your work will make lambda support result_of!
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