C++/CLI : Advantages over C#

前端 未结 11 2228
自闭症患者
自闭症患者 2021-01-05 00:54

Is there any major advantage of managed C++/CLI over C#. Definitely not the syntax I suppose as the following code in C++/CLI is real ugly,

C++/CLI code:

<         


        
11条回答
  •  一整个雨季
    2021-01-05 00:59

    CLI/C++ has many advantages over C#.

    1. STD libraries
    2. Native C++/C cannot be viewed by disassembler (like Reflector) because they are not actually CLI (no need to obfuscate (although a good hacker can already get by this)).
    3. Mingling C/C++ projects as a wrapper to be used with .Net languages. C++/CLI is not a language is just adds support for .Net with C/C++.
    4. Some bit of control on memory via C/C++ pointer pointing to C/C++ objects on the heap.

    I hate having to trust in GC to get to an object stuck on the gen 2. Lord knows when that will be released from the managed heap.

提交回复
热议问题