Subject: Re: [boost] [Foreach] Proposal to simplify using Boost.Foreach withmaps
From: Pete Bartlett (pete_at_[hidden])
Date: 2009-09-14 18:22:08


Christian Schladetsch wrote:
>Is there any performance difference between
>
>BOOST_FOREACH_PAIR(K const &key, V &val, map)
>{
>}
>
>and
>
>BOOST_FOREACH(Map::reference ref, map)
>{
>}

I haven't tested this specific case but in previous discussions and tests on
this subject, I found these extra for-loops of fixed "length" 1 hidden in
the macro expansion were optimized well by popular compilers, so the hit may
be negligible.

Pete