I have a template class that worked perfectly in Visual Studio 6 but fails in a more modern version.

```
template<double B, double C>
class MyClass
{
    double k(double x) const
    {
        x = fabs(x);
        if (x < 1.0)
            return ((2.0 - 1.5*B - C) * x*x*x) + ((-3.0 + 2.0*B + C) * x*x) + (1.0 - 0.33333333*B);
        if (x < 2.0)
            return ((-0.16666667*B - C) * x*x*x) + ((B + 5.0*C) * x*x) + ((-2.0*B - 8.0*C) * x) + (1.3333333*B + 4.0*C);
        return 0.0;
    }
};

error C2993: 'double' : illegal type for non-type template parameter 'B'

```

I get it, the standard disallowed using `double` constants as template parameters and VC++ is finally conforming. But what should I use instead? The expression is evaluated repeatedly and is a true bottleneck, and I'd like the constants to be computed at compile time rather than run time.