Greetings<div><br></div><div>Kindly make me understand this. I have been trying to call an alias for a class method from another scope. I keep getting an error saying that I need "this" to call a method. Why will not "this" pointer be available when I am passing the method symbol along with an object of the class? Is there another way of doing what I am trying to achieve. I have pasted a sample code below here.</div>

<div><br></div><div>Regards</div><div>- Puneet</div><div><br></div><div><div>void callfoo(alias F, T) (T t) {</div><div>  void foo() {</div><div>    F();   // Error: need 'this' to access member foo</div><div>    t.F(); // Error: undefined identifier 'F'</div>

<div>  }</div><div>}</div><div><br></div><div>class Foo {</div><div>  void foo() {}</div><div>}</div><div><br></div><div>void main() {</div><div>  Foo f = new Foo();</div><div>  callfoo!(f.foo)(f);</div><div>}</div></div>

<div><br></div>