static static

Bill Baxter wbaxter at gmail.com
Wed Nov 11 13:28:01 PST 2009


On Wed, Nov 11, 2009 at 1:16 PM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:

> One option that hasn't been mentioned:
>
> private ref int myInt() {
>    static int theInt;
>    return theInt;
> }
>
> void fun(T)(T arg) {
>    ... use myInt() ...
> }

Is that a joke?  That just replaces global symbol theInt with global
symbol myInt.  I don't see the win.

--bb



More information about the Digitalmars-d mailing list