Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the advantages of C++/CLI (formerly "Managed C++") over standard C++?

The closest question I found in SO was this one, but the answers were really referring to advantages of C++/CLI over C#.

I need to understand the advantages of C++/CLI over standard C++.

like image 243
Android Eve Avatar asked Dec 26 '10 15:12

Android Eve


1 Answers

C++/CLI and Managed C++ (or Managed Extensions for C++) are two different things. Managed C++ is the previous version, and has some syntactical differences. It is also deprecated in favor of C++/CLI.

C++/CLI is an extension of ISO C++, so the comparison is moot. It allows writing code that will run on the CLR. As such, whether or not you want to use that extension depends on whether or not you need to write something in C++ that also needs to interface with a CIL language (C#, for instance).

For example, if you need to use a legacy library written in C or C++ within a .NET application, you can write a C++/CLI wrapper for it.

like image 141
Etienne de Martel Avatar answered Nov 16 '22 00:11

Etienne de Martel