I have read couple of the questions regarding my problem on StackOverflow.com now, and none of it seems to solve my problem. Or I maybe have done it wrong... The overloaded
You can't declare a friend like that, you need to specify a different template type for it.
template friend ostream& operator<< (ostream & os, const D& rhs);
note SclassT so that it doesn't shadow classT. When defining
SclassT
classT
template ostream& operator<< (ostream & os, const D& rhs) { // body.. }