I am working on some code and stumble upon something like this:
class Foo
{
private:
union {
byte bar;
struct {
byte baz1;
byte baz2;
};
};
};
Now I am compiling with a Level 4 warning in VS 2010 (pure unmanaged), and of course, VS complains that the unnamed structure / join is a non-standard extension (C4201 warning), and I want to fix this warning.
Is there any reason someone would prefer:
class Foo
{
private:
byte bar;
byte baz1;
byte baz2;
};
Or will any reason why change the first to the last be violated?
source
share