Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
c++ - error when accessing a base class
Hi, With reference to the following FAQ item:The compiler gives me an error when accessing a base class? With the code: template <class T> struct Base { int m_member; }; template <class T> struct Derived : public Base<T> { Derived() : m_member(0) {} }; the compiler gives an error that the m_member or any other members of Base<T> are not found. Although other compilers accept such code, it is incorrect according to the C++98 Standard 14.6.2-2 and 14.6.2.1-1. Base<T> is a dependent type, and so it is not in scope for template class Derived. Aug 20 2007
Alok wrote:Hi, With reference to the following FAQ item:The compiler gives me an error when accessing a base class? With the code: template <class T> struct Base { int m_member; }; template <class T> struct Derived : public Base<T> { Derived() : m_member(0) {} }; the compiler gives an error that the m_member or any other members of Base<T> are not found. Although other compilers accept such code, it is incorrect according to the C++98 Standard 14.6.2-2 and 14.6.2.1-1. Base<T> is a dependent type, and so it is not in scope for template class Derived. Aug 25 2007
Alok wrote:Hi, With reference to the following FAQ item:The compiler gives me an error when accessing a base class? With the code: template <class T> struct Base { int m_member; }; template <class T> struct Derived : public Base<T> { Derived() : m_member(0) {} }; the compiler gives an error that the m_member or any other members of Base<T> are not found. Although other compilers accept such code, it is incorrect according to the C++98 Standard 14.6.2-2 and 14.6.2.1-1. Base<T> is a dependent type, and so it is not in scope for template class Derived. Aug 30 2007
|