Add `result_with_exception_ptr` result type. Successful result has user specified type. Failed result has std::exception_ptr. This approach is simpler than `result_with_exception`. It does not require user to pass exception types as variadic template through all the callstack. Specific exception type can still be accessed without costly std::rethrow_exception(eptr) by using `try_catch`, if configured so via `USE_OPTIMIZED_EXCEPTION_HANDLING`. This means no information loss, but less verbosity when writing result types. Refs: #24567
2.8 KiB
2.8 KiB