Fixing C's Biggest Mistake

areYouSureAboutThat areYouSureAboutThat at gmail.com
Thu Jan 5 21:08:28 UTC 2023


On Thursday, 5 January 2023 at 20:58:52 UTC, areYouSureAboutThat 
wrote:
>

This would the absolute best approach:

int[] myDynamicArray = [0, 1]; // your typical dynamic D array.

int[] myStaticArray = [0, 1].staticArray;
static assert(is(typeof(myStaticArray) == int[2]));


Is there any reason the compiler cannot be made to do this?


More information about the Digitalmars-d mailing list