Is C# a single dispatch or multiple dispatch language?

OK, I understood the subtle difference where function overloading is different from multiple-dispatch. Basically, the difference is whether which method to call is chosen at run-time or compile-time. Now, I know everybody’s said this, but without a clear example this sounds VERY obvious, given that C# is statically typed and multiple-dispatch languages (apparently to me, … Read more

Multiple dispatch in C++

Multi-dispatch is the ability to choose which version of a function to call based on the runtime type of the arguments passed to the function call. Here’s an example that won’t work right in C++ (untested): class A { }; class B : public A { }; class C : public A { } class … Read more