The tutorial composes CURL_async_get into the sender-based API rather than vice versa which requires new std::string{} rather than placing said string in the operation state.
Moreover the sender-based API reports that it only succeeds, which seems unlikely (especially since initiation allocates). start should likely be written as:
it is around CURL_async_get intentionally to cover any other C-style API, which, in general case, you dont know the implementstion details. I mentioned at one point that this way you build unoptimized API, causing multiple unneeded allocations, implying building CURL wrapper targetting senders would be better.
Regarding error reporting - CURL API never fails, new is nothrow + assert, so it never fails too, start has no need to hndle exceptions since there are zero
I don't see how it's the case that "[the] CURL API never fails." It can fail to allocate, it can fail to resolve DNS, it can fail to connect to the remote host, the remote host can send it a corrupt response...
Ah, I dint update the article code (github version is nothrow). The intention was to basically have noexcept CURL_async_get() for simplicity. You are right, will add a point of everything noexcept. Introducing errors handling adds another layer of complexity. I planned to have this discussed separately, but it's too much
View all comments
2
u/robertahleahy WG21, SCC, std::execution, Finance Sep 20 '26 edited Sep 20 '26
The tutorial composes
CURL_async_getinto the sender-based API rather than vice versa which requiresnew std::string{}rather than placing said string in the operation state.Moreover the sender-based API reports that it only succeeds, which seems unlikely (especially since initiation allocates).
startshould likely be written as:Which would necessitate advertising
std::execution::set_error_t(std::exception_ptr).