[LC++]Template functions and linking

Davide Bolcioni 9odb6x3rfr001 at sneakemail.com
Tue Jul 9 04:43:06 UTC 2002


Vincent Penquerc'h Vincent.Penquerch at artworks.co.uk [mltuxcpp/linux-cpp
list] wrote:

>  > One solution would be to put the implementation of doit in the
>  > header
>  > and make it inline.
>  >
>  > Is there a better way?
> 
> Wait for the export keyword to be implemented ;)


A gcc-only alternative exists and is documented in the info pages,
look for "template instantiation" under "C++ Extensions"; basically
it is a pragma.

On a different note, in my opinion the lack of a functioning export
greatly helped the C++ template metaprogramming community by making
it *essentially impossible* to provide templates without source,
but I digress ...

Davide Bolcioni
-- 
Paranoia is a survival asset.





More information about the tuxCPProgramming mailing list