sort() function in C++
<p>I found two forms of sort() in C++:</p>

<p>1) sort(begin, end);</p>

<p>2) XXX.sort();</p>

<p>One can be used directly without an object, and one is working with an object.</p>

<p>Is that all? What's the differences between these two sort()? They are from the same library or not? Is the second a method of XXX? </p>

<p>Can I use it like this</p>

<pre><code>vector&lt;int&gt; myvector
myvector.sort();
</code></pre>

<p>or</p>

<pre><code>list&lt;int&gt; mylist;
mylist.sort();
</code></pre>
