TITLE: STL is exception safe (Newsgroups: comp.lang.c++.moderated,comp.std.c++,comp.lang.c++, 20 Feb 98) AUSTERN: Matt Austern I wrote an article about exceptions and the standard C++ library ("Making the World Safe for Exceptions") that was published in the January 1998 issue of C++ Report. Unfortunately, when I actually read that issue a couple of weeks ago, I noticed that something very important had failed to get printed: an author's note that I intended to go at the end of the article. Someone---maybe an editor, maybe me---goofed. The problem is that I originally wrote that article almost a year ago, and some of the things I said in it are no longer true. My intention was to note, briefly, some of the things that had changed. First, it is no longer true that the C++ standard says nothing about exception safety and the standard library. The standard containers and algorithms are explicitly guaranteed to be exception safe. (Using the terminology of my article, all STL algorithms and containers have Level 3 exception safety provided that their template arguments satisfy the appropriate restrictions, some have Level 4 exception safety, and some are guaranteed not to throw exceptions at all.) Second, there are now some new techniques for exception safety of generic conatiners in addition to the ones that I discussed in that article. In some cases the new techniques (I'm thinking in particular of the base class initialization technique) are cleaner and more efficient than the equivalent ones from my article. Third and most important, Dave Abrahams is responsible for many of these changes. He did a lot of work on exception safety of generic containers, and he managed to convince the C++ standardization committee that guarantees of exception safety were important and practical. I'm sorry that this note didn't get printed along with my article.