Message from C, C++ discussions

December 2019

— It's my mistake

— 

I've changed it but it's not still working
auto end = points.end();
--end; --end;
for (auto it = points.begin(); it != end;)
{
auto it2 = ++it;
while (it2 != points.end())
{
if (it->x == it2->x && it->y == it2->y && it->z == it2->z)
it2 = points.erase(it2);
else
++it2;
}
}

— I see one more problem (except that you keep saying "not working" without providing what exactly is going wrong).
Your it and it2 are equal at the start of each iteration. Because you increment it when set it2.
You should set it2 = it and then increment it2 only. And increment it at the and of the iteration (or better in the loop expression, as it was before)

Message permanent page

— Ah, hard to explain something with such a variable name in the context :)

— You can convert it to a set and back to a list

— I've finally do it:
for (auto it = points.begin(); it != prev(points.end()); it++)
{
auto it2 = next(it);
while (it2 != points.end())
{
if (it->x == it2->x && it->y == it2->y && it->z == it2->z)
it2 = points.erase(it2);
else
++it2;
}
}

Message permanent page

— Looks like a very high complexity

— O(n2)

— Hello

— How do not escape from size of array?

— Wat

— Purge complete.