Chapter 19: Using the Singleton Pattern

This chapter will continue our goal to expand your C++ programming skills beyond core OOP concepts, with the objective of empowering you to solve recurring types of coding conundrums utilizing core design patterns. Utilizing design patterns in coding solutions can not only provide refined solutions but contribute to easier code maintenance and provide potential opportunities for code reuse.

The next core design pattern that we will learn how to implement effectively in C++ is the Singleton pattern.

In this chapter, we will cover the following main topics:

  • Understanding the Singleton pattern and how it contributes to OOP
  • Implement the Singleton pattern in C++ (with a simple versus a paired-class approach); ...

Get Demystified Object-Oriented Programming with C++ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.