示例#1
0
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;
}
示例#2
0
文件: XAIUtil.hpp 项目: rrti/ai-libs
	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;
	}
示例#3
0
文件: XAIUtil.hpp 项目: rrti/ai-libs
	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;
	}