How do I strip a tuple<> back into a variadic template list of types?

后端 未结 5 2350
死守一世寂寞
死守一世寂寞 2020-12-15 07:29

Is there a way to strip a std::tuple in order to get it back to T...?

Example

Suppose

5条回答
  •  没有蜡笔的小新
    2020-12-15 08:18

    Using c++17 std::apply.

    using U = std::tuple;
    using X = vct;
    using Y = vct>; // should be same as X
    
    auto my_y = std::apply(
            [](auto... ts) {
                using Y = vct;
                return Y{};
            },
            U{});
    

提交回复
热议问题