|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-05-01 15:13:52
David Abrahams:
> on Tue Apr 29 2008, "Daniel Walker" <daniel.j.walker-AT-gmail.com> wrote:
...
>> template <class F>
>> typename result_of<F const&()>::type
>> call(F const& f)
>> {
>> return f();
>> }
>
> Fine, then take the case where call takes f by value; then F can be a
> function type and result_of<F()> is illegal.
If you call
template <class F>
typename result_of<F()>::type
call( F f )
{
return f();
}
with a function, F will be deduced as a function pointer.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk