Something similar to "inline"

Johan j at j.nl
Wed Dec 27 16:50:42 UTC 2023


On Wednesday, 27 December 2023 at 16:35:47 UTC, Paul Backus wrote:
> On Wednesday, 27 December 2023 at 15:57:14 UTC, tososdk wrote:
>> Two things: Could you explain how "inline" works? Is there 
>> something similar in Dlang?

I don't think the D forums is the best place to ask about how 
"inline" works, when you mean another "inline" than what is 
available in D...

>
> In C and C++, `inline` is a suggestion to the compiler that it 
> should consider using [inline expansion][1] for calls to a 
> particular function. However, the compiler is free to ignore 
> this suggestion, and is also free to use inline expansion for 
> functions that are not marked with `inline`.

`inline` in C/C++ is only vaguely related to inline expansion. 
Its meaning is related to linkage, allowing multiple definitions 
of that symbol. https://en.cppreference.com/w/cpp/language/inline
Dlang does not have something similar.

-Johan





More information about the Digitalmars-d-learn mailing list