help cast

Steven Schveighoffer schveiguy at yahoo.com
Sun Mar 18 17:10:28 UTC 2018


On 3/18/18 4:34 AM, sdvcn wrote:
> dchar v11=dchar.max;
>      auto vp11 = [v11];
> 
>      auto v2 = cast(ubyte[]) (vp11);   //v2.length=4
>      auto v22 = cast(ubyte[])( [v11]); //v2.length=1


This seems like a bug to me.

It appears that v22 has truncated v11 to a byte and made only a single 
byte array out of it.

-Steve


More information about the Digitalmars-d mailing list