Boost logo

Boost :

Subject: Re: [boost] painless currying
From: Eric Niebler (eric_at_[hidden])
Date: 2011-08-26 14:51:08


On 8/26/2011 1:46 PM, Thomas Heller wrote:
> I additionally have some problems in thinking
> about possible semantics:
>
> auto g = f(_, y, z); // pretend that f is a curryable function

If f has a 4th argument, the above returns a binary function and ...

> auto h = g(1); // same as f(1, y, z)? what if f had a 4th argument?

... that returns a unary function, same as f(1, y, z).

> As much as i like the idea, i can almost always construct trivial
> usecases where the proposed syntax is ambiguous.

It's not ambiguous, AFAICT.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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