https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107367
--- Comment #6 from cqwrteur <unlvsur at live dot com> --- Your argument is not correct when you can just detect all the iterator methods are noexcept. Plus, the standard does not need you to handle exceptions if iterator throw it but to terminate. Btw what is the point of contiguous_iterator if i am not allowed to use std::to_address to optimize code? The whole point of contiguous_iterator is that i am allowed to use pointer arithematics directly. Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: redi at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> Sent: Friday, June 28, 2024 7:41:47 AM To: unlv...@live.com <unlv...@live.com> Subject: [Bug libstdc++/107367] All standard library algorithms should optimize to pointers internally when they are contiguous iterators after C++20 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107367 --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- This optimization isn't valid if any iterator operations can throw, because such an exception should terminate the loop early. Performing the algo on raw pointers would alter the behaviour. -- You are receiving this mail because: You are on the CC list for the bug. You reported the bug.