托管 C++ 和有什么区别?和 C++/CLI?
“旧”托管 C++ 和“新”C++/CLI 之间到底有什么区别?
What is exactly the difference between the "old" Managed C++ and the "new" C++/CLI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Managed C++是VS2002和VS2003中的版本。它有竞争条件和其他严重的错误,而且令人困惑。不再支持。
在VS2005中,微软引入了C++/CLI,它也被接受为ISO标准。 VS2008 和即将推出的 VS2010 也支持它。
他们都有相同的目标,即使用 C++ 语言创建 .NET 程序集。语法不同(C++/CLI 托管代码一眼就能与标准 C++ 区分开来),并且 C++/CLI 还具有适用于 .NET 2.0 功能(例如泛型)的语法。
Managed C++ is the version in VS2002 and VS2003. It had race conditions and other serious bugs, as well as being confusing. It's no longer supported.
In VS2005, Microsoft introduced C++/CLI, which has also been accepted as an ISO standard. It's also supported in VS2008 and the upcoming VS2010.
Both of them had the same goal, which is to create .NET assemblies using the C++ language. The syntax is different (C++/CLI managed code is a lot easier to differentiate from standard C++ at a glance) and C++/CLI also has syntax for .NET 2.0 features such as generics.
http://msdn.microsoft.com/en-us/library/ms235298.aspx 给出了语法变化的粗略概述。
http://msdn.microsoft.com/en-us/library/ms235298.aspx gives a rough overview of the syntax changes.
托管 C++(C++ 托管扩展)是一组 Microsoft 特定关键字,与标准 C++ 语法一起使用,以允许编译托管代码。 IT 的设计使程序员可以尽快开始使用 .NET,并使将本机代码移植到 .NET 平台变得非常容易。它使用 IJW(it just Works)原理,这使得编程移植到 .NET 变得更容易,但它也有很多缺陷。
C++/CLI 是一种新语言。它解决了托管 C++ 的许多问题,使 .NET 编程更加强大并被接受为标准,但也引入了新语法、新关键字,并且与旧托管 C++ 相比,它与非托管 C++ 的区别更大。
Managed C++ (Managed Extensions for C++) is a set of microsoft specific keywords used with standard C++ syntax to allow compile managed code. IT was designed such that programmers could start using .NET as fast as possible and made porting native code to .NET platform very easy. It used IJW (it just works) priciple, which made programming porting to .NET easier, but it also had lot of flaws.
C++/CLI is a new language. It solved lot of problems of Managed C++, made .NET programming more powerful and is accepted as standard, but also introduces new syntax, new keywords, and is more more different from unmanaged C++ than older Managed C++.