Please help me check the small C++ snippet.
class Imy
{
public:
enum ReCode_et {
E_Success = 0,
E_Fail = -1,
};
};
template<class T>
bool CheckSuccess(typename T::ReCode_et err)
{
if(err==T::E_Success)
return true;
else
return false;
}
int main()
{
return !CheckSuccess(Imy::E_Success);
}
When compiling with gcc 4.1.0, it fails with
tpl1.cpp: In function ‘int main()’:
tpl1.cpp:21: error: no matching function for call to
‘CheckSuccess(Imy::ReCode_et)’
But I think the CheckSuccess can decude that T is Imy , right?