So I have SkipList.hpp which has a nested templated class called SkipListIterator.
//SkipList.hpp
template <class Key_t, class Mapped_t>
class SkipList {
template <bool isConst, bool isReverse>
class SkipListIterator {
...
}
...
}
In my Map.hpp, I want to make typedefs for the different types of iterators. What I tried to do was the following:
//Map.hpp
#include "SkipList.hpp"
template <class Key_t, class Mapped_t>
class Map {
typedef typename SkipList<Key_t, Mapped_t>::SkipListIterator<false, false> iterator;
typedef typename SkipList<Key_t, Mapped_t>::SkipListIterator<true, false> const_iterator;
typedef typename SkipList<Key_t, Mapped_t>::SkipListIterator<false, true> reverse_iterator;
typedef typename SkipList<Key_t, Mapped_t>::SkipListIterator<true, true> const_reverse_iterator;
...
}
This does not work, and g++ gives me the following error:
error: non-template 'SkipListIterator' used as template
typedef typename SkipList<Key_t, Mapped_t>::SkipListIterator<false, false> iterator
^