Wikipedia says that sequence points are deprecated in C++11. What does that mean? Does that mean that undefined behaviors due to sequence points has no effects?
In C, sequence points occur in the following places. Between evaluation of the left and right operands of the && (logical AND), || (logical OR) (as part of short-circuit evaluation), and comma operators.
The comma operator has the lowest precedence of any C operator, and acts as a sequence point.
The C language defines the following sequence points: Left operand of the logical-AND operator (&&). The left operand of the logical-AND operator is completely evaluated and all side effects complete before continuing. If the left operand evaluates to false (0), the other operand is not evaluated.
Sequence point rules (until C++11) A sequence point is a point in the execution sequence where all side effects from the previous evaluations in the sequence are complete, and no side effects of the subsequent evaluations started.
One major problem with the term "sequence point" is that it suggests a type of absolute sequencing which never existed. Consider the expression a = (b(),c()) + d();
There is a sequence point between b()
and c()
, but that doesn't mean everything else can be described as being clearly before c()
or being clearly after b()
. It would be possible for b()
, c()
, and d()
, to be evaludated in the order bcd
, bdc
, or dbc
. The "sequence" point terminology didn't really make that clear, but the newer terminology does.
The term "sequence point" is deprecated in order to provide a clearer explanation. The C++ language should not change.
You can find more information here
The phrase "sequence point" has been deprecated in favor of more explicit phrasing like "sequenced before". Sequence points were difficult to understand already. Adding multithreading make them almost impossible for anybody to deal with, so they were (at least mostly) eliminated in favor of other wording.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With