Рет қаралды 17,375
We continue our series on C++11 features you might have forgotten or never learned. Specifically, we will talk about the move constructor and move assignment operator and how it can help you write more efficient classes. In the example, we'll improve efficiency from O(n) to O(1) for the selected operations.
As part of the discussion, we'll write a class that includes these methods and other overloaded operators.
Since we're including the move methods, we'll be including a destructor, copy assignment operator, and copy constructor.
Once done, we've implemented a class that follows the Rule of 5.
A great tutorial for not so beginners.
// Writing the Move Code //
~ 22:00
// Source Code //
www.dropbox.co...
// Learn More //
Check out my complete C++ videos playlist:
• Playlist
Value categories:
en.cppreferenc...
Rule of three/five/zero:
en.cppreferenc...
// Consider supporting this channel in multiple ways //
ko-fi.com/prof...
paypal.me/hank...
Bitcoin: 177wfkQwzXiC8o2whQMVpSyuWUs95krKYB
Dogecoin: DRK2HDp3ZkkbFpvGZnVgMVosnBhPv8r3uP