|
|
|
|
|
by o11c
906 days ago
|
|
You don't need multimethods per se, but you need something and `dynamic_cast` is usually easiest (and with reasonable restrictions, most efficient). Overloaded operators is a major category of problem here. The "which subclass (if any) is more derived" might be done by the compiler proper, but that still needs to use the cast internally. And of course if you ignore operator overloading, you're just pulling a Java and mandating extra verbosity; the user's problem still has to be solved the exact same way. (most other use cases for multimethods I don't find compelling) |
|
https://gcc.gnu.org/legacy-ml/gcc-patches/2009-07/msg01239.h...