I have a template class that has two nested classes in it, and one is derived from another:
template <typename T>
class SuperList
{
public:
using List = typename std::list<T>;
struct BaseIterator
{
explicit BaseIterator(typename List::iterator iterator):
iterator_(iterator) {}
typename List::iterator iterator_;
};
struct DerivedIterator : public BaseIterator
{
explicit DerivedIterator(typename List::iterator iterator):
BaseIterator(iterator) {}
void test() {iterator_;};
};
};
It does not compile:
error: 'iterator_' was not declared in this scope void test() {iterator_;};
I don't understand, why the DerivedIterator
doesn't see a member from the base class.