草庐IT

OtherParameter

全部标签

c++ - 隐式构造函数可用于从 Base 派生的所有类型,但当前类型除外?

以下代码总结了我的问题:templateclassBase{};templateclassDerived1:publicBase{};templateclassDerived2:publicBase{public://CopyconstructorDerived2(constDerived2&x);//AnEXPLICITconstructorthatdoesaspecialconversionforaDerived2//withothertemplateparameterstemplateexplicitDerived2(constDerived2&x);//Nowtheproble