C#2.0泛型 [英] C# 2.0 Generics

查看:60
本文介绍了C#2.0泛型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我假设2.0将推出VS.NET 2004.有人知道是否

MS计划用它发送STL包吗?

I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know if
MS is planning to ship an STL package with it?

推荐答案

查克,


虽然我不能肯定地说,我会怀疑它。在泛型和模板之间有许多不同的东西,其中一些是在STL中实现的,而不能用泛型来实现。因为这个单独的
,我认为在发布仿制药时不会发生这种性质的事情




希望这会有所帮助。


-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" Chuck Bowling" < CH ********** @ sbcglobal-NO-SPAM.net>在消息中写道

新闻:Oj ************** @ TK2MSFTNGP09.phx.gbl ...
Chuck,

While I can not say for sure, I would doubt it. There are a number of
things that differ between generics and templates, some of which are
implemented in STL which can not be implemented with generics. Because of
this alone, I would think that there wouldn''t be something of this nature
distributed when generics is released.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chuck Bowling" <ch**********@sbcglobal-NO-SPAM.net> wrote in message
news:Oj**************@TK2MSFTNGP09.phx.gbl...
我认为2.0会用VS.NET 2004推出。如果MS计划用它发送STL包,有人知道
吗?
I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know if MS is planning to ship an STL package with it?



>虽然我不能肯定地说,但我会怀疑它。有许多
> While I can not say for sure, I would doubt it. There are a number of
在泛型和模板之间有所不同的东西,其中一些在STL中实现,无法用泛型实现。因为单凭这个,我认为在发布仿制药时不会发布这种性质的东西。
things that differ between generics and templates, some of which are
implemented in STL which can not be implemented with generics. Because of
this alone, I would think that there wouldn''t be something of this nature
distributed when generics is released.




它取决于你的意思你有资格作为stl?如果他只是提到

模板集合,那么Microsoft正在向System.Collections.Generic命名空间中的

基类库中添加泛型集合。包括

字典,列表,队列和堆栈的通用版本。虽然

名称\ namespaces可能会在发布之前发生变化,但会有genric

集合。


n!



It depends on what you mean you qualify as stl? If he''s just referring to
templated collections, then Microsoft are adding generic collection to the
base class library in the System.Collections.Generic namespace. Including
generic versions of Dictionary, List, Queue and Stack. Though the
names\namespaces may change before release, there will be genric
collections.

n!


查克,


没有像C#Generics这样的东西,有(将)Generics

for .NET。

这意味着.NET Generics是跨语言而STL喜欢模板

是特定于语言的。

模板实例是编译时生成/专用的,一旦发布到

一个程序集模板不再存在,这意味着:

- 你无法实例化模板另一个程序集(MSIL代码

库)。

- 每种语言都需要自己的模板源代码包。


如果你真的需要STL支持,我建议你看看

即将发布的C ++ CLI,这个版本将支持

混合模式程序集中的模板和泛型,

威利。

" Chuck Bowling" < CH ********** @ sbcglobal-NO-SPAM.net>在消息中写道

新闻:Oj ************** @ TK2MSFTNGP09.phx.gbl ...
Chuck,

There is no such a thing like "C# Generics", there are (will be) Generics
for .NET.
That means that .NET Generics are cross-language while STL like Templates
are language specific.
Template instances are compile-time generated/specialized, once emitted to
an assembly the template ceases to exist, that means:
- that you can''t instantiate a template from another assembly (MSIL code
library).
- that each language would need his own template source code package.

If you really need STL support, I would suggest you take look at the
upcoming C++ CLI, this version will support both Templates and Generics in
mixed mode assemblies,

Willy.
"Chuck Bowling" <ch**********@sbcglobal-NO-SPAM.net> wrote in message
news:Oj**************@TK2MSFTNGP09.phx.gbl...
我认为2.0会用VS.NET 2004推出。如果MS计划用它发送STL包,有人知道
吗?
I assume that 2.0 will be rolled out with VS.NET 2004. Does anybody know if MS is planning to ship an STL package with it?



这篇关于C#2.0泛型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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