Good points, got it down to this.

void error(string a_Msg, string file = __FILE__, size_t line = __LINE__)
{
   writefln( a_Msg ~ ". In file %s on line %d.", file, line );
}

int main()
{
   format("hallo").error;
   format("Hallo %s.", "du da").error;
}

There should be no more template bloat, and it looks to be about as usable and simple as possible.

Do you see any further optimizations that do not increase the usage convenience?

--rt

Reply via email to