Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Are there any conformant C compilers? Date: Fri, 26 Aug 2022 06:56:47 -0700 Organization: A noiseless patient Spider Lines: 27 Message-ID: <86r113rtuo.fsf@linuxsc.com> References: <86zgfss6k3.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader01.eternal-september.org; posting-host="afcc7083db196e1e8e1d2e6bebe1e49f"; logging-data="4191228"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199PxQ22MOc0SqLeEmTEX+4B16d0oZ4z4M=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:u5NPHXbEh2P11/gSzKgLUDbp4Wo= sha1:70me0CQoI9aZbpeYE6JSdhxA1qE= Xref: csiph.com comp.lang.c:167232 antispam@math.uni.wroc.pl writes: > Tim Rentsch wrote: > >> antispam@math.uni.wroc.pl writes: >> >>> IMO main problem with 'constexpr' is that >>> it is quite limited. >> >> If constexpr functions are allowed, constexpr is >> Turing complete, is it not? > > [...] > If 'constexpr' > functions were defined requiring that all steps > are constexpr one would be limited to purely functional > style. And currently 'constexpr' is forced to live > in its own world, so if you need "the same" computation > in 'constexpr' and in regular code you need to > copy code and rename identifiers to avoid clashes. TTBOMK neither of those things is true in C++. I don't know what constexpr will look like in C23. Whatever it is, I figure it's only a matter of time before the C version of constexpr adopts at least most of the C++ semantics for constexpr.