Код: Выделить всё
#include
struct A {
int pp=0;
A(int p) : pp(p) {}
A &prop(int nn) & {pp=nn; return *this;}
A &&prop(int nn) && {pp=nn; return std::move(*this);}
};
struct B {
B(const A &aa) {std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79016187/why-does-a-deducing-this-template-give-different-results-than-overloading-by-r[/url]