views:

121

answers:

1

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?

+4  A: 

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.

Eric Lippert
+1 for not slamming the C-style varidiac bits :) And here's to hope you'll have variadic templates (not generics) by 5.0.
rama-jka toti