Templates and shared libraries in D

I just realized something:

Almost everything in D becomes a template. This is awesome for a single executable, but how does it work with shared libraries? If the code is not generated before it is compiled, then D cannot create shared libraries that use templates, right? (e.g. Phobos should be static - there is no other way, right?)

+8
templates shared-libraries d d2
source share
1 answer

Well, this is the same problem as with C ++ code.

Only parts without templates are precompiled. Everything else must be provided with complete source code.

Phobos, which is a shared or static library, does not really matter here. It is still static due to dmd issues with shared libraries.

+8
source share

All Articles