title: Incrementation and decrementation of “enum class”
body: <p>As we know, incrementation and decrementation of <code>enum</code> in C++03 is illegal, because C++03 <code>enum</code> may not be continuous. But the C++11 standard introduced the new <code>enum class</code> construction, which, according to Wikipedia, is more type-safe because it isn’t built on any simple countable type. So now, if we have a bounded list of values of an enum, can we write something like</p>
  
  <pre><code>enum class Colors { Black, Blue, White };
  // ...
  Colors color = Colors::White;
  color++;
  </code></pre>
  
  <p>and will it work correctly (e.g. incrementation of <code>White</code> will return <code>Black</code> and decrementation of <code>Black</code> will return <code>White</code>)?</p>
  
  <p><strong>If we can't write such code, do you know any behavior-like classes either from <code>boost</code> or from <code>Qt</code> that provide us this feature (correct in- and decrementing)?</strong></p>