This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why this template code fails to comple?



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).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]