Cook Computing

Bertrand Meyer is also a

May 8, 2002 Written by Charles Cook

Bertrand Meyer is also a bit confused about what Managed C++ is (see earlier postings here). In his article Polyglot Programming he writes:

C++ typifies the Procrustean solution: Make the language fit the model. To be more precise, on .NET, the name "C++" denotes not one language, but two: Unmanaged and Managed C++. Classes from both languages can coexist in an application: Any class marked __gc is managed; any other is unmanaged. The unmanaged language is traditional C++, far from the object model of .NET; unmanaged classes will compile into ordinary target code (such as Intel machine code), but not to the object model. As a result, they don't benefit from the Common Language Runtime and lack the seamless interoperability with other languages. Only managed classes are full .NET players.

Unmanaged classes do not compile into machine code when compiling an application with the /clr switch. They are not managed on the .NET garbage-collected heap but they certainly compile to IL. Again the difference between managed code and managed types. Write a simple program and run ILDASM on it to see what I mean.