Can someone please explain -allinst?

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Thu Nov 21 15:25:49 PST 2013


On Thursday, 21 November 2013 at 21:20:59 UTC, Gary Willoughby 
wrote:
> Can someone explain the -allinst compiler flag for me please? 
> I've absolutely no idea what this flag does or when to use it.

I don't think I have have an understanding of it, but here is 
what I think I had read. If I'm right, please say so. If not 
again, say so and ignore me.

-allinst causes the compiler to preform the same behavior as 
prior to 2.064. What was that behavior? When building the program 
all the called templates would get instantiated (those in the 
library used and the other program files). What changed (again my 
interpretation of a quick read) was that the library will include 
the instances of the template used in the library. When 
generating the program the code for the templates where expected 
to exist in the library so that it doesn't have to instantiate 
them again. I suspect this leads to expecting instances which 
haven't actually been used to exist in the library, so you use 
the flag -allinst to force the compiler to build all the 
instances being used.


More information about the Digitalmars-d-learn mailing list