Bonjour a tous!
Voila mon prob:
g un exo1.h comme suit:
#include <string> #include <list> class personne { protected : string nom; public : personne(string = ""); }; class ens_pers { private : list<personne> l; public : void operator <(personne); bool operator [](personne); bool operator ==(ens_pers&); bool operator !=(ens_pers&); int card(); friend ostream& operator <<(ostream&, ens_pers&); };
|
et dans mon .cpp g la fonction suivante :
bool ens_pers::operator [](personne p) { list<personne>::iterator it; it = find(l.begin(), l.end(), p); if (it!=l.end()) return true; else return false; }
|
Le prob est qu'il me dit que je fait un appel implite de int find(...)
Alors ma question est pour quoi ca ne fonctionne pas?
En fait je veux vérifier si une personne p appartient a un ens_pers. Voila.
Je vous remerci d'avance de votre attention.