delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/03/10:00:25

Message-ID: <348573EF.2C190432@no.spam.mcs.nl>
Date: Wed, 03 Dec 1997 15:59:59 +0100
From: "A.P. Zijlstra" <peter AT no DOT spam DOT mcs DOT nl>
Reply-To: peter AT no DOT spam DOT mcs DOT nl
Organization: Physics student @ University of Amsterdam
MIME-Version: 1.0
To: Martin DOT Bernreuther AT po DOT uni-stuttgart DOT de
CC: DJGPP mailing list <djgpp AT delorie DOT com>
Subject: Re: Template instances
References: <348522FB DOT D02501B0 AT po DOT uni-stuttgart DOT de>

Martin Bernreuther wrote:
> 
> Hi,
> 
> I use an own template list which is persistent. There are methods
> like Load and Save which call Load and Save methods of the list
> elements. I also used this list for non persistent objects.
> Now I have the problem that djgpp tries to build instances of
> the Load and Save methods of the list even if these methods are
> never used in the code. This is not the behaviour described in
> the Stroustrup book. Is there a way to make the compiler
> just to build the used methods. I'm porting a program from
> M$ VC++ where there are no problems!
> 
> Bye
>         Martin
This is one of GCC's genuine limitations... template instantiation...
However CYGNUS made a patch for gcc which fixes this problem...
ftp://ftp.cygnus.com/pub/g++/gcc-2.7.0-repo.gz

However if you dont feel like recompiling your compiler use the #pragma
interface, #pragma implementation "filename.h" stuff described in the
gcc info thingy..

greetinx,

Peter

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019