Boost logo

Boost :

Subject: Re: [boost] How to detect if f() returns void or not?
From: Edward Diener (eldiener_at_[hidden])
Date: 2009-12-14 22:55:15


OvermindDL1 wrote:
> On Mon, Dec 14, 2009 at 6:40 PM, Edward Diener <eldiener_at_[hidden]> wrote:
>> Eric Niebler wrote:
>>> Frédéric Bron wrote:
>>>> I would like to detect if the return type of a function is void or not
>>>> within C++03 standard?
>>> <snip>
>>>
>>> I solved this problem once while writing a different trait and documented
>>> it here:
>>>
>>>
>>> http://www.boost.org/doc/libs/1_41_0/doc/html/proto/appendices.html#boost_proto.appendices.implementation.function_arity
>> It's extremely clever, as others have noted, but I am wondering if there is
>> any website, or possibly newsgroup, devoted to advanced TMP techniques such
>> as yours.
>
> Out of curiosity, but doesn't Boost.Function_Types give information
> about all this, including return type?

I believe the OP's question was "Can function X be invoked with a name
and certain parameters and, if so, give me its return type", not "Give
me the return type of known type function X". The latter, as you say,
can be found out through Function_Types.


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