C++ template parameter deduction for std::array with non size_t integer

后端 未结 2 1776
没有蜡笔的小新
没有蜡笔的小新 2021-01-18 08:23

I\'m trying to adapt the solution presented in Avoiding struct in variadic template function to my need. However, I can\'t understand the the behavior of G++. Consider the f

2条回答
  •  孤城傲影
    2021-01-18 09:04

    Your literal 2 is interpreted as an unsigned long, but you are declaring the Size template to be an unsigned int. Just use this instead:

    template 
    

提交回复
热议问题