C++ Logo


Advanced search

Re: Unify '.' and '->' operator behavior

From: J Decker <d3ck0r_at_[hidden]>
Date: Sun, 16 Feb 2020 11:01:18 -0800
>> On Sun, Feb 16, 2020 at 9:47 AM Gašper Ažman <gasper.azman_at_[hidden]>
>> wrote:
>>> I hear you that it is technically possible to make . behave the same way
>>> as -> for raw pointers - but perhaps you should ask yourself why Ritchie
>>> and Kernighan didn't do it. I am quite sure they saw the opportunity.
>>> Perhaps they thought it was a dangerous idea?
I couldn't really speak to K&R or BS... but I can actually, I'm not sure
they could have, because they were code->assembly, and the two are quite
different on how you have to get that address... but now there's
code->meta->optimizing pipeline->assembly. There's something like it
didn't really occur to me, I used K&R pamphlet-book, and I actually caught
that '->' reads the memory location and . uses the base of a more
statically allocated thing... but then that's from stepping through code
with turbo C's debugger maybe.

Received on 2020-02-16 13:04:09