Ok,...I've been trying to figure this out for the past hour..
tree<T>::tree(int nr, int nc, int nl, const T& value)
so this constructor takes an int, int, int , and what?
I've tried everything, please help...:(
I don't understand the "&"!?... i thought "& value" would give the address of value???
and let say I've declared T as an integer with the line..
tree<int> mytree(1,2,2,y); //What is y!??
If you are using ints that constructor takes 4 int arguments, the last is a constant and is passed by reference (&). ALL this means that instead of passing a copy of value it is passing the address of value. The reason is that T could be anything and anything could be very large, so passing a reference to the actual object saves a call to a copy constructor and saves on the extra memory that the new object would take up. Got it?