From 8c87af5a4c7db75388c0f804405e3f144b630671 Mon Sep 17 00:00:00 2001 From: bemandawes Date: Sun, 5 Oct 2008 13:02:01 +0000 Subject: [PATCH] System: add throws object specification, including semantics git-svn-id: https://svn.boost.org/svn/boost/trunk@49138 b8fc166d-592f-0410-95f2-cb63ce0dd405 --- libs/system/doc/reference.html | 47 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/libs/system/doc/reference.html b/libs/system/doc/reference.html index be513cdad5..68a737a81e 100644 --- a/libs/system/doc/reference.html +++ b/libs/system/doc/reference.html @@ -57,6 +57,8 @@    Class error_condition constructors
   Class error_condition modifiers
   Class error_condition observers
+ throws object
+ Semantics of throws object
Non-member functions
Header <boost/system/system_error.hpp>
   Class system_error
@@ -223,6 +225,11 @@ provided, so users may ignore these macros if they prefer.

template<> struct is_error_condition_enum<errc::errc_t> { static const bool value = true; }; + // predefined error_code object used as "throw on error" tag + extern error_code throws; + + // non-member functions + bool operator==( const error_code & lhs, const error_code & rhs ); bool operator==( const error_code & code, const error_condition & condition ); bool operator==( const error_condition & condition, const error_code & code ); @@ -370,7 +377,7 @@ non-member functions

Class error_category predefined objects

Predefined objects system_category -and generic_category identify operating system error codes and portable error conditions, respectively.

+and generic_category identify system specific error codes and portable error conditions, respectively.

Class error_code

The class error_code describes an object used to hold error code @@ -603,7 +610,29 @@ observers eliminating some sources of user error. One possible implementation choice for this type is pointer to member. --end note ]

-

Non-member functions

+

throws object

+
extern error_code throws;
+

The predefined error_code object throws is supplied +for use as a "throw on error" tag.

+

Semantics of throws object

+

Functions that specify an argument in the form error_code& ec=throws, +with appropriate namespace qualifiers, have the following error handling +semantics:

+
+

Effects: If ec != throws:

+
    +
  • If an error occurs, and sets ec to an appropriate + error_code that identifies the error + value and category. The category should be the most specific + error_category applicable to the + particular error.
  • +
  • if an error does not occur, ec.clear().
  • +
+

Throws: If ec == throws, throws an exception of type + system_error or of a type + derived from system_error.

+
+

Non-member functions

bool operator==( const error_code & lhs, const error_code & rhs );

Returns: lhs.category() == rhs.category() && lhs.value() == @@ -677,8 +706,7 @@ bool operator!=( const error_condition & condition, const error_code & c

Class system_error

The class system_error describes an exception object used to -report error conditions that have an associated error code. Such error -conditions typically originate from the operating system or other low-level +report errors that have an associated error_code. Such errors typically originate from operating system or other low-level application program interfaces.

namespace boost
@@ -754,14 +782,15 @@ application program interfaces.


-

© Copyright Beman Dawes, 2006, 2007
-Distributed under the Boost Software License, Version 1.0. See -www.boost.org/LICENSE_1_0.txt

-

Revised -June 25, 2008 +October 05, 2008

+

© Copyright Beman Dawes, 2006, 2007, 2008

+ +

Distributed under the Boost Software License, Version 1.0. See +www.boost.org/LICENSE_1_0.txt

+ \ No newline at end of file -- 2.11.4.GIT