On Monday 2008-12-15 20:41, Paolo Tiberi wrote: > try this: > 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>(Imy::E_Success); > } Works for me (gcc 4.3.1).