c++ - Wrong number of template arguments error -


i'm new templates , trying use functions out of class adapt generic programming. wenn this:

template<int c, int d> class a{     ... }  float function(number<int c, int d> value); 

it leads following error:

error: wrong number of template arguments (1, should 2) float function(number<int c, int d> value);                                ^ 

am missing here?

you need define template arguments on function , forward them type:

template<int c, int d> float function(number<c, d> value); 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -