Can parameter pack function arguments be defaulted?

后端 未结 2 953
生来不讨喜
生来不讨喜 2020-12-09 15:54

This is a point about which gcc 4.9.2 and clang 3.5.2 are in sharp disagreement. The program:

template
int foo(int i = 0, Ts &&         


        
2条回答
  •  不思量自难忘°
    2020-12-09 15:59

    A Kerrek SB says, it's not possible. What you could do, instead, is using a std::tuple

    template 
    void foo( std::tuple t = std::tuple(0) )
    {}
    

提交回复
热议问题