cplusplus / cplusplus/draft

consider reordering Postconditions: library element after Throws:

Open
#3,612 7 comments 1 reaction 1 assignee View on GitHub

@jensmaurer is already working on this.

Since Dec 12, 2024.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

We currently list library descriptive elements in this order (ignoring Requires: on the basis that we're working to remove it):

  • Constraints:
  • Mandates:
  • Preconditions:
  • Effects:
  • Synchronization:
  • Postconditions:
  • Returns:
  • Throws:
  • Complexity:
  • Remarks:
  • Error conditions:

These mostly, but not entirely, have a nice temporal flow to them. First we do overload resolution (Constraints:) to pick a function, then picking that function might give an error (Mandates:). At runtime, we need the Preconditions: to be met, and then the Effects: happen (perhaps with a specified Complexity:), along with perhaps some Synchronization:.

Then the function either Returns: or Throws: (and in so doing, reports any Error conditions:).

Only then (after a return or the absence of a throw) are the Postconditions: fully established.

To make this flow more naturally, we could:

  • Reorder Postconditions: after Throws:
  • Reorder Error conditions: alongside Returns: and Throws:
  • Reorder Complexity: alongside Effects:

We'll need to look at some affected library wording and see if this is actually an improvement in practice, and check with LWG to see if they're happy with this reordering.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.