一元算术运算符

一元+和 - 运算符仅可用于算术类型,因此,例如,如果尝试在结构上使用它们,程序将生成诊断,例如:

struct foo
{
    bool bar;
};

void baz(void)
{
   struct foo testStruct;
   -testStruct; /* This breaks the constraint so must produce a diagnostic */
}