Re: How can I get the "owner" of a method?

2022-10-01 Thread solidstate1991 via Digitalmars-d-learn
On Friday, 30 September 2022 at 22:20:06 UTC, Salih Dincer wrote: Maybe this will help you: ```d template Bar(T) { void fun() {} } class Foo(T) { mixin Bar!T b; alias fun = b.fun; void test() { fun(); } } ``` SDB@79 The issue with that is in that case is instead of writing

Re: How can I get the "owner" of a method?

2022-09-30 Thread Ali Çehreli via Digitalmars-d-learn
On 9/30/22 14:11, solidstate1991 wrote: > extern (C) public int registerDDelegate(alias Func, That can be a lambda that takes ClassType. I wrote the following along with place holder as I assumed them to be: class C { string s; void foo() { import std.stdio : writeln;

Re: How can I get the "owner" of a method?

2022-09-30 Thread Salih Dincer via Digitalmars-d-learn
On Friday, 30 September 2022 at 21:11:48 UTC, solidstate1991 wrote: Let's say I have a class or an interface with a function, and I want to pass that to a template to generate another function (in this case one that passes it to a scripting engine, and allows it to be called from there).

How can I get the "owner" of a method?

2022-09-30 Thread solidstate1991 via Digitalmars-d-learn
Let's say I have a class or an interface with a function, and I want to pass that to a template to generate another function (in this case one that passes it to a scripting engine, and allows it to be called from there). Currently I have the following issues: 1. I have to pass the