Deutsch English Français Italiano |
<v3stia$1jpih$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Thiago Adams <thiago.adams@gmail.com> Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Thu, 6 Jun 2024 15:01:46 -0300 Organization: A noiseless patient Spider Lines: 41 Message-ID: <v3stia$1jpih$1@dont-email.me> References: <v2l828$18v7f$1@dont-email.me> <00297443-2fee-48d4-81a0-9ff6ae6481e4@gmail.com> <v2lji1$1bbcp$1@dont-email.me> <9be0c55c-38f8-496c-b335-84ad281e1753@gmail.com> <v2nc5h$1oban$1@dont-email.me> <c5866b5a-0314-4e70-af56-a86b63986b0c@gmail.com> <v2nfai$1ougd$1@dont-email.me> <cf267279-e9cf-415f-898c-f5830a997529@gmail.com> <87ed9s42sb.fsf@nosuchdomain.example.com> <f5774ff3-d2b0-4787-b16c-3b193dc418ef@gmail.com> <87bk4v2du1.fsf@nosuchdomain.example.com> <ec20f752-6132-40f5-a4e8-f884746d2f3a@gmail.com> <87v8330xq3.fsf@nosuchdomain.example.com> <97c17a49-a940-42ff-83b8-df755fb6e88e@gmail.com> <v2sgm6$2rle2$1@dont-email.me> <3510a9be-2962-4f8a-a040-62e2716eed92@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 06 Jun 2024 20:01:46 +0200 (CEST) Injection-Info: dont-email.me; posting-host="629b39aac51adf13d22ab925c2f31a10"; logging-data="1697361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197MsE4wKQ/edzGu0kPQ6eh/mRhQbsgNIA=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Ymwt+qqFgUlF6CLE8Njd7Ulv0gk= In-Reply-To: <3510a9be-2962-4f8a-a040-62e2716eed92@gmail.com> Content-Language: en-US Bytes: 2874 On 25/05/2024 08:19, Thiago Adams wrote: .... > In my view , for this sample constexpr generates noise. It also can make > the compilation slower, otherwise, why not everything constexpr by defaul? > I still didn't find a useful usage for constexpr that would compensate > the mess created with const, constexpr. I already saw ( I don't have it > now ) proposals to make const more like constexpr in C. In C++ const is > already a constant expression! > The justification for C was VLA. They should consider VLA not VLA if it > has a constant expression. In other words, better break this than create > a mess. > #define makes the job of constexpr. > > > One more sample of NOISE of constexpr from the same real source. int compare(const Node* a, const Node* b) { return memcmp(a, b, sizeof(Node)) == 0; } bool IsValid(Node * pnid) { static constexpr Node node = { 1, 2 }; return compare(pnid, &node); } What is expectation passing the address of compile constant to a runtime function? This is pure noise! Nothing happens, nothing is done at compile time. https://godbolt.org/z/ecsMf4vaY