What is the point of nothrow?

Steven Schveighoffer schveiguy at yahoo.com
Tue Jun 12 14:19:42 UTC 2018


On 6/10/18 7:59 PM, Bauss wrote:
> What is the point of nothrow if it can only detect when Exception is 
> thrown and not when Error is thrown?
> 
> It seems like the attribute is useless because you can't really use it 
> as protection to write bugless, safe code since the nasty bugs will pass 
> by just fine.

Array invalid index throws Error, and asserts throw Error. I'm not sure 
how much you could accomplish without such features. In fact, I'd 
consider these ESSENTIAL to writing safe code.

Bug-free code is a myth :)

-Steve


More information about the Digitalmars-d-learn mailing list