Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Commit 3f8fcc0

Browse files
committed
Removed unused lambda captures in examples
1 parent 7a1a23b commit 3f8fcc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

http_examples.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ int main() {
8989

9090
//GET-example for the path /match/[number], responds with the matched string in path (number)
9191
//For instance a request GET /match/123 will receive: 123
92-
server.resource["^/match/([0-9]+)$"]["GET"]=[&server](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> request) {
92+
server.resource["^/match/([0-9]+)$"]["GET"]=[](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> request) {
9393
string number=request->path_match[1];
9494
*response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length() << "\r\n\r\n" << number;
9595
};
9696

9797
//Get example simulating heavy work in a separate thread
98-
server.resource["^/work$"]["GET"]=[&server](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> /*request*/) {
98+
server.resource["^/work$"]["GET"]=[](shared_ptr<HttpServer::Response> response, shared_ptr<HttpServer::Request> /*request*/) {
9999
thread work_thread([response] {
100100
this_thread::sleep_for(chrono::seconds(5));
101101
string message="Work done";

https_examples.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ int main() {
8787

8888
//GET-example for the path /match/[number], responds with the matched string in path (number)
8989
//For instance a request GET /match/123 will receive: 123
90-
server.resource["^/match/([0-9]+)$"]["GET"]=[&server](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> request) {
90+
server.resource["^/match/([0-9]+)$"]["GET"]=[](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> request) {
9191
string number=request->path_match[1];
9292
*response << "HTTP/1.1 200 OK\r\nContent-Length: " << number.length() << "\r\n\r\n" << number;
9393
};
9494

9595
//Get example simulating heavy work in a separate thread
96-
server.resource["^/work$"]["GET"]=[&server](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> /*request*/) {
96+
server.resource["^/work$"]["GET"]=[](shared_ptr<HttpsServer::Response> response, shared_ptr<HttpsServer::Request> /*request*/) {
9797
thread work_thread([response] {
9898
this_thread::sleep_for(chrono::seconds(5));
9999
string message="Work done";

0 commit comments

Comments
 (0)