
4 Jun
2010
4 Jun
'10
6:33 p.m.
On 4 June 2010 12:40, Bartlett, Roscoe A <rabartl@sandia.gov> wrote:
Okay, the runtime vs. compile-time polymorphism debate is another issue (but a very important one).
You can split the polymorphism situations into 2 types: 1) Those with consistent types and 2) Those that require different types For (2), runtime polymorphism doesn't work. For (1), it can be coded as static polymorphism, then a single type erasure layer can be easily written (with an abstract base "interface" class and an "implementation" class template) that adapts the static classes for dynamic polymorphism. So why wouldn't I just write everything as static, then apply the erasure layer at the level appropriate for my application, if needed?