|
Boost : |
Subject: Re: [boost] Adding support for auto in Boost.Foreach
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-02-15 17:15:46
paul Fultz wrote
>
> Also, on compilers that support variadiac macros, it would be nice to add
> support for commas in the type, such as:
>
> BOOST_FOREACH(pair<string, string> p, range) {}
>
I can't try the code below right now... but you should be able to use
BOOST_IDENTITY_TYPE:
https://svn.boost.org/svn/boost/trunk/libs/utility/identity_type/doc/html/index.html
BOOST_FOREACH(BOOST_IDENTITY_TYPE((pair<string, string>)) p, range) {}
This should work on all compilers because it does not require variadics.
(BTW, the comma issue is not a "bug"- it's the way the pp works by spec. If
anything, it can be considered a limitation of the pp specs.)
HTH,
--Lorenzo
-- View this message in context: http://boost.2283326.n4.nabble.com/Adding-support-for-auto-in-Boost-Foreach-tp4391181p4392187.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk