Salve ragazzi, ho un grosso problema nella visualizzazione di lista è da due giorni che ci combatto, mi potreste dire quale sia l'errore?
#include<iostream>
using namespace std;
template<class H> class Nodo {
	private:
		H key;
		Nodo<H>* next;
	
	public:
		Nodo(H k){
			key = k;
			next = NULL;
		}
		
		void setKey(H key){
			this->key = key;
		}
		
		void setNext(Nodo<H>* next){
			this->next = next;
		}
		
		H getKey() const {
			return key;
		}
		
		Nodo<H>* getNext() const{
			return next;
		}
};
template<class H> class List{
	private:
		int n;
		Nodo<H>* head;
	
	public:
		List(){
			n = 0;
			head = NULL;
		}
		
		List<H>* insert(H x){
			Nodo<H>* prev = NULL;
			Nodo<H>* i = head;
			
			while(i != NULL)
			{
				prev = i;
				i = i->getNext();
			}
			
			Nodo<H>* nd = new Nodo<H>(x);
			
			if(prev == NULL)
				head = nd;
			else
				prev->setNext(nd);
			
			nd->setNext(i);
			
			n++;
			return this;
		}
		
		Nodo<H>* getHead() const {
			return head;
		}
		
		friend ostream& operator<<(ostream& stream, const List<H>*& l){
			List<H>* l1 = l;
			
			Nodo<H>* tmp = l1.getHead();
			while(tmp != NULL)
				{
					stream << tmp->getKey() << " ";
					tmp = tmp->getNext();
				}
			
			return stream;
		}
};
template<class H> class MultiList : public List< List<H> >{
	private:
		List< List<H> >* ml;
	
	public:
		MultiList(){
			ml = new List< List<H> >();
		}
		
		MultiList<H> *insert(H x){
			Nodo< List<H> >* tmp = ml->getHead();
			
			if(!tmp)
			{
				List<H> aux;
				aux.insert(4);
				ml->insert(aux);
			}
			
			tmp = tmp->getNext();
			
			return this;
		}
		
		void print(){
			Nodo< List<H> >* tmp = ml->getHead();
			
			while(tmp != NULL)
			{
				cout << tmp->getKey();
				tmp = tmp->getNext();
			}
		}
};
int main(){
	MultiList<int>* l = new MultiList<int>();
	l->insert(5)->insert(4)->insert(7)->insert(6)->print();
}
il concetto l'ho capito, ma non capisco perchè mi da errore nella ridefinizione dell'operatore <<, nel void print di MultiList... cout << tmp->getKey();
anche se nella classe list definisco ciò che deve fare...        @oregon