How can I generate a tuple of N type T's?

后端 未结 3 1637
再見小時候
再見小時候 2020-12-19 14:28

I want to be able to write generate_tuple_type which would internally have a type alias type which would be std::tuple

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-19 14:52

    Check the bottom of this link for an example:

    http://en.cppreference.com/w/cpp/utility/integer_sequence.

    You'll need to do a little more work to encapsulate the resulting tuple as a type alias, but the crucial construct here is std::integer_sequence and friends.

提交回复
热议问题