Transform tuple type

前端 未结 1 622
悲哀的现实
悲哀的现实 2021-01-15 19:17

So I\'m new to boost MPL, and I don\'t know how to use it with standard types.

I want a metafunction that coverts this type:

std::tuple

        
相关标签:
1条回答
  • 2021-01-15 20:12

    How about the following?

    template<typename T> struct transform;
    template<typename ...T>
    struct transform<std::tuple<T...>> {
      typedef std::tuple<std::function<T(std::tuple<T...>, std::tuple<T...>)>...> type;
    };
    
    0 讨论(0)
提交回复
热议问题