有没有的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.