Hello i have a vector of stores. i would like to delete the specified choice(store) from the list. Here is what i have but my erase statement is wrong and wont compile. I am a beginner and cant figure out a way to do this correctly. Any help is appretiated. Thank you.
1 2 3 4 5 6 7
void Store::deleteSpecifiedStoreFromList(string choice) {
for (int i = 0; i < this->stores.size(); i++) {
if(this->stores[i].getStoreNames() == choice) {
this->stores.erase( std::remove_if( this->stores.begin(), this->stores.end(), choice ), this->stores.end() );
}
}
}