fork download
  1. #include <iostream>
  2.  
  3. enum FACE { NORTH, SOUTH, EAST, WEST };
  4.  
  5. struct Direction {
  6. FACE face;
  7.  
  8. operator FACE () const { return face; }
  9. };
  10.  
  11. int main(){
  12. Direction dir;
  13. dir.face = EAST;
  14.  
  15. std::cout << dir;
  16. }
  17.  
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
2