Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++CRTPSingle-choice MCQ

In this CRTP setup, why does Derived::value() get called from the base's interface() without virtual functions?

template <class D> struct Base { int interface() { return static_cast<D*>(this)->value(); } }; struct Derived : Base<Derived> { int value() { return 42; } };