下面的代码红色报错,为什么?
#include<iostream>#include"vector.h"
#include<iomanip>
#define N 4
using namespace std;
template<typename T>
struct Stack{
Stack(){}
~Stack() {clear();}
bool empty(void) const {return vector<T>::empty();}
int size (void) const {return vector<T>::size();}
int top(void) {return vector<T>::back();}
void pop(void) {vector<T>::pop_back();}
void push(int v){vector<T>::push_back(v);}
void clear(void){vector<T>::clear();}
};
Stack*edge = new Stack[N];
//F:\Cpp\deepfind.cpp(17) : error C2955: 'Stack' : use of class template requires template argument list
F:\Cpp\deepfind.cpp(16) : see declaration of 'Stack'
[ 本帖最后由 fishviv 于 2010-12-25 20:14 编辑 ]