how to use this c++ template function. simple beginner question
<p>I found this merge sort function but i dont know how to use it.
please help</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;stdlib.h&gt;
#include&lt;vector&gt;
using namespace std;

template &lt;typename Comparable&gt;
void mergeSort(vector&lt;Comparable*&gt; &amp;v)
{
    mergeSortPart(v, 0, v.size() - 1);
}

template &lt;typename Comparable&gt;
void mergeSortPart(vector&lt;Comparable*&gt; &amp;v,int first,int last)
{  
    if(first &lt; last)
    {
        int mid = (first + last)/2;
        mergeSortPart(v, first, mid);
        mergeSortPart(v, mid + 1, last);
        merge(v, first, mid, last);
    }
}
template &lt;typename Comparable&gt;
void merge(vector&lt;Comparable*&gt; &amp;v, int first, int mid,int last)
{
    vector&lt;Comparable*&gt; temp(v.size());
    int first1 = first; int last1 = mid; int first2 = mid + 1;
    int last2 = last; int index = first1;
    while((first1 &lt;= last1) &amp;&amp; (first2 &lt;= last2))
    {
        if(*v[first1]&lt;*v[first2])
            temp[index++] = v[first1++];
        else
            temp[index++] = v[first2++];
    }
    while(first1 &lt;= last1)
        temp[index++] = v[first1++];
    while(first2 &lt;= last2)
        temp[index++] = v[first2++];
    for(index = first; index &lt;= last; index++)
        v[index] = temp[index];
}

void main()
{  
    vector&lt;int&gt; arr (20);
    for(int i=0;i&lt;20;i++)
        arr[i]=i;
    mergeSort&lt;int&gt;(arr);
}
</code></pre>

<p>In <code>main</code> function i tried to declare an array of 6 elements and called <code>mergeSort</code> template function but it gives a compilation error: </p>

<blockquote>
  <p>Error  1   error C2664: <code>'mergeSort'</code> : cannot convert parameter 1 from <code>'std::vector&lt;_Ty&gt;'</code> to <code>'std::vector&lt;_Ty,_Ax&gt; &amp;'</code></p>
</blockquote>

<p>I am not very familiar with template functions so if some one could show me how to use this function that would be a treat to me</p>

<p>Thanks</p>
