What does 'inline' mean?
Avrina
avrina12309412342 at gmail.com
Tue Jun 9 20:16:17 UTC 2020
On Tuesday, 9 June 2020 at 09:29:47 UTC, Walter Bright wrote:
> On 6/8/2020 7:09 AM, Manu wrote:
>> On Mon, Jun 8, 2020 at 8:20 PM Walter Bright via Digitalmars-d
>> 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,
> The C/C++ inline semantics revolve around the mechanics of .h
> files because it doesn't have modules. These reasons are
> irrelevant for D.
>
> > it's absolutely necessary, and very important.
>
> For .h files, sure. Why for D, though?
The same is true for .di files. There's no option for the
compiler to tell the compiler to include the source of a function
for the header files in D. So there's no chance for it to inline.
I know .di files aren't used much, but they are still supported
nonetheless.
Note: This is different than the argument Manu is making, but it
is as relevant for D as it is for C++ for the compiler to
actually be able to inline the source.
More information about the Digitalmars-d
mailing list