[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OFF-TOPIC] C++ template question



For template classes, the class has to be in the header file only, it
can't have separate files for header and class file.

When you want to use the template class, only include the header file,
and compile only the test file, not the template class file.

Ex.
template class file : bar.h
test file: foo.c

#include "bar.h"
void main(void) {
...
}

and compile using g++ -o foo foo.c

Qiang 


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: