Export (0) Print
Expand All
Expand Minimize

Compiler Error C2428

'operation' : not allowed on operand of type 'bool'

You cannot apply a decrement operator to objects of type bool.

The following sample generates C2428:

// C2428.cpp
void g(bool fFlag) {
   --fFlag;   // C2428
   fFlag--;   // C2428
}

Community Additions

ADD
Show:
© 2014 Microsoft