No we should not support enum types derived from strings

12345swordy alexanderheistermann at gmail.com
Wed May 12 02:41:31 UTC 2021


On Wednesday, 12 May 2021 at 02:30:50 UTC, deadalnix wrote:
> On Wednesday, 12 May 2021 at 02:21:06 UTC, 12345swordy wrote:
>> Yes. A is being replace with the new instance of A that 
>> happens to have the same value here. There is no guarantee 
>> that they will share the same address.
>>
>> - Alex
>
> You might want to reconsider how sure of yourself you are.
The code you posted, do not support your claim what so ever. When 
I am talk about address I am literally talking about virtual 
memory address here, such as 0x40000 or something similar to 
that. You do not know what the actual virtual memory address of 
variable of 'a' for class 'b', as the GC takes it care of it for 
you.
So when A is being replace with the new instance of A that 
happens to have the same value that is being replace, the virtual 
memory that A holds from the function parameter currently holds 
will change.

-Alex


More information about the Digitalmars-d mailing list