Boost logo

Boost :

Subject: Re: [boost] painless currying
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-09-03 12:21:24


On 09/03/11 11:12, Eric Niebler wrote:
> On 9/3/2011 10:48 AM, Larry Evans wrote:
>> when passed arguments that cannot
>> possibly be valid, the arguments just keep accummulating
>> in the curryable<F,Args...>::argI.
>
> Correct.
>
>> It would be helpful
>> if some diagnostic were issued in case too many arguments
>> are supplied.
>
> I agree it would be helpful, but I don't think that's possible. Without
> true introspection, there is no way to know a priori what the max arity
> of the bound function is, hence no way to know when we've accumulated
> more arguments than are valid. It just keeps collecting arguments in a
> vain attempt to satisfy the can_be_called predicated.
>
OK, so *now* I see a good use-case for David Abraham's point:

http://lists.boost.org/Archives/boost/2011/08/185096.php

about using () to cause evaluation. The user would then know if invalid
arguments were supplied.


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