This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/22634] partial_sum is too constrained
- From: "squell at alumina dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jul 2005 20:08:37 -0000
- Subject: [Bug libstdc++/22634] partial_sum is too constrained
- References: <20050723200746.22634.squell@alumina.nl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From squell at alumina dot nl 2005-07-23 20:08 -------
Created an attachment (id=9338)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9338&action=view)
See the original post
There is an issue here that this routine assumes that the result of the
operation is CopyConstructible and Assignable. However, this is the same
requirement placed on T in std::accumulate(), and the original routine even
assumed Assignability of the input iterator's value_type, which in fact _IS
NOT_ guaranteed!. This proposal does not assume this (since it doesn't need
it anymore), by also replacing the first assignment by a copy construction.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22634