Hi all.
I've hit a snag that I can't seem to get around.
I'm converting some floating point code to use my fixed point class.
It all works pretty well, except at one place where there is a union where float is used as a member and I cannot use my fixed point class since it creates an error C2620:
member 'fValue' has user-defined constructor or non-trivial default constructor
What can I do to get around this? I've never used unions, and I'm not sure what to do.
My FixedPoint class has several constructors. One takes no paramater, other takes one (int, long, double, float, etc).
Here is the declaration:
typedef union
{
int iValue;
float fValue;
void *pValue;
} DValue;
I would like to replace the "float fValue" with "FixedPoint fValue" but I cannot due to explained cause.
Thanks for any help!
I've hit a snag that I can't seem to get around.
I'm converting some floating point code to use my fixed point class.
It all works pretty well, except at one place where there is a union where float is used as a member and I cannot use my fixed point class since it creates an error C2620:
member 'fValue' has user-defined constructor or non-trivial default constructor
What can I do to get around this? I've never used unions, and I'm not sure what to do.
My FixedPoint class has several constructors. One takes no paramater, other takes one (int, long, double, float, etc).
Here is the declaration:
typedef union
{
int iValue;
float fValue;
void *pValue;
} DValue;
I would like to replace the "float fValue" with "FixedPoint fValue" but I cannot due to explained cause.
Thanks for any help!