What happens with the odd indexes? If it doesn't matter or if they sould be sorted with their even neighbor, you could do that:

template <class type>

void shellSort(type B[], int size)

{

struct Even

{

type x[2];

bool operator> (const Even& e) const

{ return x[0] > e.x[0]; }

};

Even* A = reinterpret_cast<Even*>(B);

size /= 2;

// below use your code

...

}

Regards, Alex

template <class type>

void shellSort(type B[], int size)

{

struct Even

{

type x[2];

bool operator> (const Even& e) const

{ return x[0] > e.x[0]; }

};

Even* A = reinterpret_cast<Even*>(B)

size /= 2;

// below use your code

...

}

Regards, Alex