title: Internal enum as a base class template parameter
body: <h1>pragma once</h1>
  <pre><code>#include &quot;stdafx.h&quot;
  #include &quot;Token.h&quot;
  
  //I would like this enum to be inside class Number
  enum Number_enm {ZERO, ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE};
  
  class Number : public Token&lt;Number_enm&gt;//and this template parameter to be Number::Number_enm
  {
  private:
      
  public:
      Number(const Number_enm&amp; num)
      try:
      Token(num)
      {   }
      catch(...)
      {
          cerr &lt;&lt; &quot;Error in Number::Number(const Number_enm&amp;).&quot;;
          return;
      }
      
      Number(const char num)
      try:
      Token(static_cast&lt;Number_enm&gt;(num &amp; 0xf)) //get number value from char
      {
  #ifdef DEBUG_
      cout &lt;&lt; &quot;Converting ctor, from char to Token.\n&quot;;
  #endif
      }
      catch(...)
      {
          cerr &lt;&lt; &quot;Error in Number::Number(const char num).&quot;;
          return;
      }
      
  };
  
  #pragma once
  
  /*Abstract class*/
  template&lt;class T&gt;
  class Token
  {
      typedef T value_type;
  private:
      value_type my_data_;
  protected:
      /*Token()
      try: my_data_()
      {   }
      catch(...)
      {
          cerr &lt;&lt; &quot;Error in Token&lt;T&gt;::Token().&quot;;
          return;
      }*/
      Token(const value_type value)
          try:
      my_data_(value)
      {   }
      catch(...)
      {
          cerr &lt;&lt; &quot;Error in Token&lt;T&gt;::Token(const value_type&amp;).&quot;;
          return;
      }
      /*Token(const Token&amp; value): my_data(value)
      {   }*/
      Token&amp; operator=(const Token&amp; right)
      {
  #ifdef DEBUG_
          cout &lt;&lt; &quot;Token&amp; operator=(const Token&amp; right).\n&quot;;
  #endif
          my_data = right;
          return my_data;
      }
  public:
      T get() const
      {
          return my_data_;
      }
      T set(const T&amp; new_value)
      {
          T old = my_data_;
          my_data_ = new_value;
          return old;
      }
  };
  </code></pre>
  <p>I wonder if it is possible to do this kind of construction?</p>