enum and const or immutable ‘variable’ whose value is known at compile time

Cecil Ward cecil at cecilward.com
Fri Oct 2 06:14:58 UTC 2020


On Thursday, 17 September 2020 at 01:57:39 UTC, Mike Parker wrote:
> On Thursday, 17 September 2020 at 00:32:40 UTC, Cecil Ward
>>
>> So can the result of declaring certain things with enum ever 
>> have an _address_ then? (According to legit D code that is, 
>> never mind the underlying implementation details, which may 
>> not be observable)
>
> No. Think of it as a named literal.
>
Thank you Mike. That’s exactly what I thought. And it’s another 
reason in favour of using enum - that it forbids address-taking 
and so declares that there will be none.


More information about the Digitalmars-d-learn mailing list