Skip to content

Commit

Permalink
C++ isn't Rust - return statements required.
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-parent committed Jan 25, 2025
1 parent 65bb949 commit d1b9a7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
"cacheVariables": {
"CMAKE_CXX_STANDARD": "20",
"CMAKE_BUILD_TYPE": "DEBUG",
"CMAKE_CXX_FLAGS": "-fsanitize=thread -fsanitize=undefined",
"CMAKE_LINKER_FLAGS": "-fsanitize=thread -fsanitize=undefined"
"CMAKE_CXX_FLAGS": "-fsanitize=thread -fsanitize=undefined"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions include/stlab/concurrency/await.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ auto invoke_waiting(F&& f) {
if (!detail::pts().wake()) detail::pts().add_thread();
#endif

std::forward<F>(f)();
return std::forward<F>(f)();
}

/**************************************************************************************************/
Expand Down Expand Up @@ -113,7 +113,7 @@ struct blocking_get_guarded {
auto wait_for(const std::chrono::nanoseconds& timeout) -> future<T> {
std::unique_lock<std::mutex> lock{_mutex};
_timed_out = !invoke_waiting(
[&] { _condition.wait_for(lock, timeout, [&] { return _result.valid(); }); });
[&] { return _condition.wait_for(lock, timeout, [&] { return _result.valid(); }); });
return _timed_out ? future<T>{} : std::move(_result);
}
};
Expand Down

0 comments on commit d1b9a7a

Please sign in to comment.