Question

Would a C++ CLI compiler be able to compile some large sets of C++ classes without modifications?

Is C++ CLI a superset of C++?

Was it helpful?

Solution

technically no, but depending how standard the C++ code is, you'll probably be just fine. when you get into windows stuff you may run into issues. I compiled the whole game engine we use at work in C++/CLI once and it worked just fine. A colleague did the same for all of mozilla and no such luck.

OTHER TIPS

According to Wikipedia:

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++

I'm still new with my learning curve on C++/CLI -- but I've had the same question myself, and what I've determined so far is that C++/CLI is, as a language, a superset of standard C++.

If you don't use the CLI extensions, your C++ code will end up as native unmanaged code, and should be essentially the same, but compiled to the CLR IL, instead of native x86.

Once you start using the CLI extensions (and start falling into the use of objects/handle/managed classes), you start interacting with the underlying CLR platform more heavily. At that point, it essentially becomes a new "language", and you'll have to separate your thinking between the "unmanaged" side and the "managed" side.

C++/CLI is not a superset of C++. It rather is a subset with additions. E.G. C++/CLI does not support multiple inheritance.

Angelo

Page 3 of Marcus Heege's book 'Expert C++/CLI.NET for Visual C++ Programmers' states:

C++/CLI is a set of extensions made to the C++ language to benefit from the services that an implementation of the CLI offers.

And further down the same page:

C++/CLI is a superset of the C++ language.

His excellent book is available for free from here.

I was able to compile whole Qt library (which is huge) as C++/CLI with minor modifications (mostly in the build environment, but also fixed one bug in Qt source code)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top