I’m not sure if this is serious or not and that scares me.
Rest of the world: We’re deprecating C++ due to lack of memory safety. Please consider doing something for safety.
C++ commite: Here’s a new convenient operator to make it easier to do a potentially unsafe, multi-level pointer dereference.
I honestly don’t know why they even have -> instead of just a dot like everyone else. The compiler knows whether it’s a record, object, pointer, or any level of pointer to pointers.
Why make the programmer do the donkey work?
Operator overloading allows you to redefine what each operator does. It’s essential to achieve a truly fucked up code base
It’s important for objects that can be dereferenced. Smart pointers have methods that can be accessed with dot syntax like
swap()
. You can still dereference through a smart pointer using arrow syntax to access methods on the referenced type since they overload theoperator->()
method.