I\'m programming in c++ using sublimetext3. My program has a superclass called Array, and a subclass called IntArray. Both classes are template classes. Currently, I\'m having t
Use
template <class T> IntArray<T>::IntArray(T s) throw() : Array<T>(s) {}
// ^^^ Use <T>
More importantly, put the implemetation also in the .h file.
See Why can templates only be implemented in the header file?.
Other Issues I Noticed
T s
for size. std::size_t s
makes more sense.It does not make sense that IntArray
is a class template. It makes more sense to me to use:
class IntArray : public Array<int> { ... };