Re: [Question] About mixin, template and alias

2013-09-23 Thread monarch_dodra
On Monday, 23 September 2013 at 06:31:01 UTC, monarch_dodra wrote: I'm filing a bug report right now. http://d.puremagic.com/issues/show_bug.cgi?id=11107

Re: [Question] About mixin, template and alias

2013-09-23 Thread Michael
I understand. So, at least it's has interesting behaviour and big question)

Re: [Question] About mixin, template and alias

2013-09-23 Thread Michael
Code below shows that I would achieve: / fire.d alias void delegate() EventHandler; class Event(T) { private T[] _events; public void opOpAssign(string op)(T param) if (op == ~) { _events ~= param; } public void opCall(ParamType ...)(ParamType params) {

[Question] About mixin, template and alias

2013-09-22 Thread Michael
/// fire.d import std.stdio; alias void delegate() EventHandler; class Event(T) { private T[] _events; public void opOpAssign(string op)(T param) if (op == ~) { writeln(param.funcptr); _events ~= param; } public void opCall(ParamType ...)(ParamType

Re: [Question] About mixin, template and alias

2013-09-22 Thread monarch_dodra
On Sunday, 22 September 2013 at 18:31:20 UTC, Michael wrote: /// fire.d import std.stdio; alias void delegate() EventHandler; class Event(T) { private T[] _events; public void opOpAssign(string op)(T param) if (op == ~) { writeln(param.funcptr); _events ~=

Re: [Question] About mixin, template and alias

2013-09-22 Thread Michael
This: // auto eventObserver = new Event!DelegateType(); // Does not do what you think it does: It *statically* initializes eventObserver to the *single* new Event!DelegateType();. SO basically, all your instances are sharing the same Event. I'm surprised this compiles at all,