[Issue 20811] Regression as of 2.066.0 - CTFE static variable retained across calls

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 8 19:23:35 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20811

Basile-z <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com

--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
> having a compile-time counter like this can actually be pretty useful

There was a plan to add a new primary exp for counting, see the defunct PR
https://github.com/dlang/dmd/pull/10131/files.

The problem with a CTFE counter is that it must allow static CTFE variables,
this is not correct. global and mutable states are forbidden in CTFE, they can
only change in a function body

--


More information about the Digitalmars-d-bugs mailing list