5 ms·
It may be a good summary, but I completely disagree with author's (implied) assertion that all these should be lumped under one term. All these concepts are dif
by obiterdictum 16y ago
It may be a good summary, but I completely disagree with author's (implied) assertion that all these should be lumped under one term. All these concepts are different in their mechanics, which is the reason we have different terminology to describe them. Just call overloading overloading. C++ does not need more ambiguity, it needs less.
- scott_s 16y agoI sympathize with your point, but I used to think of runtime and parametric polymorphism as two completely separate things. It wasn't until I heard them both described as a type of polymorphism that I realized the relationship between them.
- pkrumins 16y agoI never implied that they should lumped under one term. On the contrary. I wrote out all the meanings the term can have to disambiguate it.
- seliopou 16y agoThe blog post is titled "The Four Polymorphisms in C++."
- pkrumins 16y agoYes, the four polymorphisms you can find in C++. Am I missing something?
- dkarl 16y agoYou're missing the fact that "polymorphism" has an established meaning in C++ which excludes two of your examples. You're using a definition of polymorphism that is independent of C++ and applying it to C++, which is certainly a valid exercise, but you haven't bothered to tell us what your definition is or explain why it applies to each example. If I assume that by "polymorphism" you mean when a single name can be used to refer to different things, then consider the following: void foo(float f); int main() { foo(1); return 0; } What name is polymorphic here? I suppose you can say that foo is polymorphic if you attribute the coercion operation to foo, but that's not the way I think about it. foo is called after the coercion. The coercion is caused by the relation of the type of 1 with the type of the function parameter f. In your blog post it would have made things much clearer if you had acknowledged the conventional usage of the term in the context of C++ and explained the different definition you were using.
- deleted 16y ago[deleted]