Can we just have struct inheritence already?
Walter Bright
newshound2 at digitalmars.com
Thu Jun 13 21:45:38 UTC 2019
On 6/13/2019 12:51 PM, Timon Gehr wrote:
> On 13.06.19 21:44, Walter Bright wrote:
>> On 6/13/2019 4:30 AM, Timon Gehr wrote:
>>> Yes. IMHO this shouldn't be a @safe pure operation.
>>
>> D regards converting a pointer to an int as safe, but not the other way around.
>
> I know, and that is fine, but casting a pointer to int is not pure. It glances
> into the global state maintained by the memory allocator.
We had a discussion a while back about whether allocating memory via new was
pure or not, since a different value was produced each time. We eventually took
the pragmatic route that pure functions would be next to useless if this was not
allowed.
More information about the Digitalmars-d
mailing list