title: Enum with associated value
body: <p>I have an Enum with operators different operators.</p>
  
  <pre><code>enum OperatorsTypes
      {
          Zero, Division, Equal, If, Minus, Multiplication, One, Plus, RandomNumber, Time
      };
  </code></pre>
  
  <p>Each operator have different contacts count. For instance Plus - 2 contacts count, Random number - zero.
  What is the base way to store and use contacts counts assotiated with opetators.</p>
  
  <p>I considered 3 options:</p>
  
  <p>1) Using array with index ewual to OperatorsTypes and value = contacts count.</p>
  
  <p>2) Using following declaration:</p>
  
  <pre><code>enum OperatorsTypes
      {
          Zero = 0, Division = 12, Equal = 21, If = 32, Minus = 42, Multiplication = 52, One = 60, Plus = 72, RandomNumber = 81, Time = 90,
      };
  </code></pre>
  
  <p>where first digit is Id number and second - contacts count. Then using % operator in some static method i can find operator's contacts count from OperatorsTypes value. </p>
  
  <p>3) Using switch in some static method</p>
  
  <p>But all this approach has drawbacks... (note - that my code must be top speed).
  Is there better way for this task in C++ both beatifull and top-speed?</p>