我正在尝试掌握可变函数/模板参数的窍门。但是,在下面的两个函数中,我很困惑为什么SumIndices不能编译(我收到编译器错误“expansion pattern \xe2\x80\x98std::size_t\xe2\x80\x99 {aka \xe2\x80\x98long unsigned int\xe2\x80\x99} 不包含参数包”)而包含SumValues。
template <typename ...t_data_type>\nconstexpr auto SumValues(t_data_type ..._values) { \n return (_values + ...); \n}\n\nconstexpr auto SumIndices(std::size_t ..._indices) { \n return (_indices + ...); \n}\nRun Code Online (Sandbox Code Playgroud)\n如果有人能为我澄清这个困惑,我将不胜感激!
\n