Boost logo

Boost :

Subject: Re: [boost] [functional] adding overload
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2012-01-17 10:32:11


Nathan Ridge wrote:
> Lorenzo Caminiti wrote:
>
> > During Boost.Local review, it was proposed to move the overload
> > template out of Local and in Boost.Functional. What would the best
> > name for it?
> >
> > 1) boost::overload_function (my preference)
> > 2) boost::overloaded_function
> > 3) boost::function_overload
> > 4) boost::functional::overload (Boost.Functional seems to use boost::
> > directly and not boost::functional-- to mimic C++11 ).
>
> I like boost::functional::overload. You can then add a convenience
> function make_overload() with creates one without having to specify
> the template parameters, and it will be at once intuitive-sounding
> and consistent with Boost naming conventions.

An overload is a function with a signature differing from others of the same name. What's being created here is a function object that represents an overload set. It's a collection of overloaded functions. "overload" is not correct as you're using it. "overloaded_function" is closer to correct, but I think that "overload_set" is the right term. You create an overload_set object and call it. When called, it does something like overload resolution, and forwards to the appropriate callable in the set.

Thus, I suggest boost::function_overload_set and boost::make_function_overload_set, if you want to avoid the nested namespace (and permit s/boost/std/ for the future), and boost::functional::overload_set and boost::functional::make_overload_set, otherwise.

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer using std::disclaimer;
Dev Tools & Components
Susquehanna International Group, LLP http://www.sig.com

________________________________

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


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