"static" UFCS

Jacob Carlborg doob at me.com
Thu Jun 14 07:19:07 PDT 2012


On 2012-06-14 14:33, deadalnix wrote:

> 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.
>
> What would be the use case for such a feature ?

Originally the idea pop up in my head when I was thinking if it was 
possible to implement, in library code, the magic meta namespace the 
community has been talking about a couple of times in the past.

Something like this:

import std.meta;

class Foo
{
     void bar (){}
}

auto methods = Foo.meta.methods;

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list