fork download
  1. #include <iostream>
  2. #include <cstddef>
  3. using namespace std;
  4.  
  5. template<typename T>
  6. void foo(T){}
  7.  
  8. template<>
  9. void foo<int>(int) { cout << "Integer" << endl; }
  10.  
  11. template<>
  12. void foo<void*>(void*) { cout << "Pointer" << endl; }
  13.  
  14. int main() {
  15. foo(NULL);
  16. return 0;
  17. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
Integer