怎么办阿!!!
编译报了这些错,不知道怎么办了?高手指点下
MySimulation.cpp
c:\program files\microsoft visual studio\vc98\include\functional(86) : error C2784: 'bool __cdecl std::operator <(const class std::deque<_Ty,_A> &,const class std::deque<_Ty,_A> &)' : could not deduce template argument for 'const class std::deque<_T
y,_A> &' from 'const class Event'
c:\program files\microsoft visual studio\vc98\include\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class Event>::operator ()(const class Event &,const class Event &) const'
c:\program files\microsoft visual studio\vc98\include\functional(86) : error C2784: 'bool __cdecl std::operator <(const class std::vector<_Ty,_A> &,const class std::vector<_Ty,_A> &)' : could not deduce template argument for 'const class std::vector
<_Ty,_A> &' from 'const class Event'
c:\program files\microsoft visual studio\vc98\include\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class Event>::operator ()(const class Event &,const class Event &) const'
c:\program files\microsoft visual studio\vc98\include\functional(86) : error C2784: 'bool __cdecl std::operator <(const class std::basic_string<_E,_Tr,_A> &,const _E *)' : could not deduce template argument for 'const class std::basic_string<_E,_Tr,
_A> &' from 'const class Event'
c:\program files\microsoft visual studio\vc98\include\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class Event>::operator ()(const class Event &,const class Event &) const'
c:\program files\microsoft visual studio\vc98\include\functional(86) : error C2784: 'bool __cdecl std::operator <(const _E *,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'const *' from 'const class Event'
c:\program files\microsoft visual studio\vc98\include\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class Event>::operator ()(const class Event &,const class Event &) const'
c:\program files\microsoft visual studio\vc98\include\functional(86) : error C2784: 'bool __cdecl std::operator <(const class std::basic_string<_E,_Tr,_A> &,const class std::basic_string<_E,_Tr,_A> &)' : could not deduce template argument for 'const
class std::basic_string<_E,_Tr,_A> &' from 'const class Event'
c:\program files\microsoft visual studio\vc98\include\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class Event>::operator ()(const class Event &,const class Event &) const'
c:\program files\microsoft visual studio\vc98\include\functional(86) : error C2784: 'bool __cdecl std::operator <(const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &,const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &)' : could not deduce te
mplate argument for 'const class std::reverse_iterator<_RI,_Ty,_Rt,_Pt,_D> &' from 'const class Event'
c:\program files\microsoft visual studio\vc98\include\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class Event>::operator ()(const class Event &,const class Event &) const'
c:\program files\microsoft visual studio\vc98\include\functional(86) : error C2784: 'bool __cdecl std::operator <(const struct std::pair<_T1,_T2> &,const struct std::pair<_T1,_T2> &)' : could not deduce template argument for 'const struct std::pair<
_T1,_T2> &' from 'const class Event'
c:\program files\microsoft visual studio\vc98\include\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class Event>::operator ()(const class Event &,const class Event &) const'
c:\program files\microsoft visual studio\vc98\include\functional(86) : error C2676: binary '<' : 'const class Event' does not define this operator or a conversion to a type acceptable to the predefined operator
c:\program files\microsoft visual studio\vc98\include\functional(86) : while compiling class-template member function 'bool __thiscall std::less<class Event>::operator ()(const class Event &,const class Event &) const'
Error executing cl.exe.
MySimulation.obj - 8 error(s), 0 warning(s)
[解决办法]
没实现
bool operator< (const Event&, const Event&);
?瞎猜。。
[解决办法]
是不是Simulation头文件中没有加#include"Event.h"这里使用了啊,priority_queue <Event> pq; 还有就是Event类的定义问题了。