J
Joseph Paterson
Hi all,
I'm writing a simple Stack class, that inherits from a Stack Interface,
IStack.
IStack has a protected member variable, m_root
I have:
--snip--
template <class T>
class IStack
{
//...
protected:
struct entry * m_root;
};
template <class T>
class Stack : public IStack<T>
{
public:
Stack()
{
m_root = 0;
}
};
--snip--
This does not compile, the compiler can't see m_root inside Stack.
However, if I call it with this->m_root, it compiles.
Any clues?
Thanks,
Joseph.
I'm writing a simple Stack class, that inherits from a Stack Interface,
IStack.
IStack has a protected member variable, m_root
I have:
--snip--
template <class T>
class IStack
{
//...
protected:
struct entry * m_root;
};
template <class T>
class Stack : public IStack<T>
{
public:
Stack()
{
m_root = 0;
}
};
--snip--
This does not compile, the compiler can't see m_root inside Stack.
However, if I call it with this->m_root, it compiles.
Any clues?
Thanks,
Joseph.