From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1025b4,43ae7f61992b3213 X-Google-Attributes: gid1025b4,public X-Google-Thread: 103376,faf964ea4531e6af X-Google-Attributes: gid103376,public From: Ed Avis Subject: Re: GPL and "free" software Date: 1999/05/02 Message-ID: <372C1824.1417502F@doc.ic.ac.uk>#1/1 X-Deja-AN: 473122583 Content-Transfer-Encoding: 7bit References: <3729D0F6.3DF2CCED@doc.ic.ac.uk> <925572182snz@vision25.demon.co.uk> Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@doc.ic.ac.uk X-Trace: lux.doc.ic.ac.uk 925636644 892 146.169.49.30 (2 May 1999 09:17:24 GMT) Organization: Mime-Version: 1.0 NNTP-Posting-Date: 2 May 1999 09:17:24 GMT Newsgroups: comp.lang.ada,gnu.misc.discuss Date: 1999-05-02T09:17:24+00:00 List-Id: Phil Hunt wrote: >>Can't you write a template class in C++, and put >>it in a dynamically linked library? > >I would be surprised if this is the case. However instantiations of >templates can be put in a DLL or .so. What do you mean by 'instantiations of templates'? Surely if I write a class like this (pseudocode, I don't know Ada and my C++ is rusty): class List let T be any class method add(T) method get_first_item : returns T method count_items : returns Int then there will only one copy of the executable code in the object file. If the program instantiates a List of Int, then the code for List is called and passed pointers (or references) to Ints. If the program wants a List of Char, then the same object code can be used, being passed pointers to Chars. Or have I got it horribly wrong? -- Ed Avis Advertise here! epa98@doc.ic.ac.uk