NodaMoney icon indicating copy to clipboard operation
NodaMoney copied to clipboard

Why Currency is a struct, not class?

Open ultimaweapon opened this issue 3 years ago • 3 comments

Just wonder due to it hold a lot of fields, which will cause a large block of memory to copy whenever it got assigned a value.

ultimaweapon avatar Mar 18 '21 12:03 ultimaweapon

I think it makes sense, as it's in many ways a value that will be used instead of a Decimal.

gliljas avatar Apr 15 '21 07:04 gliljas

Seems like you misunderstood what I mean. I mean this one https://www.github.com/DynamicHands/NodaMoney/tree/master/src%2FNodaMoney%2FCurrency.cs, which is a struct to hold currency information.

ultimaweapon avatar Apr 15 '21 17:04 ultimaweapon

Indeed I did misunderstand/misread. Yes, that's a good question.

gliljas avatar Apr 15 '21 20:04 gliljas