c++ - template instantiation
- Christof Meerwald (25/25) Oct 15 2001 In the following test-case, the template function isn't instantiated (li...
- John Fletcher (4/29) Oct 16 2001 You don't say what compiler options you used. When I get messages like ...
- Walter (5/43) Oct 16 2001 Yes, -XD will make it work with the existing compiler, but I wanted to f...
- Christof Meerwald (10/19) Oct 16 2001 and the '-XI' command line option doesn't seem to work for class templat...
- Walter (6/25) Oct 16 2001 The XI is a holdover from the bad old days before comdat's. Do you need ...
- Christof Meerwald (9/10) Oct 17 2001 I would prefer the standard C++ explicit template instantiation. STLport...
In the following test-case, the template function isn't instantiated (linker complains with "Symbol Undefined ?f YAHH Z (int cdecl f(int ))"): template<class T> int f(T a); int main(int argc, char *argv[]) { int a = 0; return f(a); } template<class T> int f(T a) { return 0; } and DM doesn't support explicit template instantiation, e.g. template<class T> struct A { void f() { } }; template A<int>; bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net?
Oct 15 2001
Christof Meerwald wrote:In the following test-case, the template function isn't instantiated (linker complains with "Symbol Undefined ?f YAHH Z (int cdecl f(int ))"): template<class T> int f(T a); int main(int argc, char *argv[]) { int a = 0; return f(a); } template<class T> int f(T a) { return 0; } and DM doesn't support explicit template instantiation, e.g. template<class T> struct A { void f() { } }; template A<int>; bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net?You don't say what compiler options you used. When I get messages like this I retry with -XD added. John
Oct 16 2001
Yes, -XD will make it work with the existing compiler, but I wanted to fix it so it worked automatically. -Walter John Fletcher wrote in message <3BCBF5E9.83FE7752 aston.ac.uk>...Christof Meerwald wrote:(linkerIn the following test-case, the template function isn't instantiatedthis Icomplains with "Symbol Undefined ?f YAHH Z (int cdecl f(int ))"): template<class T> int f(T a); int main(int argc, char *argv[]) { int a = 0; return f(a); } template<class T> int f(T a) { return 0; } and DM doesn't support explicit template instantiation, e.g. template<class T> struct A { void f() { } }; template A<int>; bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net?You don't say what compiler options you used. When I get messages likeretry with -XD added. John
Oct 16 2001
On Tue, 16 Oct 2001 11:42:43 -0700, Walter wrote:Yes, -XD will make it work with the existing compiler, but I wanted to fix it so it worked automatically. -WalterThanks for fixing it.and the '-XI' command line option doesn't seem to work for class templates.and DM doesn't support explicit template instantiation, e.g.If I compile it with 'sc -c -cod "-XIA<int>"' no code for the instantiation is generated. bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net?template<class T> struct A { void f() { } };
Oct 16 2001
The XI is a holdover from the bad old days before comdat's. Do you need it? "Christof Meerwald" <cmeerw web.de> wrote in message news:9qi0v7$2gvh$1 digitaldaemon.com...On Tue, 16 Oct 2001 11:42:43 -0700, Walter wrote:fixYes, -XD will make it work with the existing compiler, but I wanted totemplates.it so it worked automatically. -WalterThanks for fixing it.and the '-XI' command line option doesn't seem to work for classand DM doesn't support explicit template instantiation, e.g.instantiationIf I compile it with 'sc -c -cod "-XIA<int>"' no code for thetemplate<class T> struct A { void f() { } };is generated. bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net?
Oct 16 2001
On Tue, 16 Oct 2001 15:12:08 -0700, Walter wrote:The XI is a holdover from the bad old days before comdat's. Do you need it?I would prefer the standard C++ explicit template instantiation. STLport's I/O stream library makes heavy use of it (I was just looking for an alternative). bye, Christof -- http://cmeerw.cjb.net Jabber: cmeerw jabber.at mailto cmeerw at web.de ICQ: 93773535, Yahoo!: cmeerw ...and what have you contributed to the Net?
Oct 17 2001