Content deleted Content added
→Example: Remove subheading that interrupts flow (revert if inappropriate) |
→Example: + link to operator overloading as this is directly related to the example |
||
Line 31:
* In the fourth and fifth cases, [[List (computing)|list]] [[concatenation]] must be invoked.
* 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 (programming)|overloading]]'' or more specifically, ''[[operator 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.
|