Commit ea9114c1 authored by Dominik Charousset's avatar Dominik Charousset

Fix dispatching in response promises

parent e3c1467a
...@@ -41,11 +41,11 @@ public: ...@@ -41,11 +41,11 @@ public:
return static_cast<bool>(promise_); return static_cast<bool>(promise_);
} }
void deliver(Ts... what) const { template <class... Us>
promise_.deliver(make_message(std::move(what)...)); void deliver(Us&&... xs) const {
promise_.deliver(make_message(std::forward<Us>(xs)...));
} }
private: private:
response_promise promise_; response_promise promise_;
}; };
...@@ -66,11 +66,12 @@ public: ...@@ -66,11 +66,12 @@ public:
return static_cast<bool>(promise_); return static_cast<bool>(promise_);
} }
void deliver(either_or_t<L, R> what) const { template <class... Ts>
promise_.deliver(what.value); void deliver(Ts&&... xs) const {
either_or_t<L, R> tmp{std::forward<Ts>(xs)...};
promise_.deliver(std::move(tmp.value));
} }
private: private:
response_promise promise_; response_promise promise_;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment