does alias this work correctly?

Zhenya zheny at list.ru
Sun Jan 13 11:16:35 PST 2013


Hi!
Is it all right with it:
struct Foo
{
	struct Bar
	{
		void opCall()
		{
			writeln("non-static");
		}
	}
	Bar bar;
	static struct Anotherbar
	{
		static void bar()
		{
			writeln("static");
		}
	}
	alias Anotherbar this;
}

void main()
{
	Foo f;
	f.bar();
	Foo.bar();//fils with message:type Bar is not an expression
         Foo.Bar b;
         b();//this works however
}
?


More information about the Digitalmars-d-learn mailing list