Search

Sponsored Links

Meta

Categories

Archives

Recent Posts

RSS Feeds

03
Nov

Inline functions & Macros comparision

Related Blog Items

Inline functions :

 

 

  • processed at compile time
  • Its just a hint to comiler, compiler may ignore if it found code is not suitable for inlining
  • no side affects
  • easy to understand
  • type checking applied to function args
  • If u are trying to take address of a inline function, inlining will be ignored by compiler
  • If ur inlined code contains complex loops and all, inlining will be ignored
  • Ignoring inlining depends on comiler

 

Macros :

  • processed at preprocessor stage
  • produce unknown side affects
  • not that easy to understand
  • no type checking appiled for function args

 

Are macros useless

U can pass any type of argument to a macro (which can be achieved by using templates)

[tags]inline functions, macros, macros inline function comparison, macros inline functions which is better, inline functions explained[/tags]

Popularity: 5%

You need to log on to convert this article into PDF


Related Blog Items

No Comments

No comments yet.

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-spam image