-
[C++] inlineNote/C C++ 2022. 3. 4. 16:23
https://stackoverflow.com/questions/8885665/c-pointer-to-inline-function
C: Pointer to inline function
I have a static inline function defined in an H file, and at one point in a C file, I'm assigning a pointer to the function, something like this: foo.h: static inline void frobnicate(void) { //
stackoverflow.com
======================================
Remember that inline is only a suggestion to the compiler
=======================================Inline calls are not as powerful as you might think.
This is a good discussion
http://www.parashift...-functions.html
The most important thing to be aware of is that a request to have the compiler inline something is not always going to be respected.
Also a good compiler will inline things even if you don't ask for it if they can see inline would be a good idea.
There are several ways to designate that a function is inline, some of which involve the inline keyword, others do not. No matter how you designate a function as inline, it is a request that the compiler is allowed to ignore: it might inline-expand some, all, or none of the calls to an inline function.
So they are less different to 'normal' functions than it is possible you might think they are.'Note > C C++' 카테고리의 다른 글
[C++] override와 virtual function (0) 2022.03.05 [C++] 조건문 최적화 (0) 2022.03.05 [C++]0x 중 rvalue reference[링크][퍼옴] (0) 2022.03.04 [C++] Return value optimization (RVO) (링크) (0) 2022.03.01 [C++]ftell() – ftello() — 현재 위치 얻기 (0) 2022.02.11