请描述您使用Microsoft C ++ / CLI的经验 [英] Please, describe you experience of using Microsoft C++/CLI

查看:152
本文介绍了请描述您使用Microsoft C ++ / CLI的经验的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C ++ / CLI是非常强大的语言。它是唯一的CLR语言,您可以无缝地组合托管代码和非托管代码。有多少软件开发人员(在本网站上)使用这种语言?你在使用什么样的项目?它是适应遗留代码还是创建原始软件?你能比较旧的托管C ++与新的C ++ / CLI?你对C ++ / CLI的当前质量和未来有什么看法?

C++/CLI is very powerful language. It's the only CLR language where you can seamlessly combine managed and unmanaged code. How many software developers (on this site) are using this language? In what kind of projects do you use it? Is it an adapting of legacy code or creation of an original software? Can you compare old Managed C++ with new C++/CLI? What do you think about the current quality and about the future of C++/CLI?

推荐答案

托管代码和本地代码之间的集成层。

I've used it to write thin layers of integration between managed and native code. That's all though.

它最有名的独特功能是能够无缝地挖掘非托管代码,并修改(或意外损坏)整个可写内存的任何位过程 - 这不是一般编程的优势,但当你需要它,它是伟大的。但我想我越来越需要它。

The best known unique feature of it is the ability to seamlessly delve into unmanaged code and modify (or accidentally corrupt) any bit of writeable memory in the entire process - that's not an advantage in general programming, but when you need it, it's great. But I think I'm going to need it less and less. You can compile C++/CLI with a /pure flag, but then it really becomes a completely new language.

还有另外两个非常独特的特性:

There are two other big unique features though:


  • 有用的析构函数。在C#中,析构函数是终结器。在C ++中,它是一个适当的确定性称为析构函数。这意味着C ++ / CLI具有使用 IDisposable 的最完整的基础结构。 C#只帮助客户端(通过 using 语句),但只有C ++ / CLI才能帮助实现者。我希望可能有一天C#会吸收这个功能。

  • Destructors that do something useful. In C# a destructor is a finalizer. In C++ it is a proper deterministically-called destructor. This means that C++/CLI has the most complete infrastructure for working with IDisposable. C# only helps clients (through the using statement), but only C++/CLI helps implementors as well. I'm hopeful that perhaps one day C# will absorb this feature.

Duck-typing模板,可以和CLI泛型一起使用。

Duck-typing templates, which can be used along with CLI generics. Another thing that would be very useful in C#, although it could be made a lot more seamlessly without the historical baggage.

但是C#是足够好,没有最后两件事情,我不想诱使使用C ++ / CLI一般。

But C# is good enough without the last two things that I'm not tempted to use C++/CLI generally.

这篇关于请描述您使用Microsoft C ++ / CLI的经验的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆