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

Build fix bazel #350

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ else()
-D__STDC_LIMIT_MACROS
-g
)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND CXX_FLAGS -Wno-uninitialized)
else()
list(APPEND CXX_FLAGS -Wno-maybe-uninitialized)
endif()
endif()

set(IS_ACC OFF CACHE INTERNAL "Whether the current compiler is ACC")
Expand Down
13 changes: 6 additions & 7 deletions async_simple/FutureState.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <thread>
#include "async_simple/Common.h"
#include "async_simple/Executor.h"
#include "async_simple/MoveWrapper.h"
#include "async_simple/Try.h"
#include "async_simple/util/move_only_function.h"

namespace async_simple {

Expand Down Expand Up @@ -62,7 +62,7 @@ constexpr State operator&(State lhs, State rhs) {
template <typename T>
class FutureState {
private:
using Continuation = std::function<void(Try<T>&& value)>;
using Continuation = util::move_only_function<void(Try<T>&& value)>;

private:
// A helper to help FutureState to count the references to guarantee
Expand Down Expand Up @@ -228,11 +228,10 @@ class FutureState {
void setContinuation(F&& func) {
logicAssert(!hasContinuation(),
"FutureState already has a continuation");
MoveWrapper<F> lambdaFunc(std::move(func));
new (&_continuation) Continuation([lambdaFunc](Try<T>&& v) mutable {
auto& lambda = lambdaFunc.get();
lambda(std::forward<Try<T>>(v));
});
new (&_continuation)
Continuation([func = std::move(func)](Try<T>&& v) mutable {
func(std::forward<Try<T>>(v));
});

auto state = _state.load(std::memory_order_acquire);
switch (state) {
Expand Down
1 change: 0 additions & 1 deletion async_simple/LocalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <utility>
#include "async_simple/Common.h"
#include "async_simple/Executor.h"
#include "async_simple/MoveWrapper.h"
#include "async_simple/Try.h"

namespace async_simple {
Expand Down
50 changes: 0 additions & 50 deletions async_simple/MoveWrapper.h

This file was deleted.

Loading
Loading