Hi fellow members,
I have wrote two abstract classes, with the second inheriting from the first.
However, I receive this error when I try to compile: "error C2143: syntax error : missing ',' before '<'."
Will somebody help me out?
Thanks!
template <class DataType>
class AbstactArrayClass
{
friend ostream& operator << (ostream& s, AbstactArrayClass<DataType>& ac);
public:
virtual int size() const = NULL;
virtual DataType& operator[] (int k) = NULL;
};
template <class DataType>
ostream& operator << (ostream& s, AbstactArrayClass<DataType>& ac)
{
s << "[";
for (int i = 0; i < ac.size(); i++)
{
if (i > 0)
{
s << ',';
}
s << ac[i];
}
s << "]";
return s;
}
template <class DataType>
class AbstractVector : virtual public AbstractArrayClass<DataType>
{
public:
virtual void insert(const DataType& item, int index) = NULL;
virtual void remove(int index) = NULL;
virtual void add(const DataType& item) = NULL;
};