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 - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -