As explained in this document:
Is there still a use for inline?
So, what is the actual purpose of the inline keyword? It's simple: a function marked inline can be defined in more than one translation unit without violating the One Definition Rule (ODR). Imagine these two files:
but using inline in this way has a problem as explained in this document:
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_71/rzarg/inline_linkage.htm
Redefining an inline function with the same name but with a different function body is illegal; however, the compiler does not flag this as an error, but simply generates a function body for the version defined in the first file entered on the compilation command line, and discards the others.
Is there a way that I can define a function in the header file and use it in multiple translations and if I accidentally redefine a function twice with two different function body, the compiler can generate an error? (assuming that all functions are inside the same namespace)
Is there any plan to have such keyword in further versions of C++
Edit
I already saw the answer that set as duplicate, but that question did not refer to issue that IBM reported on using inline functions. The duplicate explained that now a day, inline is used for preventing multi-translation, which I also referred in my question, but there is no reference to the problem that it generates.