Template fun.

Karl Nelson kenelson@ece.ucdavis.edu
Thu Mar 25 09:57:00 GMT 1999


This code is wrong but generates an internal compiler error.

template <class A>
  struct Sig
    {
     typedef void (*Func)(A);
     Func f_;
     void call(A& a) 
       {f_(a);}
     Sig(Func f):f_(f) 
       {}

template <class A>
  struct Sig
    {
     typedef void (*Func)(A&);
     Func f_;
     void call(A a) 
       {f_(a);}
     Sig(Func f):f_(f) 
       {}
    };

--Karl


More information about the Gcc-bugs mailing list