diff --git a/httplib.h b/httplib.h index e79ae3c..947f08d 100644 --- a/httplib.h +++ b/httplib.h @@ -3390,7 +3390,11 @@ inline bool Server::listen_internal() { break; } - task_queue->enqueue([=]() { process_and_close_socket(sock); }); +#if __cplusplus > 201703L + task_queue->enqueue([=, this]() { process_and_close_socket(sock); }); +#else + task_queue->enqueue([=]() { process_and_close_socket(sock); }); +#endif } task_queue->shutdown();