<div dir="ltr"><div>Is there a better way than the example below to have an informative (ie formatted with runtime values) error message inside a nogc function?</div><div><br></div><div>@nogc</div><div>void test(int a){</div><div>  char[100]buf; //TODO:make sure big enough</div><div>  //auto s=sformat(buf, "a = %s", a);/// not nogc even though it accepts a buf</div><div>  auto m=snprintf(buf.ptr, buf.length, "a = %d", a);</div><div>  assert(m<buf.length && m>0);</div><div>  assert(a==3, buf[0..m]);</div><div>}</div><div><br></div></div>