Fix template parameter
pascal111
judas.the.messiah.111 at gmail.com
Tue Aug 9 20:53:44 UTC 2022
On Monday, 8 August 2022 at 14:48:27 UTC, Dom Disc wrote:
> On Monday, 8 August 2022 at 12:46:48 UTC, bauss wrote:
>> On Monday, 8 August 2022 at 12:02:02 UTC, Dom Disc wrote:
>>>
>>> ```D
>>> pure @nogc @safe BigInt opAssign(T : BigInt)(T x);
>>> ```
>>
>> This will only be included in the object file if used.
>>
>>> ```D
>>> pure @nogc @safe BigInt opAssign(BigInt x);
>>> ```
>>
>> This will always be in the object file.
>
> Ah, ok. But shouldn't the linker throw it out of an executable,
> if it is not used?
> I mean, even the most dump linker should be able to do this
> basic optimization...
I didn't study this level yet in templates, but did you ask about
if changing compiler can make a difference to what you desire? I
know that there are gdc, ldc and dmd compilers. DMD is the most
common one, I think.
More information about the Digitalmars-d-learn
mailing list