Boost logo

Boost :

Subject: Re: [boost] phoenix::bind
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-10-02 10:42:45


Joel de Guzman:
...
>> template<class F> void g( F f )
>> {
>> h( bind( f, _2, _1 ) );
>> }
>>
>> int main()
>> {
>> g( _1 < _2 ); // fail
>> g( unlambda( _1 < _2 ) ); // works
>> }
>>
>> A top-level lambda[] that does let()[] will not work for this case.
>
> Yep, I'm keeping the behavior of protect, not unlambda.

What is the current Phoenix way to make the above work?

> As I mentioned in my other post. val(_1 < _2) can probably be the unlambda
> behavior.

This doesn't feel right to me. val(x)(...) returns x. val(_1 < _2)( 1, 2 )
ought to return _1 < _2. unlambda( _1 < _2 )( 1, 2 ) returns true.


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