Inline function

Publicado em: 24 October 2014
no canal de: Audiopedia
3,807
5

An inline function is a function in C and C++ programming languages qualified with the keyword inline which tells the compiler to substitute the body of the function inline by performing inline expansion i.e. by inserting the function code at the address of each function call thereby saving the overhead of function invocation and return (register saving and restore) by avoiding a jump to a sub-routine. The keyword inline function is similar to a macro as the compiler places a new copy of the inline function in each place it is called. Inline functions run a little faster than the normal functions as function-calling-overheads are saved, however, there is a memory penalty. If an inline function is called 10 times, there will be 10 copies of the function inserted into the code. Hence inline functions are best for small functions that are called often. The member functions of a class, if defined within the class definition, are inlined by default (no need to use the inline keyword); otherwise, the keyword is needed. The compiler may ignore the programmer’s attempt to inline a function, mainly if it is particularly large.


This video is targeted to blind users.

Attribution:
Article text available under CC-BY-SA
Creative Commons image source in video


Nesta página do site você pode assistir ao vídeo on-line Inline function duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Audiopedia 24 October 2014, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 3,807 vezes e gostou 5 espectadores. Boa visualização!