mirror of
https://github.com/Naios/continuable.git
synced 2026-01-01 03:12:12 +08:00
Remove an unused lambda capture
This commit is contained in:
parent
8d7f4e5a1b
commit
0f242df1a6
@ -137,7 +137,7 @@ public:
|
||||
auto create_callback(traits::size_constant<From> from,
|
||||
traits::size_constant<To> to) {
|
||||
|
||||
return [ me = this->shared_from_this(), from, to ](auto&&... args) {
|
||||
return [ me = this->shared_from_this(), from ](auto&&... args) {
|
||||
static_assert(sizeof...(args) == (To - From),
|
||||
"Submission called with the wrong amount of arguments!");
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include <continuable/continuable.hpp>
|
||||
#include <string>
|
||||
|
||||
cti::continuable<std::string> http_request(std::string url) {
|
||||
static cti::continuable<std::string> http_request(std::string url) {
|
||||
return [url = std::move(url)](cti::promise<std::string> promise) {
|
||||
promise.set_exception(nullptr);
|
||||
promise.set_value("");
|
||||
@ -31,13 +31,14 @@ cti::continuable<std::string> http_request(std::string url) {
|
||||
};
|
||||
}
|
||||
|
||||
auto http_request2(std::string url) {
|
||||
return cti::make_continuable<std::string>([url = std::move(url)](
|
||||
auto&& promise) {
|
||||
promise.set_exception(nullptr);
|
||||
promise.set_value("");
|
||||
promise("");
|
||||
});
|
||||
static auto http_request2(std::string url) {
|
||||
return cti::make_continuable<std::string>(
|
||||
// ...
|
||||
[url = std::move(url)](auto&& promise) {
|
||||
promise.set_exception(nullptr);
|
||||
promise.set_value("");
|
||||
promise("");
|
||||
});
|
||||
}
|
||||
|
||||
int main(int, char**) {
|
||||
@ -56,5 +57,6 @@ int main(int, char**) {
|
||||
.catching([](std::exception_ptr /*e*/) {
|
||||
// ...
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user