title: How to find matching string in a list of strings
body: <p>I am learning c++ and wondering what the best or most idiomatic way to do the following would be.  I have a list of known accepted strings that will be constant for a program.  I want to know if a string provided to a function is in the list of my accepted strings.  I came up with:</p>
  
  <pre><code>bool match(const char* foo, const char* bar) {
      return strcmp(foo, bar) == 0;
  }
  
  bool thingIsValid(const char* thing) {
      return match("foo", thing) || match("bar", thing) || match("baz", thing);
  }
  
  ...
  thingIsValid(someArg.c_str());
  ...
  </code></pre>
  
  <p>This approach just seems to be more of the C idiom to me.   In other languages I would probably just have a list and do a .contains(thing) on that list.  How do people typically do this in C++?</p>