home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH15 / A15107.TXT < prev    next >
Encoding:
Text File  |  1993-09-29  |  450 b   |  9 lines

  1. Template functions are more robust than macros.  The preprocessor
  2. directive #define can provide limited support for parameterized
  3. types.  However, macro expansion can have undesirable
  4. side-effects.  In this example, the value assigned to "i" is
  5. wrong, and the value of "k" or "j" is incremented twice.  In
  6. addition, a macro does not check the types of its arguments.
  7. Template functions, on the other hand, check the types of their
  8. arguments.
  9.