First, the introduction
C + + programmers react differently when Microsoft introduced Vs.net7 to implement extensible managed C + +. Although most programmers are relieved to be able to continue using C + +, almost everyone suffers from the arcane syntax provided by managed C + +. Microsoft clearly sensed from feedback that managed C + + was not so successful.
October 6, 2003, ECMA (European Computer Manufacturers Association) announced the formation of a group of experts responsible for the integration of ISO standard C + + and the common language, the development of an extensible language standards, the new extensible language is called the C++/CLI standard. This standard will be supported by the vs.net2005 C + + compiler.
The problems existing in the old grammar
1, the obscure grammar and grammar-these two "double bottom line" problem increased the burden of reading.
2. Second-rate CLI Support-provides CLI support relative to the use of inconvenient workspaces with C # and vb.net,mc++, for example, it does not have a one by one corresponding structure to enumerate. NET of the collection.
3, C + + and. NET rough combination-for CLI types, you can not use the characteristics of C + +, such as templates; Similarly, for C + + types, you cannot use the features of the CLI, such as a fragment collection.
4, confusing pointers--unmanaged C + + pointers and managed reference pointers all use the * syntax, which is confusing because the-GC pointer is fundamentally different from the managed pointer in essence and behavior.
5, the MFC compiler can not produce verifiable code.
What does C++/CLI offer us?
1, elegant and fluent grammar and grammar--c++/cli provides a very natural feeling for C + + developers to write managed code, and it provides an excessive smoothness of unmanaged code to managed code. The previously so-called "double bottom line" problem has now vanished.
2. The first class CLI supports--CLI features such as attributes, fragmentation sets, and generic classes that are directly supported, and C++/CLI also allows these features to be used for local unmanaged classes.
3. Class C + + classes support--c++ features such as templates and destructors continue to be effective for drag and drop tube classes. In fact, C++/CLI is one that you can "ostensibly" declare on a stack or C + + local heap. NET-type unique. NET language.