Unary arithmetic operators
suggest changeThe unary \+
and \-
operators are only usable on arithmetic types, therefore if for example one tries to use them on a struct the program will produce a diagnostic eg:
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