Hi, I'm trying to compile the following code under VC2010.
struct CircValRange
{
double a,b; // range: [a,b)
};
template <struct CircValRange* Range>
class CircVal
{
// todo
};
const CircValRange SignedDegRange= {-180., 180.};
CircVal<SignedDegRange> x;
I'm getting
error C2970: 'CircVal' : template parameter 'Range' : 'SignedDegRange' : an expression involving objects with internal linkage cannot be used as a non-type argument
1> d:\4\circval\circval\circval.h(8) : see declaration of 'CircVal'
1> d:\4\circval\circval\circval.h(13) : see declaration of 'SignedDegRange'
I am trying to define a templated class CircVal that will receive a struct Range as the templated parameter.
I don't want it to be possible to assign classes with one range to classes with another range (I want them to be different types).
How can I do it?