Explorar o código

Fixed an example in README

yhirose %!s(int64=2) %!d(string=hai) anos
pai
achega
fe9a1949a6
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      README.md

+ 1 - 1
README.md

@@ -303,7 +303,7 @@ svr.Get("/stream", [&](const Request &req, Response &res) {
   res.set_content_provider(
     data->size(), // Content length
     "text/plain", // Content type
-    [data](size_t offset, size_t length, DataSink &sink) {
+    [&, data](size_t offset, size_t length, DataSink &sink) {
       const auto &d = *data;
       sink.write(&d[offset], std::min(length, DATA_CHUNK_SIZE));
       return true; // return 'false' if you want to cancel the process.