What does 'inline' mean?

Walter Bright newshound2 at digitalmars.com
Mon Jun 8 10:23:06 UTC 2020


On 6/8/2020 1:42 AM, evilrat wrote:
> Sorry for sticking in my nose, but in result inline in C++ simply tells the 
> linker "this symbol could be present multiple times, just pick whichever one of 
> them and done with it" so it won't complain about multiple symbols anymore.
> And that's why you have to slap inline to functions that have body in header in 
> order to build.

You're right that the linker expected to combine multiple copies into one.

A more advanced linker will remove unreferenced functions.


More information about the Digitalmars-d mailing list