Compiler Error C2135
'bit operator' : illegal bit field operation
The address-of operator (&
) cannot be applied to a bit field.
The following sample 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
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for