C++ Generic Linked List

前端 未结 4 1352
旧巷少年郎
旧巷少年郎 2021-01-29 00:38

For the code below:

#include 
#include 

using namespace std;

class Foo2;
class Foo3;

template 
class Foo1 {
  pub         


        
4条回答
  •  庸人自扰
    2021-01-29 01:06

    You need to use a T*, not a T. Looks to me like you came from Java where everything is a reference. There is no ? in C++ templates. I think that you need to pick up a book on basic C++ first, and then come back to templates.

提交回复
热议问题