title: c++ vector size. why -1 is greater than zero
body: <p>Please take a look at this simple program:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  int main() {
  
  vector&lt;int&gt; a;
  
  std::cout &lt;&lt; "vector size " &lt;&lt; a.size() &lt;&lt; std::endl;
  
  int b = -1;
  
  if (b &lt; a.size())
     std::cout &lt;&lt; "Less";
  else
     std::cout &lt;&lt; "Greater";
  
      return 0;
  }
  </code></pre>
  
  <p>I'm confused by the fact that it outputs "Greater" despite it's obvious that -1 is less than 0. I understand that <code>size</code> method returns unsigned value but comparison is still applied to -1 and 0. So what's going on? can anyone explain this?</p>