title: Enums support for inheritance
body: <p>I frequently come across a situation where we create a class that acts on some enumeration, but later we derive and we want to add more values to the enumeration without changing the base class.</p>
  
  <p>I see this question from 2009: 
  <a href="https://stackoverflow.com/questions/644629/base-enum-class-inheritance">Base enum class inheritance</a></p>
  
  <p>However, I know there were a number of changes to enum in C++11, 14, 17.
  Do any of those changes allow for extension of enums from base class to derived?</p>
  
  <pre><code>class Base 
  { 
     enum State {STATE_1, STATE_2, STATE_3}; 
  };
  
  class Derived : public Base 
  { 
     enum State {STATE_4};
  }; 
  </code></pre>
  
  <p>...where we want derived to have an enumeration describing the states it can be in, which are: STATE_1, STATE_2, STATE_3, and STATE_4. We don't really want to change the enumeration in the base class, because other derived classes might not have the ability to be in STATE_4. We don't really want to create a new enumeration either, because we already have one for State in the Base.</p>
  
  <p>Do we still use static const values instead in order to accomplish this 8 years later?</p>
  
  <pre><code>class Base 
  { 
     static int STATE_1= 0;
     static int STATE_2= 1;
     static int STATE_3= 2; 
  };
  
  class Derived : public Base 
  { 
     static int STATE_4= 3; 
  };
  </code></pre>