The C++ Programming Language

Brian A. Malloy, PhD

The GoF Singleton Pattern

In this video, we demonstrate a five step process used to convert an "ordinary" class into a "so-called" Gang of Four Singleton.

The Meyer's Singleton

In this video, we convert a Gof singleton into the "so called" Meyer's singleton.

Using a Singleton

We convert a class in an SDL 2.0 "Hello World" program into a GoF singleton. We show that the singleton can eliminate global variables in a GLUT/OpenGL program.