January 2019
Intermediate to advanced
512 pages
14h 5m
English
When implementing CRTP classes, you do have to worry about access—any method you want to call has to be accessible. Either the method has to be public, or the caller has to have special access. This is a little different from the way virtual functions are called—when calling a virtual function, the caller must have access to the member function that is named in the call. For example, a call to the base class function, B::f(), requires that either B::f() is public or the caller has access to non-public member functions (another member function of class B can call B::f() even if it's private). Then, if B::f() is virtual and overridden by the derived class, D, the override, D::f(), is actually called at runtime. There ...