2015-04-08 22:49 GMT+03:00 Cosmin Boaca
Hello,
The main problem that appears is the following :
In the implementation of the ++ operator I am doing something like
iterator it = ++intrusive_set::s_iterator_to(*tnode) if (it != tnode->parent->children.end()) { /* code */ }
In the implementation of the -- operator I need to do the reversed operation
iterator it = --intrusive_set::s_iterator_to(*tnode) if (it != ??????) { /* code */ }
I can't compare it with begin() because the comparison should work for the begin node, but fail for a node that is somehow before begin(), like end() is past the last element. I don't know how to achieve this. I have tried casting the iterator to reverse_iterator but it didn't help me.
How about iterator it = intrusive_set::s_iterator_to(*tnode) if (it != tnode->parent->children.begin()) { --it; /* code */ } -- Best regards, Antony Polukhin