Re: Enums and immutables

2017-03-18 Thread ag0aep6g via Digitalmars-d-learn
On 03/18/2017 01:22 PM, Oleg B wrote: enum arr = cast(ubyte[])[0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4]; auto arr1 = cast(void[])arr; immutable arr2 = cast(immutable(void)[])arr; enum arr3 = cast(void[])arr; Aside: The casts here do nothing to affect the outcome.

Re: Enums and immutables

2017-03-18 Thread rikki cattermole via Digitalmars-d-learn
On 19/03/2017 1:22 AM, Oleg B wrote: Hello. I found strange behavior while casting enum array and immutable array. import std.stdio; void main() { enum arr = cast(ubyte[])[0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4]; auto arr1 = cast(void[])arr; immutable arr2 = cast(immutable(void)[])arr;

Enums and immutables

2017-03-18 Thread Oleg B via Digitalmars-d-learn
Hello. I found strange behavior while casting enum array and immutable array. import std.stdio; void main() { enum arr = cast(ubyte[])[0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4]; auto arr1 = cast(void[])arr; immutable arr2 = cast(immutable(void)[])arr; enum arr3 = cast(void[])arr;