title: Why does naming an enum value "IN" cause a syntax error?
body: <p>I have a class with an enum for units of length.</p>
  
  <pre><code>class LengthUnit
  {
  public:
      enum Value
      {
          IN,
          CM,
          FT
      };
      static double convert(double value, Value from, Value to){
          if (from == to) return value;
          return value * getScale(from)/getScale(to);
      }
      constexpr LengthUnit(Value value) : value(value) {}
  
      bool operator==(LengthUnit lUnit) const { return value == lUnit.value; }
      bool operator!=(LengthUnit lUnit) const { return value != lUnit.value; }
  
  private:
      static double getScale(Value value){
          switch (value){
          case IN: return 2.54; // 1 in = 2.54 cm
          case FT: return 30.48; // 1 ft = 30.48 cm
          case CM: return 1;
          default:
              throw QException();
          }
      }
      Value value;
  };
  </code></pre>
  
  <p>An error is detected on the 6th line.</p>
  
  <pre><code>error: expected identifier before ',' token
           IN,
             ^
  </code></pre>
  
  <p>If I change the name of the variable from IN to INCHES, the error goes away.</p>
  
  <p>What is causing this error? As far as I can tell, IN is not a keyword of C++ or Qt, so why is the name causing an issue? </p>