title: if (cin >> x) - Why can you use that condition?
body: <p>I have been using "Accelerated C++" to learn C++ over the summer, and there's a concept which I don't seem to understand properly.</p>
  
  <p>Why is</p>
  
  <pre><code>int x;
  if (cin &gt;&gt; x){}
  </code></pre>
  
  <p>equivalent to</p>
  
  <pre><code>cin &gt;&gt; x;
  if (cin){}
  </code></pre>
  
  <p>By looking at the code, it seems to me that we're using cin as a variable. But, I thought it was a function. Why can we use cin in this way when it is x that has whatever value we input into our keyboard?</p>