Template question ?

Hi !

This is related to previous posts about big applications. (this is only on Linux as far as I know)

I could not find any options in the compilation scripts for Linux to control the template compilation.

Usually you need to use -frepo -fno-implicit-templates or -fexternal-templates when you compile code with templates.

Without one of this options you will get a huge amount of duplicated code generated in the excutable (at least as I understand it, I am no expert on templates :o) ).

My application is around 32MB on Windows but on Linux it looks like it is around 52MB in size....

Also when the size of applications is this big I think it would be much more useful to compile the library with -Os instead of -O3 as this would probably generate "much" smaller code. And the difference in speed would not be big, it might even speed up the code as the amount of code in the cpu cache would be smaller.

As usual I am no expert on this, so maybe you have already tried this.