This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: using templates in shared library


[ deleting duplicate template instantiations at link time ]

> > Ideally, we should also be able to do the same with shared libraries.
> 
> This was my first impression, as well. But then, the implicit
> instantiation in the shared library might go away, which would mean
> that we have to recompile all applications relying on it.

Just the same, some libraries may be template-heavy enough so that
if the library doesn't have the needed template instantiations, far
less code will be shared.

If we want the library to be highly reusable, and are willing to pay a
space penalty to achieve this, we can get rid of all but one of the
instantiations in the library, and use that instantiation to satisfy
internal references (for calls within the library), but not export it to
external code.

But some people may want maximum space efficiency even if it means
more recompiles for library changes.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]