C#4.0 brings optional parameters, which I’ve been waiting for for quite some time. However it seems that because only System types can be const, I cannot use any class/struct which I have created as an optional parameter.
Is there a some way which allows me to use a more complex type as an optional parameter. Or is this one of the realities that one must just live with?
The best I could come up with for reference types was:
You can use the same idea for structs by making the parameter nullable: