Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-11-21 11:44:00


On Thursday 21 November 2002 11:03 am, David Abrahams wrote:
> Do we have any precedent for ways to find out what the arity and
> argument types of an arbitrary function object is (I'm not talking
> about function pointers, here, but "functors")?
>
> -Dave

No :(

Lambda has the "sig" member template that, given the set of argument types,
computes the return type. function_traits will give you the information for a
function pointer. Boost.Function supplies 'arity' and argI_type.
std::unary_function and std::binary_function are useful for standard library
function objects. Basically, it's a big mess, especially when one needs to
deal with template operator().

        Doug


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