Manifest constants (was const again)
Walter Bright
newshound1 at digitalmars.com
Thu Dec 6 16:48:42 PST 2007
Janice Caron wrote:
> Hoping to branch this off to a new thread to avoid polluting the const one...
>
> On 12/6/07, Walter Bright <newshound1 at digitalmars.com> wrote:
>> That leaves what to do about manifest constants. It occurs that we
>> already have a mechanism for them - enums. So why not:
>> enum x = 3;
>> enum long y = 4;
>> ? I think that solves our problem.
>
> Will it work for reals?
>
> enum pi = 3.14159265358979;
>
> ?
Yes.
More information about the Digitalmars-d
mailing list