How can I check whether a struct has been instantiated? [duplicate]

A struct is a value type – it’s never null.

You can check against default(ProportionPoint), which is the default value of the struct (e.g. zero). However, for a point, it may be that the default value – the origin – is also a “valid” value.

Instead you could use a Nullable<ProportionPoint>.

Leave a Comment