On Mon, 19 Apr 2010 07:28:09 +0200, Philippe Sigaud <philippe.sig...@gmail.com> wrote: > > On Mon, Apr 19, 2010 at 05:21, Justin Spahr-Summers < > justin.spahrsumm...@gmail.com> wrote: > > > You can use some expression tuple magic to accomplish something like > > that: > > > > bool check(alias func, EL ...)() { > > GError* err; > > bool ok = func(EL, &err); > > if (!ok) > > throw new Exception((*err).message); > > > > return ok; > > } > > > > // used like: > > check!(fooXXX, arg1, ..., argN); > > > > > But in this case, you need to know the ELs at compile-time. You can make > them run-time values that way: > > bool check(alias func, EL ...)(EL el) { > GError* err; > bool ok = func(el, &err); > if (!ok) > throw new Exception((*err).message); > > return ok; > } > > // used like: > check!fooXXX(arg1, ..., argN);
Yes, sorry. That's what I was trying to do originally, but I couldn't quite spit it out. Indeed, templating the actual arguments is a horrible idea.