Commit Graph
26 Commits
Author SHA1 Message Date
Peter Dimov c92d50abbd Do not consider types with explicit operator bool (such as result itself) constructible from bool for the purposes of result construction. Refs #104. 2023-01-22 02:07:28 +02:00
Peter Dimov 8ce2a9f835 Disable result converting constructor when T is convertible from the rhs result<T2, E2>. Refs #104. 2023-01-22 01:22:02 +02:00
Peter Dimov f0b27c5826 Enable implicit construction when the alternative is explicitly constructible from the argument. Fixes #103. 2023-01-21 20:09:53 +02:00
Peter Dimov 1e4c050d6c Add result<>::emplace (refs #85) 2022-10-18 00:46:59 +03:00
Peter Dimov 20ce51858b Add in_place_value, in_place_error to result<>. Refs #93. 2022-09-27 18:18:16 +03:00
Peter Dimov 52d7429473 Add value_type, error_type typedefs to result. Refs #93. 2022-09-26 21:20:40 +03:00
Peter Dimov cc7c2f7ee4 Return v_.index() == 1 from has_error() to avoid -Wmaybe-uninitialized in error() 2022-08-02 22:44:34 +03:00
Peter Dimov f2e1db8021 Constrain explicit value and error constructors to not accept zero arguments. Fixes #86. 2022-07-26 21:49:13 +03:00
Peter Dimov 4200b00973 Add converting constructor to result (refs #82) 2022-06-18 18:12:06 +03:00
Peter Dimov 6d7a57a970 Add throw_exception_from_error overload for std::exception_ptr 2022-02-18 02:55:34 +02:00
Peter Dimov 00c71cf388 Add throw_exception_from_error overloads for boost::system::errc, std::errc 2022-02-17 21:55:47 +02:00
Peter Dimov 4f09f4adde Use throw_with_location in throw_exception_from_error 2022-02-13 22:50:20 +02:00
Peter Dimov b92be6417a Add a source_location parameter to throw_exception_from_error 2022-02-05 05:24:29 +02:00
Peter Dimov 9554d8bbd3 Suppress incorrect warnings from GCC 7/8 2022-02-03 19:02:19 +02:00
Peter Dimov a5d68e52e6 Add throw_exception_from_error overload for std::error_code 2022-02-03 18:35:42 +02:00
Peter Dimov 9c6a09f41d Mark throw_exception_from_error as noinline 2022-02-03 09:37:59 +02:00
Peter Dimov 01ce081470 Disable errc_t -> arithmetic conversions when initializing result (closes #74) 2021-12-11 01:22:08 +02:00
Peter Dimov 5217e58a7d Enable implicit construction for aggregates using {{ ... }} 2021-10-02 22:07:05 +03:00
Peter Dimov ce37e23491 Protect against dangling references in op* and value() 2021-10-02 19:16:04 +03:00
Peter Dimov 2b6a708070 Update test/result_copy_construct 2021-09-17 19:25:20 +03:00
Peter Dimov 50f84f16dc Add result<void, E> specialization 2021-09-17 19:22:15 +03:00
Peter Dimov 3f67d3def5 Rename throw_exception_from_error_code to throw_exception_from_error 2021-09-17 18:33:04 +03:00
Peter Dimov c8492a705d Use unsafe_get instead of *get_if 2021-09-17 15:47:35 +03:00
Peter Dimov fe3d0e6c14 Update all references to <system_error> to refer to Boost.System 2021-09-16 19:16:30 +03:00
Peter Dimov ae77563039 Define result in boost::system instead of in boost::result 2021-09-16 18:56:35 +03:00
Peter Dimov fd852c675e Add <boost/system/result.hpp> 2021-09-16 18:47:05 +03:00