以下模版类哪里错了
Sort.h
template<class T> class Sort{public: void BubblerSort(T * arr,int n);};#include "Sort.h"template<class T> void Sort<T>::BubblerSort(T * arr,int n){ T temp; for (int i=0;i<n-1;i++) { for (int j=0;j<n-1-i;j++) { if (arr[j]>arr[j+1])//交换相邻的两个数 { temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } }}#include <iostream>#include <Windows.h>#include "Sort.h"using namespace std;class sort2{public: void BubblerSort(int * arr,int n) { int temp; for (int i=0;i<n-1;i++) { for (int j=0;j<n-1-i;j++) { if (arr[j]>arr[j+1])//交换相邻的两个数 { temp=arr[j]; arr[j]=arr[j+1]; arr[j+1]=temp; } } } }};void bubbler_sort(int *arr,int n);int main(){ int arr[10]={2,3,1,4,6,7,9,8,0,5}; //bubbler_sort(arr,10); Sort<int> sort; //sort2 sort; sort.BubblerSort(arr,10); for (int i=0;i<10;i++) { cout<<arr[i]<<" "; } cout<<endl; system("pause"); return 0;}