Boost logo

Boost :

From: Dirk Gerrits (dirkg_at_[hidden])
Date: 2002-05-11 11:22:09


----- Original Message -----
From: "Douglas Gregor" <gregod_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, 11 May, 2002 17:15
Subject: Re: [boost] Overloading a function taking a boost::function

> You can do the same without partial specialization using function
overloading:

<cut>

> Of course, this style only works for free and member functions. We'd need
> something like ArityTraits to handle arbitrary function objects. That's
the
> reason that make_function never really made it: we don't have a good set
of
> function object traits to work with.

Wouldn't make_function work for std::unary_function, std::binary_function
and
boost::function too? But yes, handling arbitrary function objects would be
difficult.

Well I guess I'll write make_function myself then. It won't work for any
function
object but I can live with that.

Just one thing though, I'd like it to work for the result of a boost::bind
as well.
But the result of a boost::bind is implementation-defined according to the
documentation. So there is no way to portably create boost::bind overloads
for
make_function, right?

> If we _did_ have a working set of function traits, it would be possible to
> make Boost.Function objects implicitly constructed only from function
objects
> that are callable by the Boost.Function object.

This seems to me as an awesome addition to Boost.Function! Too bad there are
compilers out there that don't support the needed functionality. :(

Dirk Gerrits


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