title: How to assign a value to an enum based on input from a file in C++?
body: <p>I have a file with values like: START and STOP. I also have the following enum declared:</p>
  
  <pre><code>enum Type {
      START,
      STOP
  };
  </code></pre>
  
  <p>I'm trying to set the enum equal to the first value in the file with something like this:</p>
  
  <pre><code>enum Type foo;
  
  ifstream ifile;
  ifile.open("input.txt");
  
  ifile &gt;&gt; foo;
  </code></pre>
  
  <p>I'm getting the error: no match for ‘operator>>’ in ‘ifile >> foo’.</p>
  
  <p>How do I go about doing this correctly?</p>