Boost logo

Boost :

Subject: Re: [boost] [functional] adding overload
From: Roman Perepelitsa (roman.perepelitsa_at_[hidden])
Date: 2012-01-16 17:14:40


2012/1/16 Lorenzo Caminiti <lorcaminiti_at_[hidden]>

> On Mon, Jan 16, 2012 at 9:11 AM, Roman Perepelitsa
> <roman.perepelitsa_at_[hidden]> wrote:
> > 2012/1/16 Lorenzo Caminiti <lorcaminiti_at_[hidden]>
> >
> >> On Sun, Jan 15, 2012 at 9:06 PM, Nathan Ridge <zeratul976_at_[hidden]>
> >> wrote:
> >>
> >> > I like boost::functional::overload. You can then add a convenience
> >> > function make_overload() with creates one without having to specify
> >>
> >> Yes, I will add boost::functional::make_overload as well.
> >>
> >
> > I don't think it can be implemented in general case. What signature will
> it
> > have?
>
> It was suggested during Boost.Local review to use make_overload with
> auto (or BOOST_AUTO):
>
> auto f = make_overload(f1, f2, f3);
>

Right, but there is no way to make it work for any function object,
unless make_overload returns a proxy object with conversion operator
to boost::functional::overload<...>. I'm not sure if such a thing would be
useful, but it may be.

Roman Perepelitsa.


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