C++ template partial specialization error

Posted by JP19 on Stack Overflow See other posts from Stack Overflow or by JP19
Published on 2011-01-05T10:51:32Z Indexed on 2011/01/05 10:53 UTC
Read the original article Hit count: 351

Hi,

The following code is giving me a compilation error: class Q64 is not a valid type for a template constant parameter

template<int GRIDD, class T>
INLINE T grid_residue(T amount) {
  T rem = amount%(GRIDD);
  if (rem > GRIDD/2) rem -= GRIDD;
  return rem;
}


template<int GRIDD, Q64>
INLINE Q64 grid_residue(Q64 amount) {
  return Q64(grid_residue<GRIDD, int64_t>(to_int(amount)));
}

Whats wrong? I am trying to specialize grid_residue for class Q64.

thanks

© Stack Overflow or respective owner

Related posts about c++

Related posts about templates