C++ Inheritance & Polymorphism: Multiple Inheritance & the Diamond Hierarchy
C++ 20
| Expert
- 11 Videos | 1h 21m 49s
- Earns a Badge
C++ allows multiple inheritance, which means that one class can have more than one base. C++ also has some powerful mechanisms for dealing with edge cases such as the diamond hierarchy. You will start this course by learning the precise syntax which is required to implement multiple inheritance in C++, specifically, how it's important to have both base class access specifiers marked independently. You will then move on to the topic of a diamond inheritance hierarchy, in which the grandchild-level derived class has two parents, both of which inherit from the common, grandparent level base class. Finally, you will see how dynamic casts work in the context of an inheritance hierarchy, how these are a lot safer than static casts, and how they return a null value on failure when used with pointers but they throw an exception on failure when used with references.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this courseoutline the concepts of multiple inheritance and the diamond hierarchyperform multiple inheritance and explore naming collisionsuse the ‘using’ keyword and implement virtual methods in multiple inheritancedemonstrate the diamond hierarchy and virtual public inheritanceperform C-style casts and recognize risks associated with them
-
use C++-style static casts and contrast them with C-style castscast an object of one class to another classperform dynamic castsrecognize errors and issues which can result with dynamic castssummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview1m 57sUP NEXT
-
2.Multiple Inheritance and Diamond Hierarchy Overview6m 27s
-
3.Understanding Multiple Inheritance8m 3s
-
4.Implementing Virtual Methods in Multiple Inheritance8m 38s
-
5.Creating a Diamond Inheritance Hierarchy11m 28s
-
6.Using C-style Casts in C++9m 57s
-
7.Performing Static Casts6m 15s
-
8.Casting Objects7m 54s
-
9.Performing Dynamic Casts7m 26s
-
10.Exploring Errors Related to Dynamic Casts10m 46s
-
11.Course Summary2m 56s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.