There is plenty of information about Nullable<T> type out there and how to use it. There are, however a few tidbits that are not quite as obvious at first glance. Nullable is a value type It’s a struct that can be null. The only reason why int? intVal = null; compiles is because C# compiler [...]
2010 Double Dispatch – RTTI vs. Pure Vtable
As Jeremy Clarkson would say, I have been inundated with a request to performance test a dynamic_cast DD mechanism against the pure vtable one. The results surprised me, both in Debug and Release modes. So here is the dynamic_cast implementation: I have used the most non-trivial case where the above function is called with a2 [...]
2010 Double dispatch without RTTI
I liked my StackOverflow answer so much that I decided to make it into a blog post. The question was how to implement a double dispatch mechanism for subclasses of one base class without casting. After dismissing the question as stupid, I spent a bit of time trying to come up with a solution that [...]
2009 Shouldn’t RAII should be RDID???
I will openly plead ignorance for design patterns. I know this is really not the way to be and I have Design Patterns and Code Complete on my “to read” list. It’s only that I trawl through StackOverflow, I get to hear a lot of buzz about patterns and idioms. Some people get really obsessive [...]