Boost logo

Boost :

Subject: Re: [boost] [Config] Macro for C++0x range-based for
From: John Maddock (boost.regex_at_[hidden])
Date: 2010-12-17 06:55:16


>> C++0x range-based for is available on GCC 4.6 (Pre-release).
>> There is no BOOST_NO_RANGE_BASED_FOR macro,
>> so I made a patch against trunk and made a test case. Please see
>> attached files.
>> Is it reasonable to add this macro?
> I don't think there's really a point, unless you want Boost's users to use
> the config macros. Range-based for is a convenience functionality, not an
> enabling functionality. In other words, if you can't use it all the time,
> but have to write the long form anyway, what's the point in using it?

That's a problem, writing code both the "old" way and the "new" way (which
is what boost authors would have to do, complete with all the #ifdef logic)
is probably worse than just using the old style and be done with it.

Just my 2c, John.


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