class Data1
{
int i;
char c[4];
};
class Data2
{
int i;
char d[5];
double dd;
};
template <typename T> class TableObject
{
public:
list<T*> links;
typename list<T*>::iterator ite;
TableObject(){
//do insert Data1 or Data2 into links
}
~TableObject(){}
void Sort(){
ite=links.begin();
int i=0;
while ((ite+i)<links.end()){
if (*(ite+i).i>*(ite+i+1).i) //<-it seems impossible work
iter_swap((ite+i),(ite+i+1))
}
i++;
}
}
{
int i;
char c[4];
};
class Data2
{
int i;
char d[5];
double dd;
};
template <typename T> class TableObject
{
public:
list<T*> links;
typename list<T*>::iterator ite;
TableObject(){
//do insert Data1 or Data2 into links
}
~TableObject(){}
void Sort(){
ite=links.begin();
int i=0;
while ((ite+i)<links.end()){
if (*(ite+i).i>*(ite+i+1).i) //<-it seems impossible work
iter_swap((ite+i),(ite+i+1))
}
i++;
}
}