* Jaspreet:
hack_tick wrote: Hi Guys!
Is function overloading a kind of static polymorphism?
I may be wrong but I suppose function templates is a case of static
polymorphism. Function over-loading is not considered a correct example
of static polymorphism. It (overloading) is sometimes termed as ad-hoc
polymorphism. Let the experts throw more light on it.
It all depends on what one means by "polymorphism", which depends on
context.
In the most general meaning, yes, although function overloading is not
enough by itself. It requires some templated client code in order to
deal with different types in the same source code way. But templated
code could not do different things in the same way with different types
if there was no function or operator overloading (or other mechanism).
In the most common very narrow meaning we do not even consider static
polymorphism, e.g. the standard's "polymorphic class" (def: §10.3/1).
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?