This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "not delcared in this scope" when subclassing a template


Hi Alexei,

> You can get around that error by doing:
> this->elems
another possibility would be to add a using-declaration - especially, if
you are using "elems" more than once in the derived class
template<class A>
class Derived: public Base<typename A::value_type> {
  using Base<typename A::value_type>::elems;
  void Test() {
    if (elems) {
    }
  }
};

HTH,

Axel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]