Force deriving from a class virtually
We have a special framework for interfaces in our project, and part of the requirements is that classes which represent an interface may only be used as virtual base classes, not as non-virtual ones. Is there a way to enforce this in code? That is, produce a compilation error if the class is derived from non-virtually. I have access to C++11 as implemented by VS 2010: this means static_assert , enable_if and <type_traits> are available. IMO, there is no clean and platform independent solution available to this problem. The best way is to manually go and change each and every inheritance to