I’m changing a vector to a list. Ive fixed all the errors except these kind:
Error 16 error C2784: 'bool std::operator <(const std::stack<_Ty,_Container> &,const std::stack<_Ty,_Container> &)' : could not deduce template argument for 'const std::stack<_Ty,_Container> &' from 'std::list<_Ty>::_Iterator<_Secure_validation>' c:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility 2010
Error 17 error C2784: 'bool std::operator <(const std::stack<_Ty,_Container> &,const std::stack<_Ty,_Container> &)' : could not deduce template argument for 'const std::stack<_Ty,_Container> &' from 'std::list<_Ty>::_Iterator<_Secure_validation>' c:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility 2010
Error 18 error C2784: 'bool std::operator <(const std::stack<_Ty,_Container> &,const std::stack<_Ty,_Container> &)' : could not deduce template argument for 'const std::stack<_Ty,_Container> &' from 'std::list<_Ty>::_Iterator<_Secure_validation>' c:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility 2010
Error 19 error C2784: 'bool std::operator <(const std::stack<_Ty,_Container> &,const std::stack<_Ty,_Container> &)' : could not deduce template argument for 'const std::stack<_Ty,_Container> &' from 'std::list<_Ty>::_Iterator<_Secure_validation>' c:\Program Files\Microsoft Visual Studio 9.0\VC\include\xutility 2010
How can one fix these sorts or errors if no line number indicates which file and method is causing the error? I have no idea where the problem could be.
Is there a way to find out which statement triggers these?
Thanks
From the looks of it you got stacks of list iterators which are you are trying to compare using the less than operator (i.e. stack1 < stack2). However, the stack just delegate the comparison of the elements to the element’s operator which doesn’t exist: list iterators can’t be using the less than operator. How to locate where this happens I don’t know but using a different compiler might give you a better error message.