On 28 November 2012 15:07, tn <no@email.com> wrote:
What distinguishes manifest constants from literals? Aren't manifest constants just literal aliases? That is, if the following did workOn Tuesday, 27 November 2012 at 21:16:41 UTC, Walter Bright wrote:
On 11/27/2012 9:51 PM, Manu wrote:
There's another you missed:
enum X = 10;
I would have imagined this would be semantically identical to E.A/E.B,
but the compiler seemed to view this as distinct in my experiments.
Those are not enums, they are manifest constants. What distinguishes a manifest constant from, say:
const Y = 11;
is that no storage is allocated for X, and X's address cannot be taken.
alias Y = 11;
wouldn't that be exactly same as
enum Y = 11;
Perhaps using "alias" instead of "enum" would make the meaning clearer?