Created on 2023-12-24.00:00:00 last changed 20 months ago
Proposed resolution:
This wording is relative to N4971.
Modify [expected.bad.void] as indicated:
namespace std {
template<>
class bad_expected_access<void> : public exception {
protected:
bad_expected_access() noexcept;
bad_expected_access(const bad_expected_access&) noexcept;
bad_expected_access(bad_expected_access&&) noexcept;
bad_expected_access& operator=(const bad_expected_access&) noexcept;
bad_expected_access& operator=(bad_expected_access&&) noexcept;
~bad_expected_access();
public:
const char* what() const noexcept override;
};
}
[ Tokyo 2024-03-23; Status changed: Voting → WP. ]
[ 2024-03-12; Reflector poll ]
Set status to Tentatively Ready after five votes in favour during reflector poll.
According to [exception]/2:
Each standard library class T that derives from class exception has the following publicly accessible member functions, each of them having a non-throwing exception specification (14.5):
(2.1) — default constructor (unless the class synopsis shows other constructors)
(2.2) — copy constructor
(2.3) — copy assignment operator
For good reasons, bad_expected_access<void> overrules from this general rule by protecting its special member functions. However, there's no reason these functions should not be noexcept.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2024-04-02 10:29:12 | admin | set | messages: + msg14042 |
| 2024-04-02 10:29:12 | admin | set | status: voting -> wp |
| 2024-03-18 09:32:04 | admin | set | status: ready -> voting |
| 2024-03-12 01:10:06 | admin | set | messages: + msg13997 |
| 2024-03-12 01:10:06 | admin | set | status: new -> ready |
| 2024-01-13 13:25:14 | admin | set | messages: + msg13906 |
| 2023-12-24 00:00:00 | admin | create | |