管理运营商的签名 [英] Signature for managed operators

查看:64
本文介绍了管理运营商的签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档说明了各种托管运营商的名称,但是没有为他们提供签名。是否有一些文件,我错过了b $ b错过了正确的签名?特别是我想为__value结构实现

op_Assign(=)运算符。

解决方案

Edward,

参见图2
http://msdn.microsoft.com/msdnmag/is...C/default.aspx


更完整的列表可以在公共语言基础设施

标准安装在\Program Files \ Microsoft Visual Studio .NET

2003 \SDK \v1.1 \Tool开发人员指南\ docs中在VS.NET 2003上。


对于打印副本,请参阅附加说明的公共语言基础结构

标准来自Addison Wesley的James S. Miller& Susann Ragsdale。


但是据我所知,它只是你需要的签名,你实际上将重载的运算符添加到你的类或结构中
compile会将正确命名的方法添加到程序集中。因为它需要

MetaData(SpecialName)中的一个特殊位,这样它们就不会与用户的命名空间冲突。在IL中设置。

错过了给出正确的签名?特别是我想
为__value结构实现op_Assign(=)运算符。
我在列表中看到op_Assign,但它是否受支持?


希望这有帮助

Jay


" Edward Diener" < ED ****** @ tropicsoft.com>在消息中写道

news:eh ************** @ TK2MSFTNGP12.phx.gbl ...文档说明了各种托管运营商的名称,但是
不给他们签名。是否有一些我错过的文件给出了正确的签名?特别是我希望
为__value结构实现op_Assign(=)运算符。



Jay B. Harlow [MVP - Outlook]写道:

Edward,
参见图2
http://msdn.microsoft.com/msdnmag/is...C/default.aspx

好文章。

更完整的列表可以在通用语言基础设施标准中找到。安装在\Program Files \ Microsoft /
Visual Studio .NET 2003 \SDK \v1.1 \Tool Developers Guide \ docs中在
VS.NET 2003.


这些.doc文件中的哪些信息?

对于打印的副本,请参阅公共语言基础设施注释
标准来自Addison Wesley的James S. Miller& Susann Ragsdale。

然而我明白它只是你需要的签名,你实际上将重载的操作符添加到你的类或结构中并且编译将正确添加命名方法到程序集。因为它需要MetaData(SpecialName)中的一个特殊位,以便它们不会与用户的命名空间冲突。在IL中设置。


我想为

__value和__gc结构和类实现赋值运算符和等号运算符,以便程序员可以使用语法

如:


-------------------------------- --------

AValue av;

AValue anv;


if(av == anv){ //等}}

av = anv;


AClass __gc * ac;

AClass __gc * anc;


if(* ac == * anc){// etc.}

* ac = * anc;

---- ------------------------------------


这是可以使用op_Equality(==)和op_Assign(=)?如果是这样,我怎么做b
,我的AValue或AClass类中的op_Equality(==)和op_Assign(=)

静态函数的签名是什么? ?


此外,还有一个虚拟的System :: Object Equals方法。我应该覆盖它并提供我自己的Equals实现吗?如果我在上面的

类中这样做,那么Equals意味着指针是否相等或者它是否相互确定

对象是否相等?文档对此非常模糊。


最后,复制构造函数如何。该文档说__gc或__value

类不能有一个。有这么好的理由吗?这似乎是一个非常奇怪的限制。

错过了给出正确的签名?特别是我想为__value结构实现op_Assign(=)运算符。


我在列表中看到op_Assign,但它是否受支持?

希望这有助于杰伊恩·哥德纳爱德华·迪纳 < ED ****** @ tropicsoft.com>在消息中写道
新闻:eh ************** @ TK2MSFTNGP12.phx.gbl ...

该文档说明了各种托管的名称运营商
但不给他们签名。是否有一些我错过的文档给出了正确的签名?
特别是我想为
__value结构实现op_Assign(=)运算符。



Edward,

这些.doc文件中的哪些信息?


分区I架构

9.3运营商超载。


您是否检查了目录?


希望这有帮助

Jay


" Edward Diener" < ED ****** @ tropicsoft.com>在消息中写道

news:ut ************* @ TK2MSFTNGP11.phx.gbl ... Jay B. Harlow [MVP - Outlook]写道:

爱德华,
参见图2
http://msdn.microsoft.com/msdnmag/is...C/default.aspx
好文章。


更完整的列表可以在通用语言基础设施标准中找到。安装在\Program Files \ MicrosoftMicrosoft Visual
Studio .NET 2003 \SDK \v1.1 \Tool Developers Guide \ docs中在VS.NET 2003上。



这些.doc文件中的哪些信息是什么?


对于打印的副本,请参阅 ;标注的公共语言基础设施
标准来自Addison Wesley的James S. Miller& Susann Ragsdale。

然而我明白它只是你需要的签名,你实际上将重载的操作符添加到你的类或结构中并且编译将正确添加命名方法到程序集。因为它需要MetaData(SpecialName)中的一个特殊位,以便它们不会与用户的命名空间冲突。在IL中设置。



我想为
__value和__gc结构和类实现赋值运算符和等号运算符,以便程序员可以使用语法
如:

------------------------------------- ---
AValue av;
AValue anv;

if(av == anv){// etc.}
av = anv;

AClass __gc * ac;
AClass __gc * anc;

if(* ac == * anc){// etc.}
* ac = * anc ;
----------------------------------------

使用op_Equality(==)和op_Assign(=)可以吗?如果是这样,怎么做



我这样做,以及我的AValue或AClass类中的op_Equality(==)和op_Assign(=)
静态函数的签名是什么?

此外,还有一个虚拟的System :: Object Equals方法。我应该覆盖它并提供我自己的Equals实现吗?如果我在上面的
类中这样做,那么Equals意味着指针是相等的还是它确实对象是相等的?该文档对此非常模糊。

最后,复制构造函数如何。该文档说__gc或__value
类不能有一个。有这么好的理由吗?这似乎是一个非常奇怪的限制。

错过了给出正确的签名?特别是我想为__value结构实现op_Assign(=)运算符。


我在列表中看到op_Assign,但它是否受支持?

希望这有助于杰伊恩·哥德纳爱德华·迪纳 < ED ****** @ tropicsoft.com>在消息中写道
新闻:eh ************** @ TK2MSFTNGP12.phx.gbl ...

该文档说明了各种托管的名称运营商
但不给他们签名。是否有一些我错过的文档给出了正确的签名?
特别是我想为
__value结构实现op_Assign(=)运算符。




The documentation states the names of the various managed operators but does
not give the signature for them. Is there some documentation which I have
missed that gives the correct signature ? In particular I want to implement
the op_Assign (=) operator for a __value struct.

解决方案

Edward,
See Figure 2 at
http://msdn.microsoft.com/msdnmag/is...C/default.aspx

A more complete list can be found in the "Common Language Infrastructure
Standard" installed in "\Program Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\Tool Developers Guide\docs" on VS.NET 2003.

For a printed copy see "The Common Language Infrastructure Annotated
Standard" from Addison Wesley by James S. Miller & Susann Ragsdale.

However I understand it is more then just the signature you need, you
actually add the overloaded operator to your class or structure and the
compile will add the properly named method to the assembly. As it requires
"a special bit in the MetaData (SpecialName) so that they do not collide
with the user''s namespace" to be set in the IL.

missed that gives the correct signature ? In particular I want to implement the op_Assign (=) operator for a __value struct. I see op_Assign on the list, however it is supported?

Hope this helps
Jay

"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:eh**************@TK2MSFTNGP12.phx.gbl... The documentation states the names of the various managed operators but does not give the signature for them. Is there some documentation which I have
missed that gives the correct signature ? In particular I want to implement the op_Assign (=) operator for a __value struct.



Jay B. Harlow [MVP - Outlook] wrote:

Edward,
See Figure 2 at
http://msdn.microsoft.com/msdnmag/is...C/default.aspx
Good article.

A more complete list can be found in the "Common Language
Infrastructure Standard" installed in "\Program Files\Microsoft
Visual Studio .NET 2003\SDK\v1.1\Tool Developers Guide\docs" on
VS.NET 2003.
Where in these .doc files is the information ?

For a printed copy see "The Common Language Infrastructure Annotated
Standard" from Addison Wesley by James S. Miller & Susann Ragsdale.

However I understand it is more then just the signature you need, you
actually add the overloaded operator to your class or structure and
the compile will add the properly named method to the assembly. As it
requires "a special bit in the MetaData (SpecialName) so that they do
not collide with the user''s namespace" to be set in the IL.
I want to implement an assignment operator and an equality operator for
__value and __gc structs and classes, so that programmers can use syntax
such as:

----------------------------------------
AValue av;
AValue anv;

if (av == anv) { // etc. }
av = anv;

AClass __gc * ac;
AClass __gc * anc;

if (*ac == *anc) { // etc. }
*ac = *anc;
----------------------------------------

Is this possible using op_Equality (==) and op_Assign (=) ? If so, how do I
do it, and what is the signature of the op_Equality (==) and op_Assign (=)
static functions in my AValue or AClass classes ?

Furthermore, there is a virtual System::Object Equals method. Should I
override that and provide my own Equals implementation ? If I do so for my
class above, does Equals mean that the pointers are equal or does it mesn
that the objects are equal ? The doc was really vague about this.

Finally, what about copy constructors. The doc says that a __gc or __value
class can not have one. Is there a good reason for this ? It seems like a
really odd limitation.

missed that gives the correct signature ? In particular I want to
implement the op_Assign (=) operator for a __value struct.


I see op_Assign on the list, however it is supported?

Hope this helps
Jay

"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:eh**************@TK2MSFTNGP12.phx.gbl...

The documentation states the names of the various managed operators
but does not give the signature for them. Is there some
documentation which I have missed that gives the correct signature ?
In particular I want to implement the op_Assign (=) operator for a
__value struct.



Edward,

Where in these .doc files is the information ?
Partition I Architecture
9.3 Operator Overloading.

Did you check the table of contents?

Hope this helps
Jay

"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:ut*************@TK2MSFTNGP11.phx.gbl... Jay B. Harlow [MVP - Outlook] wrote:

Edward,
See Figure 2 at
http://msdn.microsoft.com/msdnmag/is...C/default.aspx
Good article.


A more complete list can be found in the "Common Language
Infrastructure Standard" installed in "\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Tool Developers Guide\docs" on VS.NET 2003.



Where in these .doc files is the information ?


For a printed copy see "The Common Language Infrastructure Annotated
Standard" from Addison Wesley by James S. Miller & Susann Ragsdale.

However I understand it is more then just the signature you need, you
actually add the overloaded operator to your class or structure and
the compile will add the properly named method to the assembly. As it
requires "a special bit in the MetaData (SpecialName) so that they do
not collide with the user''s namespace" to be set in the IL.



I want to implement an assignment operator and an equality operator for
__value and __gc structs and classes, so that programmers can use syntax
such as:

----------------------------------------
AValue av;
AValue anv;

if (av == anv) { // etc. }
av = anv;

AClass __gc * ac;
AClass __gc * anc;

if (*ac == *anc) { // etc. }
*ac = *anc;
----------------------------------------

Is this possible using op_Equality (==) and op_Assign (=) ? If so, how do


I do it, and what is the signature of the op_Equality (==) and op_Assign (=)
static functions in my AValue or AClass classes ?

Furthermore, there is a virtual System::Object Equals method. Should I
override that and provide my own Equals implementation ? If I do so for my
class above, does Equals mean that the pointers are equal or does it mesn
that the objects are equal ? The doc was really vague about this.

Finally, what about copy constructors. The doc says that a __gc or __value
class can not have one. Is there a good reason for this ? It seems like a
really odd limitation.

missed that gives the correct signature ? In particular I want to
implement the op_Assign (=) operator for a __value struct.


I see op_Assign on the list, however it is supported?

Hope this helps
Jay

"Edward Diener" <ed******@tropicsoft.com> wrote in message
news:eh**************@TK2MSFTNGP12.phx.gbl...

The documentation states the names of the various managed operators
but does not give the signature for them. Is there some
documentation which I have missed that gives the correct signature ?
In particular I want to implement the op_Assign (=) operator for a
__value struct.




这篇关于管理运营商的签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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