03
Nov
Inline functions & Macros comparision
Related Blog Items
- How can inline functions help with the tradeoff of safety vs. speed?
- Do inline functions improve performance?
- where to place inline keyword, in definition or declaration?
- C++ Advanced Tutorial - Lesson 6
- Using the auto_ptr concept in C++
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 - How can inline functions help with the tradeoff of safety vs. speed?
- Do inline functions improve performance?
- where to place inline keyword, in definition or declaration?
- C++ Advanced Tutorial - Lesson 6
- Using the auto_ptr concept in C++
Related Blog Items
- How can inline functions help with the tradeoff of safety vs. speed?
- Do inline functions improve performance?
- where to place inline keyword, in definition or declaration?
- C++ Advanced Tutorial - Lesson 6
- Using the auto_ptr concept in C++
No Comments
No comments yet.