草庐IT

ConcreteContainer

全部标签

c++ - 在 CRTP 中使用内部类

有没有可能在CRTP中使用内部类或枚举?例如。templatestructContainerBase{std::map_;};structConcreteContainer:ContainerBase{enumclassEnum{left,right};}; 最佳答案 没有。在类模板中,派生类尚未完全定义(在standardese中这不是一个完整的对象)。Infact(工作草案):Aclassisconsideredacompletely-definedobjecttype(orcompletetype)attheclosing}因