On Wednesday, 30 May 2018 at 08:27:16 UTC, FeepingCreature wrote:
struct CallerInfo
{
  string file;
  size_t line;
}

Let me try to flesh this out.

void foo(CallContext caller = __CALL_CONTEXT__)
{
}

// in druntime object.d
struct CallContext
{
  public size_t line; // expected to change for every call
private const FunctionContext* functionContext; // expected to be constant for many calls
  alias functionContext this;
}

/** a variable with this type is lazily allocated once per function */
struct FunctionContext
{
  string file, fileFullPath, module, function, prettyFunction;
}

I've looked at DMDFE and I don't think I know enough to do this, annoyingly.

Reply via email to