PhobosWatch: manifest => enum

Janice Caron caron800 at googlemail.com
Fri Dec 28 12:08:32 PST 2007


On 12/28/07, "Jérôme M. Berger" <jeberger at free.fr> wrote:
> What I don't really see is why manifest constant need to be "int"
> rather than "const (int)"

Manifest constants are invariant, so in practice it will be
invariant(int), even if not explicitly declared as such.

For this reason, I would hope that the compiler should be able to realise that

    const int x = 1;

creates an x which could be stored in ROM, and automagically types x
as invariant(int). Because of implicit casting, this cannot possibly
break anything.




More information about the Digitalmars-d mailing list