Deutsch English Français Italiano |
<v12v90$ju1r$1@raubtier-asyl.eternal-september.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail From: Bonita Montero <Bonita.Montero@gmail.com> Newsgroups: comp.lang.c++,comp.lang.c Subject: Re: Threads across programming languages Date: Fri, 3 May 2024 17:18:55 +0200 Organization: A noiseless patient Spider Lines: 39 Message-ID: <v12v90$ju1r$1@raubtier-asyl.eternal-september.org> References: <GIL-20240429161553@ram.dialup.fu-berlin.de> <v0ogum$1rc5n$1@dont-email.me> <v0ovvl$1ur12$4@dont-email.me> <v0p06i$1uq6q$5@dont-email.me> <v0shti$2vrco$2@raubtier-asyl.eternal-september.org> <v0spsh$31ds4$3@dont-email.me> <v0stic$325kv$3@raubtier-asyl.eternal-september.org> <v0svtn$32o8h$1@dont-email.me> <v0t091$32qj6$1@raubtier-asyl.eternal-september.org> <v0u90h$3c1r5$4@dont-email.me> <v0v28q$3ku1r$1@raubtier-asyl.eternal-september.org> <v105sc$3skqi$1@dont-email.me> <v10adm$3to7r$1@raubtier-asyl.eternal-september.org> <v124a6$drbu$1@dont-email.me> <v125f4$e2kl$1@raubtier-asyl.eternal-september.org> <v12a4e$f4f1$2@dont-email.me> <v12hf0$gtpa$1@raubtier-asyl.eternal-september.org> <20240503180102.00002f98@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 03 May 2024 17:18:56 +0200 (CEST) Injection-Info: raubtier-asyl.eternal-september.org; posting-host="c030ccadbcaefe746bb34fa5f5a5f34a"; logging-data="653371"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dPyc7gsDmOMS6HYyzZSItPmJFZ+gq3Wo=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:WwgOH6Fbw1a8Go7c6/Dx5wi2ZPE= Content-Language: de-DE In-Reply-To: <20240503180102.00002f98@yahoo.com> Bytes: 3496 Am 03.05.2024 um 17:01 schrieb Michael S: > On Fri, 3 May 2024 13:23:13 +0200 > Bonita Montero <Bonita.Montero@gmail.com> wrote: > >> Am 03.05.2024 um 11:18 schrieb David Brown: >>> On 03/05/2024 09:58, Bonita Montero wrote: >>>> Am 03.05.2024 um 09:38 schrieb David Brown: >>>> >>>>> No it is not. C-style functions (or C++ functions for that >>>>> matter) are not objects, and do not have calling operators. >>>>> Built-in operators do not belong to a type, in the way that class >>>>> operators do. >>>> >>>> You can assign a C-style function pointer to an auto >>>> function-object. >>> >>> A C-style function /pointer/ is an object. A C-style /function/ is >>> not. Do you understand the difference? >> >> Practically there isn't a difference. >> > > For C, I agree, mostly because C has no nested functions. > For C++ (after C++11) I am less sure, because of lambdas with > non-empty captures. > Lambdas without captures can be casted to C function-pointers and those lambdas have all the same function-pointer type if the signature of the calling operator is the same. A nice trick to enforce function-pointer casting is to apply the +-ope- rator to a non-capturing lambda since the plus-operator can be applied to all pointers (I can really recommend the book "C++ Lambda Story" for such details); this makes it possible to make the function-pointer defi- nition type-inferenced. Or if you want to create a function<>-object from the lambda which is guaranteed not to allocate if you pass a C function-pointer you can enforce that if you attach the +-sign to the assigned lambda.