Opened 11 years ago
Closed 11 years ago
#5998 closed Feature Requests (fixed)
Make possible to don't provide hybrid error handling.
Reported by: | viboes | Owned by: | viboes |
---|---|---|---|
Milestone: | Boost 1.48.0 | Component: | chrono |
Version: | Boost 1.47.0 | Severity: | Not Applicable |
Keywords: | Cc: |
Description
Boost.Chrono provides by default an hybrid error handling for the Clock::now() function, implementing the following prototype
Clock::now(system::error_code&= boost::throws());
Now that the standard has accepted the prototype
Clock::now() noexcept;
the aforementioned prototype can not be noexcept, as the use of boost::throws() force the throw exception on error.
We need to overload the function as follows:
Clock::now() noexcept; Clock::now(system::error_code&);
This lost the advantages of the announced by the hybrid error handling design, as we are forced to have two implementations.
In addition, while most of the uses of now(ec) expect that there is no exception, the prototype can not state it using noexcept, if the boost::throws() semantic is taken in account.
Due to this split, we can now make Boost.Chrono a real header-only library if we admit to renounce to use the error_code interface.
The library could add a macro that prevent the inclusion of these prototype, as e.g. BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING.
Change History (1)
comment:1 by , 11 years ago
Milestone: | To Be Determined → Boost 1.48.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Merged with #74801