On 16/03/2017 4:27 PM, WhatMeForget wrote:

One of my D books says: "an enum declared without any braces is called a
manifest constant." The example shows,

enum string author = "Mike Parker";

Is this equivalent to
const string author = "Mike Parker";
or
immutable string author = "Mike Parker";

I guess what I'm asking is does enum give you some advantages over say
non-enum constants?

Thanks.

No.

An enum is an enum, that variation of the syntax just has a special name that's all.

Keep in mind the typed aspect doesn't have an affect other than forcing the value to it.

enum Foo : string {
        Author = "Mike Parker"
}

Reply via email to