https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58483
--- Comment #18 from dennis luehring <dl.soluz at gmx dot net> --- rechecked it with godbolt gcc-trunk and 14.2 gcc still does not optimize the std::vector case clang is doing the optimization for at least 11 years