On Monday, 14 May 2018 at 07:59:06 UTC, Jonathan M Davis wrote:
On Monday, May 14, 2018 07:03:35 Dukc via Digitalmars-d wrote:
On Monday, 14 May 2018 at 07:02:37 UTC, Dukc wrote:
------------
module test;
void main() { foo.i = 2; }
void foo() { static int i = 1; }
------------

If that's what you want, just make it a module-level variable.

Well, personally I don't care much because using static mutables sucks anyway, and there is rarely a reason to make static immutables just for one function. Enums are for that.

Just pointed out that it would be consistent with how classes encapsulate stuff. And the same point goes for eponymous templates, of course.

Reply via email to