fork(4) download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. template <int Arg>
  5. void foo()
  6. {
  7. std::cout << Arg << ' ';
  8. }
  9.  
  10. template <int First, int... Rest, typename T = std::enable_if_t<(sizeof...(Rest) > 0)>>
  11. void foo()
  12. {
  13. std::cout << First << ' ';
  14. foo<Rest...>();
  15. }
  16.  
  17. int main()
  18. {
  19. foo<1, 2, 3>();
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 4184KB
stdin
Standard input is empty
stdout
1 2 3