From a12b971e9b6b14c3ad29dbd4f5a70bf1fc35c4a2 Mon Sep 17 00:00:00 2001 From: bkoz Date: Tue, 5 Jan 2010 20:51:05 +0000 Subject: 2010-01-05 Benjamin Kosnik * doc/xml/manual/evolution.xml: Update for 4.4 and 4.5 releases. * doc/html: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155661 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/doc/html/manual/using_exceptions.html | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'libstdc++-v3/doc/html/manual/using_exceptions.html') diff --git a/libstdc++-v3/doc/html/manual/using_exceptions.html b/libstdc++-v3/doc/html/manual/using_exceptions.html index 5c74e93ac8f..ccf7f7be4f7 100644 --- a/libstdc++-v3/doc/html/manual/using_exceptions.html +++ b/libstdc++-v3/doc/html/manual/using_exceptions.html @@ -1,6 +1,6 @@ -Exceptions

Exceptions

+Exceptions

Exceptions

The C++ language provides language support for stack unwinding with try and catch blocks and the throw keyword. @@ -12,7 +12,7 @@ exceptional circumstances.

Two general topics of discussion follow: exception neutrality and exception safety. -

Exception Safety

+

Exception Safety

What is exception-safe code?

Will define this as reasonable and well-defined behavior by classes @@ -27,7 +27,7 @@ exception neutrality and exception safety. Using the layered approach from Abrahams, can classify library components as providing set levels of safety. These will be called exception guarantees, and can be divided into three categories. -

  • +

    • One. Don't throw.

      As specified in 23.2.1 general container requirements. Applicable @@ -36,14 +36,14 @@ exception neutrality and exception safety. Member functions erase, pop_back, pop_front, swap, clear. And iterator copy constructor and assignment operator. -

    • +

    • Two. Don't leak resources when exceptions are thrown. This is - also referred to as the “basic” exception safety guarantee. + also referred to as the basic exception safety guarantee.

      This applicable throughout the standard library. -

    • +

    • Three. Commit-or-rollback semantics. This is - referred to as “strong” exception safety guarantee. + referred to as strong exception safety guarantee.

      As specified in 23.2.1 general container requirements. Applicable to container and string classes. @@ -51,7 +51,7 @@ exception neutrality and exception safety. Member functions insert of a single element, push_back, push_front, and rehash. -

Exception Neutrality

+

Exception Neutrality

Simply put, once thrown an exception object should continue in flight unless handled explicitly. In practice, this means propagating exceptions should not be swallowed in @@ -75,7 +75,7 @@ exception neutrality and exception safety. Unfortunately, this tends to be more of a guideline than a strict rule as applied to the standard library. As such, the following is a list of known problem areas where exceptions are not propagated. -

  • +

    • Input/Output

      The destructor ios_base::Init::~Init() @@ -95,13 +95,13 @@ exception neutrality and exception safety. When closing the underlying file, basic_filebuf::close will swallow (non-cancellation) exceptions thrown and return NULL. -

    • +

    • Thread

      The constructors of thread that take a callable function argument swallow all exceptions resulting from executing the function argument. -

Doing without

+

Doing without

C++ is a language that strives to be as efficient as is possible in delivering features. As such, considerable care is used by both language implementer and designers to make sure unused features @@ -220,7 +220,7 @@ exception neutrality and exception safety. substitution of the C language keyword const with the uglified doppelganger __const. -

Compatibility

With C

+

Compatibility

With C

C language code that is expecting to interoperate with C++ should be compiled with -fexceptions. This will make debugging a C language function called as part of C++-induced stack @@ -235,7 +235,7 @@ is called. getting these details right. For GNU systems, all appropriate parts of the GNU C library are already compiled with -fexceptions. -

With POSIX thread cancellation

+

With POSIX thread cancellation

GNU systems re-use some of the exception handling mechanisms to track control flow for POSIX thread cancellation.

@@ -266,7 +266,7 @@ is called. } catch(...) { this->_M_setstate(ios_base::badbit); } -

Bibliography

+

Bibliography

System Interface Definitions, Issue 7 (IEEE Std. 1003.1-2008) . 2.9.5 Thread Cancellation @@ -274,44 +274,44 @@ is called. The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. - .

+ .

Error and Exception Handling . David Abrahams . Boost . - .

+ .

Exception-Safety in Generic Components . David Abrahams. Boost . - .

+ .

Standard Library Exception Policy . Matt Austern. WG21 N1077 . - .

+ .

ia64 c++ abi exception handling . Richard Henderson. GNU . - .

+ .

Appendix E: Standard-Library Exception Safety . Bjarne Stroustrup. - .

+ .

Exceptional C++ . Exception-Safety Issues and Techniques - . Herb Sutter.

+ . Herb Sutter.

exception_defines.h #defines try/catch . GCC Bug 25191 -- cgit v1.2.3