<s>
A	O
sequence	B-Application
point	I-Application
defines	O
any	O
point	O
in	O
a	O
computer	B-Application
program	I-Application
's	O
execution	B-General_Concept
at	O
which	O
it	O
is	O
guaranteed	O
that	O
all	O
side	O
effects	O
of	O
previous	O
evaluations	O
will	O
have	O
been	O
performed	O
,	O
and	O
no	O
side	O
effects	O
from	O
subsequent	O
evaluations	O
have	O
yet	O
been	O
performed	O
.	O
</s>
<s>
They	O
are	O
often	O
mentioned	O
in	O
reference	O
to	O
C	B-Language
and	O
C++	B-Language
,	O
because	O
they	O
are	O
a	O
core	O
concept	O
for	O
determining	O
the	O
validity	O
and	O
,	O
if	O
valid	O
,	O
the	O
possible	O
results	O
of	O
expressions	O
.	O
</s>
<s>
Adding	O
more	O
sequence	B-Application
points	I-Application
is	O
sometimes	O
necessary	O
to	O
make	O
an	O
expression	O
defined	O
and	O
to	O
ensure	O
a	O
single	O
valid	O
order	O
of	O
evaluation	O
.	O
</s>
<s>
With	O
C++11	B-Language
,	O
usage	O
of	O
the	O
term	O
sequence	B-Application
point	I-Application
has	O
been	O
replaced	O
by	O
sequencing	O
.	O
</s>
<s>
The	O
execution	B-General_Concept
of	O
unsequenced	O
evaluations	O
can	O
overlap	O
,	O
with	O
catastrophic	O
undefined	B-Language
behavior	I-Language
if	O
they	O
share	O
state	B-Application
.	O
</s>
<s>
This	O
situation	O
can	O
arise	O
in	O
parallel	B-Operating_System
computations	I-Operating_System
,	O
causing	O
race	B-Operating_System
conditions	I-Operating_System
.	O
</s>
<s>
However	O
,	O
it	O
can	O
already	O
arise	O
in	O
simple	O
non-concurrent	O
situations	O
like	O
(	O
a	O
=	O
1	O
)	O
+	O
(	O
b	O
=	O
a	O
)	O
,	O
where	O
part	O
of	O
the	O
assignment	O
to	O
a	O
(	O
e.g.	O
,	O
half	O
of	O
the	O
bits	O
)	O
may	O
happen	O
before	O
b	O
=	O
a	O
,	O
and	O
the	O
rest	O
afterwards	O
,	O
such	O
that	O
after	O
evaluation	O
of	O
the	O
expression	O
,	O
b	O
may	O
contain	O
a	O
meaningless	O
intermediate	O
state	B-Application
of	O
a	O
.	O
</s>
<s>
In	O
C	B-Language
and	O
C++	B-Language
,	O
the	O
+	O
operator	O
is	O
not	O
associated	O
with	O
a	O
sequence	B-Application
point	I-Application
,	O
and	O
therefore	O
in	O
the	O
expression	O
f( )	O
+	O
g( )	O
it	O
is	O
possible	O
that	O
either	O
f( )	O
or	O
g( )	O
will	O
be	O
executed	O
first	O
.	O
</s>
<s>
The	O
comma	B-Language
operator	I-Language
introduces	O
a	O
sequence	B-Application
point	I-Application
,	O
and	O
therefore	O
in	O
the	O
code	O
f( )	O
,	O
g( )	O
the	O
order	O
of	O
evaluation	O
is	O
defined	O
:	O
first	O
f( )	O
is	O
called	O
,	O
and	O
then	O
g( )	O
is	O
called	O
.	O
</s>
<s>
Sequence	B-Application
points	I-Application
also	O
come	O
into	O
play	O
when	O
the	O
same	O
variable	O
is	O
modified	O
more	O
than	O
once	O
within	O
a	O
single	O
expression	O
.	O
</s>
<s>
An	O
often-cited	O
example	O
is	O
the	O
C	B-Language
expression	O
i	O
=	O
i++	O
,	O
which	O
apparently	O
both	O
assigns	O
i	O
its	O
previous	O
value	O
and	O
increments	O
i	O
.	O
</s>
<s>
The	O
definition	O
of	O
a	O
particular	O
language	O
might	O
specify	O
one	O
of	O
the	O
possible	O
behaviors	O
or	O
simply	O
say	O
the	O
behavior	O
is	O
undefined	B-Language
.	O
</s>
<s>
In	O
C	B-Language
and	O
C++	B-Language
,	O
evaluating	O
such	O
an	O
expression	O
yields	O
undefined	B-Language
behavior	I-Language
.	O
</s>
<s>
Other	O
languages	O
,	O
such	O
as	O
C#	B-Application
,	O
define	O
the	O
precedence	O
of	O
the	O
assignment	O
and	O
increment	O
operator	O
in	O
such	O
a	O
way	O
that	O
the	O
result	O
of	O
the	O
expression	O
i	O
=	O
i++	O
is	O
guaranteed	O
.	O
</s>
<s>
In	O
C	B-Language
and	O
C++	B-Language
,	O
sequence	B-Application
points	I-Application
occur	O
in	O
the	O
following	O
places	O
.	O
</s>
<s>
(	O
In	O
C++	B-Language
,	O
overloaded	O
operators	O
act	O
like	O
functions	O
,	O
and	O
thus	O
operators	O
that	O
have	O
been	O
overloaded	O
introduce	O
sequence	B-Application
points	I-Application
in	O
the	O
same	O
way	O
as	O
function	O
calls	O
.	O
)	O
</s>
<s>
Between	O
evaluation	O
of	O
the	O
left	O
and	O
right	O
operands	O
of	O
the	O
&&	O
(	O
logical	O
AND	O
)	O
,	O
||	O
(	O
logical	O
OR	O
)	O
(	O
as	O
part	O
of	O
short-circuit	O
evaluation	O
)	O
,	O
and	O
comma	B-Language
operators	I-Language
.	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
expression	O
there	O
is	O
a	O
sequence	B-Application
point	I-Application
after	O
the	O
first	O
,	O
meaning	O
it	O
has	O
already	O
been	O
incremented	O
by	O
the	O
time	O
the	O
second	O
instance	O
is	O
executed	O
.	O
</s>
<s>
This	O
category	O
includes	O
expression	O
statements	O
(	O
such	O
as	O
the	O
assignment	O
)	O
,	O
return	B-Language
statements	I-Language
,	O
the	O
controlling	O
expressions	O
of	O
,	O
,	O
,	O
or	O
-	O
statements	O
,	O
and	O
each	O
of	O
the	O
three	O
expressions	O
in	O
a	O
for	O
statement	O
.	O
</s>
<s>
The	O
order	O
in	O
which	O
the	O
arguments	O
are	O
evaluated	O
is	O
not	O
specified	O
,	O
but	O
this	O
sequence	B-Application
point	I-Application
means	O
that	O
all	O
of	O
their	O
side	O
effects	O
are	O
complete	O
before	O
the	O
function	O
is	O
entered	O
.	O
</s>
<s>
(	O
The	O
function	O
call	O
is	O
not	O
a	O
use	O
of	O
the	O
comma	B-Language
operator	I-Language
;	O
the	O
order	O
of	O
evaluation	O
for	O
,	O
,	O
and	O
is	O
unspecified	O
.	O
)	O
</s>
<s>
At	O
a	O
function	O
return	O
,	O
after	O
the	O
return	B-Language
value	I-Language
is	O
copied	O
into	O
the	O
calling	O
context	O
.	O
</s>
<s>
(	O
This	O
sequence	B-Application
point	I-Application
is	O
only	O
specified	O
in	O
the	O
C++	B-Language
standard	O
;	O
it	O
is	O
present	O
only	O
implicitly	O
in	O
C	B-Language
.	O
)	O
</s>
<s>
(	O
This	O
is	O
not	O
an	O
example	O
of	O
the	O
comma	B-Language
operator	I-Language
.	O
)	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
expression	O
,	O
there	O
is	O
a	O
sequence	B-Application
point	I-Application
after	O
the	O
is	O
evaluated	O
and	O
before	O
printing	O
.	O
</s>
