0

I was told that inline function behaves in a similar way as Macro.

May I know whether there are any major differences between them?

One concern (but not limited to) is that inline is just a suggestion to compiler whereas it might not be executed. So I want to get to know the differences between the two. In case I have a long function that I would like to inline for sure, I could use Macro as alternative with caution.

user3791991
  • 129
  • 6
  • 1
    The `inline` keyword really has nothing to do with inlining functions. It's for allowing multiple identical definitions of that function. You should trust your compiler to inline functions when appropriate. Macros just plain suck when used as inline functions. The loss of scoping and pre-compilation replacement is not worth it. – chris Jul 14 '14 at 22:31
  • Macros - just say no! http://www.youtube.com/watch?v=D2nq8DzYToE – Skizz Jul 14 '14 at 22:32

0 Answers0