#include #include void fetch(CURL* c, std::string* body) { curl_easy_setopt(c, CURLOPT_WRITEDATA, body); curl_easy_setopt(c, CURLOPT_WRITEFUNCTION, +[](char* d, size_t s, size_t n, void* u) -> size_t { static_cast(u)->append(d, s * n); return s * n; }); }