C++/CLI

From OSDev Wiki
Jump to: navigation, search

What is it?

C++/CLI is a .NET variant of the C++ language. It should be thought of variant of C++, rather than an extension (like Managed C++), because it breaks compatibility with some C++ code. Currently, C++/CLI compilers only come with Visual Studio from 2005 onwards.

Differences

The major features in C++/CLI that do not exist in C++ include the ^ symbol to signify a managed smart pointer, and the keyword gcnew to allocate managed memory.

Uses

C++/CLI is most often used as a bridging language between the native and .NET world, since you have access to both native C/C++ libraries and .NET assemblies. It is not uncommon to see an entire C++ library wrapped around in managed classes using managed pointers so they may be used in .NET assemblies.

It may be possible to run C++/CLI binaries, which have been compiled with the /clr:pure switch in Visual Studio (which signifies the assembly/binary contains no native code), under Mono.

Personal tools
Namespaces
Variants
Actions
Navigation
About
Toolbox