Jump to content

Managed C++

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Curps (talk | contribs) at 08:44, 5 January 2006. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Managed C++ is one of Microsoft's new managed languages for their .NET initiative. Officially it is called Managed Extensions for C++ by Microsoft, but it is almost universally referred to by its shortened form.

Managed C++ is not a language unto itself, but, as its official name implies, extensions to the C++ language. It adds special syntax additions to the language to leverage the usual .NET language features also found in C# and Visual Basic .NET, such as garbage collection. "Managed" refers to that it is run in, or managed by, the .NET virtual machine that functions as a sandbox for enhanced security in the form of more runtime checks, such as buffer overrun checks. Additionally, applications written in Managed C++ compile to CIL — Common Intermediate Language — and not directly to native CPU instructions like regular C++ applications do.

Managed C++ occupies a unique position in the gallery of .NET languages. It is the only language that can communicate natively with .NET languages (such as C#, VB.NET) and native C++. The other .NET languages can only communicate with C++ code via COM, a rather slow and inefficient method. But since Managed C++ can communicate directly with both languages, it is often used as a "bridge" between the two languages. Therefore, it is often used to write wrappers for C# or C++ code bases which wish to communicate.

The Managed C++ extensions was significantly revised in Microsoft Visual Studio 2005, with both changes to the syntax and otherwise. To reflect these significant differences, the new revision was also renamed C++/CLI.

See also: Managed Extensions for C++