-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErase.cpp
More file actions
49 lines (35 loc) · 899 Bytes
/
Erase.cpp
File metadata and controls
49 lines (35 loc) · 899 Bytes
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
/**
* \file Erase.cpp
* \brief
*
* \todo
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//-------------------------------------------------------------------------------------------------
int main(int, char **)
{
std::size_t uiRv = 0;
std::map<char,int> m;
m['a'] = 10;
m['b'] = 20;
m['c'] = 30;
uiRv = m.erase('a');
std::cout << "a: " << STD_TRACE_VAR(uiRv) << std::endl;
uiRv = m.erase('a');
std::cout << "a: " << STD_TRACE_VAR(uiRv) << std::endl;
uiRv = m.erase('x');
std::cout << "x: " << STD_TRACE_VAR(uiRv) << std::endl;
for (std::map<char,int>::iterator it=m.begin(); it!=m.end(); ++it)
std::cout << it->first << " => " << it->second << '\n';
return 0;
}
//-------------------------------------------------------------------------------------------------
#if OUTPUT
a: uiRv: 1
a: uiRv: 0
x: uiRv: 0
b => 20
c => 30
#endif