Remove C++14isms from delayed_helper::apply()

Clang to the rescue:
- `void` isn't a literal type in C++11
- calling `f()` from `constexpr` isn't allowed in C++11

So, remove `constexpr` to simplify things.
This commit is contained in:
Flössie 2020-08-10 13:55:45 +02:00
parent 5e207afff6
commit a55e06c676

View File

@ -55,13 +55,13 @@ namespace delayed_helper
// See https://aherrmann.github.io/programming/2016/02/28/unpacking-tuples-in-cpp14/ // See https://aherrmann.github.io/programming/2016/02/28/unpacking-tuples-in-cpp14/
template<typename F, typename T, size_t... Is> template<typename F, typename T, size_t... Is>
constexpr void apply_impl(F f, T t, index_sequence<Is...>) void apply_impl(F f, T t, index_sequence<Is...>)
{ {
f(std::get<Is>(t)...); f(std::get<Is>(t)...);
} }
template <typename T, typename F> template <typename T, typename F>
constexpr void apply(F f, T t) void apply(F f, T t)
{ {
apply_impl(f, t, make_index_sequence<std::tuple_size<T>{}>{}); apply_impl(f, t, make_index_sequence<std::tuple_size<T>{}>{});
} }