如何在新的C ++ / CLI语法中执行__typeof(__ box MyValueType)? [英] How do I do __typeof(__box MyValueType) in the new C++/CLI syntax ?

查看:62
本文介绍了如何在新的C ++ / CLI语法中执行__typeof(__ box MyValueType)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


推荐答案

嗨伯尔尼,
Hi Bern,

>我该如何做__typeof (__box MyValueType)在新的C ++ / CLI语法中?
>How do I do __typeof(__box MyValueType) in the new C++/CLI syntax ?



由于新的C ++ / CLI没有使用__box关键字来进行拳击,我是害怕b / b
似乎不存在一对一翻译,我的想法是

以下:


((MyValueType ^)MyValueTypeVar) - > GetType()

谢谢!


祝你好运,

Gary Chang

Microsoft在线社区支持
============================================= =====

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。


注意:MSDN托管新闻组支持服务是针对非紧急问题

如果社区或微软支持人员在1个工作日内做出初步回复是可以接受的。请注意,每个跟随

的响应可能需要大约2个工作日作为支持

专业人士与您合作可能需要进一步调查才能达到

最有效的分辨率。该产品不适用于需要紧急,实时或基于电话的交互或复杂的b $ b项目分析和转储分析问题的情况。这种性质的问题最好通过联系

Microsoft客户支持服务(CSS)处理
href =http://msdn.microsoft.com/subscriptions/support/default.aspx\"target =_ blank> http://msdn.microsoft.com/subscripti...t/default.aspx

======================================== ==========

此帖子按原样提供。没有保证,也没有授予任何权利。

Since the new C++/CLI doesn''t use the __box keyword to do the boxing, I am
afraid there seems not existed an one to one translation, my idea is as the
following:

((MyValueType^)MyValueTypeVar)->GetType()
Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


嗨加里!
Hi Gary!

>如何在新的C ++ / CLI语法中执行__typeof(__ box MyValueType)?
>How do I do __typeof(__box MyValueType) in the new C++/CLI syntax ?



由于新的C ++ / CLI没有使用__box关键字来进行拳击,我是害怕b / b
似乎不存在一对一翻译,我的想法如下:


((MyValueType ^)MyValueTypeVar) - > GetType()


Since the new C++/CLI doesn''t use the __box keyword to do the boxing, I am
afraid there seems not existed an one to one translation, my idea is as the
following:

((MyValueType^)MyValueTypeVar)->GetType()



" - > GetType()"和__ typeof是

" - > GetType()"需要一个对象的实例,而__ typeof需要一个对象的实例。没有。


因此相当于__ typeof在C ++ / CLI中是:: typeid。


请参阅:typeof转到T :: typeid
http://msdn2.microsoft.com/en-us/lib...60(VS。 80).aspx


问候

Jochen

The difference between "->GetType()" and "__typeof" is that
"->GetType()" requires an instance of an object while "__typeof" does not.

Therefor the equivalent of "__typeof" in C++/CLI is "::typeid".

See: typeof Goes to T::typeid
http://msdn2.microsoft.com/en-us/lib...60(VS.80).aspx

Greetings
Jochen


感谢您的建议, Jochen。


所以等价的表达式可能是:


MyValueType :: typeid

祝你好运,


Gary Chang

Microsoft在线社区支持

================== ================================

通过电子邮件收到我的帖子通知?请参阅
http://msdn.microsoft .com / subscripti ... ult.aspx#notif

ications。

================ ==================================

此帖子提供按现状 ;没有保证,也没有授予任何权利。

Thanks for the suggestion, Jochen.

So the equivalent expression could be:

MyValueType::typeid
Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


这篇关于如何在新的C ++ / CLI语法中执行__typeof(__ box MyValueType)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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