Re: Call a function passed as template parameter.

2015-09-04 Thread moechofe via Digitalmars-d-learn
On Thursday, 3 September 2015 at 13:16:41 UTC, Adam D. Ruppe wrote: http://arsdnet.net/dcode/book/chapter_08/11/caller.d https://github.com/adamdruppe/arsd/blob/master/jsvar.d#L608 Thank you for these examples.

Call a function passed as template parameter.

2015-09-03 Thread moechofe via Digitalmars-d-learn
Hi, I would like to create a template that take a function as template parameter, create an arguments list for it, fill it with some data and call the function. void foo(uint a, string b) { // ... } void bar(long a, long b, string c) { // ... } call(alias F)(JSONValue j) { // create

Re: Call a function passed as template parameter.

2015-09-03 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 3 September 2015 at 11:31:22 UTC, moechofe wrote: I would like to create a template that take a function as template parameter, create an arguments list for it, fill it with some data and call the function. Check out the sample chapter to my book: