Topic: Declaration and Definition of a template class


Author: Ralf Stoffels <stoffels@faho.rwth-aachen.de>
Date: 1996/11/26
Raw View
Hi Sebastien,

you can put the declaration and the definition of a template
class in different files, if use "explicit instantiation".
This means that you have to write something like
template class A<int>;
for all classes, which you want to use in class A.
You have to write this in the definition file.

In ANSI C++ this problem will be fixed by the new keyword "export".


Ralf
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]





Author: sboivin@videotron.ca (Sebastien Alix)
Date: 1996/11/22
Raw View
Are we forced to put the Declaration and the definition of a template
class in the same file? If not how can we avoid this?

Sebastien Alix
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]