On Mon, Jan 4, 2016 at 1:55 PM, Mike Shaver <mike.sha...@gmail.com> wrote:
> Has there been some innovation in EH since Cargill's spine-chilling > exploration of making a simple container strongly exception safe? I recall > the consensus being that it was quite difficult to actually be strongly > exception safe, but it sounds like that's no longer the case now. > I hadn't seen Cargill's article before: < http://ptgmedia.pearsoncmg.com/images/020163371x/supplements/Exception_Handling_Article.html > Frankly, yeah, C++ as it's actually practiced is a lot different now. The code being critiqued here is chock full of bugs, and no surprise: non-placement new and raw pointers everywhere. The first three bugs Cargill finds have nothing to do with exceptions! The next involves a `throw` statement, but the same bug would obtain if it said `return false;` instead. I saw a lot of this caliber of C++ in the 1990s, but twenty years on, it reads like a straw man. Where I'm coming from is: Using exceptions instead of explicit error checking can turn 30 lines of code into 10. Being able to see what I'm doing is kind of a big deal for me. YMMV. The tradeoff is, mfbt/Vector.h would have to be deeper code. It isn't currently exception-safe. It'd require different primitives, no more Impl::copyConstruct() on a whole range of values. But what the hell. Many Mozilla hackers can hack that grade of code, and the benefit would be worth the ongoing maintenance (if we could afford the full initial investment, which we still can't). -j _______________________________________________ dev-tech-js-engine-internals mailing list dev-tech-js-engine-internals@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals