Re: template class with default parameter in template parameter declaration

2011-11-09 Thread Marc Glisse
On Tue, 8 Nov 2011, Marc Glisse wrote: On Tue, 8 Nov 2011, Ulrich Drepper wrote: Complicated title, here's a bit of code: #ifdef FIX # define PARM2 , class T5 #else # define PARMS2 #endif template struct cl1 { }; template class T4 = cl1> struct cl2 { }; cl2<> var; If compiled without FIX

Re: template class with default parameter in template parameter declaration

2011-11-08 Thread Andrew Pinski
On Tue, Nov 8, 2011 at 10:53 AM, Marc Glisse wrote: > On Tue, 8 Nov 2011, Ulrich Drepper wrote: > >> Complicated title, here's a bit of code: >> >> #ifdef FIX >> # define PARM2 , class T5 >> #else >> # define PARMS2 >> #endif >> >> >> template >> struct cl1 { >> }; >> >> template class T4 = cl1> >

Re: template class with default parameter in template parameter declaration

2011-11-08 Thread Marc Glisse
On Tue, 8 Nov 2011, Ulrich Drepper wrote: Complicated title, here's a bit of code: #ifdef FIX # define PARM2 , class T5 #else # define PARMS2 #endif template struct cl1 { }; template class T4 = cl1> struct cl2 { }; cl2<> var; If compiled without FIX defined this will fail with gcc 4.3 and

Re: template class

2011-06-10 Thread Ruben Safir
FWIW Array( const Array&rhs ); On Fri, Jun 10, 2011 at 08:30:05PM -0700, eric wrote: > Dear Mr. Bjarne Stroustrup: > > Thanks your suggestion, I follow it but it show fatal error:Array.cpp: > no such file > so > I add #include "Array.cpp" in my main program, pg52.cpp > then > it can compile

Re: template class

2011-06-10 Thread Ian Lance Taylor
eric writes: > Thanks your suggestion, I follow it but it show fatal error:Array.cpp: > no such file > so > I add #include "Array.cpp" in my main program, pg52.cpp > then > it can compile > but > when I run it, it response > Segmentation fault > > again it's g++ 4.5.2. What may cause wrong? >

Re: template class

2011-06-10 Thread eric
Dear Mr. Bjarne Stroustrup: Thanks your suggestion, I follow it but it show fatal error:Array.cpp: no such file so I add #include "Array.cpp" in my main program, pg52.cpp then it can compile but when I run it, it response Segmentation fault again it's g++ 4.5.2. What may cause wrong? hope to

Re: template class scoping rules

2006-03-14 Thread David Fang
Hi, Since 3.4, (template-)dependent lookup has been changed to conform to the standard. In particular, from http://gcc.gnu.org/gcc-3.4/changes.html: "In a template definition, unqualified names will no longer find members of a dependent base." This allows lookups to be bound at template