What is inlining?

前端 未结 10 1539
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 06:45

I am referring to this discussion. I have never written any code in C or in C++ . I do not have any CS background. However I have been working as Java developer for 5 years

10条回答
  •  旧巷少年郎
    2020-12-01 07:11

    Inline functions are used typically in C++ header files not Java. A C++ header file usually does not contain implemented code and is considered an interface to the cpp file of the same name, which does usually contain the implemented code. It is legal to include an inline function in a header file, usually a small lightweight function. Inline functions do come at a cost, so they should not be large memory-intensive operations. For small routines the performance hit is minimal and they are more used for convenience.

提交回复
热议问题