"static" UFCS

jerro a at a.com
Thu Jun 14 13:21:31 PDT 2012


> I already think that static method was a bad idea from the « 
> everything have to be an object » time.
>
> The need for static function is pretty weak when we have free 
> function and that they can access private objects data as 
> needed.
>

I sometimes use structs with static members in a way similar
to ML functors:

struct A
{
     alias SomeType T;
     T foo(){ ... }
     void bar(T a, T b){ ... }
}

struct B(S)
{
// some static members that use S.T, S.foo and S.bar
}

...

B!(A).someMember();

> What would be the use case for such a feature ?

I haven't ever felt a need to have the feature discussed in
this thread either.


More information about the Digitalmars-d mailing list