[Issue 23579] static locals cannot be initialized with stack locals
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 26 13:48:02 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23579
Max Samukha <maxsamukha at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |maxsamukha at gmail.com
--- Comment #3 from Max Samukha <maxsamukha at gmail.com> ---
(In reply to Nick Treleaven from comment #1)
> Assignment is not initialization. A static variable is only initialised
> once. What is your use case? In the example b's previous value is discarded
> every time v is called, so why is b static?
The initialization vs assignment distinction is useless, given the requirement
that T.init is a valid value of T.
--
More information about the Digitalmars-d-bugs
mailing list