diff --git a/src/Contact.cpp b/src/Contact.cpp index 2cced8f..001d269 100644 --- a/src/Contact.cpp +++ b/src/Contact.cpp @@ -51,12 +51,23 @@ bool Contact::rechercher(const Personne& unContact){ lesContacts.sort(); } -// bool Contact::supprimerContact(const Personne& unContact){ -// //remove -// } +bool Contact::supprimerContact(const Personne& unContact){ + list::iterator it = find(lesContacts.begin(), lesContacts.end(), &unContact); + if(it!=lesContacts.end()){ + lesContacts.erase(it); + cout << "Contact " << unContact << " supprimé\n"; + return true; + } + else { + cout << "Erreur : le contact n'existe pas\n"; + return false; + } +} -// string envoyerMessage(std::string texte, Personne p) +void Contact::envoyerMessage(std::string texte, Personne p){ + +} // string recevoirMessage(std::string texte, Personne p)