missing HexString documentation

Walter Bright newshound2 at digitalmars.com
Thu Feb 8 06:10:14 UTC 2018


On 2/7/2018 9:45 PM, Ralph Doncaster wrote:
 > While the fix is a huge improvement, it doesn't match the code generated by 
the hex literals.  hexString!"deadbeef" stores the null-terminated string in the 
data section of the object file, while x"deadbeef" only stores 4 bytes in the 
data section.

   string s = x"deadbeef";

stores a null terminated string, too.

If you want only 4 bytes,

   __gshared immutable char[4] = hexString!"deadbeef";

just as you'd do for any string literal.


More information about the Digitalmars-d mailing list