Boost logo

Boost :

From: Dirk Gerrits (dirkg_at_[hidden])
Date: 2002-05-11 15:00:54


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

> > 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.
>
> Yes, it could be made to work with unary_function, binary_function, and
> boost::function.
>
> > Well I guess I'll write make_function myself then. It won't work for any
> > function
> > object but I can live with that.
>
> That's probably the best option. Sorry :(

Well it's good enough for my current project. I'll start coding
make_function for
0, 1 and 2 parameters. If I ever need more I can just add additional
overloads.

> > Just one thing though, I'd like it to work for the result of a
boost::bind
> > as well.

> It wouldn't work anyway, because boost::bind function objects don't have
> exact argument types to deduce. <cut> Boost.Function doesn't (and can't)
do
> partial bindings.

Oops! Hadn't considered that. Thanks for pointing that out.

> There are workarounds for most compiler deficiencies, but of course we
won't
> know until someone tries. I'll work on it sometime.

Great.

Dirk Gerrits


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