[Bug libstdc++/22634] partial_sum is too constrained
squell at alumina dot nl
gcc-bugzilla@gcc.gnu.org
Sat Jul 23 20:09:00 GMT 2005
------- 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
More information about the Gcc-bugs
mailing list