Here's a simple template;
template <class T>
class tt {
private:
T x;
public:
tt() {x=0;};
Add(T p) {x += p;};
};
... and then a subclass of it;
class cc : public tt<int> {
public:
cc() : tt() {};
};
This compiles fine in VC, but not in C++ Builder (XE) where it gives a E2102 error. The C++ Builder compiler needs the following syntax on the constructor of the cc class to compile;
cc() : tt<int>() {};
In fact, the C++ Builder compiler needs the template parameters repeated every time the tt template are mentioned within the cc class.
Does the standard C++ specification specify the need for constantly repeating the template parameters or is the C++ Builder compiler wrong?
you can avoid the repetitions by using typedef:
...