32_CRTP - Static Polymorphism for better performance #6
MarioGalindoQ
started this conversation in
IV. C++ Specific & Frameworks
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
The Curiously Recurring Template Pattern (CRTP) is a powerful C++ idiom for achieving static polymorphism. Unlike traditional virtual functions, CRTP resolves calls at compile-time, eliminating the overhead of the vtable.
Discussion points
I'd love to hear your experience with this technique:
Is CRTP your first choice for high-performance libraries, or do you prefer other modern alternatives like
std::variant? 💻Beta Was this translation helpful? Give feedback.
All reactions