<s>
C++	B-Language
/CLI	I-Language
is	O
a	O
variant	O
of	O
the	O
C++	B-Language
programming	I-Language
language	I-Language
,	O
modified	O
for	O
Common	O
Language	O
Infrastructure	O
.	O
</s>
<s>
It	O
has	O
been	O
part	O
of	O
Visual	B-Application
Studio	I-Application
2005	O
and	O
later	O
,	O
and	O
provides	O
interoperability	O
with	O
other	O
.NET	B-Application
languages	O
such	O
as	O
C#	B-Application
.	O
</s>
<s>
Microsoft	O
created	O
C++	B-Language
/CLI	I-Language
to	O
supersede	O
Managed	B-Language
Extensions	I-Language
for	I-Language
C++	I-Language
.	O
</s>
<s>
In	O
December	O
2005	O
,	O
Ecma	O
International	O
published	O
C++	B-Language
/CLI	I-Language
specifications	O
as	O
the	O
ECMA-372	B-Language
standard	O
.	O
</s>
<s>
C++	B-Language
/CLI	I-Language
should	O
be	O
thought	O
of	O
as	O
a	O
language	O
of	O
its	O
own	O
(	O
with	O
a	O
new	O
set	O
of	O
keywords	O
,	O
for	O
example	O
)	O
,	O
instead	O
of	O
the	O
C++	B-Language
superset-oriented	O
Managed	B-Language
C++	I-Language
(	O
MC++	O
)	O
(	O
whose	O
non-standard	O
keywords	O
were	O
styled	O
like	O
or	O
)	O
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
there	O
are	O
some	O
major	O
syntactic	O
changes	O
,	O
especially	O
related	O
to	O
the	O
elimination	O
of	O
ambiguous	O
identifiers	O
and	O
the	O
addition	O
of	O
.NET-specific	O
features	O
.	O
</s>
<s>
Many	O
conflicting	O
syntaxes	O
,	O
such	O
as	O
the	O
multiple	O
versions	O
of	O
operator	O
in	O
MC++	O
,	O
have	O
been	O
split	O
:	O
in	O
C++	B-Language
/CLI	I-Language
,	O
.NET	B-Application
reference	O
types	O
are	O
created	O
with	O
the	O
new	O
keyword	O
(	O
i.e.	O
</s>
<s>
garbage	B-General_Concept
collected	I-General_Concept
new( )	O
)	O
.	O
</s>
<s>
Also	O
,	O
C++	B-Language
/CLI	I-Language
has	O
introduced	O
the	O
concept	O
of	O
generics	O
from	O
.NET	B-Application
(	O
similar	O
,	O
for	O
the	O
most	O
common	O
purposes	O
,	O
to	O
standard	O
C++	B-Language
templates	O
,	O
but	O
quite	O
different	O
in	O
their	O
implementation	O
)	O
.	O
</s>
<s>
In	O
MC++	O
,	O
there	O
were	O
two	O
different	O
types	O
of	O
pointers	O
:	O
pointers	O
were	O
normal	O
C++	B-Language
pointers	O
,	O
while	O
pointers	O
worked	O
on	O
.NET	B-Application
reference	O
types	O
.	O
</s>
<s>
In	O
C++	B-Language
/CLI	I-Language
,	O
however	O
,	O
the	O
only	O
type	O
of	O
pointer	O
is	O
the	O
normal	O
C++	B-Language
pointer	O
,	O
while	O
the	O
.NET	B-Application
reference	O
types	O
are	O
accessed	O
through	O
a	O
"	O
handle	O
"	O
,	O
with	O
the	O
new	O
syntax	O
(	O
instead	O
of	O
)	O
.	O
</s>
<s>
This	O
new	O
construct	O
is	O
especially	O
helpful	O
when	O
managed	O
and	O
standard	O
C++	B-Language
code	I-Language
is	O
mixed	O
;	O
it	O
clarifies	O
which	O
objects	O
are	O
under	O
.NET	B-Application
automatic	B-General_Concept
garbage	I-General_Concept
collection	I-General_Concept
and	O
which	O
objects	O
the	O
programmer	O
must	O
remember	O
to	O
explicitly	O
destroy	O
.	O
</s>
<s>
A	O
tracking	O
reference	O
in	O
C++	B-Language
/CLI	I-Language
is	O
a	O
handle	O
of	O
a	O
passed-by-reference	O
variable	O
.	O
</s>
<s>
It	O
is	O
similar	O
in	O
concept	O
to	O
using	O
""	O
(	O
reference	O
to	O
a	O
pointer	O
)	O
in	O
standard	O
C++	B-Language
,	O
and	O
(	O
in	O
function	O
declarations	O
)	O
corresponds	O
to	O
the	O
""	O
keyword	O
applied	O
to	O
types	O
in	O
C#	B-Application
,	O
or	O
""	O
in	O
Visual	B-Language
Basic	I-Language
.NET	I-Language
.	O
</s>
<s>
C++	B-Language
/CLI	I-Language
uses	O
a	O
""	O
syntax	O
to	O
indicate	O
a	O
tracking	O
reference	O
to	O
a	O
handle	O
.	O
</s>
<s>
Note	O
that	O
this	O
would	O
be	O
illegal	O
in	O
C#	B-Application
,	O
which	O
does	O
not	O
allow	O
loops	O
to	O
pass	O
values	O
by	O
reference	O
.	O
</s>
<s>
Another	O
change	O
in	O
C++	B-Language
/CLI	I-Language
is	O
the	O
introduction	O
of	O
the	O
finalizer	B-Application
syntax	O
,	O
a	O
special	O
type	O
of	O
nondeterministic	O
destructor	O
that	O
is	O
run	O
as	O
a	O
part	O
of	O
the	O
garbage	B-General_Concept
collection	I-General_Concept
routine	I-General_Concept
.	O
</s>
<s>
The	O
C++	B-Language
destructor	O
syntax	O
also	O
exists	O
for	O
managed	O
objects	O
,	O
and	O
better	O
reflects	O
the	O
"	O
traditional	O
"	O
C++	B-Language
semantics	O
of	O
deterministic	O
destruction	O
(	O
that	O
is	O
,	O
destructors	O
that	O
can	O
be	O
called	O
by	O
user	O
code	O
with	O
)	O
.	O
</s>
<s>
In	O
the	O
raw	O
.NET	B-Application
paradigm	O
,	O
the	O
nondeterministic	O
destruction	O
model	O
overrides	O
the	O
protected	O
method	O
of	O
the	O
root	O
class	O
,	O
while	O
the	O
deterministic	O
model	O
is	O
implemented	O
through	O
the	O
interface	B-Application
method	O
(	O
which	O
the	O
C++	B-Language
/CLI	I-Language
compiler	O
turns	O
the	O
destructor	O
into	O
)	O
.	O
</s>
<s>
Objects	O
from	O
C#	B-Application
or	O
VB.NET	B-Language
code	O
that	O
override	O
the	O
Dispose	O
method	O
can	O
be	O
disposed	O
of	O
manually	O
in	O
C++	B-Language
/CLI	I-Language
with	O
just	O
as	O
.NET	B-Application
classes	O
in	O
C++	B-Language
/CLI	I-Language
can	O
.	O
</s>
<s>
Operator	O
overloading	O
works	O
analogously	O
to	O
standard	O
C++	B-Language
.	O
</s>
<s>
Every	O
*	O
becomes	O
a	O
^	O
,	O
every	O
&	O
becomes	O
an	O
%	O
,	O
but	O
the	O
rest	O
of	O
the	O
syntax	O
is	O
unchanged	O
,	O
except	O
for	O
an	O
important	O
addition	O
:	O
for	O
.NET	B-Application
classes	O
,	O
operator	O
overloading	O
is	O
possible	O
not	O
only	O
for	O
classes	O
themselves	O
,	O
but	O
also	O
for	O
references	O
to	O
those	O
classes	O
.	O
</s>
<s>
This	O
feature	O
is	O
necessary	O
to	O
give	O
a	O
ref	O
class	O
the	O
semantics	O
for	O
operator	O
overloading	O
expected	O
from	O
.NET	B-Application
ref	O
classes	O
.	O
</s>
<s>
(	O
In	O
reverse	O
,	O
this	O
also	O
means	O
that	O
for	O
.NET	B-Application
framework	O
ref	O
classes	O
,	O
reference	O
operator	O
overloading	O
often	O
is	O
implicitly	O
implemented	O
in	O
C++	B-Language
/CLI	I-Language
.	O
)	O
</s>
<s>
C++	B-Language
/CLI	I-Language
allows	O
C++	B-Language
programs	I-Language
to	O
consume	O
C#	B-Application
programs	O
in	O
C#	B-Application
DLLs	O
.	O
</s>
<s>
This	O
simple	O
example	O
requires	O
no	O
data	B-Application
marshalling	I-Application
.	O
</s>
<s>
The	O
C#	B-Application
source	O
code	O
content	O
of	O
MyCS.dll	O
.	O
</s>
<s>
This	O
examples	O
shows	O
how	O
strings	O
are	O
marshalled	O
from	O
C++	B-Language
strings	O
to	O
strings	O
callable	O
from	O
C#	B-Application
then	O
back	O
to	O
C++	B-Language
strings	O
.	O
</s>
<s>
String	O
marshalling	B-Application
copies	O
the	O
string	O
contents	O
to	O
forms	O
usable	O
in	O
the	O
different	O
environments	O
.	O
</s>
<s>
The	O
C#	B-Application
code	O
is	O
not	O
in	O
any	O
way	O
C++	B-Language
-aware	O
.	O
</s>
<s>
C++	B-Language
/C	O
#	O
interoperability	O
allows	O
C++	B-Language
simplified	O
access	O
to	O
the	O
entire	O
world	O
of	O
.NET	B-Application
features	O
.	O
</s>
<s>
C++	B-Language
/CX	I-Language
targeting	O
WinRT	O
,	O
although	O
it	O
produces	O
entirely	O
unmanaged	O
code	O
,	O
borrows	O
the	O
ref	O
and	O
^	O
syntax	O
for	O
the	O
reference-counted	O
components	O
of	O
WinRT	O
,	O
which	O
are	O
similar	O
to	O
COM	B-Application
"	O
objects	O
"	O
.	O
</s>
