, ++. , , .
As an example, Boost.Spirit uses the comma operator pretty well to implement list initializers for symbol tables. Thus, it makes the following syntax possible:
keywords = "and", "or", "not", "xor";
Please note that due to the priority of the operator, the code (intentionally!) Is identical
(((keywords = "and"), "or"), "not"), "xor";
That is, the first statement is called keyword.operator = ("and"), which returns the proxy object on which the remaining statement is called: s:
keywords.operator =("and").operator ,("or").operator ,("not").operator ,("xor");
source
share