Article View: gnu.g++.help
Article #811Re: Templates
From: Albert Golembiowski
Date: Thu, 02 Nov 1995 01:25
Date: Thu, 02 Nov 1995 01:25
43 lines
2412 bytes
2412 bytes
Sorry Rohan,
In the name of sowing snow on confusion, I have to disagree.
Or maybe I misunderstood the original question.
What do you say to this:
[1] g++ has to see both template interface (*.hh) and implementation (*.C),
by magic (`-frepo') or in front of her nose, to instantiate.
[2] this doesn't mean that *.C has to be put in *.hh (dependency nightmare)
ag> From: rjl@f111.iassf.easams.com.au (Rohan LENARD) writes:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ag> In article <471ltm$vtd@penny.tagsys.com>,
ag> Andrew Gideon <andrew@tagsys.com> wrote:
ag> :In article AA05482@brie, albert@inrs-telecom.uquebec.ca (Albert Golembiowski) writes:
ag> :>Of course it's possible with g++-2.7.0 to include only interface headers,
ag> :>templates or not. To carry along template implementations, as suggested
ag> :>below, is to create dependency nightmare, i.e. any change
ag> :>in `mytemplates.cc' might put you through the amazing experience of watching
ag> :>the whole world recompile!
ag> :>
ag> :>Not to mention that doing this with any sizable project will make your
ag> :>compiler eat all the available memory, then proceed to your pets, then ...:-)
ag> :>
ag> :
ag> :Well, I don't want to lose my cats to a greedy compiler.
ag> :
ag> :I was not aware that I no longer needed to include the source
ag> :file (from the template header file). I'm including the sources now,
ag> :and things seem to work.
ag>
ag> You can only do this if -
ag>
ag> 1. You use -frepo
ag> 2. You need to compile at least 1 version of the source (so g++ knows
ag> where to find the class definition).
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:
<9511020125.AA08550@brie>Path:
arc1-ca.pugleaf.net!inrs-telecom.uquebec.ca!albertReferences:
<476625$1fb@f111.iassf.easams.com.au>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: 1 Nov 1995 20:25:47 -0500 Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu Sender: daemon@cis.ohio-state.edu Distribution: world Message-ID: <9511020125.AA08550@brie> References: <476625$1fb@f111.iassf.easams.com.au>