isocpp / CppCoreGuidelines

The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
Other
42.55k stars 5.43k forks source link

C.hier: discussion on alternative implementations of run-time polimorphism is missing. #1225

Open imre-palik opened 6 years ago

imre-palik commented 6 years ago

There is a long section on the rules of implementing run-time polimorphism via class hierarchies, but no guidelines on the alternative implementations on runtime-polimorphism, (I.e., with std::variant, or type erased containers).

I think some guidance on when to use which sollution would also be great. (I am addicted to variants these days, so I cannot really come up with those ...)

hsutter commented 6 years ago

Perhaps add a cross-reference to the guidelines where variant and type erasure are discussed?