These are part of C++17. Later, we'll get the parallel versions.
Details
Diff Detail
Event Timeline
https://gist.github.com/brycelelbach/137f1e45b737d615134e228ec0c84f3a <- some crude tests I wrote based on slides/notes of mine.
EDIT: Okay, looks good, your implementation passes my little tests.
This implementation works, but performs unnecessary operations.
https://gist.github.com/brycelelbach/907ac3b8a74603cc189897ab789a65a9
The "next" result is calculated in each iteration; this means one unnecessary application of the binary op (the "next" result on the final iteration).
EDIT: I don't think we can avoid this for the case of InputIterators (and ForwardIterators?), because we can't decrement last.
Added a _VSTD::, made some assertions static_assert, and addressed Bryce's concerns about doing an init when the input range is empty.
Add extra tests to make sure that the calculations are not done using the source sequence value_type.
Previous update was br0ken. This is better. :-)
Add a test to ensure that the calculations are done using the correct type.
If __first == __last, this initialization is unnecessary; I'd refactor this so that we check for __first != __last first.