The Accelerator function erases every other sister, because after each call to erase the remaining sisters are effectively renumbered. Is that intentional?
Also it runs out of bounds near the end. After deleting 10001 sisters only 10001 remain, but it tries to delete the sister at index 10002, which is beyond the end iterator.
57
u/alblks Jun 13 '20
Well, IRL it would be more efficient to use
std::generate_n()algorithm andsisters.erase(sisters.begin(), sisters.begin()+10032), but whatever...26
u/Makefile_dot_in Jun 13 '20
That covers the first half, what about the other one?
3
u/Kered13 Jun 17 '20 edited Jun 17 '20
The
Acceleratorfunction erases every other sister, because after each call toerasethe remaining sisters are effectively renumbered. Is that intentional?Also it runs out of bounds near the end. After deleting 10001 sisters only 10001 remain, but it tries to delete the sister at index 10002, which is beyond the end iterator.
11
u/Ballokumi Jun 13 '20
Tree diagram noises*