title: Enums inside of a C++ class
body: <p>I am trying to use a class that has an enum type declared inside the class like so:</p>
  
  <pre><code>class x {
  public:
      x(int);
      x( const x &amp;);
      virtual ~x();
      x &amp; operator=(const x &amp;);
      virtual double operator()() const;
  
      typedef enum  {
          LINEAR = 0,      /// Perform linear interpolation on the table
          DIPARABOLIC = 1  /// Perform parabolic interpolation on the table
      } XEnumType; 
  };
  </code></pre>
  
  <p>I need to declare an instance of this class and initialize the enum type.  I come from C# and normally see enums declared OUTSIDE of a class, not INSIDE like it is here.  How do I initialize the enum type.  For example, I want to do something like this:</p>
  
  <pre><code>x myX(10);   
  myX.XEnumType = Linear;
  </code></pre>
  
  <p>Obviously this doesn't work.  How would I do this?</p>