|
ThreadSchedule 1.0.0
Modern C++ thread management library
|
Polyfill for std::expected (C++23) for pre-C++23 compilers.
More...
#include <exception>#include <functional>#include <system_error>#include <type_traits>#include <utility>Go to the source code of this file.
Classes | |
| struct | threadschedule::unexpect_t |
| Tag type used to construct an expected in the error state. More... | |
| class | threadschedule::unexpected< E > |
Exception thrown by expected::value() when the object is in the error state. More... | |
| class | threadschedule::expected< T, E > |
A result type that holds either a value of type T or an error of type E. More... | |
| class | threadschedule::expected< void, E > |
| Specialization of expected for operations that produce no value. More... | |
Macros | |
| #define | THREADSCHEDULE_HAS_STD_EXPECTED 0 |
| #define | THREADSCHEDULE_EXPECTED_THROW(ex) |
Functions | |
| template<typename T, typename E> | |
| constexpr void | threadschedule::swap (expected< T, E > &lhs, expected< T, E > &rhs) noexcept(noexcept(lhs.swap(rhs))) |
Variables | |
| constexpr unexpect_t | threadschedule::unexpect {} |
Polyfill for std::expected (C++23) for pre-C++23 compilers.
When the standard library already provides std::expected (detected via the __cpp_lib_expected feature-test macro or a C++23-or-later language mode), every type in this header is a simple alias to its std:: counterpart. Otherwise a from-scratch implementation is supplied.
-fno-exceptions builds. When exceptions are disabled, value() calls std::terminate() instead of throwing bad_expected_access. Prefer value_or(), operator*(), or an explicit has_value() check when building without exceptions.void specialization support the four monadic combinators from P0323R12:and_then – chain an operation that returns an expected or_else – recover from an error, returning an expected transform – map the contained valuetransform_error – map the contained error Definition in file expected.hpp.
| #define THREADSCHEDULE_EXPECTED_THROW | ( | ex | ) |
Definition at line 61 of file expected.hpp.
| #define THREADSCHEDULE_HAS_STD_EXPECTED 0 |
Definition at line 48 of file expected.hpp.
|
constexprnoexcept |
Definition at line 1035 of file expected.hpp.
|
inlineconstexpr |
Definition at line 90 of file expected.hpp.