fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Name
  5. {
  6. int a;
  7. int b;
  8. };
  9.  
  10. class Name1
  11. {
  12. int a;
  13. int b;
  14. };
  15.  
  16. template <class T>
  17. bool isName(T *t) {
  18. return false;
  19. }
  20.  
  21. template <>
  22. bool isName(Name *t) {
  23. return true;
  24. }
  25.  
  26. int main() {
  27. Name *n;
  28. Name1 *n1;
  29. cout << "(1): " << isName(n) << endl;
  30. cout << "(2): " << isName(n1) << endl;
  31.  
  32. // your code goes here
  33. return 0;
  34. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
(1): 1
(2): 0