Is it possible to transform the types in a parameter pack?

前端 未结 1 1687
清歌不尽
清歌不尽 2021-01-01 19:20

Is it possible to transform the types of a parameter pack and pass it on?

E.g. given the following:

template struct X {};
templa         


        
相关标签:
1条回答
  • 2021-01-01 19:44

    Yes we can do that

    template<template<typename...> class List, 
             template<typename> class Mod, 
             typename ...Args>
    struct magic {
        typedef List<typename Mod<Args>::type...> type;
    };
    
    0 讨论(0)
提交回复
热议问题