C++ template compilation error - recursive type or function dependency

后端 未结 5 795
醉话见心
醉话见心 2021-01-02 13:11

I wrote a template class which is giving compilation error

template
class Entity
{
    string EntityName;
    int  EntitySize;
    Entity

        
5条回答
  •  感情败类
    2021-01-02 13:36

    You have written a recursive type. Entity has other Entity members. You should change the Entity members into a pointer or reference.

提交回复
热议问题