You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm fairly certain there is not. C# structs being zero-initialized in a number of cases seems deeply ingrained in the language. I also think this is a bad design choice.
Even following #1783, the following value type:
can be constructed in an invalid state, e.g. by using
ValueType v = default;
Following
v.string_member = "...";
resulting reads will result in garbage being read.A remedy could be a variable to track whether the object was initialized and if not initializing it whenever any operation is called on it.
The text was updated successfully, but these errors were encountered: