C++ Logo

std-proposals

Advanced search

Re: Proposal - Allow '.' operator to work on pointers (again sortof)

From: Andrey Semashev <andrey.semashev_at_[hidden]>
Date: Thu, 5 Mar 2020 15:10:31 +0300
On 2020-03-05 14:29, J Decker via Std-Proposals wrote:
>
> On Thu, Mar 5, 2020 at 12:41 AM Andrey Semashev via Std-Proposals
> <std-proposals_at_[hidden] <mailto:std-proposals_at_[hidden]>>
> wrote:
>
> On 2020-03-05 06:09, J Decker wrote:
> >
> > I'm sorry I have seen 0 examples where they conflict in meaning and
> > don't continue to work the same way.
>
> Smart pointers were given as an example.
>
> Smart pointers continue to work as they do, because they are an object
> that contains a pointer to an object, and are not 'pointers'. they are
> of a class type 'smart pointer', they are not pointers to a class of
> type 'smart pointer'.

And as it was said, this creates inconsistency between raw and smart
pointers. Which means more confusion to new users.

And most importantly, my initial point stands - I don't find your
motivation convincing. The proposal does not offer anything new to
users. It doesn't reduce programmer's work (not counting one less
character to type, which is not the reason for such a change in the
language). Your initial case for making C/C++ look more similar to other
languages does not hold because the languages are different on a much
deeper level than just syntax. Even in C and C++, despite syntactical
similarities, some constructs have different meanings.

Received on 2020-03-05 06:13:20