cpp_weekly icon indicating copy to clipboard operation
cpp_weekly copied to clipboard

Deducing this by value or reference?

Open BluBb-mADe opened this issue 2 years ago • 2 comments

Channel

C++Weekly

Topics

I would really like to see a deeper dive into deducing this. Specifically questions like when to take self as value or rvalue reference. How these differ and behave in practice. I am interested in how they get optimized especially when capturing self by value. Would that, at least in theory, allow compilers to more effectively optimize because value semantics are generally easier to reason about for compilers? I have seen self by rvalue ref quite a bit in many examples but how exactly this feature interacts with perfect forwarding is quite opaque to me still.

This of course is a very new feature with very little compiler support so far, so it might be a good idea to leave this topic for the future when implementations have caught up and the implications have been explored more fully.

Length

I am not sure how much subtlety there is in the answers to these questions so it really depends on how deep the topic goes. My intuition tells me it's a quite complex topic that would require a longer video but I very much lack the expertise to judge it properly.

BluBb-mADe avatar Feb 24 '23 12:02 BluBb-mADe