diff options
author | Tor Egge <Tor.Egge@online.no> | 2024-02-16 15:36:00 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2024-02-16 15:36:00 +0100 |
commit | aac2d4cbb8a875acc958e978ccd212598afa53ce (patch) | |
tree | e2138ef793780c2675e55d0a6518dc3e856ea94b | |
parent | e78cf88d37cfe4a099caa3e7b9e81d5dca5118b5 (diff) |
Avoid static_assert(false, ...) in portion of function that is eliminated
due to 'if constexpr' since this is not well handled by old compilers.
'if constexpr' in templated functions.
-rw-r--r-- | searchlib/src/vespa/searchlib/queryeval/flow.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/searchlib/src/vespa/searchlib/queryeval/flow.h b/searchlib/src/vespa/searchlib/queryeval/flow.h index cfbb28b190f..1436ca18fa7 100644 --- a/searchlib/src/vespa/searchlib/queryeval/flow.h +++ b/searchlib/src/vespa/searchlib/queryeval/flow.h @@ -53,12 +53,11 @@ concept DirectAdaptable = requires(const T &t) { auto make_adapter(const auto &children) { using type = std::remove_cvref_t<decltype(children)>::value_type; + static_assert(DefaultAdaptable<type> || DirectAdaptable<type>, "unable to resolve children adapter"); if constexpr (DefaultAdaptable<type>) { return DefaultAdapter(); - } else if constexpr (DirectAdaptable<type>) { - return DirectAdapter(); } else { - static_assert(false, "unable to resolve children adapter"); + return DirectAdapter(); } } |