[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    Re: [might be a bug] Solaris vs Linux template handling
From:       Alexandre Oliva <oliva () dcc ! unicamp ! br>
Date:       1999-04-29 22:24:02
[Download RAW message or body]

On Apr 29, 1999, Lavoie Philippe <lavoie@yoho.genie.uottawa.ca> wrote:

> But how can I create a library then ? 

Libraries of templates should provide the source code, so that the
user can use specializations for his own types.  If you really want a
`closed' template library, you'll really have to explicitly
instantiate all the symbols the user might need.

> template <> void f<float>();

This is an explicit specialization, but not an explicit instantiation.
It shouldn't cause a non-weak symbol to be defined.  But if you omit
the angle brackets, it becomes an explicit instantiation, and then at
most one translation unit must include that piece of code.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic