-
29May
2010 A few things you might not know about System.NullableThere 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 [...]
-
02Feb
2010 Double Dispatch – RTTI vs. Pure VtableAs 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: void c_rtti::foobar(a_rtti & a2) { c_rtti* c_ = dynamic_cast<c_rtti*>(&a2); if (c_) { ::foobar(*this,*c_); return; } [...]
-
01Feb
2010 Double dispatch without RTTII 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 [...]
-
11Dec
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 Design Patterns and Code Complete are on my “to read” list. It’s only that I trawl through StackOverflow a bit lately that I get to hear a lot of buzz about patterns and idioms. Some people [...]