4 ms·
> "inline" is confusing in C++, as it is not really about inlining. Its purpose is to allow multiple definitions of the same function. No, its purpose was and
by ack_complete 2y ago
> "inline" is confusing in C++, as it is not really about inlining. Its purpose is to allow multiple definitions of the same function.
No, its purpose was and is still to specify a preference for inlining. The C++ standard itself says this:
> The inline specifier indicates to the implementation that inline substitution of the function body at the point of call is to be preferred to the usual function call mechanism.
https://eel.is/c++draft/dcl.inline https://eel.is/c++draft/dcl.inline