https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115444
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #3) > We could just use while (__first != __last) instead, but that would remove a > very intentional "optimization" that's explicitly mentioned in a comment: > > // All of these auxiliary structs serve two purposes. (1) Replace > // calls to copy with memmove whenever possible. (Memmove, not memcpy, > // because the input and output ranges are permitted to overlap.) > // (2) If we're using random access iterators, then write the loop as > // a for loop with an explicit count. Although that comment came directly from the SGI STL, so the "optimization" is more than 25 years old and might be irrelevant now.