Unary arithmetic operators
suggest changeThe unary + and - operators require an arithmetic operand. Applying either one to a structure is a constraint violation, so the compiler must issue a diagnostic:
#include <stdbool.h>
struct foo
{
bool bar;
};
void baz(void)
{
struct foo testStruct;
-testStruct; /* This breaks the constraint so must produce a diagnostic */
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents