This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [Patch] libstdc++/23425
chris jefferson wrote:
>For vectors, just replacing "first != last" with "first < last" is
>enough to let the loop optimisers remove the loop. This is PR 23361.
>It's annoying that the != gets left behind and the < gets removed, as
>clearly != is the most generic looping method from the point of view of
>iterators.
>
>Unfortunatly, the optimiser seems to (not unreasonably) always get
>confused by deque iterators, and the loop optimisers never seem to kick
>in at all.
>
>
I see. Longer term more accurate type_traits (i.e., trivial_destructor)
will take care at the outset of most of the common cases in a very clean
way. Still, probably makes sense to also overload for random access
iterators. Unfortunately, however, we cannot just replace the forward
iterators version with the random access iterators version because the
former is assumed in ext/memory and also in backward/iterator.h. Too bad
because in principle the random access iterators form should be the
easiest to optimize and the only one we really need for the containers.
Paolo.