2B. No Ducks Allowed – Templates and Deduction

Learning Objectives

By the end of this chapter, you will be able to:

  • Develop your own classes to an even greater effect using inheritance and polymorphism
  • Implement an alias to make your code easier to read
  • Develop templates using SFINAE and constexpr to simplify your code
  • Implement your own solutions using the STL to leverage generic programming
  • Describe the context and basic rules for type deduction

This chapter will show you how to define and extend your types through inheritance, polymorphism, and templates.

Introduction

In the previous chapter, we learned how to develop our own types (classes) with the help of unit tests and made them behave like built-in types. We were introduced ...

Get Advanced C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.