joeGrammar
Programmer
code:
template <class T>
class RangeValidator : public FieldValidator
{
public:
RangeValidator( RECTYPE eRecType, int iErrNo, PValMsgArgsCB pVMCBINI, const char *szName, const char *pData, T, T );
virtual LOGIC IsValid();
private:
--> T Low;
--> T High;
};
template <class T>
RangeValidator<T>::RangeValidator(
RECTYPE eRecType, int iErrNo, PValMsgArgsCB pVMCBINI, const char *szName, const char *pDataIni, T LowIni, T HighIni ) :
FieldValidator( eRecType, iErrNo, pVMCBINI, szName )
{
--> pData = pDataIni;
--> Low = LowIni;
--> High = HighIni;
}
template <class T>
LOGIC RangeValidator<T>::IsValid()
{
error --> return ( Low <= pData && pData <= High ) ? PASS : FAIL;
}
c:\windows\desktop\newbatch\inc\zdataval.hpp(161) : error C2667: '<=' : none of 2 overload have a best conversion
I understand what's going on here, I need you guys to tell me if you think this error should be occuring. One parameter is a template var, the other is a const char. Isn't it possible to compare a template var?
template <class T>
class RangeValidator : public FieldValidator
{
public:
RangeValidator( RECTYPE eRecType, int iErrNo, PValMsgArgsCB pVMCBINI, const char *szName, const char *pData, T, T );
virtual LOGIC IsValid();
private:
--> T Low;
--> T High;
};
template <class T>
RangeValidator<T>::RangeValidator(
RECTYPE eRecType, int iErrNo, PValMsgArgsCB pVMCBINI, const char *szName, const char *pDataIni, T LowIni, T HighIni ) :
FieldValidator( eRecType, iErrNo, pVMCBINI, szName )
{
--> pData = pDataIni;
--> Low = LowIni;
--> High = HighIni;
}
template <class T>
LOGIC RangeValidator<T>::IsValid()
{
error --> return ( Low <= pData && pData <= High ) ? PASS : FAIL;
}
c:\windows\desktop\newbatch\inc\zdataval.hpp(161) : error C2667: '<=' : none of 2 overload have a best conversion
I understand what's going on here, I need you guys to tell me if you think this error should be occuring. One parameter is a template var, the other is a const char. Isn't it possible to compare a template var?