From the November 2014 working draft of the C++14 standard:
§ 1.7 6
c ISO/IEC N4296 5 [Example: A structure declared as
struct {
char a;
int b:5,
c:11,
:0,
d:8;
struct {int ee:8;} e;
}
contains four separate memory locations: The field a and bit-fields d and e.ee are each separate memory locations, and can be modified concurrently without interfering with each other. The bit-fields b and c together constitute the fourth memory location. The bit-fields b and c cannot be concurrently modified, but b and a, for example, can be. — end example ]
I assume that the :0
acts as a separator of sorts, which is why d
has a separate memory location while b
and c
do not. However, I do not understand what is meant by
together constitute the fourth memory location
Are b
and c
a union
? E.g., equivalent to
union {
int b:5;
int c:11;
};