The {} operators in this context are the "anonymous scope operator" (also called the "lexical application", the "form", etc. They are used somewhat similar to the namespace to limit the scope of _a and _b located inside curly braces, therefore, they will not conflict with other vars that may have the same name. "auto" vars defined in {braces} will be "destroyed" after reaching the end of the curly brace ;, with non-local hyphenation, for example, "return" or "longjmp" However, you cannot use "goto" reliably. hold them out.
You are probably used to seeing them only after the "if", "do", "while" and "for" statements, but think of it as a way to "combine" several statements into one "slot", "just like you could would run multiple statements as a "then" or "else" clause for "if" (where, if you leave curly braces, you only have one slot ")"
As Mike Seymour noted, operation ({}) is a non-standard GCC extension that returns the value of the last element evaluated in it. It is very similar to the general survey operator, with the exception of an integral return at the end.
BRFennPocock
source share