are mixin string templates with functions removed?
JS
js.mdnq at gmail.com
Thu Aug 1 10:57:27 PDT 2013
On Thursday, 1 August 2013 at 17:53:38 UTC, Ali Çehreli wrote:
> On 08/01/2013 10:45 AM, H. S. Teoh wrote:
>> On Thu, Aug 01, 2013 at 07:12:51PM +0200, John Colvin wrote:
>>> On Thursday, 1 August 2013 at 17:09:07 UTC, JS wrote:
>>>> If I have a bunch of templates that are only used for code
>>>> generation, are they removed in the binary(since they are not
>>>> needed)?
>>>
>>> templates don't exist in binaries.
>>
>> Templates are like cookie molds, you use them to generate lots
>> of
>> (almost) identical cookies, but you never serve the mold to the
>> customer. ;-)
>>
>>
>> T
>>
>
> I think the question is whether the instantiations of such
> templates are removed. If the instance is used only to
> initialize an enum, the function shouldn't stay in the binary.
>
> Even if the function remains, I think the linker takes care of
> removing unused functions.
>
> Ali
I have a lot of code generation templates(only for code). I want
to make sure they don't hang around in the binary(even strings
they use) as there is no point and it is potentially
dangerous(security issues).
More information about the Digitalmars-d-learn
mailing list