ReactOS 0.4.15-dev-7942-gd23573b
test.cpp File Reference
#include <iostream>
#include <set>
#include <vector>
Include dependency graph for test.cpp:

Go to the source code of this file.

Functions

template<class T >
void printElements (const T &coll, const char *msg="")
 
int main (int, char **)
 

Function Documentation

◆ main()

int main ( int  ,
char **   
)

Definition at line 16 of file test.cpp.

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 }
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

◆ printElements()

template<class T >
void printElements ( const T coll,
const char msg = "" 
)
inline

Definition at line 6 of file test.cpp.

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 }
#define msg(x)
Definition: auth_time.c:54

Referenced by main().