3 ms·
Dereference syntax in C++ is very, very fixable. C++ could easily adopt a postfix operator^ as a synonym for prefix op*, even at this late date. Then (*p)->m c
by ncmncm 5y ago
Dereference syntax in C++ is very, very fixable.
C++ could easily adopt a postfix operator^ as a synonym for prefix op*, even at this late date. Then (*p)->m could be written p^->m, or p^^.m. (The last is clearly best.)
Rust, too, could do the same, for the same benefit. And C could, too, if there were any point.
The only people to complain would be IDE vendors.
If you were then allowed to declare a pointer argument like "char p^", or even "char^ p", you could begin to dispense with use of "*" as a unary operator. Declaring "char^ p, q" would mean both p and q are pointers, eliminating another source of beginners' confusion.