All, Could somebody tell me why the commented out constructor in the attached code doesn't compile (it doesn't make sense to do that in this example, but it would do in some code I'm currently writing ;-). TIA, Fred
#include <iostream> template <class T, T defaultVal> class baseClass { public: baseClass() : theVal(defaultVal) { } baseClass(T val) : theVal(val) { } // baseClass(T val) // : baseClass() // { // theVal = val; // } void printVal() { std::cout << theVal << std::endl; } private: T theVal; }; class intClass : public baseClass<int, 5> { public: intClass() : baseClass<int, 5>() { } intClass(int val) : baseClass<int, 5>(val) { } }; main() { intClass a(10); a.printVal(); baseClass<int,1>b; b.printVal(); }