0

Can someone here tell me how to get the derived class method below to recognize the inner class Option from the base class?

template <typename T>
class Menu {
protected:
    class Option { };
    Option* first;
};

template <typename T>
class MenuSpecial : Menu<T> {
    template <typename U>
    void foo();
};

template <typename T>
template <typename U>
void MenuSpecial<T>::foo() {
//  Option* option;  // GCC 11.2 does not recognize type Option.
    Menu<T>::Option* option;  // GCC 11.2 complains: 'option' was not declared in this scope
}
prestokeys
  • 4,817
  • 3
  • 20
  • 43

0 Answers0