fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class A {
  6. public:
  7. template<typename T, typename... Args>
  8. void stuff(Args... args);
  9. void stuff(int = 0);
  10. };
  11.  
  12. template<typename T, typename... Args>
  13. void A::stuff(Args... args) {
  14. cout << sizeof...(args) << endl;
  15. }
  16.  
  17. void A::stuff(int) {
  18. cout << "int" << endl;
  19. }
  20.  
  21. int main() {
  22. A a;
  23. A b;
  24.  
  25. a.stuff<char>();
  26. b.stuff(); // remove <int> kind of specialization
  27. }
Success #stdin #stdout 0s 2884KB
stdin
Standard input is empty
stdout
0
int