fork(2) download
  1. #include <iostream>
  2.  
  3.  
  4. template<typename T>
  5. struct A
  6. {
  7. bool IsTEnum()
  8. {
  9. // TODO : implement
  10. return false;
  11. }
  12.  
  13. void printIsEnum()
  14. {
  15. if(IsTEnum())
  16. {
  17. printf(" is an enum\n");
  18. }
  19. else
  20. {
  21. printf(" is not an enum\n");
  22. }
  23. }
  24. };
  25.  
  26. enum MyEnum
  27. {
  28. MyEnumValue1,
  29. MyEnumValue2,
  30. MyEnumValue3,
  31. };
  32.  
  33. int main()
  34. {
  35. A<float> aFloat;
  36. A<MyEnum> aEnum;
  37.  
  38. printf("float...");
  39. aFloat.printIsEnum();
  40.  
  41. printf("MyEnum...");
  42. aEnum.printIsEnum();
  43.  
  44. return 0;
  45. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
float... is not an enum
MyEnum... is not an enum