Deriving a class from a class template

后端 未结 3 508
青春惊慌失措
青春惊慌失措 2021-01-21 16:37

I am new to C++. During my learning phase I encountered with below issue. I am trying to derive a class stack from a class template Queue. Compiler thr

3条回答
  •  -上瘾入骨i
    2021-01-21 16:55

    In a template definition, unqualified names will no longer find members of a dependent base (as specified by [temp.dep]/3 in the C++ standard). For example, You must make the names dependent, e.g. by prefixing them with this->.

    gcc-problem-using-a-member-of-a-base-class-that-depends-on-a-template-argument

    And yes, it can be valid in VS.

提交回复
热议问题