Strange CTFE issue, string replacement

Stefan Koch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Apr 9 14:17:15 PDT 2017


On Sunday, 9 April 2017 at 20:20:55 UTC, Jethro wrote:
> On Sunday, 9 April 2017 at 19:55:57 UTC, Stefan Koch wrote:
>> On Sunday, 9 April 2017 at 19:38:33 UTC, Jethro wrote:
>>> [...]
>>
>> The constructor is nuts.
>> You do not need to zero the string!
>>
>> Also avoid templates if you can.
>
> Please don't criticize banal stuff by choosing one meaningless 
> line and calling the whole thing "nuts". It's a waste of time. 
> I zero'ed it because it helps in debugging and for other 
> errors.(if used in C terminated like string usage it helps to 
> have the string actually terminate at some point)
>
>
> My questions still stand though. Why is it 10x the speed and 
> memory?!?!

The short answer is because the current (soon to be replaced) 
CTFE implementation has a number of issues.


More information about the Digitalmars-d-learn mailing list