Boost logo

Boost :

Subject: Re: [boost] New libraries implementing C++11 features in C++03
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-25 09:47:02


On 11/25/2011 10:40 PM, Joel de Guzman wrote:
> On 11/25/2011 10:26 PM, Christopher Jefferson wrote:
>>
>> Thank you, but I was thinking more doing the whole thing in-line (else, I would just
>> write a function object, much like you did, without the phoenix), or use std::bind.
>>
>> Of course, it might be the case that writing that inline is just more pain than it is
>> worth. Certainly it would get a bit long hanging off a for-each!
>
> Well, the point of the exercise is to use "statement syntax",
> just as you did using Locals. By doing so, you lessen the chance
> of having "outrageous error messages" and minimize compile time.
>
> There are advantages with phoenix functions over plain function
> objects, but I do not want to digress. At the very least, you
> have easy binding of locals. Also, it's just as succinct and
> clear as your Locals version.

Oh, and BTW, speaking of std::bind, you're also at the same
risk when it comes to spewing error messages as with phoenix.
Like phoenix, std::bind is also a TMP library and is not immune
to bad error messages.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

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