diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2003-12-01 18:48:24 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2003-12-01 18:48:24 +0000 |
commit | d78e147a14209d759f79a95ca0fcdffce924eb81 (patch) | |
tree | b89ba5bffe4ad19575de1adbbed31354ecddbc48 /libstdc++-v3/docs | |
parent | aa66a642c1fc139f3a7db4d98dd033bc47d84e05 (diff) | |
download | gcc-d78e147a14209d759f79a95ca0fcdffce924eb81.zip gcc-d78e147a14209d759f79a95ca0fcdffce924eb81.tar.gz gcc-d78e147a14209d759f79a95ca0fcdffce924eb81.tar.bz2 |
C++STYLE: Add exception bits.
2003-12-01 Benjamin Kosnik <bkoz@redhat.com>
* docs/html/17_intro/C++STYLE: Add exception bits.
* include/bits/fstream.tcc: Add location info to exception strings.
* include/bits/stl_construct.h: Formatting tweaks.
From-SVN: r74119
Diffstat (limited to 'libstdc++-v3/docs')
-rw-r--r-- | libstdc++-v3/docs/html/17_intro/C++STYLE | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libstdc++-v3/docs/html/17_intro/C++STYLE b/libstdc++-v3/docs/html/17_intro/C++STYLE index f838b83..90dc879 100644 --- a/libstdc++-v3/docs/html/17_intro/C++STYLE +++ b/libstdc++-v3/docs/html/17_intro/C++STYLE @@ -200,7 +200,25 @@ Notable areas of divergence from what may be previous local practice For more explanation and examples, see src/globals.cc. All such variables should be contained in that file, for simplicity. - +15. Exception abstractions + Use the exception abstractions found in functexcept.h, which allow + C++ programmers to use this library with -fno-exceptions. (Even if + that is rarely advisable, it's a necessary evil for backwards + compatibility.) + +16. Exception error messages + All start with the name of the function where the exception is + thrown, and then (optional) descriptive text is added. Example: + + __throw_logic_error("basic_string::_S_construct NULL not valid"); + + Reason: The verbose terminate handler prints out exception::what(), + as well as the typeinfo for the thrown exception. As this is the + default terminate handler, by putting location info into the + exception string, a very useful error message is printed out for + uncaught exceptions. So useful, in fact, that non-programmers can + give useful error messages, and programmers can intelligently + speculate what went wrong without even using a debugger. The library currently has a mixture of GNU-C and modern C++ coding styles. The GNU C usages will be combed out gradually. |