Is there any advantage to using C++/CLI over either standard C++ or C#?

后端 未结 4 1967
你的背包
你的背包 2020-12-06 20:37

I\'m not seeing any real advantages, other than the fact that you have a C++ syntax, and with it, things like pointers and destructors.

4条回答
  •  一整个雨季
    2020-12-06 20:43

    If you're talking about why you would use C++/CLI over C#, I think the main reasons are that:

    1. it might be more natural for C++ developers (though I think this is probably not true)
    2. C++/CLI has very nice capabilities for bridging the native and managed environments (using the 'IJW' - It Just Works - technology)

    I think that Herb Sutter probably gives the best overview:

    A Design Rationale for C++/CLI

    If you want to know why you might want to use native C++ over C#/.NET, this boils down to why you would want a managed environment (safety, easier development) over native code (absolute control, possibly speed advantages). There are arguments for each, and the answer really depends on what you want to develop and what your market might be.

提交回复
热议问题