What does 'inline' mean?
Steven Schveighoffer
schveiguy at gmail.com
Mon Jun 8 15:18:06 UTC 2020
On 6/8/20 2:14 AM, Manu wrote:
> 3. I want to treat the function like an AST macro; I want the function
> inserted at the callsite, and I want to have total confidence in this
> mechanic. [This is about articulate mechanical control over code-gen;
> ie, I know necessary facts about the execution context/callstack that I
> expect to maintain]
This is my main use case. Not because I want AST macros (not sure I'd
agree that AST macro is the right description), but because I write a
lot of wrapping functions which are like "parameter modifiers". iopipe
is full of them for instance.
Being able to inject a few statement before/after a call without having
to dispatch to a separate function first is very useful for a wrapper.
It's what the optimizer should do anyway, but making it part of the API
makes a declaration that the function is a wrapper and should be treated
that way.
Unfortunately, D does not implement this feature in a way that I prefer:
https://issues.dlang.org/show_bug.cgi?id=15671
-Steve
More information about the Digitalmars-d
mailing list