Re:Current hardware trends make C++ exceptions harder to jus...
by _b on Tuesday February 22, 2022 @01:57PM
(#30431982)
Don't write constructors that can fail unless it is failure that would be appropriate to crash for. That works out a lot better than it might naively sound. It is hard for people to reason about the possibility of constructors/destructors failing, so actually rather nice to just forbid it.
[ Parent
| on HN ]
Re:Current hardware trends make C++ exceptions harder to jus...
by addaon on Tuesday February 22, 2022 @02:02PM
(#30432073)
And for those super-rare cases where it's appropriate to crash / fail hard in a constructor but you still have requirements about reporting or even recovery... setjmp/longjmp still exist.