This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/22634] partial_sum is too constrained


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]