safakgur/guard

NotDefault limited to struct

randygeyer opened this issue · 1 comments

Hi, I'm curious why you chose to limit NotDefault/Default to value types (struct)? I have a use case to guard against an uninitialized (null or default value) generic type parameter instance that can be either struct or class (e.g. String or Guid). C# default(T) is the exact semantics I need for both class and struct.

Is there a better way to do this than using default(T)?

Hi @randygeyer, I think it was an arbitrary decision we could revise with v2, but I'm retiring Guard - I apologise for any inconvenience, and thank you for all the support. The readme has details.