阅读背景:

类型提供基类(或不可复制)和虚继承

来源:互联网 

I've in the past used base classes purely for making type information constant (similar to traits classes, as well as perhaps ios_base). These classes would typically have no data, but only provide types that are commonly used (perhaps decorating an original type), the idea being in the event of change, changing the type constant at one location. I've been wondering if there are any advantages in using virtual inheritance for interfaces that might inherit from such type classes. A well known example of a similar case is interfaces that may derive boost::noncopyable (not that I often use boost::noncopyable for interfaces). I've in the past used base classes purely for m




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: