BitsOfQ
A Bits of Q advanced tutorial on move semantics in C++.
— TIMESTAMPS —
00:00 – Introduction
00:28 – The cost of copying
04:47 – Moving vs Copying
05:48 – lvalues and rvalues
09:33 – lvalue and rvalue references
11:12 – When is data moved?
11:49 – Making your classes movable
15:58 – std::move and move operations in practice
21:11 – Summary
More in depth information on move semantics: https://youtu.be/St0MNEU5b0o
and part 2:
https://youtu.be/pIzaZbKUw2s
Outro music by lesfm from pixabay.
If you have any questions or feedback, just leave a comment below.
See you next time!
Good Content.
Nice video, the only problem is with the voice where I hear noise
Nice presentation💗
Amazing! I love your channel especially because you deep dive into contents so we can truly grasp concepts and deepen our knowledge. I was studying about “inhereting from lambdas on Jason Turner’s channel and there were perfect forwarding and universal refernces which I was looking up to see what are those concepts are and YouTube suggested your video 🙂 I enjoyed watching it. Thanks for sharing your knowledge with us❤ just have a question: i’l love to deepen my knowledge on C++ like the way you do , what do you recommend? You must have read books for sure 🙂
I am a bit confused. @12:18 To be explicitly clear and in line with the Rule of Five, I think we would need to either:
Provide implementations (or delete them) for the move constructor, move assignment, copy assignment, and destructor.
Or not provide any custom implementations for any of the special member functions, in which case the compiler will generate all of them (Rule of Zero).
the Article class is copyable and "movable." However, the nuance is that the "movability" here falls back to copying due to the absence of explicitly defined move operations.
Great clarity. A rarity. How do you typically study for these or other topics? Books or blogs?
14:57 I think you forgot to execute a "free(m_content)" before overwriting it which may induce memory leaks depending on the program flow. I might be wrong, haven't tested the example.
Very good episode.