Get type from string
DarkRiDDeR via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Oct 29 06:13:15 PDT 2015
On Wednesday, 28 October 2015 at 20:04:51 UTC, Adam D. Ruppe
wrote:
> On Wednesday, 28 October 2015 at 17:57:16 UTC, DarkRiDDeR wrote:
>> Thank you! Is it possible to call a method from a string at
>> run time?
>
> Yes, though you have to prepare code to do it. Again, I'd try
> to make it work on interfaces on some level.
>
> The free sample chapter of my book
> https://www.packtpub.com/application-development/d-cookbook
> shows an example near the end of how to write that code.
> Basically, you loop over members at compile time and generate
> wrapper functions for them, which you then call based on a
> runtime string.
I had the same idea to solve this problem. But the book is
already good examples. Thank you.
More information about the Digitalmars-d-learn
mailing list