On Fri, Feb 28, 2020 at 10:25 PM J Decker via Liaison <liaison@lists.isocpp.org> wrote:


On Fri, Feb 28, 2020 at 10:07 AM Patrice Roy via Liaison <liaison@lists.isocpp.org> wrote:
My initial point in response to your message was to point out that in C++, there are cases where making '.' behave as '->' does today breaks otherwise correct code and introduces ambiguity.

C++ users, contrary to C# or Java users, have the option of using objects directly or indirectly. In C# (excluding structs) and Java, all objects are accessed through indirect means. On the other hand, for a C++ programmer using a smart pointer such as unique_ptr<T>, the ability to distinguish the services exposed by that object (using '.') and those exposed by the pointee (using '->') carries meaning, and that distinction is not readily accessible in some other languages this proposal refers to.

Please also note that operator-> can be (and is sometimes) overloaded in C++ classes.


I'm failing to communicate 'where it is now an error'.
I think the clarification needs to go beyond that. Using . on a class instance where the name to the right does not clearly name a specific member is also an error.