On Tuesday, 14 August 2012 at 23:21:32 UTC, Mehrdad wrote:
Or even better:
auto joiner(RoR, Separator)(RoR r, Separator sep)
throws(auto);
That way it's easy enough for the programmer to make the
compiler shut up (it's certainly easier than swallowing the
exception), while allowing him to write functions that are
perfectly transparent toward exceptions, and which would be
allowed to throw/catch as they would in any other
exception-unchecked language.
IMO it would work well in practice.
Caveat perhaps worth mentioning:
Indirect calls (function pointers, delegates, virtual methods)
would be inferred as throw-all, and would preferably give an
informational warning to the user that they may need tighter
exception specifications.