TypedReference的实际用途 [英] Practical uses of TypedReference
问题描述
有没有的<一个任何实际用途href="http://msdn.microsoft.com/en-us/library/system.typedreference.aspx"><$c$c>TypedReference$c$c>结构,你实际上在现实code使用?
修改:在.NET框架中使用它们 Console.WriteLine
和 String.Concat $的重载C $ C>它构建一个
__参数列表的
参数数组并把它传递到正常 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屋!