fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <class Type>
  5. ostream & operator<< (ostream & stream, const Type & t)
  6. {
  7. return (stream << static_cast<typename std::underlying_type<Type>::type>(t));
  8. }
  9.  
  10. template <class Type>
  11. iostream & operator>>(iostream & stream, Type & t)
  12. {
  13. typename std::underlying_type<Type>::type temp;
  14. stream >> temp;
  15. t = static_cast<Type>(t);
  16. return stream;
  17. }
  18.  
  19. enum class T: int {
  20. ZERO = 0,
  21. ONE = 1
  22. };
  23.  
  24. int main() {
  25. cout << T::ONE;
  26. return 0;
  27. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
1