D
Daniel Switkin
Hi there,
I'm trying to do the following:
class tLimits {
static const int kIntMin = 0; // fine
static const float kFloatMin = 0.0f; // breaks
};
and I get this message:
error C2864: 'kFloatMin' : only const static integral
data members can be initialized inside a class or struct
We've been using this technique fine under gcc, both 2.9
and 3.3. Is there any reason VC++ .NET 2003 can't handle
a floating point static const initialized within the
header? Pushing the definition into the .cpp file will
cost a memory access which I don't want. Since I'm
passing classes like this to templates there's a big
rippling effect in this limitation. I'd really like to
see this fixed in a future release.
Thanks,
Daniel Switkin
I'm trying to do the following:
class tLimits {
static const int kIntMin = 0; // fine
static const float kFloatMin = 0.0f; // breaks
};
and I get this message:
error C2864: 'kFloatMin' : only const static integral
data members can be initialized inside a class or struct
We've been using this technique fine under gcc, both 2.9
and 3.3. Is there any reason VC++ .NET 2003 can't handle
a floating point static const initialized within the
header? Pushing the definition into the .cpp file will
cost a memory access which I don't want. Since I'm
passing classes like this to templates there's a big
rippling effect in this limitation. I'd really like to
see this fixed in a future release.
Thanks,
Daniel Switkin