std::set_difference is it possible to compare set and map Keys?
问题 So we get a new set of strings, and we have one as map Keys. And we want to do one way set_difference (note - not set_symmetric_difference). So currently I have such ugly code like: std::map<std::string, boost::shared_ptr<some_class> > _ds; std::set<std::string> compare_and_clean(std::set<std::string> &new_) { std::set<std::string> result; std::set<std::string> old; for (std::map<std::string, std::string>::iterator mi = _ds.begin(); mi != _ds.end(); ++mi) old.insert(mi->first); std::set