The X Macro using D

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 21 05:17:45 PDT 2017


On Friday, 21 July 2017 at 11:19:47 UTC, Patrick Schluter wrote:
> In C there's no point in the X macro anymore since C99.
> Designated initializer allow to do it properly[1] now.
>
>     enum COLORS { red, blue, green, max };
>     char *cstring[max] = {[red]="red", [blue]="blue", 
> [green]="green" };  /* C99 */

I don't see how this allows data for different arrays to be 
written in interleaved form and then extracted by column to 
initialize the separate arrays, as Walter's does.


More information about the Digitalmars-d mailing list