[Bug libstdc++/80811] out-of-line string members less efficient than they could be
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 18 15:07:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80811
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=59048
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Thanks for the pointer! It's a good question. I'd expect non-modifying
algorithms to be pure. Only one reason for them to have side-effects comes to
mind: to test whether they implement the standard requirements to the letter
(e.g., call traits_type::eq on every character, or maybe
allocator_type::address). Can you think of some other use case?
Certainly the required specializations are pure. If it does make a significant
difference in efficiency, I wonder if attribute pure could be applied to just
those by some enable_if trick.
More information about the Gcc-bugs
mailing list