Re: Why this template code fails to comple?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux