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


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

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

Well I guess I'll write make_function myself then. It won't work for any
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
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
> 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, gregod at, cpdaniel at, john at