class Manage{ public: vectordlls; public: void addstring(char* n); bool isStringExist(char* s); bool removeString(char* str); }; void Manage::addstring(char *n){ dlls.push_back(n); } bool Manage::isStringExist(char *s){ vector::iterator i = std::find(dlls.begin(),dlls.end(), s); return ((i == dlls.end()) ? false : true); } bool Manage::removeString(char *str){ vector::iterator remIt = dlls.find(str); if(remIt != dlls.end()){ dlls.erase(remIt); return true; } return false; } template class Print { ostream &o; public: Print(ostream &o) : o(o){} void operator() (T t) { o << t << endl; } }; template void Manage::print(ostream &o) const{ for_each(dlls.begin(),dlls.end(),Print(o)); }