delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/16/22:47:07

From: James Undery <james AT ghoti DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ld 2.8.1 does not remove duplicate template instantiations
Date: Fri, 17 Apr 1998 01:43:33 +0100
Organization: None unless you want to pay me
Message-ID: <Z$0YIBA1WqN1Ewly@ghoti.demon.co.uk>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980415110702 DOT 7293O-100000 AT is>
<j3uZ.2664$sN3 DOT 254770 AT news21 DOT bellglobal DOT com>
<6h5tcg$p9$1 AT rosenews DOT rose DOT hp DOT com>
<E7wZ.2980$sN3 DOT 341803 AT news21 DOT bellglobal DOT com>
Reply-To: james AT ghoti DOT demon DOT co DOT uk
NNTP-Posting-Host: ghoti.demon.co.uk
MIME-Version: 1.0
Lines: 43
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <E7wZ.2980$sN3 DOT 341803 AT news21 DOT bellglobal DOT com>, Paul Derbyshire
<pderbysh AT usa DOT net> writes
>Andrew Crabtree wrote in message <6h5tcg$p9$1 AT rosenews DOT rose DOT hp DOT com>...
>
>>What was suspicious about it?  Nobody has ever tried using the borland style
>>template
>>removal because it was never advertised as working.
>
>Huh?
>Info gcc, then look at C++ extensions and then template instantiation. Read
>about halfway down, it says ..."code written for the Borland model should work
                                                                    ^^^^^^
>as-is"... with just a slowdown because template instances are recompiled in
>each file where they're used.

Slightly dubious wording but I would read that as not fully tested but assumed
working.

>
>>I'll take a look at the -fno-implicit-template problem as time permits.  I
>>suspect you'd get more help if you didn't come off as expecting service and
>>support from volunteer projects.
>
>That isn't what is annoying me. What is annoying me is how certain seemingly
>critical features are made available only on certain platforms that are
>preferentially treated, and the documentations all either imply or overtly say
>otherwise! I don't like being told "If you really want to write software that
>uses ropes of chars in two different source files, you and everyone who might
>want to use this software has to throw away DOS, Windows, and the entire
>installed base for these platforms and get Linux or FreeBSD. Or shell out the
>$$$ for a Microsoft product that won't be able to write portable code, or even
>DOS code, and will mean that ONLY users with DOS, WIndows, etc can use your
>software. And you sure as heck can't write code that will be compilable and
>runnable on both DOS and Linux unless you keep your rope<char> to one
>sourcefile only."

You don't have to keep your all your X<Y> in a single sourcefile. An quick and
very dirty workaround is to compile a single file that #includes all the
separate sourcefiles that use templates. (I've never thought of a reason for
#including source code files before.) A more elegant solution would be to fix
template support yourself and submit your patch ;).
-- 
James Undery <james AT ghoti DOT demon DOT co DOT uk>

- Raw text -


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