Skip to content

Commit 6e11daa

Browse files
committed
Workaround ppl bind bug.
1 parent eae66c1 commit 6e11daa

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Release/samples/CasaLens/casalens.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ void CasaLens::handle_error(pplx::task<void>& t)
8181

8282
pplx::task<void> CasaLens::open()
8383
{
84-
return m_listener.open().then(std::bind(&handle_error, std::placeholders::_1));
84+
return m_listener.open().then(handle_error);
8585
}
8686

8787
pplx::task<void> CasaLens::close()
8888
{
89-
return m_listener.close().then(std::bind(&handle_error, std::placeholders::_1));
89+
return m_listener.close().then(handle_error);
9090
}
9191

9292
// Handler to process HTTP::GET requests.
@@ -97,15 +97,15 @@ void CasaLens::handle_get(http_request message)
9797
auto content_data = m_htmlcontentmap.find(path);
9898
if (content_data == m_htmlcontentmap.end())
9999
{
100-
message.reply(status_codes::NotFound, U("Path not found")).then(std::bind(&handle_error, std::placeholders::_1));
100+
message.reply(status_codes::NotFound, U("Path not found")).then(handle_error);
101101
return;
102102
}
103103

104104
auto file_name = std::get<0>(content_data->second);
105105
auto content_type = std::get<1>(content_data->second);
106106
concurrency::streams::fstream::open_istream(file_name, std::ios::in).then([=](concurrency::streams::istream is)
107107
{
108-
message.reply(status_codes::OK, is, content_type).then(std::bind(&handle_error, std::placeholders::_1));
108+
message.reply(status_codes::OK, is, content_type).then(handle_error);
109109
}).then([=](pplx::task<void>& t)
110110
{
111111
try
@@ -116,7 +116,7 @@ void CasaLens::handle_get(http_request message)
116116
{
117117
// opening the file (open_istream) failed.
118118
// Reply with an error.
119-
message.reply(status_codes::InternalError).then(std::bind(&handle_error, std::placeholders::_1));
119+
message.reply(status_codes::InternalError).then(handle_error);
120120
}
121121
});
122122
}
@@ -132,11 +132,11 @@ void CasaLens::handle_post(http_request message)
132132
message.extract_string().then([=](const utility::string_t& location)
133133
{
134134
get_data(message, location);
135-
}).then(std::bind(&handle_error, std::placeholders::_1));
135+
}).then(handle_error);
136136
}
137137
else
138138
{
139-
message.reply(status_codes::NotFound, U("Path not found")).then(std::bind(&handle_error, std::placeholders::_1));
139+
message.reply(status_codes::NotFound, U("Path not found")).then(handle_error);
140140
}
141141
}
142142

Release/samples/CasaLens/datafetcher.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,11 @@ void CasaLens::fetch_data(http_request message, const std::wstring& postal_code,
395395
}
396396

397397
// Reply with the aggregated JSON data
398-
message.reply(status_codes::OK, resp_data).then(std::bind(&handle_error, std::placeholders::_1));
398+
message.reply(status_codes::OK, resp_data).then(handle_error);
399399
}
400400
catch(...)
401401
{
402-
message.reply(status_codes::InternalError).then(std::bind(&handle_error, std::placeholders::_1));
402+
message.reply(status_codes::InternalError).then(handle_error);
403403
}
404404
}
405405

0 commit comments

Comments
 (0)