CaseyCarter / cmcstl2

An implementation of C++ Extensions for Ranges
Other
222 stars 68 forks source link

closes a corner case in ranges::advance #315

Closed cjdb closed 5 years ago

cjdb commented 5 years ago

ranges::advance(i, -n, i) decrements i while bool(i != i), but it was accidentally doing one too many decrements thanks to the post-checked loop. This commit changes the loop to a pre-check.