This repository is designed to list examples of design patterns with implementations in C++.
- strategy/ — Implementation of the Strategy Pattern
- (More patterns coming soon!)
Examples have been built with C++23
Each subdirectory will have a readme to a Godbolt.org link which will compile and run the code on the web browser. For example the strategy pattern code can be run here: https://godbolt.org/z/KWvn8j7qs.
Use CMake to generate the project (This example uses the ninja-build
generator). Then build the executables using the
generated files and run the executable.
cmake -S . -B bin -G Ninja
cd bin
ninja strategy_pattern
./strategy/strategy_pattern