public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/109333] New: Use std::move in std::accumulate etc. for std::string for C++11/14/17
@ 2023-03-29  9:32 redi at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: redi at gcc dot gnu.org @ 2023-03-29  9:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109333

            Bug ID: 109333
           Summary: Use std::move in std::accumulate etc. for std::string
                    for C++11/14/17
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0616r0.pdf changed
some <numeric> algos to use std::move for the accumulator, which is an
observable semantic change. For that reason, we only implement the change for
C++20 and up, to retain the behaviour specified in earlier standards.

If the accumulator is std::string then we know it's not observable, and so we
can improve performance by always moving (except in C++98 mode).

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-29  9:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-29  9:32 [Bug libstdc++/109333] New: Use std::move in std::accumulate etc. for std::string for C++11/14/17 redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).