typename std::set<Connection*> WeightedPoll::get_objects(){ typename std::set<Connection*> items; for(typename std::map<Connection*,double>::iterator it = counter.begin(); it != counter.end(); ++it) { items.insert(it->first); } return items; }
template<typename T> std::set<T> UnionSets(const std::set<T>& s1, const std::set<T>& s2) { typename std::set<T> r; typename std::set<T>::const_iterator sit; for (sit = s1.begin(); sit != s1.end(); sit++) { r.insert(*sit); } for (sit = s2.begin(); sit != s2.end(); sit++) { r.insert(*sit); } return r; }
template<typename T> std::set<T> IntersectSets(const std::set<T>& s1, const std::set<T>& s2) { typename std::set<T> r; typename std::set<T>::const_iterator sit; for (sit = s1.begin(); sit != s1.end(); sit++) { if (s2.find(*sit) != s2.end()) { r.insert(*sit); } } return r; }