Templates problem

Pascal Francq pfrancq@ulb.ac.be
Wed Feb 23 05:25:00 GMT 2000

I define a template with two files ".h" for the declaration and ".hh" (include
in ".h") for the definition (see below).
I seems that the compiler (gcc 2.95.2) have problems with generating correct
code and debug information. For example in the init function, also if nb is
different than null, the program doesn't run the for loop.
It is possible? Perhaps is the way I manage the files for the templates is

// foo.h
template<class T> : class foo
  T **tab;
  unsigned int nb;
  void init(void);

#include "foo.h"

template<class T> void foo<T>::init(void)
  T **ptr;
  unsigned i;



Ir. Pascal Francq
Université Libre de Bruxelles
Faculty of Applied Mechanics
Avenue F.D. Roosevelt, 50
CP 165/41
B-1050 Brussels
Tel. +32-2-650 47 65
Fax +32-2-650 27 10

More information about the Gcc mailing list