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

后端 未结 5 810
醉话见心
醉话见心 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:24

    Change

        Entity pPrev;
        Entity pNext;
    

    to

        Entity *pPrev;
        Entity *pNext;
    

    Your type definition is recursive...

提交回复
热议问题