是否可以通过演绎指南实现整个 std::make_tuple 功能?

Is it possible to implement the whole std::make_tuple functionality via deduction guides?

指出 C++17 中的演绎指南将使 std::make_tuple 过时。然而,据我了解,std::make_tuplestd::tuple::tuple 的标准推导指南之间的区别在于给定一个 std::reference_wrapperstd::make_tuple 将推导一个参考。

这个推导如何用推导来实现?类似的东西,但扩展到 std::tuple::tuple 具有的模板 Args...

#include <tuple>
#include <functional>

template <typename T>
struct Element {
    Element(std::reference_wrapper<std::decay_t<T>> rw) : value_{rw.get()} {}
    Element(T t) : value_{std::move(t)} {}

    T value_;
};

template <typename T> Element(T) -> Element<T>;
template <typename T> Element(std::reference_wrapper<T>) -> Element<T&>;
template <typename T> Element(std::reference_wrapper<const T>) -> Element<const T&>;

struct A {    
    int i;
};

int main()
{
    A a{10};

    Element wa{std::ref(a)};
    static_assert(std::is_lvalue_reference_v<decltype(wa.value_)>);

    Element wb{A{15}};
    static_assert(std::is_object_v<decltype(wb.value_)>);
}

Example.

template<class T> struct unwrap { using type = T; };
template<class T> struct unwrap<reference_wrapper<T>> { using type = T&; };

template<class... Ts>
tuple(Ts...) -> tuple<typename unwrap<T>::type...>;