title: Using the less than comparison operator for strings
body: <p>I'm following a tutorial for C++ and looking at strings and overloading with operators such as <code>+=</code>, <code>==</code>, <code>!=</code> etc. Currently I have a simple if-statement:</p>
  <pre><code>if(s1 &lt; s2)
      cout &lt;&lt; s2 &lt;&lt;endl;
  else
    if(s2 &lt; s1)
      cout &lt;&lt; s1 &lt;&lt; endl;
    else
      cout &lt;&lt; &quot;Equal\n&quot;;
  </code></pre>
  <p>But how does this work, and how does the program decide which string is greater than another?
  looking around I've found a basic template declaration:</p>
  <pre><code>template&lt;class charT, class traits, class Allocator&gt;
  bool operator&lt; ( const basic_string&lt;charT,traits,Allocator&gt;&amp; lhs,
                   const basic_string&lt;charT,traits,Allocator&gt;&amp; rhs );
  </code></pre>
  <p>Does this define how <code>&lt;</code> works? If so, what does <code>&lt;charT,traits,Allocator&gt;</code> mean / do?</p>
  <p>Also do the following operators have any meaning for strings? <code>-=</code> and <code>*=</code></p>