Ad hoc polymorphism: Difference between revisions

Content deleted Content added
m linking
Overloading: Attempt to use inline code for clarity
Line 34:
* In the last case, [[literal string|string]] concatenation must be invoked.
Thus, the name <code>+</code> actually refers to three or four completely different functions. This is an example of ''overloading''.
(Note the ambiguity in the string types used in the last case. Consider <code>"123" + "456"</code> in which the programmer might ''naturally'' assume addition rather than concatenation. They may expect "<code>579"</code> instead of <code>"123456"</code>. Overloading can therefore provide different meaning, or semantics, for an operation, as well as differing implementations.)
 
==References==