diff --git a/cpp_impl/src/TSLQueue.hpp b/cpp_impl/src/TSLQueue.hpp index c4fafe9..fd28bb3 100644 --- a/cpp_impl/src/TSLQueue.hpp +++ b/cpp_impl/src/TSLQueue.hpp @@ -51,6 +51,9 @@ class TSLQueue { bool prev(); std::optional current(); + TSLQIterWrapper& operator++(); + TSLQIterWrapper& operator--(); + private: std::conditional_t, std::list> *containerPtr; @@ -333,6 +336,20 @@ std::optional TSLQueue::TSLQIterWrapper::current() { return *iter; } +template +template +typename TSLQueue::template TSLQIterWrapper& TSLQueue::TSLQIterWrapper::operator++() { + next(); + return *this; +} + +template +template +typename TSLQueue::template TSLQIterWrapper& TSLQueue::TSLQIterWrapper::operator--() { + prev(); + return *this; +} + template typename TSLQueue::template TSLQIterWrapper TSLQueue::iter() { return TSLQIterWrapper(&container, iterValid, iterWrapperCount);