一个类模板定义问题
我在"list.h"头文件中定义了模板类,在"list.cpp"源文件中写了其成员函数的实现,在ex.cpp源文件中有个main()调用模板类
/********list.h************/
#ifndef LIST_H_
#define LIST_H_
#include <iostream>
#include <stdexcept>
........
......
#include "list.cpp"
#endif
/*************list.cpp***************/
#include "list.h"
using namespace std;
.........
......
/****************"ex.cpp"**********/
#include "list.h"
using namespace std;
void main()
{..............}
可是编译的时候老报错,在list.cpp中定义的每一个成员函数都说是:函数模板已定义,参见
list.h中此函数的声明,不晓得为什么?望高人解答!