Discussion Thread: DIP 1044--Enum Type Inference--Community Review Round 1

ryuukk_ ryuukk.dev at gmail.com
Sun Nov 27 23:15:51 UTC 2022


On Sunday, 27 November 2022 at 23:13:39 UTC, ryuukk_ wrote:

And you cut off the most interesting part of my code example that 
you quoted, i'll psot it again for clarity:

from: 
https://forum.dlang.org/post/wrcrrmjgvrckyyvwfxec@forum.dlang.org

```
// verbose API, readable
struct SuperLongStruct
{
     struct SuperLongInnerStruct
     {
         enum SuperLongEnum
         {
             VALUE_A, VALUE_B
         }

         SuperLongEnum super_long_flags;
     }
     SuperLongInnerStruct some_data;
}

// oh shoot

SuperLongStruct super_long_struct = {
     some_data: {
         super_long_flags:  
SuperLongStruct.SuperLongInnerStruct.SuperLongEnum.VALUE_A | 
SuperLongStruct.SuperLongInnerStruct.SuperLongEnum.VALUE_A
     }
};

// oh nice!

SuperLongStruct super_long_struct = {
     some_data: {
         super_long_flags: .VALUE_A | .VALUE_A
     }
};

```



More information about the Digitalmars-d mailing list