N
not_a_commie
A method parameter declared as "const ref" would allow for passing
large structs quickly and enforce that the struct does not get
reassigned. I know there was concern before about the inability of
such a device to enforce that the members don't get set. I don't care
about that. Let them assign the members (all of which I've declared
readonly.) I've started making most of my structs immutable. They're
just so nice to use that way. I just wish that I could pass them into
methods without such a hard hit and at the same time avoid the fear
that my coworkers might reassign them without my permission.
large structs quickly and enforce that the struct does not get
reassigned. I know there was concern before about the inability of
such a device to enforce that the members don't get set. I don't care
about that. Let them assign the members (all of which I've declared
readonly.) I've started making most of my structs immutable. They're
just so nice to use that way. I just wish that I could pass them into
methods without such a hard hit and at the same time avoid the fear
that my coworkers might reassign them without my permission.