home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / list2.cpp < prev    next >
C/C++ Source or Header  |  2000-12-07  |  637b  |  30 lines

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3.  
  4. #include <iostream>
  5. #include <list>
  6.  
  7. #ifdef MAIN 
  8. #define list2_test main
  9. #endif
  10.  
  11. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  12. using namespace std;
  13. #endif
  14. int list2_test(int, char**)
  15. {
  16.   cout<<"Results of list2_test:"<<endl;
  17. int array1 [] = { 1, 16 };
  18. int array2 [] = { 4, 9 };
  19.  
  20.   list<int> l1(array1, array1 + 2);
  21.   list<int> l2(array2, array2 + 2);
  22.   std::list<int>::iterator i = l1.begin();
  23.   i++;
  24.   l1.splice(i, l2, l2.begin(), l2.end());
  25.   i = l1.begin();
  26.   while(i != l1.end())
  27.     cout << *i++ << endl;
  28.   return 0;
  29. }
  30.