fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <class T0>
  5. void func(const T0& val0)
  6. {
  7. cout << 1 << endl;
  8. }
  9. template <class T0, class T1>
  10. void func(const T0& val0, const T1& val1)
  11. {
  12. cout << 2 << endl;
  13. }
  14. template <class T0, class T1, class T2>
  15. void func(const T0& val0, const T1& val1, const T2& val2)
  16. {
  17. cout << 3 << endl;
  18. }
  19.  
  20.  
  21. int main(){
  22. func(1);
  23. func(1,2);
  24. func(1,2,4);
  25. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
1
2
3