fork(1) download
  1. #include <iostream>
  2.  
  3. void test(int)
  4. {
  5. }
  6.  
  7. void test(double, int)
  8. {
  9. }
  10.  
  11. template<typename T,typename...Args>
  12. void test(int& sum,T v,Args... args)
  13. {
  14. sum+=v;
  15. test(sum,args...);
  16. }
  17.  
  18. auto a = test<int, int, int>;
  19.  
  20. int main()
  21. {
  22. int s = 0;
  23. a(s, 1, 10, 20);
  24. std::cout << s << std::endl;
  25. }
  26.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
31