Typedef等效于.NET [英] Typedef Equivalent in .NET

查看:88
本文介绍了Typedef等效于.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我们在.NET中有什么东西相当于C ++的Typedef。


问候,

Vasanth

Hi All,

Do we have anything in .NET which is equivalent to C++''s Typedef .

Regards,
Vasanth

推荐答案

我们在.NET中有什么东西相当于C ++' 's typedef。
Do we have anything in .NET which is equivalent to C++''s Typedef .




不在VB.NET中,没有。最接近的是你可以做的事情


导入SomeAlias = SomeType


然后使用SomeAlias而不是SomeType。但与typedef相比,这是非常有限的




Mattias


-

Mattias Sj?gren [MVP] mattias @ mvps.org
http ://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com

请回复到新闻组。



Not in VB.NET, no. The closest thing is that you can do

Imports SomeAlias = SomeType

and then use SomeAlias instead of SomeType. But that''s pretty limited
compared to typedef.

Mattias

--
Mattias Sj?gren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.


谢谢。它可以工作,但正如你所说它仅限于声明的文件

声明。


如果你还有其他方法来实现这一点,请参阅让我知道。


我试图为所有原始数据类型创建包装类,但

因为vb.net不支持运算符重载,我无法使用它。

即使支持我也必须使用''new''关键字来声明任何

变量。这又是一个问题。


Vasanth


" Mattias Sj?gren" <毫安******************** @ mvps.org>在消息中写道

news:ua ************** @ TK2MSFTNGP12.phx.gbl ...
Thanks. It works, but as you said it is restricted to the file where it is
declared.

If you have anyother round about way to achieve this, pls let me know.

I was trying to create wrapper classes for all the primitive datatypes, but
as vb.net doesn''t support operator overloading, i was not able to use it.
Even if it supports i will have to use ''new'' keyword for declaring any
variables. That is again a problem.

Vasanth

"Mattias Sj?gren" <ma********************@mvps.org> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
我们在.NET中有什么东西相当于C ++的Typedef。
Do we have anything in .NET which is equivalent to C++''s Typedef .



不在VB.NET中,没有。最接近的是你可以做到

导入SomeAlias = SomeType

然后使用SomeAlias而不是SomeType。但与typedef相比,这相当有限。

Mattias

-
Mattias Sj?gren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
请仅回复新闻组。



Not in VB.NET, no. The closest thing is that you can do

Imports SomeAlias = SomeType

and then use SomeAlias instead of SomeType. But that''s pretty limited
compared to typedef.

Mattias

--
Mattias Sj?gren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.



" vvv" <所以***** @ microsoft.com> schrieb
"vvv" <so*****@microsoft.com> schrieb
我试图为所有原始的
数据类型创建包装类,但由于vb.net不支持运算符重载,我无法使用它。即使它支持我也必须使用''new''
关键字来声明任何变量。这又是一个问题。
I was trying to create wrapper classes for all the primitive
datatypes, but as vb.net doesn''t support operator overloading, i was
not able to use it. Even if it supports i will have to use ''new''
keyword for declaring any variables. That is again a problem.




出于兴趣:为什么需要它?到目前为止我既不需要typedef也不需要运算符

重载。

-

Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html



Out of interest: Why do you need it? Neither I needed typedefs nor operator
overloading so far.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


这篇关于Typedef等效于.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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