考虑下面的类
#include <set>
#include <vector>
using namespace std;
class foo {
public:
struct spatial {
bool block;
char status; // H, M, Z
};
typedef pair< int, vector<spatial> > way; // tag + spatial vector
typedef set< way > one_set;
void bar()
{
way theWay;
theWay.first = 10;
one_set theSet;
one_set::iterator sit = theSet.end();
if (theSet.size() == 16) {
sit = theSet.begin();
}
theSet.insert(sit, theWay);
}
};
对于插入功能,我收到这些错误,我不知道这是什么意思
error C2784: 'bool std::operator <(const std::vector<_Ty,_Ax> &,const std::vector<_Ty,_Ax> &)' : could not deduce template argument for 'const std::vector<_Ty,_Ax> &' from 'const foo::spatial' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility
error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const foo::spatial' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 3144
error C2784: 'bool std::operator <(const std::unique_ptr<_Ty,_Dx> &,const std::unique_ptr<_Ty2,_Dx2> &)' : could not deduce template argument for 'const std::unique_ptr<_Ty,_Dx> &' from 'const foo::spatial' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 3144
error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'const foo::spatial' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 3144
error C2784: 'bool std::operator <(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : could not deduce template argument for 'const std::_Revranit<_RanIt,_Base> &' from 'const foo::spatial' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 3144
error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : could not deduce template argument for 'const std::pair<_Ty1,_Ty2> &' from 'const foo::spatial' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 3144
error C2676: binary '<' : 'const foo::spatial' does not define this operator or a conversion to a type acceptable to the predefined operator c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 3144
卡在这一点上。感谢任何帮助。