Edit

Share via


Compiler Error C2135

'bit operator' : illegal bit field operation

Remarks

The address-of operator (&) cannot be applied to a bit field.

Example

The following example generates C2135:

// C2135.cpp
struct S {
   int i : 1;
};

struct T {
   int j;
};
int main() {
   &S::i;   // C2135 address of a bit field
   &T::j;   // OK
}