2013-06-23 19 views
0

我正在尝试使用其中一个开源库MMSP编写程序。我写了以下两个文件:缺少模板参数或期望的主表达式

#include<update.hpp> 


int main(int argc, char** argv) 
{ 
    MMSP::Init(argc,argv); 
    std::cout<<"Hello MMSP"<<std::endl; 
    MMSP::grid<2,double> GRID(argv[1]); 

    update(grid,atoi(argv[3])); 

    output(GRID,argv[2]); 

    MMSP::Finalize(); 
    return 0; 
} 

这是update.hpp。

#include "MMSP.hpp" 
using namespace MMSP; 
template<class T,class S> 
void update(T& GRID, S steps) 
{ 
    grid<2,double>update(GRID); 
    for(int step=0;step<steps;step++){ 
      for (int x=x0(GRID);x<x1(GRID);x++) 
        for (int y=y0(GRID);y<y1(GRID);y++){ 
        update[x][y]=GRID[x][y]; 
        } 
      swap(GRID,update); 
      ghostswap(GRID); 
    } 
} 

但我不断收到以下错误。

main.cpp:11: error: expected primary-expression before ‘,’ token 

我哪里错了?

回答

2

你有一个错字:

update(grid,atoi(argv[3])); 
//  ^^^^ this is the name of a class template 

应该

update(GRID,atoi(argv[3])); 
//  ^^^^ this is the name of an instance of class template grid