Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings in Future implementation #168

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion support-lib/cpp/Future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <condition_variable>
#include <mutex>
#include <cassert>
#include <exception>

#ifdef __cpp_coroutines
#if __has_include(<coroutine>)
Expand Down Expand Up @@ -414,7 +415,7 @@ Future<void> combine(U&& futures, size_t c) {
return future;
}
for (auto& f: futures) {
f.then([context] (auto f) {
f.then([context] (auto) {
if (--(context->counter) == 0) {
context->promise.setValue();
}
Expand Down
4 changes: 2 additions & 2 deletions support-lib/objc/Future_objc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class FutureAdaptor<Void>

__block auto p = std::make_unique<NativePromiseType>();
auto f = p->getFuture();
[o then: ^id(DJFuture* res) {
[o then: ^id(DJFuture*) {
@try {
p->setValue();
} @catch (NSException* e) {
Expand All @@ -98,7 +98,7 @@ class FutureAdaptor<Void>
DJPromise<NSNull*>* promise = [[DJPromise alloc] init];
DJFuture<NSNull*>* future = [promise getFuture];

c.then([promise] (Future<void> res) {
c.then([promise] (Future<void>) {
try {
[promise setValue:[NSNull null]];
} catch (const std::exception& e) {
Expand Down
Loading