If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using RSS
By the way, if you want static methods on generic classes, and easy way to get them is to create another static class with no type parameters.
<br>
<br>For example, on Set, you would have:
<br>public class Set<T> { ... }
<br>public static class Set {
<br>public static Set<T> Union<T>(Set<T> set0, Set<T> set1) {...}
<br>}
<br>This lets you type "Set.Union(" instead of "Set<T>.Union(" or "Set.Union<T>" because the compiler can infer the type of T.
<br>This is the approach that the framework designers used for Nullable<T>, and I think it's going to end up in the design guidelines for generics. I've seen mention of it in the SLAR. I've personally used the pattern in several places.
Oh, and I agree about the operator overloading. I don't like operator overloading on anything but types with value semmantics. Mutable types with operators can be confusing.
Is there a reason the forums don't seem to be sending out new post notifications?