fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Inventory {
  5. public:
  6. enum Fruit { APPLE, BANANA, GRAPE, ORANGE };
  7. };
  8.  
  9. int main() {
  10. if(Inventory::APPLE < Inventory::Fruit::ORANGE) {
  11. cout << "Comparing C++03 'enum' with C++11 'enum class' is like comparing apples and oranges." << endl;
  12. }
  13. }
Success #stdin #stdout 0s 2828KB
stdin
Standard input is empty
stdout
Comparing C++03 'enum' with C++11 'enum class' is like comparing apples and oranges.