TheChaseMan's Frenetic SoapBox

Always looking for better ways to do things...

Generic Struct Constraint and Nullable Types

Abhinaba Basu's blog is quickly becoming one of my favorite subscriptions. Not just because of The Hitchhiker's Guide title reference either. There's an interesting “discussion” going on at C# 2.0: Generics, default(T) and compare to null weirdness. Specifically, I'm curious about the generic struct constraint and null checking versus Nullable types. I'm thinking that what looks obvious, might not be so obvious: a struct is far different than Nullable<T> and the CLR only knows about value type and not struct (try reflection). Either way, be sure to check it out.
Digg!

posted on Saturday, December 10, 2005 11:11 AM

Feedback

No comments posted yet.