Boost logo

Boost :

Subject: Re: [boost] [functional] adding overload
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2012-02-03 02:13:26


On Tue, 17 Jan 2012 14:37:10 -0800, Lorenzo Caminiti
<lorcaminiti_at_[hidden]> wrote:

> On Tue, Jan 17, 2012 at 10:32 AM, Stewart, Robert
> <Robert.Stewart_at_[hidden]> wrote:
>> 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.
>
> I don't like the _set postfix- even if correct, I'd find it confusing
> as a user. I picked overloaded_function.
>
> Here's a first draft for the docs:
>
> https://svn.boost.org/svn/boost/sandbox/closure/libs/functional/overloaded_function/doc/html/index.html
>
> Comments welcome.

Didn't Boost.Interface, something that was worked on a while back but
never made it into Boost proper, capture this functionality, but more
comprehensively?

BTW, in the url above "closure" should be replaced by "local_function".


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