January 2019
Intermediate to advanced
512 pages
14h 5m
English
We have previously used policies to control the public interface in one of two ways—first, we were able to inject a public member function by inheriting from a policy. This approach is reasonably flexible and powerful, but has two drawbacks—first, once we inherit publicly from a policy, we have no control over what interface gets injected—every public member function of the policy becomes a part of the derived class interface. Second, to implement anything useful this way, we have to let the policy class cast itself to the derived class, and then it has to have access to all of the data members and possibly other policies of the class. The second approach we tried relied on a particular property ...