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

A CRTP base exposes a static interface. What goes wrong here, and what is the standard fix?

template <class D> struct Counter { static int count; }; template <class D> int Counter<D>::count = 0; struct A : Counter<A> {}; struct B : Counter<B> {};