Document: N2636=08-0146
Date: 2008-05-16
Authors: Jeff
Garland
<jeff@crystalclearsoftware.com>
Nick
Stoughton <nick@usenix.org>
Benjamin Kosnik <bkoz@redhat.com>
Beman Dawes <bdawes@acm.org>
Motivation
Proposed Wording
Change
17.3.1.3 Specifications
[structure.specifications], paragraph 3, as indicated:
Descriptions of function semantics contain the
following elements (as appropriate):153)
— Requires: the preconditions for calling the function
— Effects: the actions performed by the function
— Postconditions: the observable results established by the
function
— Returns: a description of the value(s) returned by the
function
— Throws: any exceptions thrown by the function, and the
conditions that would cause the exception
— Complexity: the time and/or space complexity of the
function
— Remarks: additional semantic constraints on the function
— Error
conditions: the default error conditions for error codes reported by the
function.
For non-reserved replacement and handler functions, clause 18 specifies two behaviors for the functions in question: their required and default behavior. The default behavior describes a function definition provided by the implementation. The required behavior describes the semantics of a function definition provided by either the implementation or a C++ program. Where no distinction is explicitly made in the description, the behavior described is the required behavior.
Complexity requirements specified in the library
clauses are upper bounds, and implementations that provide better
complexity guarantees satisfy the requirements.
Error conditions
specify two types of failure: conditions where a function shall fail, and
conditions where a function may fail. The conditions are listed, together
with a suitable explanation, as the enum class errc
constants ([syserr]) that could be
used as an argument to function make_error_condition
([syserr.errcondition.nonmember
[Note: the class
error_condition
([syserr.errcondition.overviewdefault_error_condition
function ([syserr.errcode.observers]) of the class error_code
object representing the error. --end note.
Error
conditions:
* resource_unavailable_try_again -
The
system lacked the necessary resources to create another thread, or the
system-imposed limit on the total number of threads in
a process would be exceeded.
Acknowedgements
Special thanks to Anthony Williams for reviewing drafts and clarifying error specifications.