invalid use of template name without an argument list

前端 未结 1 395
醉酒成梦
醉酒成梦 2021-02-01 02:51

I am facing a problem with my linked list class, I have created the interface and implementation files of the class, but when I build it, this error occurs: \"invalid use of tem

1条回答
  •  礼貌的吻别
    2021-02-01 03:34

    Write it like this:

    template
    LinkedList::LinkedList()
    {
       start = nullptr;
       current = nullptr;
    }
    

    And similarly for other member functions. But you'll run into another problem - declarations and definitions of a template can't be separated to different files.

    0 讨论(0)
提交回复
热议问题