C++ Programming - Inline or Macro

A function defined within the declaration of a class is inline by default. When no inline specifier is used, linkage will be external unless an inline definition appears before the first call.
Inline function should only have exactly one definition.



  • Expansion of Arguments can give weird result or compile time errors while using MACRO
  • MACROS has the ability to operate on any type of arguments.
  • Both MACROS and inlining has a problem that the callers of an inline/MACRO has to recompiled
  • Both exposes implementation details.

Labels:


About this entry