bearophile wrote:
Steven Schveighoffer:

What's the advantage over:

static int y;

T foo(T)(T x) { // ... }

That the global name space is kept clean, the "y" name can be seen
only inside foo. Reducing the visibility of names is useful to keep
things tidy. (Inside normal functions in D static has just that
purpose).

struct MyNameSpace
{
    static int y;

    T foo(T)(T x) { ... }
}

Reply via email to