Commit 0f642844 authored by Samir Halilcevic's avatar Samir Halilcevic Committed by Dominik Charousset

Fix compiler warnings on Linux

parent 10a157f0
...@@ -804,7 +804,7 @@ public: ...@@ -804,7 +804,7 @@ public:
if (has_value()) if (has_value())
return f(); return f();
else else
return res_t{std::move(*error_)}; return res_t{*error_};
} }
template <class F> template <class F>
...@@ -864,7 +864,7 @@ public: ...@@ -864,7 +864,7 @@ public:
if constexpr (std::is_void_v<res_t>) { if constexpr (std::is_void_v<res_t>) {
if (!has_value()) if (!has_value())
f(std::move(*error_)); f(std::move(*error_));
return std::move(*this); return *this;
} else { } else {
static_assert(std::is_same_v<expected, res_t>, static_assert(std::is_same_v<expected, res_t>,
"F must return expected<T> or void"); "F must return expected<T> or void");
...@@ -916,7 +916,7 @@ public: ...@@ -916,7 +916,7 @@ public:
if (has_value()) if (has_value())
return detail::expected_from_fn(std::forward<F>(f)); return detail::expected_from_fn(std::forward<F>(f));
else else
return expected<res_t>{std::move(*error_)}; return expected<res_t>{*error_};
} }
template <class F> template <class F>
......
...@@ -526,7 +526,7 @@ scheduled_actor::categorize(mailbox_element& x) { ...@@ -526,7 +526,7 @@ scheduled_actor::categorize(mailbox_element& x) {
auto& what = content.get_as<std::string>(2); auto& what = content.get_as<std::string>(2);
if (what == "info") { if (what == "info") {
CAF_LOG_DEBUG("reply to 'info' message"); CAF_LOG_DEBUG("reply to 'info' message");
rp.deliver(ok_atom_v, std::move(what), strong_actor_ptr{ctrl()}, name()); rp.deliver(ok_atom_v, what, strong_actor_ptr{ctrl()}, name());
} else { } else {
rp.deliver(make_error(sec::unsupported_sys_key)); rp.deliver(make_error(sec::unsupported_sys_key));
} }
......
...@@ -298,6 +298,8 @@ bool operator!=(std::nullptr_t, const typed_actor<Xs...>& x) noexcept { ...@@ -298,6 +298,8 @@ bool operator!=(std::nullptr_t, const typed_actor<Xs...>& x) noexcept {
return !(x == nullptr); return !(x == nullptr);
} }
CAF_PUSH_DEPRECATED_WARNING
/// Returns a new actor that implements the composition `f.g(x) = f(g(x))`. /// Returns a new actor that implements the composition `f.g(x) = f(g(x))`.
/// @relates typed_actor /// @relates typed_actor
template <class... Xs, class... Ys> template <class... Xs, class... Ys>
...@@ -314,6 +316,8 @@ operator*(typed_actor<Xs...> f, typed_actor<Ys...> g) { ...@@ -314,6 +316,8 @@ operator*(typed_actor<Xs...> f, typed_actor<Ys...> g) {
actor_cast<strong_actor_ptr>(std::move(g)), std::move(mts)); actor_cast<strong_actor_ptr>(std::move(g)), std::move(mts));
} }
CAF_POP_WARNINGS
} // namespace caf } // namespace caf
// allow typed_actor to be used in hash maps // allow typed_actor to be used in hash maps
......
...@@ -29,7 +29,7 @@ struct builtin_arg_parser { ...@@ -29,7 +29,7 @@ struct builtin_arg_parser {
if (auto err = detail::parse(str, tmp); !err) if (auto err = detail::parse(str, tmp); !err)
return tmp; return tmp;
else else
return {}; return std::nullopt;
} }
}; };
......
...@@ -121,7 +121,7 @@ public: ...@@ -121,7 +121,7 @@ public:
if (auto res = caf::get_as<T>(val)) if (auto res = caf::get_as<T>(val))
return std::move(*res); return std::move(*res);
} }
return {}; return std::nullopt;
} }
/// Executes the provided callable `f` for each field in the request header. /// Executes the provided callable `f` for each field in the request header.
......
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