Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"C++23’s Deducing this: what it is, why it is, how to use it" by Sy Brand

29 views
Skip to first unread message

Lynn McGuire

unread,
Jul 14, 2023, 5:33:43 PM7/14/23
to
"C++23’s Deducing this: what it is, why it is, how to use it" by Sy Brand
https://devblogs.microsoft.com/cppblog/cpp23-deducing-this/

"Deducing this (P0847) is a C++23 feature which gives a new way of
specifying non-static member functions. Usually when we call an object’s
member function, the object is implicitly passed to the member function,
despite not being present in the parameter list. P0847 allows us to make
this parameter explicit, giving it a name and const/reference
qualifiers. For example:"

struct implicit_style {
void do_something(); //object is implicit
};

struct explicit_style {
void do_something(this explicit_style& self); //object is explicit
};

We use the implicit this a lot.

Lynn

Sam

unread,
Jul 15, 2023, 7:20:26 AM7/15/23
to
Lynn McGuire writes:

> We use the implicit this a lot.

Congratulations, you win a gold star.

Lynn McGuire

unread,
Jul 17, 2023, 8:22:20 PM7/17/23
to
Still waiting for the delivery of my gold star !

Lynn

wij

unread,
Jul 17, 2023, 10:45:56 PM7/17/23
to
Great, C++23 doubles its own complexity (and, VISIBLE is important!) again.
So the boss knows they are brilliant and work hard, if I understand the feature correctly.
0 new messages