[Issue 5909] Allow implicit conversion of hex strings to immutable(ubyte)[] and immutable(ubyte[N])

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon May 19 05:00:35 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=5909

--- Comment #4 from bearophile_hugs at eml.cc ---
If implicit conversions are not appreciated, then an alternative solution is to
consider hex strings as ubyte array literals:

pragma(msg, typeof(x"1a b2"));
==>
immutable(ubyte)[]

This avoids implicit conversions. In 99% of the cases you don't want that
literal to produce a string, so this is useful.

--


More information about the Digitalmars-d-bugs mailing list