Skip to content

Instantly share code, notes, and snippets.

View JoshHayes's full-sized avatar
🦉

Joshua Hayes JoshHayes

🦉
View GitHub Profile
@JoshHayes
JoshHayes / concepts_for_composition_over_inheritance.cpp
Created September 13, 2023 09:10
Using C++20 concepts to avoid inheritance - a tiny demo
// Using C++20 concepts to enable composition over inheritance - a tiny demo.
// Notes from a lovely talk by Jonathan Gopel
//
// Source:
// Using Modern C++ to Eliminate Virtual Functions - Jonathan Gopel - CppCon 2022
// https://www.youtube.com/watch?v=gTNJXVmuRRA
// See also:
// https://en.cppreference.com/w/cpp/language/constraints
#include <concepts>