What does 'inline' mean?

Manu turkeyman at gmail.com
Tue Jun 9 01:01:26 UTC 2020


On Tue, Jun 9, 2020 at 9:20 AM Jonathan M Davis via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On Monday, June 8, 2020 8:09:04 AM MDT Manu via Digitalmars-d wrote:
> > On Mon, Jun 8, 2020 at 8:20 PM Walter Bright via Digitalmars-d <
> > > C/C++ inline has always been a hint to the compiler, not a command.
> >
> > 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, it's absolutely
> > necessary, and very important.
>
> It is my understanding that in C++, inline is a hint to the compiler with
> regards to whether a particular function call is actually inlined. There
> are
> other effects that inline has which aren't just a hint, but the behavior of
> actually inlining the function is a hint, not a command.
>

I'm not sure it's even a hint. That behaviour is basically irrelevant. The
'other effects' you describe are what inline does in C++, and we need that
too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20200609/b2ff2f57/attachment.htm>


More information about the Digitalmars-d mailing list