force_inline etc.

Manu via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 3 04:39:19 PST 2015


On 3 February 2015 at 01:16, John Colvin via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> Can we just have this:
>
> pragma(inline) means "inline it unless you literally can't make it work".
>
> pragma(force_inline) or pragma(always_inline) means "the same as
> pragma(inline), but stop compilation if it can't be inlined".
>
> in the absence of either of these, "inline as you please".
>
>
> A pragma is OK. It will get the job done. People need something to get the
> job done. If Walter really doesn't like the attribute route then give his
> taste the benefit of the doubt and let's move on.

Hear hear!
I've been in support of precisely this motion for as long as it's been
on the table.

I'd personally prefer an attribute, and I'll argue for it, but I'll
take whatever I can get. Pragma will likely lead to text mixins, and
difficulty discovering the state of inline attribution applied to
functions. It may lead to meta problems of the type I'm all too
frequently familiar with.


More information about the Digitalmars-d mailing list