June 21, 2019
On Friday, 21 June 2019 at 19:18:02 UTC, KnightMare wrote:
> On Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote:

> auto goodName( ... ) {
>     pragma( inline, true )
>     return terribleName( ... );
> }

hmm.. I have a question: this pragma will inline terribleName (double code) or goodName (fine)?
June 21, 2019
On Friday, June 21, 2019 3:31:46 PM MDT KnightMare via Digitalmars-d-learn wrote:
> On Friday, 21 June 2019 at 19:18:02 UTC, KnightMare wrote:
> > On Friday, 21 June 2019 at 12:02:10 UTC, Jonathan M Davis wrote:
> >
> > auto goodName( ... ) {
> >
> >     pragma( inline, true )
> >     return terribleName( ... );
> >
> > }
>
> hmm.. I have a question: this pragma will inline terribleName
> (double code) or goodName (fine)?

pragma(inline, true) goes on function declarations, not on function calls. So, you would need to put it on goodName's signature, in which case, it's goodName which would be inlined. There is no way for a caller to force a function to be inlined.

- Jonathan M Davis



1 2
Next ›   Last »