typeof() in templates

Lawrence Foard entropy@virek.vwis.com
Sun Jul 25 14:01:00 GMT 1999


I'm somewhat new to templates so this code may not be legal, the
following piece of code causes an internal compiler error. I'm using egcs
that comes with Redhat 6. Attempting to compile the following "class"
will cause an internal compiler error.


template <class AParticle>
 class World
  {
   typedef typeof(AParticle::origin) Position;
   typedef typeof(AParticle::velocity) Velocity;
        
  }

g++ -v 
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

Thanks




More information about the Gcc-bugs mailing list