issue with std::advance on std::sets
- by tim
I've stumbled upon what I believe is a bug in the stl algorithm advance.
When I'm advancing the iterator off of the end of the container, I get inconsistent results. Sometimes I get container.end(), sometimes I get the last element. I've illustrated this with the following code:
#include <algorithm>
#include <cstdio>
#include…