用函数模板编写QuickSort函数实现对所有基本数据类型排序,该如何处理

用函数模板编写QuickSort函数实现对所有基本数据类型排序
#include<iostream>
using namespace std;
template<class T,int nSize>
void QuickSort(T(&ar)[nSize],int left,int right)
{
int i=left;
int j=right;
T tMid=ar[(i+j)/2];
T temp;
do
{
while(ar[i]<tMid)
i++;
while(tMid<ar[j])
j--;
if(i<=j)
{
temp=ar[i];
ar[i]=ar[j];
ar[j]=temp;
i++;
j--;
}
}while(i<=j);
if(left<j)QuickSort(ar,left,j);
if(i<right)QuickSort(ar,i,right);

}
int main()
{
int a[10];
for(int k=0;k<10;k++)
cin>>a[k];
QuickSort(a,0,10);
for(int k=0;k<10;k++)
cout<<a[k];
return 0;
}
用vc6.0编译器出现下面错误:
D:\vc编译器\Microsoft Visual Studio\MyProjects\tem\tem.cpp(4) : error C2265: '<Unknown>' : reference to a zero-sized array is illegal
D:\vc编译器\Microsoft Visual Studio\MyProjects\tem\tem.cpp(34) : error C2784: 'void __cdecl QuickSort(T (&)[1],int,int)' : could not deduce template argument for ' (&)[1]' from 'int [10]'
D:\vc编译器\Microsoft Visual Studio\MyProjects\tem\tem.cpp(35) : error C2374: 'k' : redefinition; multiple initialization
  D:\vc编译器\Microsoft Visual Studio\MyProjects\tem\tem.cpp(32) : see declaration of 'k'
执行 cl.exe 时出错.
//我是一名新手,刚开始学C++模板,查了好长时间还是找不到错误,请哪位大侠帮忙指点一下,谢谢。

------解决方案--------------------
你用的什么编译器啊?是VC6么?
我用Visual C++ 2010 Express编译一个错误都没有。
------解决方案--------------------
或许对你不是,但是对vc6,的确是