Skip to content

Commit 4699253

Browse files
Merge pull request #802 from elbeno/guard-call-with-message-branch
🚸 Guard all call options in `msg::call_with_message`
2 parents 56ed298 + edae0e0 commit 4699253

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

include/msg/message.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,16 @@ call_with_message(F &&f, S &&s, Args &&...args) -> decltype(auto) {
700700
}) {
701701
return std::forward<F>(f)(typename Msg::view_t{std::forward<S>(s)},
702702
std::forward<Args>(args)...);
703-
} else {
703+
} else if constexpr (requires {
704+
std::forward<F>(f)(
705+
typename Msg::owner_t{std::forward<S>(s)},
706+
std::forward<Args>(args)...);
707+
}) {
704708
return std::forward<F>(f)(typename Msg::owner_t{std::forward<S>(s)},
705709
std::forward<Args>(args)...);
710+
} else {
711+
static_assert(stdx::always_false_v<Msg, F, S>,
712+
"No call option for call_with_message");
706713
}
707714
}
708715

0 commit comments

Comments
 (0)