Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fiw static article #133

Open
p0nce opened this issue May 9, 2017 · 0 comments
Open

Fiw static article #133

p0nce opened this issue May 9, 2017 · 0 comments

Comments

@p0nce
Copy link
Owner

p0nce commented May 9, 2017

<calex> p0nce: I just read the rest of your "four ways to use static" tip. You missed one of the more nifty usages D retained from C++: function-local static variables.
<calex> size_t monotonic() { static size_t sequenceNumber; return sequenceNumber++; }
<calex> assert( monotonic != monotonic );
<ketmar> p0nce: also, `__gshared` implies `static` everywhere except top-level declarations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant