file tst.d: import std.stdio : writeln; import tst1; void main() { writeln(do_op()); writeln(do_op()); } and file tst1.d: static int do_op() { static int x; x += 1; return(x); }
Leveraging my knowledge of C, I assumed a "static" function would
be hidden outside of its own source file. I can't find any
statement about the semantics of a static function in the
documentation, and in practice (ldc2 on Linux) it doesn't hide
the function?
- static functions? Andy Valencia via Digitalmars-d-learn
- Re: static functions? Jonathan M Davis via Digitalmars-d-learn
- Re: static functions? Andy Valencia via Digitalmars-d-learn
- Re: static functions? user1234 via Digitalmars-d-learn
- Re: static functions? Jonathan M Davis via Digitalmars-d-learn