C++: Using Class Templates
C++ 20
| Expert
- 15 Videos | 1h 52m 8s
- Includes Assessment
- Earns a Badge
Class templates are a way of reusing code for classes parameterized by types of internal state variables, just as function templates are a way of reusing code for functions parameterized by the types of input arguments and return types. In this course you will discover how to define and instantiate class templates, along with common uses of templated classes. Learn how to use the braced initialization list constructor and explore how the compiler provides this special construct so that container objects can be initialized from a list of values. Finally, investigate partial and full template specializations, and how partial specializations can be used to correctly deal with pointer types.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this courseexplore class template parameterscreate and instantiate classes with class template parameterswork with the braced initialization list constructoruse the braced initialization list constructor and let the compiler deduce template parametersrecognize side effects of braced initialization list constructorsuse non-type template parameters with classesillustrate the features of non-type parameters
-
create specializations of class templatesuse specialized templatescreate a partial specialization to manage pointersfix one out of multiple template parameters using partial specializationscheck template type parameters using static_assertdefine friend functions to templated classes using the introvert and extrovert patternssummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview1m 49sUP NEXT
-
2.Using Class Template Parameters7m 36s
-
3.Creating Classes with Template Parameters8m 28s
-
4.Using the Braced Initialization List Constructor10m 27s
-
5.Automatically Deducing Class Template Parameters6m 45s
-
6.Using Functional Notation for Initializing Variables5m 38s
-
7.Using Non-type Template Parameters with Classes7m 49s
-
8.Demonstrating Features of Non-type Parameters7m 57s
-
9.Specializing Class Templates8m 56s
-
10.Using Specialized Templates7m 27s
-
11.Using Partial Specializations8m 16s
-
12.Performing Partial Specializations11m 16s
-
13.Using static_assert9m 40s
-
14.Defining Friend Functions to Templated Classes6m 14s
-
15.Course Summary3m 50s
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.