   Some help with this function
  I cant get this to work :template<class OP, int Val> static float transformNoise(int x, int y){  OP(Val, perlinNoise(x,y));}and the call is like this :Grid3D(size,stepSize,transformNoise<std::multiplies<int>(),2>)Where Grid3D is Grid3D(int,int,float(*heightFunction)(int,int))
  You've templated on the type of OP, but then (a) try to use an instance of std::multiplies where a type is expected, and (b) try to use the type as the thing that does the work.You need a way to "bind" the std::multiplies functor into your larger functor. There is no particular reason why Grid3D needs to take that specific function pointer; template that, and then have transformNoise be a functor rather like std::multiplies is - i.e. a struct with an operator(), which you instantiate.Also, using a template parameter for the integer is a bit of a premature optimization. It prevents you from using a value that is calculated at runtime, and potentially increases the amount of bloat in the generated code.The net result looks something like this:template <typename heightFunction>ReturnType Grid3D(int, int, heightFunction);// The implementation of Grid3D calls heightFunction as if it were a// float(*)(int, int). With the templating, you accept anything that can behave// in that manner.template <typename OP>struct noiseTransformer {  OP op;  int val;  float operator()(int x, int y) {    return op(val, perlinNoise(x,y));  }}// Constructors can't infer template types, but free functions can. So we// make a helper function to construct an instance of the struct.template <typename OP>noiseTransformer transformNoise(OP op, int val) {  noiseTransformer result = { op, val };  return result;}// The template type of std::multiplies<int> for transformNoise<> is inferred.Grid3D(size, stepSize, transformNoise(std::multiplies<int>(), 2));