Boost logo

Boost :

Subject: Re: [boost] Checking for return types (result_of) - redux..
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-08-21 10:32:49


AMDG

Frank Mori Hess wrote:
> On Friday 21 August 2009, Edward Grace wrote:
>
>> boost::result_of<O()>::type
>>
>
> I don't have experience with boost::result_of, but is it right to add
> parenthesis? That looks to me like you are asking for the return type of a
> function type that takes no arguments and returns an object of type O.
>

This use of result_of is correct. result_of is designed
to handle polymorphic function objects which can have
a different return type depending on the arguments.

boost::result_of<F()>::type means the result of calling
an object of type F with no arguments.
boost::result_of<F(int)> means the result of calling
an object of type F with an int argument.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk