Missing template arguments or expected primary expression

I am trying to write a program with one of the open source libraries MMSP. I have written following two files

#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;
}

And this is 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);
     }
}

But I constantly get following error.

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

Where am I going wrong?

Upvotes: 0

Views: 128

Answers (1)

juanchopanza
juanchopanza

Reputation: 227608

You have a typo:

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

should be

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

Upvotes: 2

Related Questions