ReactOS  0.4.15-dev-5606-gf34e425
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  }
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>
37 main()
38 {
39  // std::stringstream tstr;
40  std::cout<<"hello world\n";
41 }
42 # endif
#define T
Definition: mbstring.h:31
#define cout
Definition: iostream.cpp:38
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
Definition: _ostream.h:357
static void set1(uint8 *data, int x, int y)
Definition: nanoxwin.c:811
int main(int, char **)
Definition: test.cpp:16
#define msg(x)
Definition: auth_time.c:54
void printElements(const T &coll, const char *msg="")
Definition: test.cpp:6