L
Leo Meyer
Hello,
if I don't describe this problem properly, please ask me, I'm not an expert on the STL. This thing has me quite baffled.
I'm porting a program to Pocket PC 2002 using STLPort using MS EVC3 and I keep running into this problem:
....\STLport-5.2.1\stlport\stl/_algobase.c(198) : error C2678: binary '==' : no operator defined
which takes a left-hand operand of type 'struct stlp_std:air<class CIMGFile,bool>' (or there is no acceptable conversion)
The problem occurs in an implementation of find:
template <class _InputIter, class _Tp>
_STLP_INLINE_LOOP _InputIter __find(_InputIter __first, _InputIter __last,
const _Tp& __val,
const input_iterator_tag &) {
while (__first != __last && !(*__first == __val)) ++__first;
^ on this line the error is reported
return __first;
}
As far as I can tell, the pair is being constructed with this macro call:
std::make_pair(CIMGFile(), true)
CIMGFile is a proper class that seems to compile ok.
Previously, in a header file, the programmer defined the == operator using:
inline bool operator == (std:air<CIMGFile, bool> & p, int id )
{
return p.first.GetID() == id;
}
So STLPort keeps telling me that there is no == operator while there clearly should be. Note that it doesn't work either if I change
std:air to stlp_std:air or make it const in the operator definition. I have also tried "int & id" instead with no effect.
Is there something wrong about the type signature that I am missing? How can I get this operator definition to work?
Kind regards, Leo
if I don't describe this problem properly, please ask me, I'm not an expert on the STL. This thing has me quite baffled.
I'm porting a program to Pocket PC 2002 using STLPort using MS EVC3 and I keep running into this problem:
....\STLport-5.2.1\stlport\stl/_algobase.c(198) : error C2678: binary '==' : no operator defined
which takes a left-hand operand of type 'struct stlp_std:air<class CIMGFile,bool>' (or there is no acceptable conversion)
The problem occurs in an implementation of find:
template <class _InputIter, class _Tp>
_STLP_INLINE_LOOP _InputIter __find(_InputIter __first, _InputIter __last,
const _Tp& __val,
const input_iterator_tag &) {
while (__first != __last && !(*__first == __val)) ++__first;
^ on this line the error is reported
return __first;
}
As far as I can tell, the pair is being constructed with this macro call:
std::make_pair(CIMGFile(), true)
CIMGFile is a proper class that seems to compile ok.
Previously, in a header file, the programmer defined the == operator using:
inline bool operator == (std:air<CIMGFile, bool> & p, int id )
{
return p.first.GetID() == id;
}
So STLPort keeps telling me that there is no == operator while there clearly should be. Note that it doesn't work either if I change
std:air to stlp_std:air or make it const in the operator definition. I have also tried "int & id" instead with no effect.
Is there something wrong about the type signature that I am missing? How can I get this operator definition to work?
Kind regards, Leo