Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

* UNIX is a Trademark of Bell Laboratories.


devel / comp.lang.c++ / Re: What does this code print ?

SubjectAuthor
* What does this code print ?Bonita Montero
`* Re: What does this code print ?Ben Bacarisse
 +* Re: What does this code print ?Kenny McCormack
 |`* Re: What does this code print ?Bonita Montero
 | +* Re: What does this code print ?Scott Lurndal
 | |+- Re: What does this code print ?Bo Persson
 | |`* Re: What does this code print ?Bonita Montero
 | | `* Re: What does this code print ?Ben Bacarisse
 | |  `- Re: What does this code print ?Bonita Montero
 | `* Re: What does this code print ?Richard Damon
 |  +- Re: What does this code print ?Scott Lurndal
 |  `* Re: What does this code print ?Bonita Montero
 |   `* Re: What does this code print ?Richard Damon
 |    `* Re: What does this code print ?Bonita Montero
 |     +- Re: What does this code print ?Chris M. Thomasson
 |     `* Re: What does this code print ?Richard Damon
 |      `- Re: What does this code print ?Chris M. Thomasson
 +- Re: What does this code print ?Bonita Montero
 +* Re: What does this code print ?Chris M. Thomasson
 |+- Re: What does this code print ?Chris M. Thomasson
 |`- Re: What does this code print ?Bonita Montero
 `* Re: What does this code print ?Chris M. Thomasson
  `* Re: What does this code print ?Bonita Montero
   +* Re: What does this code print ?Richard Damon
   |`* Re: What does this code print ?Bonita Montero
   | `* Re: What does this code print ?Richard Damon
   |  `* Re: What does this code print ?Bonita Montero
   |   `* Re: What does this code print ?Richard Damon
   |    `* Re: What does this code print ?Bonita Montero
   |     `- Re: What does this code print ?Chris M. Thomasson
   +* Re: What does this code print ?Kaz Kylheku
   |+* Re: What does this code print ?Chris M. Thomasson
   ||`* Re: What does this code print ?Kaz Kylheku
   || +- Re: What does this code print ?Chris M. Thomasson
   || `* Re: What does this code print ?Paavo Helde
   ||  `* Re: What does this code print ?Chris M. Thomasson
   ||   `* Re: What does this code print ?Kaz Kylheku
   ||    `* Re: What does this code print ?Paavo Helde
   ||     `* Re: What does this code print ?Kaz Kylheku
   ||      `* Re: What does this code print ?Chris M. Thomasson
   ||       `- Re: What does this code print ?Chris M. Thomasson
   |`* Re: What does this code print ?Bonita Montero
   | `* Re: What does this code print ?Kaz Kylheku
   |  +- Re: What does this code print ?Richard Damon
   |  `- Re: What does this code print ?Bonita Montero
   +* Re: What does this code print ?Richard Damon
   |`* Re: What does this code print ?Bonita Montero
   | +* Re: What does this code print ?Bonita Montero
   | |+* Re: What does this code print ?Bonita Montero
   | ||`* Re: What does this code print ?Richard Damon
   | || `* Re: What does this code print ?Bonita Montero
   | ||  `* Re: What does this code print ?Richard Damon
   | ||   +* Re: What does this code print ?Bonita Montero
   | ||   |`- Re: What does this code print ?Richard Damon
   | ||   `* Re: What does this code print ?Bonita Montero
   | ||    `* Re: What does this code print ?Kaz Kylheku
   | ||     `* Re: What does this code print ?Bonita Montero
   | ||      `* Re: What does this code print ?Kaz Kylheku
   | ||       +- Re: What does this code print ?Richard Damon
   | ||       `* Re: What does this code print ?Chris M. Thomasson
   | ||        `* Re: What does this code print ?Kaz Kylheku
   | ||         `* Re: What does this code print ?Bonita Montero
   | ||          +* Re: What does this code print ?Richard Damon
   | ||          |`* Re: What does this code print ?Bonita Montero
   | ||          | `* Re: What does this code print ?Richard Damon
   | ||          |  `* Re: What does this code print ?Bonita Montero
   | ||          |   `* Re: What does this code print ?Richard Damon
   | ||          |    `* Re: What does this code print ?Bonita Montero
   | ||          |     `* Re: What does this code print ?Richard Damon
   | ||          |      `* Re: What does this code print ?Bonita Montero
   | ||          |       `* Re: What does this code print ?Richard Damon
   | ||          |        `* Re: What does this code print ?Bonita Montero
   | ||          |         `* Re: What does this code print ?Richard Damon
   | ||          |          `* Re: What does this code print ?Bonita Montero
   | ||          |           +- Re: What does this code print ?Branimir Maksimovic
   | ||          |           `* Re: What does this code print ?Richard Damon
   | ||          |            `* Re: What does this code print ?Bonita Montero
   | ||          |             `* Re: What does this code print ?Richard Damon
   | ||          |              `* Re: What does this code print ?Bonita Montero
   | ||          |               +* Re: What does this code print ?Richard Damon
   | ||          |               |+* Re: What does this code print ?Bonita Montero
   | ||          |               ||+* Re: What does this code print ?Richard Damon
   | ||          |               |||`* Re: What does this code print ?Bonita Montero
   | ||          |               ||| `* Re: What does this code print ?Richard Damon
   | ||          |               |||  `* Re: What does this code print ?Bonita Montero
   | ||          |               |||   `* Re: What does this code print ?Richard Damon
   | ||          |               |||    `* Re: What does this code print ?Bonita Montero
   | ||          |               |||     `* Re: What does this code print ?Kaz Kylheku
   | ||          |               |||      `* Re: What does this code print ?Bonita Montero
   | ||          |               |||       `* Re: What does this code print ?Richard Damon
   | ||          |               |||        `- Re: What does this code print ?Bonita Montero
   | ||          |               ||`* Re: What does this code print ?Branimir Maksimovic
   | ||          |               || `- Re: What does this code print ?Bonita Montero
   | ||          |               |`* Re: What does this code print ?Scott Lurndal
   | ||          |               | `- Re: What does this code print ?Richard Damon
   | ||          |               `* Re: What does this code print ?Kaz Kylheku
   | ||          |                `- Re: What does this code print ?Bonita Montero
   | ||          `* Re: What does this code print ?Kaz Kylheku
   | ||           +* Re: What does this code print ?Bo Persson
   | ||           |`- Re: What does this code print ?Kaz Kylheku
   | ||           `* Re: What does this code print ?Bonita Montero
   | |`* Re: What does this code print ?Richard Damon
   | +* Re: What does this code print ?Scott Lurndal
   | `- Re: What does this code print ?Richard Damon
   `* Re: What does this code print ?Chris M. Thomasson

Pages:123456
Re: What does this code print ?

<uh6b5h$2fvna$2@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2241&group=comp.lang.c%2B%2B#2241

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Mon, 23 Oct 2023 10:40:01 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uh6b5h$2fvna$2@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <87lec95n0t.fsf@bsb.me.uk>
<ugaeqo$2vefi$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugegmt$3uo8b$1@dont-email.me> <ugg33f$cf8s$3@dont-email.me>
<ugg3c2$ckp0$1@dont-email.me> <ugg3l3$cmg4$1@dont-email.me>
<ugh7s8$1k9qh$3@i2pn2.org> <ugl77t$2pe6u$2@dont-email.me>
<ugnhvc$1t8hq$1@i2pn2.org> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 23 Oct 2023 17:40:01 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2621162"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <uh694p$38uv3$1@dont-email.me>
 by: Richard Damon - Mon, 23 Oct 2023 17:40 UTC

On 10/23/23 10:05 AM, Bonita Montero wrote:
> Am 22.10.2023 um 16:12 schrieb Richard Damon:
>
>> On 10/21/23 9:53 PM, Bonita Montero wrote:
>
>>> The lambda can have an arbitrary size, it is always inlined.
>
>> Your lambda has a fixed code, not arbitrary size.
>
> What I wanted to say is that the lambda's size can be arbitrary
> without having s separate invoker.

So? In this case we got an invoker, because we needed something to
handle the calling convention difference.

>
>> In fact, it is likely that it was because your particular lambda was
>> small, that it was made to be inline.
>
> I did my own index_sequence<...> vs. function-object loop-unrolling
> with 1'000 increments of an atomic_char inside the lambda; it was
> still inlined.

So? The compiler gets to decide under what conditions it wants to inline
the code. Especially if it can see that the lambda isn't used in many
places.

>
>> Lambdas define a function object, which can be created inline or out
>> of line.
>
> The calling operator of a lambda is inline if it is mutable or
> const inline if it is non-mutable. But we don't discuss C++ but
> the behaviour of a specific  platform.
>

You seem to be confusing the calling via a pointer to the lambda, vs the
actual calling of the lambda.

A "Mutable" lambda means the lambda can modify the parameters it has
captured. That dosn't affect being inline or not.

ALso, THIS NEWGROUP (comp.lang.c++) is about generic C++ behavior, not
platform specific behavior. Maybe you should be posting in a group that
IS about that platform.

Re: What does this code print ?

<uh8irj$3vru6$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2242&group=comp.lang.c%2B%2B#2242

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 16:03:32 +0200
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <uh8irj$3vru6$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <87lec95n0t.fsf@bsb.me.uk>
<ugaeqo$2vefi$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugegmt$3uo8b$1@dont-email.me> <ugg33f$cf8s$3@dont-email.me>
<ugg3c2$ckp0$1@dont-email.me> <ugg3l3$cmg4$1@dont-email.me>
<ugh7s8$1k9qh$3@i2pn2.org> <ugl77t$2pe6u$2@dont-email.me>
<ugnhvc$1t8hq$1@i2pn2.org> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 14:03:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19ff846a9de35ae4cad29f4bfeec92bb";
logging-data="4190150"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RSGsnFuQnFDkVAgLWaGfTBMQXS2IA2Wk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:e4b96w186M8VVHW47WKyEXqzUpc=
In-Reply-To: <uh6b5h$2fvna$2@i2pn2.org>
Content-Language: de-DE
 by: Bonita Montero - Tue, 24 Oct 2023 14:03 UTC

Am 23.10.2023 um 19:40 schrieb Richard Damon:

> So? In this case we got an invoker, because we needed something to
> handle the calling convention difference.

It's called invoker, but the actual lambda is always inlined.
So this term is misleading here.

> So? The compiler gets to decide under what conditions it wants to inline
> the code. Especially if it can see that the lambda isn't used in many
> places.

Each atomic increment is two instruction, i.e. I've got 2.000
instructions in the actual lambda. If the compiler doesn't inline
that anyway it does this never. Try it yourself on Godbolt if you
want to manage to have s separate invoker.

>> Lambdas define a function object, which can be created inline or out
of line.

> You seem to be confusing the calling via a pointer to the lambda, vs the
> actual calling of the lambda.

You went off topic and I responded. See what you said above.

> A "Mutable" lambda means the lambda can modify the parameters it has
> captured. That dosn't affect being inline or not.

I didn't say that.

> ALso, THIS NEWGROUP (comp.lang.c++) is about generic C++ behavior, not
> platform specific behavior. ...

That's your opinion.

Re: What does this code print ?

<uh8kab$2ld7m$1@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2243&group=comp.lang.c%2B%2B#2243

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 07:28:26 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uh8kab$2ld7m$1@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <ugaeqo$2vefi$1@dont-email.me>
<ugapal$31eim$1@dont-email.me> <ugegmt$3uo8b$1@dont-email.me>
<ugg33f$cf8s$3@dont-email.me> <ugg3c2$ckp0$1@dont-email.me>
<ugg3l3$cmg4$1@dont-email.me> <ugh7s8$1k9qh$3@i2pn2.org>
<ugl77t$2pe6u$2@dont-email.me> <ugnhvc$1t8hq$1@i2pn2.org>
<ugrqok$fto1$1@dont-email.me> <20231019110532.810@kylheku.com>
<ugrrh1$fto1$4@dont-email.me> <20231019120451.638@kylheku.com>
<ugs82g$j12c$2@dont-email.me> <20231019162423.200@kylheku.com>
<ugt9lg$ue68$1@dont-email.me> <ugtiar$26i7n$2@i2pn2.org>
<ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org>
<ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org>
<uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org>
<uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org>
<uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org>
<uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org>
<uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org>
<uh8irj$3vru6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 14:28:28 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2798838"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
In-Reply-To: <uh8irj$3vru6$1@dont-email.me>
Content-Language: en-US
 by: Richard Damon - Tue, 24 Oct 2023 14:28 UTC

On 10/24/23 7:03 AM, Bonita Montero wrote:
> Am 23.10.2023 um 19:40 schrieb Richard Damon:
>
>> So? In this case we got an invoker, because we needed something to
>> handle the calling convention difference.
>
> It's called invoker, but the actual lambda is always inlined.
> So this term is misleading here.

Why do you say that? The "invoker" is a function created to invoke the
designated function in an environment (calling convention) that the
function can not directly handle.

"invoking" doesn't need a "call" instruction, as when you invoke an
"inline" function, the function is just put there.

Note also, the fact that you are agreeing that this code was an inline
expansion leads to the questions, what is it inline expanded into, the
answer to that are the two invokers that handle the calling convention
mismatch. Thus we don't have two versions of the lambda recompiled to
different calling conventions, but two inline instances of the exact
same lambda, embedded in two invokers that have different calling
conventions.

>
>> So? The compiler gets to decide under what conditions it wants to
>> inline the code. Especially if it can see that the lambda isn't used
>> in many places.
>
> Each atomic increment is two instruction, i.e. I've got 2.000
> instructions in the actual lambda. If the compiler doesn't inline
> that anyway it does this never. Try it yourself on Godbolt if you
> want to manage to have s separate invoker.
>
> >> Lambdas define a function object, which can be created inline or out
> of line.
>
>> You seem to be confusing the calling via a pointer to the lambda, vs
>> the actual calling of the lambda.
>
> You went off topic and I responded. See what you said above.
>
>> A "Mutable" lambda means the lambda can modify the parameters it has
>> captured. That dosn't affect being inline or not.
>
> I didn't say that.

You said:

> The calling operator of a lambda is inline if it is mutable or
> const inline if it is non-mutable. But we don't discuss C++ but
> the behaviour of a specific platform.

So, you said that mutability affected inlining.

So, I guess you don't know what you are saying.

>
>> ALso, THIS NEWGROUP (comp.lang.c++) is about generic C++ behavior, not
>> platform specific behavior. ...
>
> That's your opinion.
>
>

That's the newsgroup charter, not

Re: What does this code print ?

<uh8m8i$r6m$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2244&group=comp.lang.c%2B%2B#2244

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 17:01:39 +0200
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <uh8m8i$r6m$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugegmt$3uo8b$1@dont-email.me> <ugg33f$cf8s$3@dont-email.me>
<ugg3c2$ckp0$1@dont-email.me> <ugg3l3$cmg4$1@dont-email.me>
<ugh7s8$1k9qh$3@i2pn2.org> <ugl77t$2pe6u$2@dont-email.me>
<ugnhvc$1t8hq$1@i2pn2.org> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<uh8kab$2ld7m$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 24 Oct 2023 15:01:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19ff846a9de35ae4cad29f4bfeec92bb";
logging-data="27862"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fvBpOnrCaVIdTwyFsjWsNtxRkb5GsCow="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:9jZskSIwPvl6tJ+k3yTCd/HpzrI=
Content-Language: de-DE
In-Reply-To: <uh8kab$2ld7m$1@i2pn2.org>
 by: Bonita Montero - Tue, 24 Oct 2023 15:01 UTC

Am 24.10.2023 um 16:28 schrieb Richard Damon:

> Why do you say that? The "invoker" is a function created to invoke the
> designated function in an environment (calling convention) that the
> function can not directly handle.

The actual lambda is always inlined.

> "invoking" doesn't need a "call" instruction, as when you invoke an
> "inline" function, the function is just put there.

Then the term in invoker doesn't make sense.

>> The calling operator of a lambda is inline if it is mutable or
>> const inline if it is non-mutable. But we don't discuss C++ but
>> the behaviour of a specific  platform.

> So, you said that mutability affected inlining.

No, you went off-topic and I responeded to that.
Then you made the connection to the actual topic, not me.

Re: What does this code print ?

<xlRZM.207977$rbid.58230@fx18.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2245&group=comp.lang.c%2B%2B#2245

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: What does this code print ?
Newsgroups: comp.lang.c++
References: <ug54sf$1ki2m$1@dont-email.me> <ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me> <uh8kab$2ld7m$1@i2pn2.org>
Lines: 16
Message-ID: <xlRZM.207977$rbid.58230@fx18.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 24 Oct 2023 15:25:17 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 24 Oct 2023 15:25:17 GMT
X-Received-Bytes: 1720
 by: Scott Lurndal - Tue, 24 Oct 2023 15:25 UTC

Richard Damon <richard@damon-family.org> writes:
>On 10/24/23 7:03 AM, Bonita Montero wrote:
>> Am 23.10.2023 um 19:40 schrieb Richard Damon:
>>
>>> So? In this case we got an invoker, because we needed something to
>>> handle the calling convention difference.
>>
>> It's called invoker, but the actual lambda is always inlined.
>> So this term is misleading here.
>
>Why do you say that? The "invoker" is a function created to invoke the
>designated function in an environment (calling convention) that the
>function can not directly handle.

This is often also called a trampoline.

Re: What does this code print ?

<uh8nrc$2ld7l$1@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2246&group=comp.lang.c%2B%2B#2246

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 08:28:43 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uh8nrc$2ld7l$1@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <ugegmt$3uo8b$1@dont-email.me>
<ugg33f$cf8s$3@dont-email.me> <ugg3c2$ckp0$1@dont-email.me>
<ugg3l3$cmg4$1@dont-email.me> <ugh7s8$1k9qh$3@i2pn2.org>
<ugl77t$2pe6u$2@dont-email.me> <ugnhvc$1t8hq$1@i2pn2.org>
<ugrqok$fto1$1@dont-email.me> <20231019110532.810@kylheku.com>
<ugrrh1$fto1$4@dont-email.me> <20231019120451.638@kylheku.com>
<ugs82g$j12c$2@dont-email.me> <20231019162423.200@kylheku.com>
<ugt9lg$ue68$1@dont-email.me> <ugtiar$26i7n$2@i2pn2.org>
<ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org>
<ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org>
<uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org>
<uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org>
<uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org>
<uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org>
<uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org>
<uh8irj$3vru6$1@dont-email.me> <uh8kab$2ld7m$1@i2pn2.org>
<uh8m8i$r6m$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 24 Oct 2023 15:28:45 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2798837"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
In-Reply-To: <uh8m8i$r6m$1@dont-email.me>
Content-Language: en-US
 by: Richard Damon - Tue, 24 Oct 2023 15:28 UTC

On 10/24/23 8:01 AM, Bonita Montero wrote:
> Am 24.10.2023 um 16:28 schrieb Richard Damon:
>
>> Why do you say that? The "invoker" is a function created to invoke the
>> designated function in an environment (calling convention) that the
>> function can not directly handle.
>
> The actual lambda is always inlined.

Then you agree that there is ONE lambda function (inlined twice) inlined
within two invoker wrappers, not two versions of the lambda "compiled'
with different calling conventions different than the one it was
declared with.

>
>> "invoking" doesn't need a "call" instruction, as when you invoke an
>> "inline" function, the function is just put there.
>
> Then the term in invoker doesn't make sense.

Then "calling a function" that is inline doesn't make sense either.

In fact, "invoking" has less connotation of using a phyical "CALL"
instruction than the term call.

To invoke something is to make it happen. That doesn't imply calling it.

>
>>> The calling operator of a lambda is inline if it is mutable or
>>> const inline if it is non-mutable. But we don't discuss C++ but
>>> the behaviour of a specific  platform.
>
>> So, you said that mutability affected inlining.
>
> No, you went off-topic and I responeded to that.
> Then you made the connection to the actual topic, not me.
>

Maybe you don't understand enough to understand the topicality of my
statement.

YOU claimed "mutability" affected inlining.
I pointed out that it isn't defined to do that.

Re: What does this code print ?

<uh8o62$2ld7m$2@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2247&group=comp.lang.c%2B%2B#2247

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 08:34:25 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uh8o62$2ld7m$2@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<uh8kab$2ld7m$1@i2pn2.org> <xlRZM.207977$rbid.58230@fx18.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 15:34:26 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2798838"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
In-Reply-To: <xlRZM.207977$rbid.58230@fx18.iad>
Content-Language: en-US
 by: Richard Damon - Tue, 24 Oct 2023 15:34 UTC

On 10/24/23 8:25 AM, Scott Lurndal wrote:
> Richard Damon <richard@damon-family.org> writes:
>> On 10/24/23 7:03 AM, Bonita Montero wrote:
>>> Am 23.10.2023 um 19:40 schrieb Richard Damon:
>>>
>>>> So? In this case we got an invoker, because we needed something to
>>>> handle the calling convention difference.
>>>
>>> It's called invoker, but the actual lambda is always inlined.
>>> So this term is misleading here.
>>
>> Why do you say that? The "invoker" is a function created to invoke the
>> designated function in an environment (calling convention) that the
>> function can not directly handle.
>
> This is often also called a trampoline.
>

Yes, but since the program map showed a name of invoker, that is the
term being used.

I think Bonita might have a brain melt to talk about a trampoline named
with the term invoker.

Re: What does this code print ?

<uh8r8p$28od$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2248&group=comp.lang.c%2B%2B#2248

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 18:27:06 +0200
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uh8r8p$28od$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <ugg33f$cf8s$3@dont-email.me>
<ugg3c2$ckp0$1@dont-email.me> <ugg3l3$cmg4$1@dont-email.me>
<ugh7s8$1k9qh$3@i2pn2.org> <ugl77t$2pe6u$2@dont-email.me>
<ugnhvc$1t8hq$1@i2pn2.org> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<uh8kab$2ld7m$1@i2pn2.org> <uh8m8i$r6m$1@dont-email.me>
<uh8nrc$2ld7l$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 16:27:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19ff846a9de35ae4cad29f4bfeec92bb";
logging-data="74509"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Q+K56uHktXUnF91ACDwFWTwxY+rzJ5mA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sx7bA2vCAPk8dja6aMg/RqhQJag=
Content-Language: de-DE
In-Reply-To: <uh8nrc$2ld7l$1@i2pn2.org>
 by: Bonita Montero - Tue, 24 Oct 2023 16:27 UTC

Am 24.10.2023 um 17:28 schrieb Richard Damon:

> Then you agree that there is ONE lambda function (inlined twice) inlined
> within two invoker wrappers, not two versions of the lambda "compiled'
> with different calling conventions different than the one it was
> declared with.

It's two functions with two calling conventions sharing the same data.
An invoker is some kind of stub-code for each calling convention calling
a shared function; so the term invoker is misleading here.

> YOU claimed "mutability" affected inlining.

That's the connection you made.

Re: What does this code print ?

<20231024093342.675@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2249&group=comp.lang.c%2B%2B#2249

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 16:34:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <20231024093342.675@kylheku.com>
References: <ug54sf$1ki2m$1@dont-email.me> <ugaeqo$2vefi$1@dont-email.me>
<ugapal$31eim$1@dont-email.me> <ugegmt$3uo8b$1@dont-email.me>
<ugg33f$cf8s$3@dont-email.me> <ugg3c2$ckp0$1@dont-email.me>
<ugg3l3$cmg4$1@dont-email.me> <ugh7s8$1k9qh$3@i2pn2.org>
<ugl77t$2pe6u$2@dont-email.me> <ugnhvc$1t8hq$1@i2pn2.org>
<ugrqok$fto1$1@dont-email.me> <20231019110532.810@kylheku.com>
<ugrrh1$fto1$4@dont-email.me> <20231019120451.638@kylheku.com>
<ugs82g$j12c$2@dont-email.me> <20231019162423.200@kylheku.com>
<ugt9lg$ue68$1@dont-email.me> <ugtiar$26i7n$2@i2pn2.org>
<ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org>
<ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org>
<uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org>
<uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org>
<uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org>
<uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org>
<uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org>
<uh8irj$3vru6$1@dont-email.me>
Injection-Date: Tue, 24 Oct 2023 16:34:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a726e8f2e38540d8fa8b885b814471db";
logging-data="78788"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+hkT2QdkZed37hjpKQMJK48ofLO4vplDE="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:MGqAnxwJGWGmE7gxO72hHNJrY1M=
 by: Kaz Kylheku - Tue, 24 Oct 2023 16:34 UTC

On 2023-10-24, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> Am 23.10.2023 um 19:40 schrieb Richard Damon:
>
>> So? In this case we got an invoker, because we needed something to
>> handle the calling convention difference.
>
> It's called invoker, but the actual lambda is always inlined.

Well, that's an about face. Near the start of the topic you were
vehemently denying that there was inlining.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: What does this code print ?

<rsSZM.101793$HwD9.74381@fx11.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2250&group=comp.lang.c%2B%2B#2250

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx11.iad.POSTED!not-for-mail
Newsgroups: comp.lang.c++
From: branimir...@icloud.com (Branimir Maksimovic)
Subject: Re: What does this code print ?
References: <ug54sf$1ki2m$1@dont-email.me> <ugegmt$3uo8b$1@dont-email.me>
<ugg33f$cf8s$3@dont-email.me> <ugg3c2$ckp0$1@dont-email.me>
<ugg3l3$cmg4$1@dont-email.me> <ugh7s8$1k9qh$3@i2pn2.org>
<ugl77t$2pe6u$2@dont-email.me> <ugnhvc$1t8hq$1@i2pn2.org>
<ugrqok$fto1$1@dont-email.me> <20231019110532.810@kylheku.com>
<ugrrh1$fto1$4@dont-email.me> <20231019120451.638@kylheku.com>
<ugs82g$j12c$2@dont-email.me> <20231019162423.200@kylheku.com>
<ugt9lg$ue68$1@dont-email.me> <ugtiar$26i7n$2@i2pn2.org>
<ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org>
<ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org>
<uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org>
<uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org>
<uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org>
<uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org>
<uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org>
<uh8irj$3vru6$1@dont-email.me> <uh8kab$2ld7m$1@i2pn2.org>
<uh8m8i$r6m$1@dont-email.me>
User-Agent: slrn/1.0.3 (Darwin)
Lines: 17
Message-ID: <rsSZM.101793$HwD9.74381@fx11.iad>
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Tue, 24 Oct 2023 16:40:55 UTC
Organization: usenet-news.net
Date: Tue, 24 Oct 2023 16:40:55 GMT
X-Received-Bytes: 2029
 by: Branimir Maksimovic - Tue, 24 Oct 2023 16:40 UTC

On 2023-10-24, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> Am 24.10.2023 um 16:28 schrieb Richard Damon:
>
>> Why do you say that? The "invoker" is a function created to invoke the
>> designated function in an environment (calling convention) that the
>> function can not directly handle.
>
> The actual lambda is always inlined.
>
Try to compile without optimisations...

--

7-77-777, Evil Sinner!
https://www.linkedin.com/in/branimir-maksimovic-6762bbaa/

Re: What does this code print ?

<uh8tg6$2rh0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2251&group=comp.lang.c%2B%2B#2251

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 19:05:11 +0200
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uh8tg6$2rh0$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugegmt$3uo8b$1@dont-email.me> <ugg33f$cf8s$3@dont-email.me>
<ugg3c2$ckp0$1@dont-email.me> <ugg3l3$cmg4$1@dont-email.me>
<ugh7s8$1k9qh$3@i2pn2.org> <ugl77t$2pe6u$2@dont-email.me>
<ugnhvc$1t8hq$1@i2pn2.org> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<20231024093342.675@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 17:05:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19ff846a9de35ae4cad29f4bfeec92bb";
logging-data="93728"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mHZmi6OihmbkMp8Un55n6dPMcy/2HmMU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:3kVEsLjSBO7dCRThwYj5W4iUCs8=
Content-Language: de-DE
In-Reply-To: <20231024093342.675@kylheku.com>
 by: Bonita Montero - Tue, 24 Oct 2023 17:05 UTC

Am 24.10.2023 um 18:34 schrieb Kaz Kylheku:
> On 2023-10-24, Bonita Montero <Bonita.Montero@gmail.com> wrote:

>> Am 23.10.2023 um 19:40 schrieb Richard Damon:

>> It's called invoker, but the actual lambda is always inlined.

> Well, that's an about face. Near the start of the topic you were
> vehemently denying that there was inlining.

An invoker is some kind of stub-/proxy-code, there's nothing
like that here.

Re: What does this code print ?

<uh8tho$2ltqv$1@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2252&group=comp.lang.c%2B%2B#2252

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 10:05:58 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uh8tho$2ltqv$1@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <ugg3c2$ckp0$1@dont-email.me>
<ugg3l3$cmg4$1@dont-email.me> <ugh7s8$1k9qh$3@i2pn2.org>
<ugl77t$2pe6u$2@dont-email.me> <ugnhvc$1t8hq$1@i2pn2.org>
<ugrqok$fto1$1@dont-email.me> <20231019110532.810@kylheku.com>
<ugrrh1$fto1$4@dont-email.me> <20231019120451.638@kylheku.com>
<ugs82g$j12c$2@dont-email.me> <20231019162423.200@kylheku.com>
<ugt9lg$ue68$1@dont-email.me> <ugtiar$26i7n$2@i2pn2.org>
<ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org>
<ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org>
<uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org>
<uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org>
<uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org>
<uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org>
<uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org>
<uh8irj$3vru6$1@dont-email.me> <uh8kab$2ld7m$1@i2pn2.org>
<uh8m8i$r6m$1@dont-email.me> <uh8nrc$2ld7l$1@i2pn2.org>
<uh8r8p$28od$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 17:06:00 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2815839"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
In-Reply-To: <uh8r8p$28od$1@dont-email.me>
Content-Language: en-US
 by: Richard Damon - Tue, 24 Oct 2023 17:05 UTC

On 10/24/23 9:27 AM, Bonita Montero wrote:
> Am 24.10.2023 um 17:28 schrieb Richard Damon:
>
>> Then you agree that there is ONE lambda function (inlined twice)
>> inlined within two invoker wrappers, not two versions of the lambda
>> "compiled' with different calling conventions different than the one
>> it was declared with.
>
> It's two functions with two calling conventions sharing the same data.
> An invoker is some kind of stub-code for each calling convention calling
> a shared function; so the term invoker is misleading here.

But that is EXACTLY what is happening.

We have two "stub" functions, the two "invoker" functions, one for each
calling convention, "calling" (via inline expansion) the shared function.

How does that not match what you see?

>
>> YOU claimed "mutability" affected inlining.
>
> That's the connection you made.
>

Re: What does this code print ?

<uh8tjq$2s0a$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2253&group=comp.lang.c%2B%2B#2253

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 19:07:07 +0200
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uh8tjq$2s0a$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <ugg33f$cf8s$3@dont-email.me>
<ugg3c2$ckp0$1@dont-email.me> <ugg3l3$cmg4$1@dont-email.me>
<ugh7s8$1k9qh$3@i2pn2.org> <ugl77t$2pe6u$2@dont-email.me>
<ugnhvc$1t8hq$1@i2pn2.org> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<uh8kab$2ld7m$1@i2pn2.org> <uh8m8i$r6m$1@dont-email.me>
<rsSZM.101793$HwD9.74381@fx11.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 17:07:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19ff846a9de35ae4cad29f4bfeec92bb";
logging-data="94218"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/n/JPkd+ZkLPrcQbfH6FsSEhfUwu9F88s="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:7mKRCeQe3jpdV9U9NhjKxFtnxew=
Content-Language: de-DE
In-Reply-To: <rsSZM.101793$HwD9.74381@fx11.iad>
 by: Bonita Montero - Tue, 24 Oct 2023 17:07 UTC

Am 24.10.2023 um 18:40 schrieb Branimir Maksimovic:

> Try to compile without optimisations...

This could only make a difference where the parameters are
trivial types. Otherwise objects would have to be copied
and you would have side effects like allocation errors.

Re: What does this code print ?

<uh8tli$2s0a$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2254&group=comp.lang.c%2B%2B#2254

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 19:08:03 +0200
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <uh8tli$2s0a$2@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <ugg3l3$cmg4$1@dont-email.me>
<ugh7s8$1k9qh$3@i2pn2.org> <ugl77t$2pe6u$2@dont-email.me>
<ugnhvc$1t8hq$1@i2pn2.org> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<uh8kab$2ld7m$1@i2pn2.org> <uh8m8i$r6m$1@dont-email.me>
<uh8nrc$2ld7l$1@i2pn2.org> <uh8r8p$28od$1@dont-email.me>
<uh8tho$2ltqv$1@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 17:08:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19ff846a9de35ae4cad29f4bfeec92bb";
logging-data="94218"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+101lpU2K1F37VjTSu1puH3enITnLBQFk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1zZVjBy0JO1N2rl53X7cw7+jiPQ=
In-Reply-To: <uh8tho$2ltqv$1@i2pn2.org>
Content-Language: de-DE
 by: Bonita Montero - Tue, 24 Oct 2023 17:08 UTC

Am 24.10.2023 um 19:05 schrieb Richard Damon:

> But that is EXACTLY what is happening.

No, there's no stub-/proxy-code, it's like you implemented
two idential functions with different calling conventions.

Re: What does this code print ?

<uh8vgs$2ltqv$2@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2255&group=comp.lang.c%2B%2B#2255

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 10:39:39 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uh8vgs$2ltqv$2@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <ugh7s8$1k9qh$3@i2pn2.org>
<ugl77t$2pe6u$2@dont-email.me> <ugnhvc$1t8hq$1@i2pn2.org>
<ugrqok$fto1$1@dont-email.me> <20231019110532.810@kylheku.com>
<ugrrh1$fto1$4@dont-email.me> <20231019120451.638@kylheku.com>
<ugs82g$j12c$2@dont-email.me> <20231019162423.200@kylheku.com>
<ugt9lg$ue68$1@dont-email.me> <ugtiar$26i7n$2@i2pn2.org>
<ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org>
<ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org>
<uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org>
<uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org>
<uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org>
<uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org>
<uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org>
<uh8irj$3vru6$1@dont-email.me> <uh8kab$2ld7m$1@i2pn2.org>
<uh8m8i$r6m$1@dont-email.me> <uh8nrc$2ld7l$1@i2pn2.org>
<uh8r8p$28od$1@dont-email.me> <uh8tho$2ltqv$1@i2pn2.org>
<uh8tli$2s0a$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 17:39:41 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2815839"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <uh8tli$2s0a$2@dont-email.me>
 by: Richard Damon - Tue, 24 Oct 2023 17:39 UTC

On 10/24/23 10:08 AM, Bonita Montero wrote:
> Am 24.10.2023 um 19:05 schrieb Richard Damon:
>
>> But that is EXACTLY what is happening.
>
> No, there's no stub-/proxy-code, it's like you implemented
> two idential functions with different calling conventions.
>

So, how is that different than two stubs with two copies of the same
inline code?

Since they are named that way, it seems to be what it is.

Re: What does this code print ?

<uh927h$41im$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2256&group=comp.lang.c%2B%2B#2256

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 20:25:54 +0200
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uh927h$41im$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <ugl77t$2pe6u$2@dont-email.me>
<ugnhvc$1t8hq$1@i2pn2.org> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<uh8kab$2ld7m$1@i2pn2.org> <uh8m8i$r6m$1@dont-email.me>
<uh8nrc$2ld7l$1@i2pn2.org> <uh8r8p$28od$1@dont-email.me>
<uh8tho$2ltqv$1@i2pn2.org> <uh8tli$2s0a$2@dont-email.me>
<uh8vgs$2ltqv$2@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Oct 2023 18:25:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19ff846a9de35ae4cad29f4bfeec92bb";
logging-data="132694"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18uEcgW0w0NNnedMkd2gLAn9C2RHY2lq6Q="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:h2hoRLG+BCzrS9/quRUcbdHGMnA=
In-Reply-To: <uh8vgs$2ltqv$2@i2pn2.org>
Content-Language: de-DE
 by: Bonita Montero - Tue, 24 Oct 2023 18:25 UTC

Am 24.10.2023 um 19:39 schrieb Richard Damon:

> So, how is that different than two stubs with two copies of the same
> inline code?

It's not copied code as you can see from my disassembly.

Re: What does this code print ?

<20231024123628.971@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2257&group=comp.lang.c%2B%2B#2257

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 19:48:49 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 100
Message-ID: <20231024123628.971@kylheku.com>
References: <ug54sf$1ki2m$1@dont-email.me> <ugnhvc$1t8hq$1@i2pn2.org>
<ugrqok$fto1$1@dont-email.me> <20231019110532.810@kylheku.com>
<ugrrh1$fto1$4@dont-email.me> <20231019120451.638@kylheku.com>
<ugs82g$j12c$2@dont-email.me> <20231019162423.200@kylheku.com>
<ugt9lg$ue68$1@dont-email.me> <ugtiar$26i7n$2@i2pn2.org>
<ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org>
<ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org>
<uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org>
<uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org>
<uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org>
<uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org>
<uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org>
<uh8irj$3vru6$1@dont-email.me> <uh8kab$2ld7m$1@i2pn2.org>
<uh8m8i$r6m$1@dont-email.me> <uh8nrc$2ld7l$1@i2pn2.org>
<uh8r8p$28od$1@dont-email.me> <uh8tho$2ltqv$1@i2pn2.org>
<uh8tli$2s0a$2@dont-email.me> <uh8vgs$2ltqv$2@i2pn2.org>
<uh927h$41im$1@dont-email.me>
Injection-Date: Tue, 24 Oct 2023 19:48:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a726e8f2e38540d8fa8b885b814471db";
logging-data="168176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+EBUDmuGAjBzQpyejORHoGGO8HC9hHEJY="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:yDZ3x0wfr5e5bJgDtG6pMvr7zCw=
 by: Kaz Kylheku - Tue, 24 Oct 2023 19:48 UTC

On 2023-10-24, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> Am 24.10.2023 um 19:39 schrieb Richard Damon:
>
>> So, how is that different than two stubs with two copies of the same
>> inline code?
>
> It's not copied code as you can see from my disassembly.

It is quite usual for calls to inline functions not to appear identical.
The code is integrated into the caller, and then subject to
transformations as if were part of the caller's code.

Differences in calling convention would be something handled close to
the compiler code-generating back end.

You should re-examine critically what you mean by "compile twice",
and try to formalize it.

Compiling is everything from recognizing preprocessor tokens and
expanding macros and directives, to writing a .o or .obj file to disk;
even linking objects together to make an executable is sometimes
discussed as part of "compiling".

Code motion like loop unrolling and inlining is not usually discussed in
terms of "compiling twice", though it probaby does result in some
compiler passes being done twice on the different copies of the code.

If by "compiled twice" you mean that some code-generating back end
had to apply its work twice to the copies of the code, you are are
almost certainly right.

The idea that what is going on that code is distinct from inlining (that
"twice compiling" is going on there, but not in inlining) doesn't hold
water.

What most likely happened is this: because of the volatile function
pointer the compiler generated thunks which call the lambda (those
"invokers"):

We can show that using pseudo-code:

Reformatted original, minus header file and namespace boilerplate:

int main()
{
auto lambda = []( int a ) -> int
{
thread_local int i = 0;
return i++ + a;
};

int (__fastcall *volatile pFnFastcall)( int ) = lambda;
int (__stdcall *volatile pFnStdcall)( int ) = lambda;

cout << pFnFastcall( 10 ) << endl;
cout << pFnStdcall( 9 ) << endl;
}

What the compiler might have done, shown as pseudo-code:

int main()
{
auto lambda = []( int a ) -> int
{
thread_local int i = 0;
return i++ + a;
};

// hypothetical, compiler-generated code schema:

auto __notinline __fastcall invoker001 = []( int a ) -> int
{
return lambda(a); // lambda gets inlined
};

auto __notinline __stdcall invoker002 = []( int a ) -> int
{
return lambda(a); // lambda gets inlined
};

int (__fastcall *volatile pFnFastcall)( int ) = invoker001;
int (__stdcall *volatile pFnStdcall)( int ) = invoker002;

cout << pFnFastcall( 10 ) << endl;
cout << pFnStdcall( 9 ) << endl;
}

The invokers are real functions which are called. They inline
the lambda.

The invokers have matching calling conventions, propagated from
the volatile pointers. So that's where the adaptation comes from
to the calling conventions.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: What does this code print ?

<uh9hti$84mf$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2258&group=comp.lang.c%2B%2B#2258

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Tue, 24 Oct 2023 15:53:38 -0700
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <uh9hti$84mf$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <87lec95n0t.fsf@bsb.me.uk>
<ugaeqo$2vefi$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugemtr$61v$1@dont-email.me> <ugeo5l$gqp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 24 Oct 2023 22:53:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="32a2e1663c49ca7650f336158f268f0b";
logging-data="266959"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Fp0vzMTA5z4E/FU7m7fdOustN6d8bzg0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:NzWCYILnN2X6jfoaSIW87ygVPFU=
Content-Language: en-US
In-Reply-To: <ugeo5l$gqp$1@dont-email.me>
 by: Chris M. Thomasson - Tue, 24 Oct 2023 22:53 UTC

On 10/14/2023 11:54 AM, Paavo Helde wrote:
> 14.10.2023 21:33 Chris M. Thomasson kirjutas:
>> On 10/12/2023 11:50 PM, Bonita Montero wrote:
>>> Am 13.10.2023 um 05:50 schrieb Chris M. Thomasson:
>>>> On 10/11/2023 6:03 AM, Ben Bacarisse wrote:
>>>>> Bonita Montero <Bonita.Montero@gmail.com> writes:
>>>>>
>>>>>> #include <iostream>
>>>>>>
>>>>>> using namespace std;
>>>>>>
>>>>>> int main()
>>>>>> {
>>>>>>     auto lambda = []( int a ) -> int
>>>>>>     {
>>>>>>         thread_local int i = 0;
>>>>>>         return i++ + a;
>>>>>>     };
>>>>>>     int (__fastcall *volatile pFnFastcall)( int ) = lambda;
>>>>>>     int (__stdcall *volatile pFnStdcall)( int ) = lambda;
>>>>>>     cout << pFnFastcall( 10 ) << endl;
>>>>>>     cout << pFnStdcall( 9 ) << endl;
>>>>>> }
>>
>> 10 10 is a hint...
>
> I also got 10 10, first in my head, and my compiler agreed as well
> (VS2022).

Not sure what the point of Bonita's post was. thread_local is going to
the thread calling main here. All of the rest is just moronic fluff.

10
10

is correct.

Re: What does this code print ?

<uhal49$l1h3$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2259&group=comp.lang.c%2B%2B#2259

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Wed, 25 Oct 2023 10:54:33 +0200
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uhal49$l1h3$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <ugrqok$fto1$1@dont-email.me>
<20231019110532.810@kylheku.com> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<uh8kab$2ld7m$1@i2pn2.org> <uh8m8i$r6m$1@dont-email.me>
<uh8nrc$2ld7l$1@i2pn2.org> <uh8r8p$28od$1@dont-email.me>
<uh8tho$2ltqv$1@i2pn2.org> <uh8tli$2s0a$2@dont-email.me>
<uh8vgs$2ltqv$2@i2pn2.org> <uh927h$41im$1@dont-email.me>
<20231024123628.971@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 08:54:33 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f47c9491e2c7bd9cdc41f34a30b7ce83";
logging-data="689699"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Mh1FsHsDPuUE7SsQz0+e7LY9i6eQy97Y="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vHMgRP8+JdmdiSTNvfmDJFnQvts=
Content-Language: de-DE
In-Reply-To: <20231024123628.971@kylheku.com>
 by: Bonita Montero - Wed, 25 Oct 2023 08:54 UTC

Am 24.10.2023 um 21:48 schrieb Kaz Kylheku:

> It is quite usual for calls to inline functions not to appear identical.

That's true in this case because the "invoker" gets its values in
a different way. Nevertheless the term invoker is misleading if the
"invoked" function is always inlined. I did some loop unrolling inside
the lambda, producing about 2.000 instructions and the lambda was still
inlined. I guess If MSVC doesn't have a separate invoker with so much
code there's never a separate invoker. And with non-trivial parameters
there might be unexpectedd side effects if there's a non-inlined called
function like an out of memory error. So I gues MS knows that and con-
siders calling a separate functio too dangerous or intransparent.

Re: What does this code print ?

<uhb3ud$p19b$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2260&group=comp.lang.c%2B%2B#2260

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Wed, 25 Oct 2023 15:07:25 +0200
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <uhb3ud$p19b$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <87lec95n0t.fsf@bsb.me.uk>
<ugaeqo$2vefi$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugemtr$61v$1@dont-email.me> <ugeo5l$gqp$1@dont-email.me>
<uh9hti$84mf$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 13:07:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f47c9491e2c7bd9cdc41f34a30b7ce83";
logging-data="820523"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FRDk7h0v+LV3Gr+64U88tlaNdz1ujEC8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:DQRfO7W83fo1nCXbRr38tmqjyRo=
In-Reply-To: <uh9hti$84mf$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Wed, 25 Oct 2023 13:07 UTC

Am 25.10.2023 um 00:53 schrieb Chris M. Thomasson:

> Not sure what the point of Bonita's post was. thread_local is going to
> the thread calling main here. All of the rest is just moronic fluff.

Someone might expect that the thread_local or static variables
are not shared among the differernt instantiations of the calling
operator as with a generic calling operator.

Re: What does this code print ?

<uhbd3g$2mvvu$2@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2261&group=comp.lang.c%2B%2B#2261

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Wed, 25 Oct 2023 08:43:44 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uhbd3g$2mvvu$2@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <20231019110532.810@kylheku.com>
<ugrrh1$fto1$4@dont-email.me> <20231019120451.638@kylheku.com>
<ugs82g$j12c$2@dont-email.me> <20231019162423.200@kylheku.com>
<ugt9lg$ue68$1@dont-email.me> <ugtiar$26i7n$2@i2pn2.org>
<ugu84s$1685u$1@dont-email.me> <ugvca1$2918j$1@i2pn2.org>
<ugvpi4$1js55$1@dont-email.me> <uh0r9b$2b12n$2@i2pn2.org>
<uh12dd$1sgmt$1@dont-email.me> <uh138s$2b7av$2@i2pn2.org>
<uh15j2$1t8j1$1@dont-email.me> <uh19ot$2b7au$5@i2pn2.org>
<uh20qf$2705q$1@dont-email.me> <uh21ct$2ck19$1@i2pn2.org>
<uh29t3$28g3k$1@dont-email.me> <uh3al6$2ck18$1@i2pn2.org>
<uh694p$38uv3$1@dont-email.me> <uh6b5h$2fvna$2@i2pn2.org>
<uh8irj$3vru6$1@dont-email.me> <uh8kab$2ld7m$1@i2pn2.org>
<uh8m8i$r6m$1@dont-email.me> <uh8nrc$2ld7l$1@i2pn2.org>
<uh8r8p$28od$1@dont-email.me> <uh8tho$2ltqv$1@i2pn2.org>
<uh8tli$2s0a$2@dont-email.me> <uh8vgs$2ltqv$2@i2pn2.org>
<uh927h$41im$1@dont-email.me> <20231024123628.971@kylheku.com>
<uhal49$l1h3$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 15:43:44 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2850814"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
In-Reply-To: <uhal49$l1h3$1@dont-email.me>
Content-Language: en-US
 by: Richard Damon - Wed, 25 Oct 2023 15:43 UTC

On 10/25/23 1:54 AM, Bonita Montero wrote:
> Am 24.10.2023 um 21:48 schrieb Kaz Kylheku:
>
>> It is quite usual for calls to inline functions not to appear identical.
>
> That's true in this case because the "invoker" gets its values in
> a different way. Nevertheless the term invoker is misleading if the
> "invoked" function is always inlined. I did some loop unrolling inside
> the lambda, producing about 2.000 instructions and the lambda was still
> inlined. I guess If MSVC doesn't have a separate invoker with so much
> code there's never a separate invoker. And with non-trivial parameters
> there might be unexpectedd side effects if there's a non-inlined called
> function like an out of memory error. So I gues MS knows that and con-
> siders calling a separate functio too dangerous or intransparent.
>

Yes, "invoker" may be a bit misleading, but it is the term that was
chosen, and the terminology doesn't change just because the invoked
function happens to be inlined.

As someone else mentioned, perhaps a more common term is "trampoline",
but that term is longer, and actually isn't as descriptive of a term.

Re: What does this code print ?

<uhbd3m$2mvvu$3@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2262&group=comp.lang.c%2B%2B#2262

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Wed, 25 Oct 2023 08:43:50 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uhbd3m$2mvvu$3@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <87lec95n0t.fsf@bsb.me.uk>
<ugaeqo$2vefi$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugemtr$61v$1@dont-email.me> <ugeo5l$gqp$1@dont-email.me>
<uh9hti$84mf$1@dont-email.me> <uhb3ud$p19b$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 15:43:51 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2850814"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <uhb3ud$p19b$1@dont-email.me>
 by: Richard Damon - Wed, 25 Oct 2023 15:43 UTC

On 10/25/23 6:07 AM, Bonita Montero wrote:
> Am 25.10.2023 um 00:53 schrieb Chris M. Thomasson:
>
>> Not sure what the point of Bonita's post was. thread_local is going to
>> the thread calling main here. All of the rest is just moronic fluff.
>
> Someone might expect that the thread_local or static variables
> are not shared among the differernt instantiations of the calling
> operator as with a generic calling operator.
>
>

Maybe, but they would be wrong.

After all, for a "generic" lambda, each variation is really a different
function (just like a template function), but each instance of a GIVEN
instance of the "generic" lambda, just like the non-generic lambda, or
even an ordinary function, when inlined MUST share static or
thread_local variables.

Re: What does this code print ?

<uhbdth$rqvq$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2263&group=comp.lang.c%2B%2B#2263

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Wed, 25 Oct 2023 17:57:38 +0200
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uhbdth$rqvq$1@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <ugrrh1$fto1$4@dont-email.me>
<20231019120451.638@kylheku.com> <ugs82g$j12c$2@dont-email.me>
<20231019162423.200@kylheku.com> <ugt9lg$ue68$1@dont-email.me>
<ugtiar$26i7n$2@i2pn2.org> <ugu84s$1685u$1@dont-email.me>
<ugvca1$2918j$1@i2pn2.org> <ugvpi4$1js55$1@dont-email.me>
<uh0r9b$2b12n$2@i2pn2.org> <uh12dd$1sgmt$1@dont-email.me>
<uh138s$2b7av$2@i2pn2.org> <uh15j2$1t8j1$1@dont-email.me>
<uh19ot$2b7au$5@i2pn2.org> <uh20qf$2705q$1@dont-email.me>
<uh21ct$2ck19$1@i2pn2.org> <uh29t3$28g3k$1@dont-email.me>
<uh3al6$2ck18$1@i2pn2.org> <uh694p$38uv3$1@dont-email.me>
<uh6b5h$2fvna$2@i2pn2.org> <uh8irj$3vru6$1@dont-email.me>
<uh8kab$2ld7m$1@i2pn2.org> <uh8m8i$r6m$1@dont-email.me>
<uh8nrc$2ld7l$1@i2pn2.org> <uh8r8p$28od$1@dont-email.me>
<uh8tho$2ltqv$1@i2pn2.org> <uh8tli$2s0a$2@dont-email.me>
<uh8vgs$2ltqv$2@i2pn2.org> <uh927h$41im$1@dont-email.me>
<20231024123628.971@kylheku.com> <uhal49$l1h3$1@dont-email.me>
<uhbd3g$2mvvu$2@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 15:57:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f47c9491e2c7bd9cdc41f34a30b7ce83";
logging-data="912378"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19K6C5zubiqUYG5OrCNhpuaF6D6Z3PQbx0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:xl5EftfH/rHiSgNyPIHKSHQjdLg=
Content-Language: de-DE
In-Reply-To: <uhbd3g$2mvvu$2@i2pn2.org>
 by: Bonita Montero - Wed, 25 Oct 2023 15:57 UTC

Am 25.10.2023 um 17:43 schrieb Richard Damon:

> Yes, "invoker" may be a bit misleading, but it is the term that was
> chosen, and the terminology doesn't change just because the invoked
> function happens to be inlined.

The term becomes rather metaphoric with that.

Re: What does this code print ?

<uhbe4o$rqvq$2@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2264&group=comp.lang.c%2B%2B#2264

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Wed, 25 Oct 2023 18:01:28 +0200
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uhbe4o$rqvq$2@dont-email.me>
References: <ug54sf$1ki2m$1@dont-email.me> <87lec95n0t.fsf@bsb.me.uk>
<ugaeqo$2vefi$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugemtr$61v$1@dont-email.me> <ugeo5l$gqp$1@dont-email.me>
<uh9hti$84mf$1@dont-email.me> <uhb3ud$p19b$1@dont-email.me>
<uhbd3m$2mvvu$3@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 16:01:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f47c9491e2c7bd9cdc41f34a30b7ce83";
logging-data="912378"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qvQsE5wAWudofGlYYx5PoKe+IbdJfJr8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:y0fh+S/hUe9gU0PiN9QS6HNR738=
In-Reply-To: <uhbd3m$2mvvu$3@i2pn2.org>
Content-Language: de-DE
 by: Bonita Montero - Wed, 25 Oct 2023 16:01 UTC

Am 25.10.2023 um 17:43 schrieb Richard Damon:

> After all, for a "generic" lambda, each variation is really a different
> function (just like a template function), but each instance of a GIVEN
> instance of the "generic" lambda, just like the non-generic lambda, or
> even an ordinary function, when inlined MUST share static or
> thread_local variables.

I would also have thought it acceptable if each "instance" of
the lambda had its own static and thread-local variables for
each calling convention. In practice, it would be very atypical
if you actually instantiate the lambda with several calling
conventions.

Re: What does this code print ?

<uhbfam$2mvvu$4@i2pn2.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2265&group=comp.lang.c%2B%2B#2265

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!.POSTED!not-for-mail
From: rich...@damon-family.org (Richard Damon)
Newsgroups: comp.lang.c++
Subject: Re: What does this code print ?
Date: Wed, 25 Oct 2023 09:21:41 -0700
Organization: i2pn2 (i2pn.org)
Message-ID: <uhbfam$2mvvu$4@i2pn2.org>
References: <ug54sf$1ki2m$1@dont-email.me> <87lec95n0t.fsf@bsb.me.uk>
<ugaeqo$2vefi$1@dont-email.me> <ugapal$31eim$1@dont-email.me>
<ugemtr$61v$1@dont-email.me> <ugeo5l$gqp$1@dont-email.me>
<uh9hti$84mf$1@dont-email.me> <uhb3ud$p19b$1@dont-email.me>
<uhbd3m$2mvvu$3@i2pn2.org> <uhbe4o$rqvq$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 25 Oct 2023 16:21:42 -0000 (UTC)
Injection-Info: i2pn2.org;
logging-data="2850814"; mail-complaints-to="usenet@i2pn2.org";
posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg";
User-Agent: Mozilla Thunderbird
In-Reply-To: <uhbe4o$rqvq$2@dont-email.me>
Content-Language: en-US
 by: Richard Damon - Wed, 25 Oct 2023 16:21 UTC

On 10/25/23 9:01 AM, Bonita Montero wrote:
> Am 25.10.2023 um 17:43 schrieb Richard Damon:
>
>> After all, for a "generic" lambda, each variation is really a
>> different function (just like a template function), but each instance
>> of a GIVEN instance of the "generic" lambda, just like the non-generic
>> lambda, or even an ordinary function, when inlined MUST share static
>> or thread_local variables.
>
> I would also have thought it acceptable if each "instance" of
> the lambda had its own static and thread-local variables for
> each calling convention. In practice, it would be very atypical
> if you actually instantiate the lambda with several calling
> conventions.

The key point is that for functions that are inlined, each inlined
"instance" of the function doesn't get new shared static/thread-local
variables. This is REQUIRED as inlining isn't allowed to change the
visible behavior of the function, but is just an optimization.

Your multiple "instances" are all logically part of the same function.
Your thought process that you have two different versions of the lambda
with different calling conventions is just incorrect.

You have one version of the lambda, with the cdecl calling convention
(since no convention was specified) used in both "instances". Each
instance is actually an invoker/trampoline function with the specified
calling convention, using the one defined lambda function, which happens
to get inlined. So, perhaps at first glance it looks like there are two
different version of the lambda function, but by the definitions of the
Standard, there is one version, that has been inlined in two places
within two different calling convention adaptor functions.


devel / comp.lang.c++ / Re: What does this code print ?

Pages:123456
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor