'unwrap envy' and exceptions

James Blachly james.blachly at gmail.com
Fri Sep 10 18:27:25 UTC 2021


On 9/10/21 11:44 AM, jfondren wrote:
> Yeah, .assumeWontThrow in a nothrow function is very similar to .unwrap, 
> but there's no analogue to ? in a function that just propagates errors. 
> Temporarily adding nothrow still tells you where exceptions might be 
> coming from, and I suppose a Sufficiently Smart IDE could toggle that 
> behind your back to annotate uncaught exceptional function calls for you.

I've really come to appreciate `?` operator, and don't forget there is a 
complement of other library infrastructure like `map_err`, 
`unwrap_or_else`, etc.



More information about the Digitalmars-d mailing list