Having a bit of internal debate in my group about the use of unnamed structs\unions in our C++ code.
I'd like to get feedback from the community of what you think. Should they be used at all? When is it valuable? What are the pitfalls? etc.
Example:
union SFlags
{
struct
{
unsigned int A : 1;
unsigned int B : 1;
unsigned int C : 1;
unsigned int D : 1;
};
unsigned int Value;
}
Edit: also consider if the original structure was defined without the union and that was added at a later point in time.