Why writeln can't be converted to nothrow with just catching of StdioException

Mike Parker aldacron at gmail.com
Mon Feb 21 11:04:46 UTC 2022

On Monday, 21 February 2022 at 10:49:13 UTC, partypooper wrote:
> Do I completely not understand what is `nothrow` or why I can't 
> make function nothrow with just catching StdioException?

D does not have checked exceptions like Java, so the compiler 
doesn't have anyway to verify that any function you call won't 
throw a given exception. You have to catch `Exception` to satisfy 
the `nothrow` requirement.

More information about the Digitalmars-d-learn mailing list