fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. enum class Color { red, green = 1, blue };
  5.  
  6. ostream& operator<<(ostream& ostr, const Color& c) {
  7. ostr << (int)c;
  8. return ostr;
  9. }
  10.  
  11. int main() {
  12. Color c = Color::blue;
  13.  
  14. if( c == Color::blue )
  15. cout << Color::green << "\n";
  16.  
  17.  
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 4468KB
stdin
Standard input is empty
stdout
1