This month, I examine how you define C++/CLI implementation contracts, called "interfaces." Sometimes it is useful to have unrelated classes behave in similar ways by having them share a common set of public members. One way you can achieve this is to define them with a common base class; however, this approach is limiting because it requires that these classes be related via inheritance, yet they might each already have a base class of their own, and CLI types support single-class inheritance only.
展开▼