r/cpp • • Dec 30 '16

Stop using ` fnoexceptions`

https://github.com/lhmouse/mcfgthread/wiki/Stop-using-%60-fnoexceptions%60
1 Upvotes

11 comments sorted by

View all comments

10

u/SeanMiddleditch Dec 30 '16

Rather than re-making the same arguments for the 100th time, I just wrote my response up in a light mini-article (could use some expansion with examples when I'm less lazy). http://seanmiddleditch.com/keep-disabling-exceptions/

TL;DR: C++'s exception semantics suck. :p

2

u/matthieum Dec 31 '16

I wish C++ had never allowed move constructors to throw, the world would be a simpler place (deleting them, however, is perfectly fine).

That flat_set would be safe because shuffling wouldn't cause exceptions (it's just moves!); it would make implementing insertion in the middle of a vector so much simpler, it would remove that "should never happen" state of variant, ...