3 ms·
While this is often a good rule of thumb, occasionally it's useful to extract a function just to make the inputs clear for a complicated calculation. Particular
by skybrian 6y ago
While this is often a good rule of thumb, occasionally it's useful to extract a function just to make the inputs clear for a complicated calculation. Particularly when it has few inputs and they are unlikely to change.
- tobias3 6y agoWith modern C++ you could do this with a lambda
- blattimwind 6y agoWhich compiler that can compile modern C++ doesn't always inline a static single-caller function?
- Hydraulix989 6y agoAll of them? There's many cases where it doesn't make sense: - The function is exported to a library - The code generator emitted an indirect branch instruction - The inlined code exceeds the size of a single page in memory - The inlined code does not perform as well because it is not i-cacheable