After I have been reading some other materials about value categories, this lecture really helps me to understand them. Ben explained these concepts in a crystal clear way. Every modern C++ books should have this chapter.
Great lecture. I have used these types and move semantics for years and yet this gave me such a more comfortable understanding of the motivations behind these concepts. Well done!
48:14 For people wondering if std::move(T &&a) has rvalue reference to T as parameter how does it work with something like std::move(str) because str is here an lvalue and it's clearly told in the talk that references to rvalue types only bind to rvalues and not lvalues.. There's a deeper concept at play here note that std::move is templatized and the T&& a parameter actually becomes T&a when called like std::move(str)... you can find videos on type deduction on youtube.
I didn't know std::thread had the ++ operator. If C++ didn't exist, and someone said they had a great idea for a language, and described C++ as it is today, no one would take it seriously. This is no criticism of the speaker, who has done a great job.
@43:08, I don't understand the 'move' assignment overloaded operator that accepts 'rval' or 'temp-val', it is said that it will delete both previous 'lval' that became 'rval' or 'temp-val', whereupon both 's2' and 's3' become 'nullptr'? By moving, do they also mean emptying those two objects?
Oh, I see, only use move semantic if we know the `src` is no longer required. As a reminder, never miss an excellent talk/seminar/lecture, Keep watching until the end.
Because the target of a reference is defined at assignment and does not change afterwards. "p = z" does not change the reference from x to z, it just assigns the value of z similar to "p = 100". The pointer equivalent looks like this: int * const p = &x; *p = 100; *p = z; // "p = &z" does not work, since the pointer address is const *p = 200;
This is THE best talk for understanding value categories. Period.
TFW your Basics lecture includes the term Temporary Materialisation Conversion.
After I have been reading some other materials about value categories, this lecture really helps me to understand them.
Ben explained these concepts in a crystal clear way.
Every modern C++ books should have this chapter.
What materials were you reading about value categories? I'd love to read more on the subject
I hope I watched Ben’s talk before running into move semantics. Thank you!
Ahhh! I knew what lvalue and rvalue where, but never got my head around glvalue, prvalues and xvalues. Now I finally got it! Absolutely great talk!
This talk made how to think about C++ value catogories so much more clear to me. Thanks sir!
Every C++ programmer should watch this video. With exception to Ben Saks and other superprogrammers that already know it content. 😉
Great lecture. I have used these types and move semantics for years and yet this gave me such a more comfortable understanding of the motivations behind these concepts. Well done!
Saks family is an family of experts in explaining C++ in a clear way.
Mr Ben Saks is a gifted teacher!
I should watch all Ben Saks talks avaliable online.
I've been working on highly abstract languages for years so that was an excellent refresher.
48:14 For people wondering if std::move(T &&a) has rvalue reference to T as parameter how does it work with something like std::move(str) because str is here an lvalue and it's clearly told in the talk that references to rvalue types only bind to rvalues and not lvalues..
There's a deeper concept at play here note that std::move is templatized and the T&& a parameter actually becomes T&a when called like std::move(str)... you can find videos on type deduction on youtube.
@@collapsingspace it's universal reference and not rvalue reference?
This lecture is truly insightful and easy to follow after I tries to study the value categories in cpp references. Huge thanks!
I cannot find the slides file in the github link provided, is there any other place to get the slides?
This guy is awesome, I hope to see more of him in the future!
after 2 months of consusions
i finally got it
Geart job!
Great talk. Both approachable and exhaustive.
I cannot find the presentation material. Can you please advise a direct link. Thanks
Thank you Ben for such clear and thorough explanation of value categories, the best I have seen.
1 hour just flew by
Whatta teacher !
I didn't know std::thread had the ++ operator.
If C++ didn't exist, and someone said they had a great idea for a language, and described C++ as it is today, no one would take it seriously.
This is no criticism of the speaker, who has done a great job.
The presentation content isn't available in the github .
Perfect introduction to value categories.
Gifted! great talk, Helps to understand the basics (how much I didn't know)
Excellent talk by Ben.
Very helpful in untangling these concepts!
Exceptionally good presentation.
Thank you Ben for the presentation.
Clear as water now, thank you Ben!
Best explanation of this subject out there.
This is great.
48:45 Alright I'll admit. Intentional or not, that one made me laugh
Superb lecture!
Glad it was helpful!
what a great talk, thanks Ben
Great talk!
Great talk. Very helpful
Loved the talk
Amazing, thanks man.
Glad you liked it!
Thanks.... Cleared all my confusion...
I can't find presentation
Where is it?
Beyond excellent!
@43:08, I don't understand the 'move' assignment overloaded operator that accepts 'rval' or 'temp-val', it is said that it will delete both previous 'lval' that became 'rval' or 'temp-val', whereupon both 's2' and 's3' become 'nullptr'? By moving, do they also mean emptying those two objects?
Oh, I see, only use move semantic if we know the `src` is no longer required. As a reminder, never miss an excellent talk/seminar/lecture, Keep watching until the end.
Thank you.
You're welcome!
Great talk
very helpful, thanks.
int x = 6;
int z = 10;
int& p =x;
p = 100;
cout
Because the target of a reference is defined at assignment and does not change afterwards. "p = z" does not change the reference from x to z, it just assigns the value of z similar to "p = 100". The pointer equivalent looks like this:
int * const p = &x;
*p = 100;
*p = z; // "p = &z" does not work, since the pointer address is const
*p = 200;