Closed kgreen24 closed 6 years ago
That all looks really good. Thanks for this addition, Kevin.
In updating the wiki for this, I feel it better to rename this method to HasValueOf<T>
, as it just seems to fit the naming conventions of SuccincT better (very subjective). Do you have any strong objections to this? If not, I'll update the code and go with that name.
No strong opinion, the motivation on my end for HasValue
Add a method HasValue to unions. This allows for imperative checking that the union's selected case is of a certain type without having to reference Case1, Case2, etc... Also avoids using exceptions for control flow.