Re:Why you should, actually, rewrite some of it in Rust
by RcouF1uZ4gsC on Wednesday July 12, 2017 @12:16PM
(#14753781)
Basically exception safety is a solved problem in Modern C++. If you use RAIIike it was meant to be used, exception safety is not that big a deal.
[ Parent
| on HN ]
Re:Why you should, actually, rewrite some of it in Rust
by akavel on Wednesday July 12, 2017 @06:29PM
(#14757223)
For serious exception safety, you have to be able to prove that all invariants all the code of your class relies on are kept between every 2 subsequent lines of your code in that class. Because exception can occur everywhere. And actually, I oversimplified, because often you must also know what happens in each and every operator you use, including implicit casting operators, and also in your destructors and constructors, including implicit ones. Each of those may or may not throw, and each of those may have some internal state, or modify your state in unexpected ways during an exception. RAII gives you primitives which you trust are written with exception safety w.r.t. their inner invariants. But you build some code on it, which has its own invariants. Do you prove them between every 2 lines of your code every time you change a line in your code? After I read enough about exception safety, I realized how hard it is to keep watertightly.
Re:Why you should, actually, rewrite some of it in Rust
by tomjakubowski on Wednesday July 12, 2017 @01:19PM
(#14754403)
True, I guess, for "business logic"-y classes. Not true at all for data structures, particularly those that are templates.
Re:Why you should, actually, rewrite some of it in Rust
by AnimalMuppet on Wednesday July 12, 2017 @05:05PM
(#14756677)
How is it not true for data structures? Even templated ones?