binTree needs to be able to see the definitnion of binTNode(), not just the prototype. Thus
Code:
template<class T>
binTNode<T>::binTNode(const T& d=T(), binTNode<T>* l=0, binTNode<T>* r=0) : data(d), left(l), right(r) {}
needs to be in the header(basically)
Normally with templates I go with nested classes and inline functions whenever I can.
Code:
template<class T>
class tree {
struct node {
T data;
node *l,*r;
node(const &d,node *ll=0, node *rr=0) : data(d), l(ll), r(rr) {}
} *root;
public:
...
};
Note: not compiled, milage may vary.