Question for compiler gurus about compile-time strings
Stefan Koch
uplink.coder at googlemail.com
Sat Dec 9 23:38:46 UTC 2017
On Saturday, 9 December 2017 at 18:45:18 UTC, Steven
Schveighoffer wrote:
> I was thinking that all strings generated at compile-time have
> a null-terminator added. But then I thought, wait, maybe that's
> only specifically for string literals.
>
> What is the true answer? If you generate a string, let's say
> via a CTFE call, does it have a null terminator?
>
> -Steve
The results of CTFE calls are literals. Therefore they are
treated the same.
Thus the answer to your question is yes.
However there might be rare corner-cases in which the null
termiantor is not there.
Should this happen please file a bug and sent me a mail
specifically.
More information about the Digitalmars-d-learn
mailing list