* Win32 issues with Templates and Libs *

James Dennett jdennett at acm.org
Wed Feb 21 19:49:16 PST 2007


Walter Bright wrote:
> James Dennett wrote:
>> Walter Bright wrote:
>>> Pragma wrote:
>>>> That raises an interesting question: seeing as how it's using the same
>>>> backend, how does DMC handle this problem for C++?
>>> Unlike D, a C++ compiler has no idea what templates are instantiated in
>>> other files. So it instantiates everything. This is one reason why C++
>>> builds are so much slower than D.
>>
>> It's fairly common for C++ compilers to use some kind
>> of storage to record which templates are instantiated
>> from which files, and has been for quite a few years.
> 
> Yeah, I've considered building such a thing. But it would be complex,
> and the programmer would have to accommodate its idiosyncracies. Better
> off fixing the language to support proper modules.

You may well be right; while I've seen such systems work
well most of the time, they usually need help if your
build structure is not simple (for example, if you build
multiple different libraries based on overlapping sets
of object files).

-- James




More information about the Digitalmars-d mailing list