home *** CD-ROM | disk | FTP | other *** search
- Template functions are more robust than macros. The preprocessor
- directive #define can provide limited support for parameterized
- types. However, macro expansion can have undesirable
- side-effects. In this example, the value assigned to "i" is
- wrong, and the value of "k" or "j" is incremented twice. In
- addition, a macro does not check the types of its arguments.
- Template functions, on the other hand, check the types of their
- arguments.
-