I dont know why i cant show my list :         So ive been trying to overload << operator for my list, but i just cant cout it. i have the following error and i dont know how to fix it..error: no match for 'operator<<' in 'std::cout << it.std::_List_const_iterator<_Tp>::operator* [with _Tp = Joc]()'|
       


CPP: This are the methods that i tried to overload cout << operator but neither of them worked to cout my list using iterators. i dunno how to fix it.
        

ostream& Joc::afisare(ostream&os)const{
        
        
        os<<endl;
        os<<"Numele jocului:"<<this->nume<<' '<<"Stoc:"<<this->stoc<<' '<<"Descrierea joc: "<<this->Descriere<<' ';
        for(list<string>::const_iterator it=upd.begin();it!=upd.end();it++)
        {
        
        
            os<<"Lista:"<<*it<<endl;
        }
        os<<endl;
        return os;
        
        
        }
        
        
        ostream &operator << (ostream &os, Joc&j){
        return j.afisare(os);
        
        
        }
        void Joc::afisare()const
        {cout<<"Numele jocului:"<<this->nume<<' '<<"Stoc:"<<this->stoc<<' '<<"Descrierea joc: "<<this->Descriere<<' ';
        for(list<string>::const_iterator it=upd.begin();it!=upd.end();it++)
        {
        
        
            cout<<"Lista:"<<*it<<endl;
        }
        
        }


       Main:
        list < Joc > jx; here i declared a list of "joc" type.
      
        jx.push_back(j6); pushed 2 
        jx.push_back(j7);
        
        for(list<Joc>::const_iterator it=jx.begin();it!=jx.end();it++)
        {
            cout<<*it;
        }
        //tried to cout<<it->afisare(); still didnt work , i dunno what to do.
    I think its problem with overload << but i dont know how to fix it..
        
        }
    ALl i need is to tipe this list . I dunno how . i think the code is alright but im getting that error.

Details detials
ALl i need is to tipe this list . I dunno how . i think the code is alright but im getting that error.

Details detials
ALl i need is to tipe this list . I dunno how . i think the code is alright but im getting that error.

Details detials
ALl i need is to tipe this list . I dunno how . i think the code is alright but im getting that error.

Details detials
ALl i need is to tipe this list . I dunno how . i think the code is alright but im getting that error.

Details detials
