next up previous contents index
Next: Scope Up: More About C++ Previous: References and Function Arguments   Contents   Index

Overloading

C++ provides ``overloading'': Multiple functions can be given the same name, so long as the number and/or type of their arguments differ. (It is not enough for the return types alone to differ. The compiler must be able to select a function from its calling syntax.) To the user, the appearance is that a single function intelligently handles multiple argument lists. Naturally, overloaded names should refer to functions that are conceptually related. Overloading tends to be most useful in library code; ePiX provides numerous plot functions, for instance.



Andrew D. Hwang 2004-09-04