Template_16_模板与继承
1,名称模板参数
template <typename
PolicySetter1 = DefaultPolicy1,
typename
PolicySetter2 = DefaultPolicy2,
typename
PolicySetter3 = DefaultPolicy3,
typename
PolicySetter4 = DefaultPolicy4>
class BreadSlicer {…}
如果我想修改第三个默认参数需要
BreadSlicer<DefaultPolicy1, DefaultPolicy2, CustomPolicy>
如果能直接BreadSlicer<PolicySetter3 = CustomPolicy>显然更爽。
-------------------------------------------------------------------
2,空基类优化
vs支持空基类优化
3,CRTP
4,参数虚拟性