Reputation: 1523
Basically I want to replace the values in the vector
by the corresponding partial_sum
. And I can not find in the reference whether it is guaranteed to work in case the destination range is the same as input.
And what about inclusive_scan
?
Upvotes: 2
Views: 78
Reputation: 172984
It's guaranteed to work. The standard mentioned this, $26.8.6/5 Partial sum [partial.sum]
5 Remarks:
result
may be equal tofirst
.
And it's same for inclusive_scan
. $26.8.8/6 Inclusive scan
[inclusive.scan]
6 Remarks:
result
may be equal tofirst
.
Upvotes: 3