我确实阅读了一些相关的线程,但问题仍然不清楚:
#include <stdio.h>
#include <vector>
#include <iostream>
template <> class stack <int>
{
public:
std :: vector <int> stackVector;
};
编译错误:
templateSpecializ.cpp:5: error: ‘stack’ is not a template
templateSpecializ.cpp:6: error: explicit specialization of non-template ‘stack’
从这个链接:coderSource.net
我错过了什么吗?我觉得我有。我什至尝试在那里定义函数,但这没有帮助。