We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6c8fca commit eba6332Copy full SHA for eba6332
include/cpr/async_wrapper.h
@@ -8,7 +8,7 @@
8
#include "cpr/response.h"
9
10
namespace cpr {
11
-enum class [[nodiscard]] CancellationResult{failure, success, invalid_operation};
+enum class [[nodiscard]] CancellationResult { failure, success, invalid_operation };
12
13
/**
14
* A class template intended to wrap results of async operations (instances of std::future<T>)
@@ -53,6 +53,8 @@ class AsyncWrapper {
53
if (!future.valid()) {
54
throw std::logic_error{"Calling AsyncWrapper::get when the associated future instance is invalid!"};
55
}
56
+ // The wait is required on macos else std::future::get() will return prematurely somehow even though the c++ standard says something else.
57
+ future.wait();
58
return future.get();
59
60
0 commit comments