#include
#include
#include
#include
#include
Using namespace std;
Template
Void PrintList (const type & elem)
{
Static int C = 0;
IF (C% 4 == 0)
Cout << Endl;
COUT << ELEM << "/ t";
C ;
}
Int main (void)
{
List
List
For (int i = 0; i <20; i)
{
IF (i% 2 == 0)
COLL_1.PUSH_BACK (i);
Else
COLL_2.PUSH_FRONT (i);
}
COUT << "COLL_1:";
FOR_EACH (COLL_1.BEGIN (), COLL_1.END (),
PrintList
Cout << Endl;
COUT << "COLL_2:";
For_each (COLL_2.BEGIN (), COLL_2.END (),
PrintList
Cout << Endl;
COLL_1.SPLICE (COLL_1.BEGIN (), COLL_2);
COUT << "COLL_1:";
FOR_EACH (COLL_1.BEGIN (), COLL_1.END (),
PrintList
Cout << Endl;
COUT << "COLL_2:";
For_each (COLL_2.BEGIN (), COLL_2.END (),
PrintList
Cout << Endl;
COLL_2.Assign (Find (coll_1.begin (), coll_1.end (), 3),
COLL_1.END ());
COLL_1.SORT ();
COUT << "COLL_1:";
FOR_EACH (COLL_1.BEGIN (), COLL_1.END (),
PrintList
Cout << Endl;
COUT << "COLL_2:";
For_each (COLL_2.BEGIN (), COLL_2.END (),
PrintList
Cout << Endl;
COLL_2.SORT ();
COLL_1.MERGE (COLL_2);
COUT << "COLL_1:";
FOR_EACH (COLL_1.BEGIN (), COLL_1.END (),
PrintList
Cout << Endl;
COUT << "COLL_2:";
For_each (COLL_2.BEGIN (), COLL_2.END (),
PrintList
Cout << Endl;
COLL_1.Unique ();
COUT << "COLL_1:";
For_each (COLL_1.BEGIN (), COLL_1.END (), PrintList
Cout << Endl;
Return 0;
}