What does 'inline' mean?

Atila Neves atila.neves at gmail.com
Tue Jun 9 11:31:18 UTC 2020


On Monday, 8 June 2020 at 23:19:55 UTC, Jonathan M Davis wrote:
> On Monday, June 8, 2020 8:09:04 AM MDT Manu via Digitalmars-d 
> wrote:
>> On Mon, Jun 8, 2020 at 8:20 PM Walter Bright via Digitalmars-d 
>> <
>> > C/C++ inline has always been a hint to the compiler, not a 
>> > command.
>>
>> It's not a hint at all. It's a mechanical tool; it marks 
>> symbols with internal linkage, and it also doesn't emit them 
>> if it's never referenced. The compiler may not choose to 
>> ignore that behaviour, it's absolutely necessary, and very 
>> important.
>
> It is my understanding that in C++, inline is a hint to the 
> compiler with regards to whether a particular function call is 
> actually inlined.

That's a common misconception, and one that exists due to that 
being its original intended purpose. But nowawadays? Nope:

https://en.cppreference.com/w/cpp/language/inline



More information about the Digitalmars-d mailing list