<s>
In	O
C++	B-Language
programming	O
,	O
object	B-Application
slicing	I-Application
occurs	O
when	O
an	O
object	B-Language
of	O
a	O
subclass	O
type	O
is	O
copied	O
to	O
an	O
object	B-Language
of	O
superclass	O
type	O
:	O
the	O
superclass	O
copy	O
will	O
not	O
have	O
any	O
of	O
the	O
member	B-Application
variables	I-Application
or	O
Member	O
functions	O
defined	O
in	O
the	O
subclass	O
.	O
</s>
<s>
More	O
subtly	O
,	O
object	B-Application
slicing	I-Application
can	O
likewise	O
occur	O
when	O
an	O
object	B-Language
of	O
a	O
subclass	O
type	O
is	O
copied	O
to	O
an	O
object	B-Language
of	O
the	O
same	O
type	O
by	O
the	O
superclass	O
's	O
assignment	O
operator	O
,	O
in	O
which	O
case	O
some	O
of	O
the	O
target	O
object	B-Language
's	O
member	B-Application
variables	I-Application
will	O
retain	O
their	O
original	O
values	O
instead	O
of	O
getting	O
copied	O
over	O
from	O
the	O
source	O
object	B-Language
.	O
</s>
<s>
This	O
issue	O
is	O
not	O
inherently	O
unique	O
to	O
C++	B-Language
,	O
but	O
it	O
does	O
not	O
occur	O
naturally	O
in	O
most	O
other	O
object-oriented	B-Language
languages	I-Language
—	O
not	O
even	O
in	O
C++'s	O
relatives	O
such	O
as	O
D	B-Application
,	O
Java	B-Language
,	O
and	O
C#	B-Application
—	O
because	O
copying	O
of	O
objects	O
is	O
not	O
a	O
basic	O
operation	O
in	O
those	O
languages	O
.	O
</s>
<s>
In	O
C++	B-Language
,	O
by	O
contrast	O
,	O
objects	O
are	O
copied	O
automatically	O
whenever	O
a	O
function	O
takes	O
an	O
object	B-Language
argument	O
by	O
value	O
or	O
returns	O
an	O
object	B-Language
by	O
value	O
.	O
</s>
<s>
Additionally	O
,	O
due	O
to	O
the	O
lack	O
of	O
garbage	B-General_Concept
collection	I-General_Concept
in	O
C++	B-Language
,	O
programs	O
will	O
frequently	O
copy	O
an	O
object	B-Language
whenever	O
the	O
ownership	O
and	O
lifetime	O
of	O
a	O
single	O
shared	O
object	B-Language
would	O
be	O
unclear	O
.	O
</s>
<s>
For	O
example	O
,	O
inserting	O
an	O
object	B-Language
into	O
a	O
standard	O
library	O
collection	O
(	O
such	O
as	O
a	O
)	O
actually	O
involves	O
making	O
and	O
inserting	O
a	O
copy	O
into	O
the	O
collection	O
.	O
</s>
