Compile time static array issues.

Jacob Carlborg doob at me.com
Sun May 29 02:43:36 PDT 2011


On 2011-05-29 03:56, bearophile wrote:
> Era Scarecrow:
>
>>   I don't seem to have a good explanation why this isn't working.
>
> Also try:
>
> struct Joined {
>      string name, partof, preReq;
> }
>
> struct SubrecordParts {
>      string name;
>      int size;
>      string[] notes;
>      int identifyBy;
>      int[] partSize;
> }
>
> Joined[] attached = [
>      {"MAST", "DATA", "TES3"},
>      {"ANAM","INTV",  "FACT"}
> ];
>
> SubrecordParts[] parts = [
>      {"AADT", 16, ["fWeight", "iValue", "iUses", "fQuality"],
>       -1, [4,4,4,4]},
>      {"AODT", 24, ["iType", "fWeight", "iValue", "iHealth",
>       "iEnchant Points", "iArmour"], -1, [4,4,4,4,4,4]}
> ];
>
> void main() {}
>
> In D struct names are (usually) CamelCase.
>
> Bye,
> bearophile

Isn't that struct initialization syntax deprecated or to be deprecated?

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list