-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompInt.cpp
67 lines (54 loc) · 1.46 KB
/
CompInt.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* \file CompInt.cpp
* \brief Int comparator
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//-------------------------------------------------------------------------------------------------
using int_mmap_less_t = std::multimap<int, int, std::less<int>>;
using int_mmap_greater_t = std::multimap<int, int, std::greater<int>>;
//--------------------------------------------------------------------------------------------------
int main(int, char **)
{
{
const ::int_mmap_less_t intMap
{
{3, 200},
{1, 400},
{4, 999},
{2, 300}
};
std::cout << "int_mmap_less_t:" << std::endl;
for (const auto &[it_key, it_value] : intMap) {
std::cout << "{" << it_key << ", " << it_value << "}" << std::endl;
}
}
{
const ::int_mmap_greater_t intMap
{
{3, 200},
{1, 400},
{4, 999},
{2, 300}
};
std::cout << "\nint_mmap_greater_t:" << std::endl;
for (const auto &[it_key, it_value] : intMap) {
std::cout << "{" << it_key << ", " << it_value << "}" << std::endl;
}
}
return EXIT_SUCCESS;
}
//--------------------------------------------------------------------------------------------------
#if OUTPUT
int_mmap_less_t:
{1, 400}
{2, 300}
{3, 200}
{4, 999}
int_mmap_greater_t:
{4, 999}
{3, 200}
{2, 300}
{1, 400}
#endif