Created on 2009-07-21.00:00:00 last changed 171 months ago
[ 2009 Santa Cruz: ]
NAD Editorial.
What the WP says right now is literally true: these codes can be used as an argument to make_error_condition. (It is also true that they can be used as an argument to make_error_code, which the WP doesn't say.) Maybe it would be clearer to just delete "that could be used as an argument to function make_error_condition", since that fact is already implied by other things that we say. We believe that this is editorial.
[ 2009-07-21 Chris adds: ]
I'm not convinced there's a problem there, because as far as the "Error conditions" clauses are concerned, make_error_condition() is used by a user to test for the condition, whereas make_error_code is not. For example:
void foobar(error_code& ec = throws());Error conditions:
permission_denied - Insufficient privilege to perform operation.
When a user writes:
error_code ec; foobar(ec); if (ec == errc::permission_denied) ...the implicit conversion errc->error_condition makes the if-test equivalent to:
if (ec == make_error_condition(errc::permission_denied))On the other hand, if the user had written:
if (ec == make_error_code(errc::permission_denied))the test is now checking for a specific error code. The test may evaluate to false even though foobar() failed due to the documented error condition "Insufficient privilege".
While reviewing 971 I noted that [structure.specifications]/7 says:
-7- Error conditions specify conditions where a function may fail. The conditions are listed, together with a suitable explanation, as the enum class errc constants (19.5) that could be used as an argument to function make_error_condition (19.5.3.6).
This paragraph should mention make_error_code or the text "that could be used as an argument to function make_error_condition (19.5.3.6)" should be deleted. I believe this is editorial.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg1034 |
2010-10-21 18:28:33 | admin | set | messages: + msg1033 |
2009-07-21 00:00:00 | admin | create |