#include "ArrayList.h"
template <typename T>
ArrayList<T>::ArrayList(): innerArray(new T[0]), len(0) {
// constructor stuff
}
template <typename T>
ArrayList<T>::~ArrayList() {
// destructor stuff
}
... on and on and on ...
In this code, I have to write template <typename T>
and ArrayList<T>::
before every member function in the entire class.
Is there any way to eliminate this repetition (DRY), so I can do something like
#include "ArrayList.h"
// do some magic
ArrayList(): innerArray(new T[0]), len(0) {
// constructor stuff
}
~ArrayList() {
// destructor stuff
}