Boost logo

Boost :

Subject: Re: [boost] painless currying
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2011-08-27 19:20:16


On Sat, Aug 27, 2011 at 2:43 PM, Michael Caisse <
boost_at_[hidden]> wrote:

> On 08/24/2011 08:13 AM, Eric Niebler wrote:
>
>> On 8/24/2011 1:58 AM, Roman Perepelitsa wrote:
>>
>> I think this is the case with functors generated by bind -- they appear
>>> to
>>> be callable with any number of arguments.
>>>
>> Ouch. :-(
>>
>> One option, which I don't like, is to "fix" bind to disable any
>> operator() overloads that result in an invalid invocation of the bound
>> function. That can be done easily with the is_callable_with metafunction
>> in my curryable implementation, but would reduce portability somewhat.
>>
>>
> That isn't "broken" behavior. Very often that is exactly what you want from
> bind.
>

Why would you prefer enabling operator() overloads of bind that result in a
compiler error over "SFINAE-disabling" them? (Other than compile time
considerations and minimizing complexity.)

- Jeff


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