ReactOS 0.4.15-dev-7842-g558ab78
test.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <set>
3 #include <vector>
4
5 template<class T>
6 inline void printElements(const T& coll, const char* msg = "")
7 {
8 typename T::const_iterator it;
9 std::cout << msg;
10 for(it = coll.begin(); it != coll.end(); ++it) {
11 std::cout << *it << ' ';
12 }
13 std::cout << std:: endl;
14 }
15
16 int main(int /* argc */, char** /* argv */)
17 {
18 std::set<int> set1, set2;
19 std::vector<int> aVector;
20
21 aVector.push_back(1);
22 aVector.push_back(1);
23
24 set1.insert(aVector.begin(), aVector.end());
25
26 set2.insert(1);
27 set2.insert(1);
28
29 printElements(aVector, "vector: ");
30 printElements(set1, "set1 : ");
31 printElements(set2, "set2 : ");
32
33 return 0;
34 }
35# if 0
36# include <iostream>
37main()
38{
39 // std::stringstream tstr;
40 std::cout<<"hello world\n";
41}
42# endif
#define msg(x)
Definition: auth_time.c:54
int main()
Definition: test.c:6
#define T
Definition: mbstring.h:31
static void set1(uint8 *data, int x, int y)
Definition: nanoxwin.c:811
void printElements(const T &coll, const char *msg="")
Definition: test.cpp:6