home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / regression / vec1.cpp < prev    next >
C/C++ Source or Header  |  2001-05-13  |  907b  |  30 lines

  1. // STLport regression testsuite component.
  2. // To compile as a separate example, please #define MAIN.
  3. #include <cstdlib>
  4. #include <iostream>
  5. #include <algorithm>
  6. #include <vector>
  7.  
  8. #ifdef MAIN 
  9. #define vec1_test main
  10. #endif
  11.  
  12. #if !defined (STLPORT) || defined(__STL_USE_NAMESPACES)
  13. using namespace std;
  14. #endif
  15. int vec1_test(int, char**)
  16. {
  17.   //   cout<<"Sizeof(vector) is "<<sizeof(vector<int>)<<endl;
  18.   //  cout<<"Sizeof(fw) is "<<sizeof(forward_iterator_tag)<<endl;
  19.   //  cout<<"Sizeof(ra) is "<<sizeof(random_access_iterator_tag)<<endl;
  20.   cout<<"Results of vec1_test:"<<endl;
  21.   vector<int> v1; // Empty vector of integers.
  22.   cout << "empty = " << v1.empty() << endl;
  23.   cout << "size = " << v1.size() << endl;
  24.   cout << "max_size = " << v1.max_size() << endl;
  25.   v1.push_back(42); // Add an integer to the vector.
  26.   cout << "size = " << v1.size() << endl;
  27.   cout << "v1[0] = " << v1[0] << endl;
  28.   return 0;
  29. }
  30.