static vs non-static

Jacob Carlborg doob at me.com
Sun Jan 13 11:49:42 PST 2013


On 2013-01-13 16:58, Zhenya wrote:
> Hi!
> Sorry,if it already was discussed,but
>
> import std.stdio;
>
> struct Foo
> {
> static void bar()
> {
> writeln("static");
> }
> void bar()
> {
> writeln("non-static");
> }
> }
>
> int main()
> {
> Foo gun;
> gun.bar();//fails here
> }
>
> Is it all right,that compiler dosn't prefer non-static function in ths
> case?

There's a bugzilla issue for this. Search for "classinfo".

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list