Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partial_sum_copy should be partial_sum #15

Closed
PeterSommerlad opened this issue May 11, 2012 · 1 comment
Closed

partial_sum_copy should be partial_sum #15

PeterSommerlad opened this issue May 11, 2012 · 1 comment

Comments

@PeterSommerlad
Copy link

the example in [stream.iterators] 24.6
refers to

   partial_sum_copy(istream_iterator<double, char>(cin),
     istream_iterator<double, char>(),
     ostream_iterator<double, char>(cout, "\n"));

the function partial_sum_copy is non-existent but named "partial_sum" instead. It would even be better if such an example would use the new initializer syntax :-)

   partial_sum(istream_iterator<double, char>(cin),
     istream_iterator<double, char>(),
     ostream_iterator<double, char>(cout, "\n"));

or better

   partial_sum(istream_iterator<double, char>{cin},
     istream_iterator<double, char>{},
     ostream_iterator<double, char>{cout, "\n"});

P.S.: This has already been reported to comp.lang.c++ in 2005 but didn't seem to have taken up attention by somebody yet
http://groups.google.com/group/comp.std.c++/browse_thread/thread/cdd1d6f37f42a33c?pli=1

and it has been sitting there since Stepanov 1995

@@ -2569,9 +2569,9 @@ are provided.

 \enterexample
 \begin{codeblock}
-partial_sum_copy(istream_iterator<double, char>(cin),
-  istream_iterator<double, char>(),
-  ostream_iterator<double, char>(cout, "@\textbackslash@n"));
+partial_sum(istream_iterator<double, char>{cin},
+  istream_iterator<double, char>{},
+  ostream_iterator<double, char>{cout, "@\textbackslash@n"});
 \end{codeblock}

 reads a file containing floating point numbers from

@PeterSommerlad
Copy link
Author

figured out how to create pull requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant