New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
consider reordering Postconditions: library element after Throws: #3612
Comments
Examples: [syserr.errcode.modifiers] p3, [optional.ctor] p8 |
Editorial meeting: Not for C++20. Revisit at a future meeting. |
Editorial meeting: We like the direction. The reordering can probably be automated. Consult with LWG. |
@jwakely: Could you please discuss this issue with LWG and let us know if there is any kind of appetite for any work on reordering the elements? |
@jwakely , ping? |
Discussed in the thread starting at https://lists.isocpp.org/lib/2021/06/19518.php Not many people expressed an opinion but those who did said to go ahead, so please go ahead. |
We currently list library descriptive elements in this order (ignoring Requires: on the basis that we're working to remove it):
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:
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.
The text was updated successfully, but these errors were encountered: