What does 'inline' mean?
Manu
turkeyman at gmail.com
Sat Jun 13 03:44:31 UTC 2020
On Sat, Jun 13, 2020 at 1:35 PM Andrei Alexandrescu via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:
> On 6/12/20 9:13 PM, Manu wrote:
> > On Sat, Jun 13, 2020 at 10:20 AM Andrei Alexandrescu via Digitalmars-d
> > <digitalmars-d at puremagic.com <mailto:digitalmars-d at puremagic.com>>
> wrote:
> >
> > On 6/12/20 2:08 PM, Johan wrote:
> > > On Friday, 12 June 2020 at 13:22:35 UTC, Andrei Alexandrescu
> wrote:
> > >> On 6/8/20 2:14 AM, Manu wrote:
> > >>> In C/C++, inline says that a function will be emit to the
> > binary only
> > >>> when it is called, and the function is marked with internal
> > linkage
> > >>> (it is not visible to the linker from the symbol table)
> > >>
> > >> By my recollection this is not the case for C++, at all.
> > >>
> > >> * "inline" does NOT change a function's linkage in C++. You may
> > have
> > >> inline functions with internal linkage (static inline) or
> (default)
> > >> external linkage. This is important because e.g. defining a
> static
> > >> variable in an extern inline function will have the same address
> in
> > >> all calls to the function.
> > >
> > > I believe Manu tried to explain that `inline` in C++ really only
> > affects
> > > how the linker must treat the symbol, and it is best to remember
> > that it
> > > does nothing at all concerning "inlining" (putting function body
> > inside
> > > another).
> >
> > Thank you. That's not at all what he wrote. AT ALL. It's what I
> wrote.
> >
> > I'm emphasizing this because it has been a recurring problem: a
> > legitimate problem with an explanation lost in translation.
> >
> >
> > You're joking right?
>
> Well, again I tried to get communication going and again I failed. So...
> again I will bow out, with apologies.
>
No, I appreciate your effort to improve the conversation.
What I don't appreciate is suggesting that "That's not at all what [he]
wrote. AT ALL." when I really feel like it is exactly what I wrote.
And if it was confused, I apologise, but there are plenty of people who
were able to read it and understand precisely what I was saying.
Anyway...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20200613/151cb5ec/attachment-0001.htm>
More information about the Digitalmars-d
mailing list