-
I'm an functional programming beginner, but wonder why there is no readonly ref record struct, now that we got record structs in C# 10? Wouldn't that make for a powerful tool for FP in C# avoiding the cost of copying large structs/allocating record classes when doing recursion? Not sure if I'm missing something obvious here, but for now I'm trying readonly ref struct, although I loose the simplified declaration that records have. Or why doesn't structs have record style declaration as well? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
You don't need a |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
record struct S
implies implementingIEquatable<S>
.ref struct
s cannot implement interfaces.