#include <iostream>
template<class T>
class Greate
{
public:
bool operator()(const T& left,const T& right)
{ return left>right;}
};
template<class T>
class Less
{
public:
bool operator()(const T& left,const T& right)
{return left<right;}
};
template<class T,class Compare=Less<T> >
class Sort
{
public:
static void BubbleSort(T* arr,size_t size)
{
bool flag=false;//设置标签
for(int i=0;i<size-1;i++)//外围循环
{
flag=false;
for(int j=0;j<size-i-1;j++)//一次排序后
{
if(Compare()(arr[j],arr[j+1]))//调用Greate类--升序,或者Less类--降序