I defined the following abstract List class:
#ifndef LIST_H
#define LIST_H
template <class T>
class List
{
public:
List();
virtual bool isEmpty() const=0;
virtual void Set(int index, T value)=0;
virtual int getSize() const=0;
virtual void add(T value)=0;
virtual T Remove(int index)=0;
virtual ~List();
protected:
int m_size;
private:
};
#endif // LIST_H
And then I defined a succesor DynamicArray:
#ifndef DYNAMICARRAY_H
#define DYNAMICARRAY_H
#include <iostream>
#include "List.h"
#define CAPACITY 15
template<class T>
class DynamicArray : public List<T>
{
public:
//|========================Constructors============================
DynamicArray(): m_size(0), m_capacity(CAPACITY) { //|Default constructor
m_data = new T[CAPACITY];
}
protected:
private:
//|========================Private Fields=========================
int m_capacity;
T* m_data;
};
(This is not the full class definition, of course I implemented a destructor and more methods but it does not concern my problem).
For some reason I get the following error:
'm_size' was not declared in this scope|
But m_size is defined in the base abstract class "List" and DyanamicArray inherits from List. So what went wrong here?
Thanks in advance.