Initializing "two-dimensional" compile-time enum

monarch_dodra monarchdodra at gmail.com
Mon Nov 25 05:08:35 PST 2013


On Sunday, 24 November 2013 at 17:16:21 UTC, Philippe Sigaud
wrote:
> On Sun, Nov 24, 2013 at 5:19 PM, monarch_dodra 
> <monarchdodra at gmail.com> wrote:
>
>> This is cleaner, IMO.
>
> Well, in an ideal world, we wouldn't have to fall back to these 
> contortions.

Even without bugs, it's still convenient way to declare a
variable as enum or const, when 1-liner initialization is simply
not possible.

enum bar = ()
{
      T t;
      initialize(t);
      return t;
}();


More information about the Digitalmars-d mailing list