You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
727 B

#include "Groupe.h"
#include <iostream>
#include <string>
using namespace std;
Groupe::Groupe(string name) : name(name) {}
string Groupe::getName() const {
return name;
}
void Groupe::affichage(ostream& flux) const {
flux << "informations du groupe : " << name << endl << "{" << endl;
for (auto & it : *this) {
flux << "; - ";
it->affichage(flux);
}
flux << ";}" << endl;
}
void Groupe::supprimer(string name) {
list<BasePtr>::iterator it, it_tosuppr;
it_tosuppr = this->end();
it = this->begin();
while (it != this->end()) {
if ((*it)->getName() == name) {
cout << "erase" << endl;
it_tosuppr = it;
}
++it;
}
if (it_tosuppr != this->end()) this->erase(it_tosuppr);
}