我正在尝试使用以下代码。非模板参数为什么不能通过std :: vector
#include <iostream>
#include <vector>
using namespace std;
template <typename T, std::vector <T> myV>
int fun()
{
cout <<" Inside fun() "<<endl;
}
int main(int argc, char ** argv)
{
std::vector<int> a;
fun<int,a>();
}
我无法通过的std ::矢量MYV?但
代替的std ::向量,我可以能够使用类似模板 **,并乐趣()。
很好解释。 – Whoami 2013-04-27 10:59:51