Home

ref struct Dump extensions

No dump extensions for ref structs has been derinde for dump

Would it be possible to add extension with signature:
public static ref T Dump(ref this T v) where T:struct

?

Comments

  • I don't believe this is possible: ref structs can't be used as type arguments.

    LINQPad 6.5.x has specific Dump overloads for Span and ReadOnlySpan, which is why you can dump those types.

  • Well, 2022 now and perhaps 'ref struct' is becoming more mainstream now with all the emphasis on dotnet core 6.0 and performance? I found this forum post precisely because I tried to dump a custom ref struct and scratched my head because I knew Linqpad would dump ReadOnlySpan!

    Made me chuckle that you added specific overloads for Span and ReadOnlySpan...

Sign In or Register to comment.