Maybe this is a silly question, but I don't understand completely the difference between an `enum` and a `shared immutable`.

I could have:

enum x = 1;

or

shared immutable x = 1;

What is the exact difference between those too?

My best guess is, that shared immutable gets initialized during the beginning of the programm execution.
Enum has to be "ready" at compile time.
Is this this accessment correct and complete?
Am I missing anything else?

(If correct, then I understand that shared immutable is capable of doing some sideeffects during is construction (if the constructor does that))

Reply via email to