There are three handy rules which explain what you must include in the types you create. They are the rule of zero, the rule of three, and the rule of five. Troy walks us through each of them.
- [Instructor] There are five class special functions:…copy constructor, copy assignment operator,…move constructor, move assignment operator,…and the destructor.…The rule of zero is simple,…don't create any of these special functions.…The compiler's implementation is usually correct…and exactly what you need.…The rule of five says is you create any of these functions,…then you should create them all.…Not creating them all can be the source of very subtle bugs.…Move semantics was added with C++ 11.…
Prior to its addition, there were only…three class special functions, hence the rule of three.…Again, the best practice is to follow the rule of zero…and leave the special functions to the compiler.…
- Major new C++ features
- Turning on modern C++
- Letting the compiler help
- Using the new features correctly
- Using auto type deduction
- Using lambdas
- Range-based for loops
- How C++ and the Standard Template Library name things
- Making the best of the filesystem library
- Managing objects
Skill Level Beginner
1. What Is Modern C++?
2. Tools That Improve Your Code
3. Using the New Features Correctly
4. Don't Reinvent the Wheel
5. Managing Objects
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.