future: Add a futurize_base
future: Add a futurize_base

With 3 specializations it is easy to implement things a bit
differently in each. Fortunately, by moving a few definitions to a
futurize_base we can have a single futurize definition by using "if
constexpr" inside the functions.

IMHO this makes the code a lot easier to read. For example, we now have

template<typename T>
template<typename Func>
SEASTAR_CONCEPT( requires std::invocable<Func> )
void futurize<T>::satisfy_with_result_of(promise_base_with_type&& pr, Func&& func) {
    using ret_t = decltype(func());
    if constexpr (std::is_void_v<ret_t>) {
        func();
        pr.set_value();
    } else if constexpr (is_future<ret_t>::value) {
        func().forward_to(std::move(pr));
    } else {
        pr.set_value(func());
    }
}

Instead of 3 definitions.

Signed-off-by: Rafael Ávila de Espíndola <1975039f9046bf513b77c0c5639a0efc25f00e7f@scylladb.com>
Message-Id: <20200826184546.968336-1-1975039f9046bf513b77c0c5639a0efc25f00e7f@scylladb.com>

syuu1228/seastar,avikivity/seastar,dreamsxin/seastar,scylladb/seastar,syuu1228/seastar,avikivity/seastar,syuu1228/seastar,dreamsxin/seastar,dreamsxin/seastar,scylladb/seastar,cloudius-systems/seastar,avikivity/seastar,cloudius-systems/seastar,cloudius-systems/seastar,scylladb/seastar