From: shunsuke (pstade.mb_at_[hidden])
Date: 2008-04-02 14:02:06
Giovanni Piero Deretta wrote:
>> ??? r = lambda[t1];
> result_of<T_lambda(T1)>::type r = lambda[t1]
> might work just fine, but maybe overloading result_of is not nice.
> What about:
> protected<t1> r = lambda[t1]
I like making everything be FunctionObject so that
result_of can be used everywhere.
Anyway, this depends on rationale of a library.
>> >> I tend to hesitate to use result_of/return_of without function-calls.
>> > Again, what do you mean exactly? And why do you esistate? I'm
>> > evaluating egg design, so these answers would be very valuable.
>> result_of<F(T1)>::type s;
>> result_of is a trait which extracts return type of function-calls,
>> but s is default-constructed without function-calls.
> Well, what is the problem? As long as there is no bind-like function
> in there which requires passing closure parameters, it should be fine.
> I agree that it might be confusing initially.
Strictly speaking, when you don't know
whether an argument is a lvalue or rvalue, result_of cannot be used.
In other words, runtime object as argument is needed.
So, I think yet another name ("imaginary_result_of" or something) is needed.
-- Shunsuke Sogame