Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

LightVector_STL_set_difference_Test.cpp

Go to the documentation of this file.
00001 // LightVector_STL_set_difference_Test.cpp
00002 
00003 #include "datastructures/vector/LightVector.hpp"
00004 #include <iostream>
00005 using namespace std;
00006 
00012 int main(int argc, char** argv) {
00013 
00014   int values[] = { 1, 3, 5, 7, 9, 11, 13 };
00015   int len = 7;
00016   int values2[] = { 1, 2, 4, 6, 7, 9 };
00017   int len2 = 6;
00018 
00019   const LightVector<int> x(values, len), y(values2, len2);
00020   LightVector<int>* res = LightVector<int>::create(10, 0);
00021 
00022   cout << "x = " << x << endl;
00023   cout << "y = " << y << endl;
00024 #if DEBUG_LEVEL > 0
00025   cout << "res.capacity = " << res->capacity() << endl;
00026 #endif
00027 
00028   res.resize(10);
00029   LightVector<int>::iterator resIter = res->begin(); // Unbounded();
00030   resIter = set_difference(x.begin(), x.end(), y.begin(), y.end(), resIter);
00031   res->resize(resIter - res->begin()); // Unbounded());
00032   
00033   cout << "set_difference(x,y) = " << *res << endl;
00034 
00035 }

Generated on Sun Sep 17 17:50:39 2006 for FIM environment by  doxygen 1.4.4