<div dir="ltr"><div dir="ltr">On Wed, Jun 10, 2020 at 9:30 AM Manu <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">On Wed, Jun 10, 2020 at 7:15 AM Walter Bright via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 6/9/2020 4:31 AM, Atila Neves wrote:<br>
> On Monday, 8 June 2020 at 23:19:55 UTC, Jonathan M Davis wrote:<br>
>> On Monday, June 8, 2020 8:09:04 AM MDT Manu via Digitalmars-d wrote:<br>
>>> On Mon, Jun 8, 2020 at 8:20 PM Walter Bright via Digitalmars-d <<br>
>>> > C/C++ inline has always been a hint to the compiler, not a > command.<br>
>>><br>
>>> It's not a hint at all. It's a mechanical tool; it marks symbols with <br>
>>> internal linkage, and it also doesn't emit them if it's never referenced. The <br>
>>> compiler may not choose to ignore that behaviour, it's absolutely necessary, <br>
>>> and very important.<br>
>><br>
>> It is my understanding that in C++, inline is a hint to the compiler with <br>
>> regards to whether a particular function call is actually inlined.<br>
> <br>
> That's a common misconception, and one that exists due to that being its <br>
> original intended purpose. But nowawadays? Nope:<br>
> <br>
> <a href="https://en.cppreference.com/w/cpp/language/inline" rel="noreferrer" target="_blank">https://en.cppreference.com/w/cpp/language/inline</a><br>
<br>
<br>
"Since this meaning of the keyword inline is non-binding, compilers are free to <br>
use inline substitution for any function that's not marked inline, and are free <br>
to generate function calls to any function marked inline. Those optimization <br>
choices do not change the rules regarding multiple definitions and shared <br>
statics listed above."<br>
<br>
I.e. it is a hint.<br></blockquote><div><br></div><div>It's like you skipped over ALL OF THE OTHER TEXT, where it details numerous precise behavioural requirements :/</div></div></div></blockquote><div><br></div><div>The the sentence that immediately follows your quote is:</div><div>"Because the meaning of the keyword inline for functions came to mean "multiple definitions are permitted" rather than "inlining is preferred", that meaning was extended to variables."</div></div></div>