What is wrong with using inline functions?

后端 未结 12 1270
滥情空心
滥情空心 2020-11-29 01:51

While it would be very convenient to use inline functions at some situations,

Are there any drawbacks with inline functions?

Conclusion:

12条回答
  •  执念已碎
    2020-11-29 02:01

    There is a problem with inline - once you defined a function in a header file (which implies inline, either explicit or implicit by defining a body of a member function inside class) there is no simple way to change it without forcing your users to recompile (as opposed to relink). Often this causes problems, especially if the function in question is defined in a library and header is part of its interface.

提交回复
热议问题