Compiler Error C2451
conditional expression of type 'type' is illegal
The conditional expression evaluates to an integer type.
The following sample generates C2451:
// C2451.cpp
class B {};
int main () {
B b1;
int i = 0;
if (b1) // C2451
// try the following line instead
// if (i)
;
}
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