os/ossrv/genericopenlibs/cppstdlib/stl/test/eh/test.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cppstdlib/stl/test/eh/test.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,42 @@
     1.4 +           #include <iostream>
     1.5 +           #include <set>
     1.6 +           #include <vector>
     1.7 +
     1.8 +           template<class T>
     1.9 +           inline void printElements(const T& coll, const char* msg = "")
    1.10 +           {
    1.11 +           typename T::const_iterator it;
    1.12 +           std::cout << msg;
    1.13 +           for(it = coll.begin(); it != coll.end(); ++it) {
    1.14 +           std::cout << *it << ' ';
    1.15 +           }
    1.16 +           std::cout << std:: endl;
    1.17 +           }
    1.18 +
    1.19 +           int main(int /* argc */, char** /* argv */)
    1.20 +           {
    1.21 +           std::set<int> set1, set2;
    1.22 +           std::vector<int> aVector;
    1.23 +
    1.24 +           aVector.push_back(1);
    1.25 +           aVector.push_back(1);
    1.26 +
    1.27 +           set1.insert(aVector.begin(), aVector.end());
    1.28 +
    1.29 +           set2.insert(1);
    1.30 +           set2.insert(1);
    1.31 +
    1.32 +           printElements(aVector, "vector: ");
    1.33 +           printElements(set1, "set1 : ");
    1.34 +           printElements(set2, "set2 : ");
    1.35 +
    1.36 +           return 0;
    1.37 +           }
    1.38 +# if 0
    1.39 +# include <iostream>
    1.40 +main()
    1.41 +{
    1.42 +  // std::stringstream tstr;
    1.43 +  std::cout<<"hello world\n";
    1.44 +}
    1.45 +# endif