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

Mike Parker aldacron at gmail.com
Mon Feb 21 11:18:58 UTC 2022


On Monday, 21 February 2022 at 11:11:28 UTC, partypooper wrote:

> So with such behavior there is no reason at all to make make 
> function nothrow, if it uses throw functions in its body?

I'm not sure what you mean. If a function throws an exception, it 
can't be nothrow.

> And as much as I already know compliler can deduce and 
> automatically adds nothrow to all functions which do not throw 
> exceptions. Right?

Function attribute inference is done in specific circumstances, 
but not for all functions. See 
https://dlang.org/spec/function.html#function-attribute-inference.


More information about the Digitalmars-d-learn mailing list