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

后端 未结 1 332
攒了一身酷
攒了一身酷 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 
    std::tuple foo(proxy... names);
    

    where proxy is

    template
    using proxy = E;
    

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

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