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.

Reply via email to