A pointer to abstract template base class?

前端 未结 2 1692
梦毁少年i
梦毁少年i 2021-02-04 13:35

I cannot figure this out. I need to have an abstract template base class, which is the following:


template  class Dendrite
{
    public:
        Den         


        
2条回答
  •  既然无缘
    2021-02-04 14:20

    Yes it is possible. Just make sure to provide virtual functions, and virtual destructor. In addition, you can use typeid to get the actual type (as well as dynamic_cast to check the type)

提交回复
热议问题