Add prefix inc/dec to TSLQIterWrapper
This commit is contained in:
parent
ebedd06fdb
commit
aa132fbf12
1 changed files with 17 additions and 0 deletions
|
@ -51,6 +51,9 @@ class TSLQueue {
|
|||
bool prev();
|
||||
std::optional<T> current();
|
||||
|
||||
TSLQIterWrapper<isConst, isRev>& operator++();
|
||||
TSLQIterWrapper<isConst, isRev>& operator--();
|
||||
|
||||
private:
|
||||
std::conditional_t<isConst, const std::list<T>, std::list<T>>
|
||||
*containerPtr;
|
||||
|
@ -333,6 +336,20 @@ std::optional<T> TSLQueue<T>::TSLQIterWrapper<isConst, isRev>::current() {
|
|||
return *iter;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <bool isConst, bool isRev>
|
||||
typename TSLQueue<T>::template TSLQIterWrapper<isConst, isRev>& TSLQueue<T>::TSLQIterWrapper<isConst, isRev>::operator++() {
|
||||
next();
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <bool isConst, bool isRev>
|
||||
typename TSLQueue<T>::template TSLQIterWrapper<isConst, isRev>& TSLQueue<T>::TSLQIterWrapper<isConst, isRev>::operator--() {
|
||||
prev();
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
typename TSLQueue<T>::template TSLQIterWrapper<false, false> TSLQueue<T>::iter() {
|
||||
return TSLQIterWrapper<false, false>(&container, iterValid, iterWrapperCount);
|
||||
|
|
Loading…
Reference in a new issue