TypedReference的实际用途 [英] Practical uses of TypedReference

查看:502
本文介绍了TypedReference的实际用途的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有的<一个任何实际用途href="http://msdn.microsoft.com/en-us/library/system.typedreference.aspx"><$c$c>TypedReference结构,你实际上在现实code使用?

修改:在.NET框架中使用它们 Console.WriteLine String.Concat 它构建一个 __参数列表的参数数组并把它传递到正常 PARAMS 超载。为什么这些重载存在?

解决方案
  

有没有在TypedReference结构,你实际上在现实code使用的任何实际用途?

是的。我会使用他们,如果我需要用C风格的可变参数方法的互操作性。

  

为什么这些重载存在?

谁喜欢用C风格的可变参数方法的互操作性的存在与呼叫者。

Are there any practical uses of the TypedReference struct that you would actually use in real code?

EDIT: The .Net framework uses them in overloads of Console.WriteLine and String.Concat which build an array from an __arglist parameter and pass it to the normal params overload. Why do these overloads exist?

解决方案

Are there any practical uses of the TypedReference struct that you would actually use in real code?

Yes. I'd use them if I needed interoperability with C-style variadic methods.

Why do these overloads exist?

The exist for interoperability with callers who like to use C-style variadic methods.

这篇关于TypedReference的实际用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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