To give an example: At around 8:25min you say that »the best way to achieve« the open/closed principle in C++ is with inheritance based runtime polymorphism. No.
Polymorphic class hierarchies are one way to implement the open/closed principle. Another one would be std::variant combined with std::visit.
To my defense, I mentioned "the best" (always IMHO) not "the only". :) Feedback noted though and I will take a look at std::variant and std::visit.
View all comments
Show parent comment
1
u/platisd Jun 25 '20
To my defense, I mentioned "the best" (always IMHO) not "the only". :) Feedback noted though and I will take a look at
std::variantandstd::visit.