
16 Nov
2009
16 Nov
'09
5:36 p.m.
Andrzej Krzemienski wrote:
Therefore, I would like to request a new tool in Boost.Foreach that would emulate the above construct, and would look something like:
BOOST_FOREACH_AUTO( const& x, collection ) {...}
I do not anticipate any technical difficulties with implementing this, as it can already be achiever with a verbose:
BOOST_FOREACH( BOOST_TYPEOF( boost::begin(collection) ) const& x, collection ) {..}
Actually, I think it has the potential of being more efficient than BOOST_FOREACH, which uses tricks that have some overhead on certain compilers. So it should not be implemented in terms of BOOST_FOREACH.