title: Using strings in switch statements - where do we stand with C++17?
body: <p>Every one of us has (probably) had the childhood dream of writing:</p>
  <pre><code>switch(my_std_string) {
  case &quot;foo&quot;:  do_stuff(); break;
  case &quot;bar&quot;:  do_other_stuff(); break;
  default:     just_give_up();
  }
  </code></pre>
  <p>but this is not possible, as is explained in the answers to this question from the olden days (2009):</p>
  <p><a href="https://stackoverflow.com/q/650162/1593077">Why the switch statement cannot be applied on strings?</a></p>
  <p>Since then we've seen the advent of C++11, which lets us go as far as:</p>
  <pre><code>switch (my_hash::hash(my_std_string)) {
  case &quot;foo&quot;_hash:  do_stuff(); break;
  case &quot;bar&quot;_hash:  do_other_stuff(); break;
  default:          just_give_up();
  }
  </code></pre>
  <p>as described in an <a href="https://stackoverflow.com/a/23684632/1593077">answer</a> to <a href="https://stackoverflow.com/questions/2111667/compile-time-string-hashing">Compile time string hashing</a> - which is not so bad, although it doesn't actually do exactly what we wanted - there's a chance of collision.</p>
  <p>My question is: Has the development of the language since then (mostly C++14 I suppose) affected the way one would write a sort-of-a string case statement? Or simplified the nuts-and-bolts for achieving the above?</p>
  <p>Specifically, with the conclusion of the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/n4618.pdf" rel="nofollow noreferrer">C++17 standard</a> being <a href="https://isocpp.org/blog/2016/12/n4632" rel="nofollow noreferrer">just around the corner</a> - I'm interested in the answer given what we can assume the standard will contain.</p>