CRTP Hack: Turning Protected Inside-Out
Vladimir Sakharuk • • 1 min read
programming
This hack is useful when you already have many derived classes. In C++, protected members are accessible only from derived classes, but with CRTP it’s often convenient to access them from the base. A trivial fix is to add friend declarations to all classes, and Cursor can help churn those.
Another solution is: