Article View: gnu.g++.help
Article #804Re: Templates
From: Albert Golembiowski
Date: Thu, 26 Oct 1995 17:56
Date: Thu, 26 Oct 1995 17:56
41 lines
2035 bytes
2035 bytes
Of course it's possible with g++-2.7.0 to include only interface headers, templates or not. To carry along template implementations, as suggested below, is to create dependency nightmare, i.e. any change in `mytemplates.cc' might put you through the amazing experience of watching the whole world recompile! Not to mention that doing this with any sizable project will make your compiler eat all the available memory, then proceed to your pets, then ...:-) ag> From: tgakem@ta0.chem.tue.nl (Eric Meijer) writes: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ag> Holger Burde <j03k> writes: ag> ag> >With g++ (v 2.7.x) i have to implement members of Template-classe in .h Files ag> >otherwise i get undefined Symbols. Is there a trick get this working with ag> >C Files or is this (for whatever reason) not 'supported' ??? ag> ag> >PS I also use a AT&T 3.x Compiler and look for a portable way to handle ag> > template classes . ag> ag> Suppose you have mytemplates.cc and mytemplates.h, you could put at the ag> bottom of mytemplates.h: ag> ag> #ifdef __GNUG__ ag> #include "mytemplates.cc" ag> #endif ag> ag> It worked for me with gcc 2.6.3 and a Silicon Graphics compiler. ag> ag> Hope this helps, ag> ag> Eric Meijer ag> -- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Albert Golembiowski albert@inrs-telecom.uquebec.ca (514) 762-8655 INRS Telecommunications, 16 Place du Commerce, Verdun, Quebec, Canada, H3E 1H6 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Technical Details
Message-ID:
<9510261754.AA05482@brie>Path:
arc1-ca.pugleaf.net!inrs-telecom.uquebec.ca!albertReferences:
<tgakem.814706049@ta0.chem.tue.nl>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!inrs-telecom.uquebec.ca!albert From: albert@inrs-telecom.uquebec.ca (Albert Golembiowski) Newsgroups: gnu.g++.help,comp.lang.c++ Subject: Re: Templates Date: 26 Oct 1995 13:56:09 -0400 Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu Sender: daemon@cis.ohio-state.edu Distribution: world Message-ID: <9510261754.AA05482@brie> References: <tgakem.814706049@ta0.chem.tue.nl>