On 12/3/15 10:24 AM, Chris Wright wrote:
You can already do it with a slight change, and it's not so painful, at
least in simple functions:

int foo(bool b) {
   auto result = 2;
   scope(exit) writeln(result);
   if (b) {
     result = 1;
   }
   return result;
}


auto ref logCall(alias f, Args...)(auto ref Args args) {
   auto ref printResult(T)(auto ref T t)
   {
      writeln(t);
      return t;
   }
   return printResult(f(args))
}

logCall!foo(true);

-Steve

Reply via email to