A
ankan.banerjee
I have a piece of STL code which compiled perfectly with VC++ 6.0 and
VS .NET 2003 but I get loads of errors for it in VS 2005.
The code is as follows:
class CTimeKey: public pair<wstring, wstring> {};
class CTimeFactors
{
public:
double calendar_factor;
double calendar_days;
bool pattern_check;
double pattern_factor;
};
class CTimeLine: public map<CTimeKey, CTimeFactors> {};
CTimeLine::iterator l_time_iterator;
....
if (l_time_iterator == NULL) {
....
}
The error is for the NULL comparison operation and is as follows:
error C2678: binary '==' : no operator found which takes a left-hand
operand of type 'std::_Tree<_Traits>::iterator' (or there is no
acceptable conversion)
with
[
_Traits=std::_Tmap_traits<CTimeKey,CTimeFactors,std::less<CTimeKey>,std::allocator<std:air<const
CTimeKey,CTimeFactors>>,false>
]
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\include\guiddef.h(192): could be 'int operator ==(const GUID &,const
GUID &)'
C:\Program Files\Microsoft Visual Studio 8\VC\include
\xtree(287): or 'bool std::_Tree<_Traits>::const_iterator:perator
==(const std::_Tree<_Traits>::const_iterator &) const'
with
[
_Traits=std::_Tmap_traits<CTimeKey,CTimeFactors,std::less<CTimeKey>,std::allocator<std:air<const
CTimeKey,CTimeFactors>>,false>
]
while trying to match the argument list
'(std::_Tree<_Traits>::iterator, int)'
with
[
_Traits=std::_Tmap_traits<CTimeKey,CTimeFactors,std::less<CTimeKey>,std::allocator<std:air<const
CTimeKey,CTimeFactors>>,false>
]
Any ideas how to resolve this?
Thanks and regards,
Ankan
VS .NET 2003 but I get loads of errors for it in VS 2005.
The code is as follows:
class CTimeKey: public pair<wstring, wstring> {};
class CTimeFactors
{
public:
double calendar_factor;
double calendar_days;
bool pattern_check;
double pattern_factor;
};
class CTimeLine: public map<CTimeKey, CTimeFactors> {};
CTimeLine::iterator l_time_iterator;
....
if (l_time_iterator == NULL) {
....
}
The error is for the NULL comparison operation and is as follows:
error C2678: binary '==' : no operator found which takes a left-hand
operand of type 'std::_Tree<_Traits>::iterator' (or there is no
acceptable conversion)
with
[
_Traits=std::_Tmap_traits<CTimeKey,CTimeFactors,std::less<CTimeKey>,std::allocator<std:air<const
CTimeKey,CTimeFactors>>,false>
]
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK
\include\guiddef.h(192): could be 'int operator ==(const GUID &,const
GUID &)'
C:\Program Files\Microsoft Visual Studio 8\VC\include
\xtree(287): or 'bool std::_Tree<_Traits>::const_iterator:perator
==(const std::_Tree<_Traits>::const_iterator &) const'
with
[
_Traits=std::_Tmap_traits<CTimeKey,CTimeFactors,std::less<CTimeKey>,std::allocator<std:air<const
CTimeKey,CTimeFactors>>,false>
]
while trying to match the argument list
'(std::_Tree<_Traits>::iterator, int)'
with
[
_Traits=std::_Tmap_traits<CTimeKey,CTimeFactors,std::less<CTimeKey>,std::allocator<std:air<const
CTimeKey,CTimeFactors>>,false>
]
Any ideas how to resolve this?
Thanks and regards,
Ankan