Follow

Thinking about a conference talk on non-virtual polymorphism. I did an article on Medium with the overload pattern so I have the material. But the definition of "polymorphism" is slippery. For example, is function overloading polymorphism? I don't think so but if polymorphism is type-based dispatch it kind of fits. 🤔 🤔

Any thoughts?

Based on the comments here and another private one, I'll accept that function overloading and similar techniques are polymorphism. That defines the term as "type-based dispatch", or, in more C++ terms, "type-based invocation". I can work with that. The main focus will be on the override pattern, CRTP, and other approaches I've yet to discern.

@rmerriam I'd say yes. Things like overloaded functions and operator overloading are compile time polymorphism, they get resolved at compilation time.
Meanwhile things like virtual functions are runtime polymorphisms, as they can only be resolved at runtime.

@rmerriam in my (C++) teaching function overloading and templates are static (compile-time) polymorphism

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.