C++ Logo


Advanced search

Re: [std-proposals] this return type

From: Andrew Tomazos <andrewtomazos_at_[hidden]>
Date: Sat, 8 Apr 2023 05:03:20 +1000
On Sat, Apr 8, 2023 at 4:50 AM Jens Maurer via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> "this" has pointer type, but the syntax actually wants to describe
> by-reference return (i.e. "return *this"). There is a disconnect
> in the syntax here.

I think the syntax is fine. Notice (a) `this` isn't a type either; and (b)
explicit object parameters use `this` in a similar fashion. It's okay for
it to be a vague allusion.

Received on 2023-04-07 19:03:33