C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allow chaining of -> for normal pointers

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sun, 8 Jan 2023 14:34:15 -0500
On Sun, Jan 8, 2023 at 2:24 PM Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> On Sun, Jan 8, 2023 at 4:05 AM Thiago Macieira via Std-Proposals
> <std-proposals_at_[hidden]> wrote:
> >
> > Please give a reason why this should have been considered. And please give a
> > reason why this should be considered *now* when the current paradigm is to
> > avoid raw pointers as much as possible and instead use smart pointer wrappers
> > of one sort or another.
>
>
> I've written a paper today entitled "Exhaustive Dereferencing in C++",
> I've attached it to this email and you can also download it from:
>
> http://www.virjacode.com/download/xdref_draft1.pdf
>
> I'm going to be honest . . . it took me hours and hours to get the
> C++11 implementation of 'xdref' to work.

But... that's not what you were asked for. You were asked why this
feature needs to exist. What the motivation is, beyond merely
"pointers to pointers are a thing, so there should be a mechanism to
fully dereference them down to the first non-pointer type". Why is
this something that needs to be in the standard, when common C++
idioms and advice are to avoid raw pointers as much as possible?

Received on 2023-01-08 19:34:21