title: iterate through non-consecutive enum elements in c++
body: <p>There are many ways to iterate through consecutive enums like</p>
  
  <pre><code>enum Animal {Cat, Dog, Dolphin}
  </code></pre>
  
  <p>But is there a convenient and easy way to iterate through non-consecutive enum elements like</p>
  
  <pre><code>enum Animal {Cat = 0, Dog = 5, Dolphin = 8}
  </code></pre>