1
0
mirror of synced 2025-07-27 23:41:48 +03:00

Changed examples to use the generic lambda.

This commit is contained in:
yhirose
2014-07-11 21:51:49 -04:00
parent 98e3e7b3c1
commit 34e5903167
4 changed files with 12 additions and 12 deletions

View File

@ -65,14 +65,14 @@ int main(int argc, const char** argv)
Server svr;
svr.set_error_handler([](const Request& req, Response& res) {
svr.set_error_handler([](const auto& req, auto& res) {
const char* fmt = "<p>Error Status: <span style='color:red;'>%d</span></p>";
char buf[BUFSIZ];
snprintf(buf, sizeof(buf), fmt, res.status);
res.set_content(buf, "text/html");
});
svr.set_logger([](const Request& req, const Response& res) {
svr.set_logger([](const auto& req, const auto& res) {
cout << log(req, res);
});