Chapter 4: Advanced Template Concepts
In the previous chapters, we learned the core fundamentals of C++ templates. At this point, you should be able to write templates that are perhaps not very complex. However, there are many more details concerning templates, and this chapter is dedicated to these more advanced topics. These include the following topics that we address next:
- Understanding name binding and dependent names
- Exploring template recursion
- Understanding template argument deduction
- Learning forwarding references and perfect forwarding
- Using the
decltype
specifier and thestd::declval
type operator - Understanding friendship in templates
On completing this chapter, you will acquire a deeper knowledge of these advanced template concepts and be able to understand and write more complex template code.
We will start this chapter by learning about name binding and dependent names.