Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-08-05 08:44:46


Howard Hinnant <hinnant_at_[hidden]> writes:

> On Aug 3, 2005, at 6:21 PM, David Abrahams wrote:
>
>> Is it really true that I can write
>>
>> bind(f, _1) > _2
>>
>> but can't write
>>
>> _1 > _2
>>
>> ??
>>
>> I can't imagine a good reason for that restriction, but I don't see
>> any indication that the latter is supported in the docs.
>
> That is a really interesting suggestion, and significantly blurs the
> line between bind and lambda.
>
> Once you have:
>
> _1 > _2
>
> then
>
> _1 > literal
>
> will pretty much come in for free (I think).

And if you construct the types of _1 and bind(...) smartly, you get
all the operators on placeholders for free, too. As in MPL, _N would
be a bind_t specialization that returns its Nth argument.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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