This is the mail archive of the gcc-bugs@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]

Template fun.



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


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