C++ Logo

std-proposals

Advanced search

Re: Do we need a way to take *this by value, for coroutines?

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Mon, 8 Nov 2021 18:23:50 -0500
On Mon, Nov 8, 2021 at 6:21 PM DBJ via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> struct Circle {
> float r;
> // spot the new keyword "self"
> // concise but prone to abuse?
> float area() const noexcept {
> self {
> return pi*r*r;
> }
> }
> };

OK, we have a feature that's already been voted into the standard. The
time for quibbling about trivial syntactic issues is long since
passed.

The ability to omit the `this` or whatever syntax from member access
is not *that* important.

Received on 2021-11-08 17:24:04