Код: Выделить всё
#include
using namespace std;
template
T adder(T first, Args... args) {
return first + adder(args...);
}
int main() {
int c = adder(1,8,4);
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/47941837/c-variadic-template-sum[/url]
Мобильная версия