Is it possible to expand non-variadic arguments in a variadic template function?

后端 未结 1 330
攒了一身酷
攒了一身酷 2021-01-31 03:56

It is probably easier to explain what I mean by an example. Imagine a following template:

template 

        
相关标签:
1条回答
  • 2021-01-31 04:42

    You can do this with something like

    template <class... Args>
    std::tuple<Args...> foo(proxy<Args, const char*>... names);
    

    where proxy is

    template<class T, class E>
    using proxy = E;
    

    You can see this in action here: https://godbolt.org/g/SHBYzy

    0 讨论(0)
提交回复
热议问题