(Common Language Infrastructure
) is Microsoft
's language specification intended to supersede Managed Extensions for C++
. It is a complete revision that aims to simplify the older Managed C++ syntax (which is now deprecated). C++/CLI is standardized by Ecma
. It is currently available only in Visual Studio
2005, 2008 and 2010 (also included in the Express Editions).
C++/CLI should be thought of as a language of its own (with a new set of keywords, for example), instead of the C++ superset-oriented Managed C++
(MC++) (whose non-standard keywords were styled like <code>__gc</code> or<code> __value</code>). Because of this, there are some major syntactic changes, especially related to the elimination of ambiguous identifiers and the addition of .NET-specific features.
Many conflicting syntaxes, such as the multiple versions of operator <code>new()</code> in MC++ have been split: in C++/CLI, .NET reference types are created with the new keyword <code>gcnew</code>. Also, C++/CLI has introduced the concept of generics (conceptually similar to standard C++ templates, but quite different in their implementation).
In MC++, there were two different types of pointer
: <code>__nogc</code> pointers were normal C++ pointers, while <code>__gc</code> pointers worked on .NET reference types. In C++/CLI the only type of pointer is the normal C++ pointer, and the .NET reference... Read More