Can I selectively (force) inline a function?

后端 未结 6 559
执念已碎
执念已碎 2020-12-28 13:46

In the book Clean Code (and a couple of others I have come across and read) it is suggested to keep the functions small and break them up if they become large. It also sugge

6条回答
  •  一整个雨季
    2020-12-28 14:22

    You cannot force the inline. Also, function calls are pretty cheap on modern CPUs, compared to the cost of the work done. If your functions are large enough to need to be broken down, the additional time taken to do the call will be essentially nothing.

    Failing that, you could ... try ... to use a macro.

提交回复
热议问题