linux 下使用set,map问题 急!

我写了一个资源池类,使用了模板类;资源池的内存使用map来管理,空闲的用set来记录;
大体就是(部分代码):
template<class KEY,class VALUE>
class CResPool
{
typedef map<KEY,VALUE*> ResNodeMap;

private:
  ResNodeMap m_resNodeMap; // 资源池内存
  set<KEY> m_sparePool; // 空闲的资源
public:
  // 从资源池中通过key查找一个资源
  VALUE* Find(KEY& key)
{
set<KEY>::iterator setitor = m_sparePool.find(key);
if (setitor!=m_sparePool.end())
return NULL;

map<KEY,VALUE*>::iterator itor = m_resNodeMap.find(key);
if (itor != m_resNodeMap.end())
return itor->second;
return NULL;
}
}
编译的时候Find函数中的set<KEY>::iterator setitor 不能编译通过,说set<KEY>::iterator不是有效的类型吧;
这个是什么原因呢,我在windows上面使用都没有问题的,但linux上有问题;
请高手帮忙啊,很急!

作者: ngnhwan   发布时间: 2011-04-12

#include <iostream>
#include <iterator>
#include <set>
using namespace std;
set<int>::iterator setitor ;
main(){}

这样是可以编译通过的
g++ test.cpp

作者: justkk   发布时间: 2011-04-13

谢谢2楼的意见。
2楼的当然可以编译通过;但是我的问题还是没有解决; 
通过以前使用set的经验来看,放入set中的内容必须有显示/隐藏的operator<()重载函数;
是不是使用泛型的时候不知道对应的类型,但windows下却可以通过,这个好纠结;
从windows下转到linux下遇到不少问题;请朋友们帮忙啊! 谢谢啊.....

作者: ngnhwan   发布时间: 2011-04-13