3 ms·
I'm not so sure it is even a strong suggestion. Actually inline nowadays mostly has a semantic meaning - the symbol can be defined in multiple compilation units
by stkdump 5y ago
I'm not so sure it is even a strong suggestion. Actually inline nowadays mostly has a semantic meaning - the symbol can be defined in multiple compilation units without causing multiple definition errors from the linker. Usually you can't remove it without moving the definition from a header file to an implementation file.
Edit: it is correct though, that the inline keyword often is a neccessity to allow the compiler to inline in the first place. After all, the compiler can only inline a function at the callsite, when both are in the same translation unit. Either the function is only used in one translation unit, or it has to be defined as inline (or worse as hidden to the linker by static or anonymous namespace). Disregarding LTO, of course.