Why ++ is overloaded but not - for C ++ bool

I am trying to understand why I can ++b bool, but not --b it

 #include <stdio.h> int main(void) { bool b = false; ++b; --b; // error C2428: '--' : not allowed on operand of type 'bool' printf("%s %d", b ? "true" : "false", b); getchar(); return 0; } 
+6
source share

Source: https://habr.com/ru/post/947443/


All Articles