fork(1) download
  1. #include <iostream>
  2.  
  3. enum class E
  4. {
  5. A,B,C
  6. };
  7.  
  8. class Some
  9. {
  10. public:
  11. template <E> void func();
  12. };
  13.  
  14.  
  15. template<> void Some::func<E::A>()
  16. {
  17. std::cout << "A\n";
  18. }
  19. template<> void Some::func<E::B>()
  20. {
  21. std::cout << "B\n";
  22. }
  23. template<> void Some::func<E::C>()
  24. {
  25. std::cout << "B\n";
  26. }
  27.  
  28. int main()
  29. {
  30. Some some;
  31. some.func<E::A>();
  32. some.func<E::B>();
  33. some.func<E::C>();
  34. }
  35.  
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
A
B
B