title: Ambiguous overload for operator>>
body: <p>I'm starting learning C++ and I cant find the cause of the error below. This code is in the book "Teach Yourself C++ ".</p>
  
  <p>main.cpp:13: error: ambiguous overload for ‘operator>>’ in ‘std::cin >> (int)ip’</p>
  
  <pre><code>#include&lt;iostream&gt;
  
  using namespace std;
  
  enum ignition_parts {distributor=1,cap,points,plug,condenser,coil,wires,done};
  
  
   main() {
  
   ignition_parts ip;
   do{
   cout &lt;&lt; "\nInsira no item (1-7, 8 para sair):";
   std::cin &gt;&gt; (int)ip;
   switch(ip){
  
       case distributor: cout&lt;&lt; "Distribuidor";
       break;
  
       case cap: cout&lt;&lt; "Tampa";
       break;
  
       case points: cout &lt;&lt; "Pontos";
       break;
  
       case plug:cout &lt;&lt; "Vela";
       break;
  
       case condenser: cout&lt;&lt;"Condensador";
       break;
  
       case done: break;
  
       default: cout &lt;&lt; "No item ignorado";
       break;
  
       }
  
       } while (ip != done);
  
  }
  </code></pre>