Commit Graph
43 Commits
Author SHA1 Message Date
Peter Dimov 32bf67f748 error_code wrapping std::error_code should never compare equal to error_code not wrapping std (because of hash_value.) Fixes #101. 2023-01-07 19:56:34 +02:00
Peter Dimov efb7634666 Move code/condition comparisons back outside class error_code; fixes #91 2022-08-24 21:10:05 +03:00
Peter Dimov 8c740705e6 Add missing include 2022-08-21 19:42:10 +03:00
Vinnie Falco ac1ed1ecc1 error_code default ctor is constexpr in c++11 2022-08-21 08:17:54 -07:00
Peter Dimov 648a35838b Remove unnecessary overloads 2022-05-05 05:12:08 +03:00
Peter Dimov 256fe92dbb Add error_code(error_code const& ec, source_location const* loc) and a corresponding assign 2022-05-05 05:02:37 +03:00
Peter Dimov 28a13571b9 Restore the original system::error_code from std::error_code (refs #79) 2022-03-18 18:24:01 +02:00
Peter Dimov de610efd53 Move conditions to detail/config.hpp 2022-02-07 03:16:23 +02:00
Peter Dimov 4b143cdacc Use BOOST_LIBSTDCXX_VERSION instead of BOOST_GCC; update syscat condition 2022-02-07 03:02:57 +02:00
Peter Dimov b9c26b9fa0 Add detail::system_error_category_message, use it in error_code::message 2022-02-03 05:47:43 +02:00
Peter Dimov 2e2430c4fa Add error_code::category_name helper, use it in to_string 2022-02-03 04:36:58 +02:00
Peter Dimov 4b1caad727 Avoid sign conversion warnings in error_code::value 2022-01-19 17:30:56 +02:00
Marcel Raad 86b031cab9 Fix error_code's operator<< for arbitrary basic_ostream specializations
This fixes a regression from commit
https://github.com/boostorg/system/commit/a9b64a888a24400cc2af9910a6ff88c3c4fd3210.
Calling `operator<<` with `std::string` only works for `std::ostream`.
Use `c_str()` to restore the previous behavior of using `const char*`,
which works for any `basic_ostream` specialization.
2021-12-21 13:17:26 +01:00
Peter Dimov 4ec1e54099 Enable error_code construction from enums specializing std::is_error_code_enum. Fixes #70. 2021-10-11 02:02:22 +03:00
Peter Dimov eefcc5dcf6 Add error_code::what 2021-10-02 14:41:27 +03:00
Peter Dimov 0ccf08509b Add a constructor taking ErrorCodeEnum and a source location 2021-10-01 23:04:04 +03:00
Peter Dimov 85c7d92302 Avoid instantiating the system category in error_code::operator std::error_code 2021-09-24 15:24:45 +03:00
Peter Dimov e3f198e52c Add error_condition::to_string 2021-09-19 15:37:49 +03:00
Peter Dimov c02cd2b004 Add private error_code::equals, use it in error_category::equivalent 2021-09-19 05:24:08 +03:00
Peter Dimov 984f8f1a92 Reorder constructor overloads 2021-09-16 18:04:27 +03:00
Peter Dimov b507b2294e Unbreak the loc == 0 case, even though the specification disallows it 2021-09-16 03:12:20 +03:00
Peter Dimov 3b70265ced Rearrange error_code::failed to improve codegen 2021-09-15 16:42:47 +03:00
Peter Dimov cd98f4edd7 Update system_error to incorporate the source location in what() 2021-09-15 07:42:57 +03:00
Peter Dimov a9b64a888a Add support for source_location to error_code 2021-09-15 07:03:18 +03:00
Peter Dimov 39a19f3c90 Add constexpr to op== against error code enums 2021-06-16 03:06:11 +03:00
Peter Dimov 96cd1c0163 Add error_code comparisons against standard error code enums (to resolve the ambiguity when an enum is both standard and ours) 2021-06-15 02:17:26 +03:00
Peter Dimov f26dfd3dd7 Add error_code comparisons against standard error condition enums (to resolve the ambiguity when an enum is both standard and ours) 2021-06-15 01:52:32 +03:00
Peter Dimov 8efb96350f Clang 6 needs more help with mixed comparisons 2021-06-14 14:44:07 +03:00
Peter Dimov 88a7be42b5 Update Clang version check 2021-06-14 14:38:26 +03:00
Peter Dimov a3225e78e2 Update GCC version check 2021-06-14 14:35:50 +03:00
Peter Dimov 9fdfa6c645 Move code == condition comparisons into error_code, unwrap std::error_code when needed 2021-06-14 04:06:24 +03:00
Peter Dimov 70b5449e99 Resolve ambiguity for std::error_code == boost::system::error_code 2021-06-14 03:53:00 +03:00
Peter Dimov 2e707ca921 Disable -Wstrict-aliasing on g++ 6, really 2021-06-14 02:50:31 +03:00
Peter Dimov a6c4b6329c Add a deleted T const& conversion for clang-6 and earlier 2021-06-14 02:35:48 +03:00
Peter Dimov 5b1909eba4 Disable -Wstrict-aliasing on g++ 6 and below 2021-06-14 02:15:37 +03:00
Peter Dimov 9dc13fd82a Change value() when holding std::error_code 2021-06-14 02:09:31 +03:00
Peter Dimov e9cdb10409 Use std::hash<std::error_code> in hash_value 2021-06-14 01:51:33 +03:00
Peter Dimov e625bd0eea Do not access d2_ when <system_error> isn't available; use std::error_code comparisons in op== and op< 2021-06-13 22:48:31 +03:00
Peter Dimov 66656f7044 Use copy-init instead of direct-init for older clangs 2021-06-13 20:45:50 +03:00
Peter Dimov 0d8511f571 Use reinterpret_cast to pointer instead of to reference 2021-06-13 20:40:27 +03:00
Peter Dimov 344eb1e1f8 Rework error_code for better std interop 2021-06-13 19:47:37 +03:00
Peter Dimov ff18f28684 Move make_ functions for errc to errc.hpp 2020-08-27 16:15:10 +03:00
Peter Dimov abc94afdb2 Extract error_code into its own header 2020-08-27 02:23:50 +03:00