chunkedseq
container library for large in-memory data sets
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
map_2.cpp
Go to the documentation of this file.
1 
16 // accessing mapped values
18 #include <iostream>
19 #include <string>
20 
21 #include "map.hpp"
22 
23 int main ()
24 {
27 
28  // insert some values:
29  mymap['a']=10;
30  mymap['b']=20;
31  mymap['c']=30;
32  mymap['d']=40;
33  mymap['e']=50;
34  mymap['f']=60;
35 
36  it=mymap.find('b');
37  mymap.erase (it); // erasing by iterator
38 
39  mymap.erase ('c'); // erasing by key
40 
41  // show content:
42  for (it=mymap.begin(); it!=mymap.end(); ++it)
43  std::cout << (*it).first << " => " << (*it).second << '\n';
44 
45  return 0;
46 }
int main()
[map_example2]
Definition: map_2.cpp:23
STL-style map data structure.
iterator begin() const
Definition: map.hpp:279
iterator find(const key_type &k) const
Definition: map.hpp:230
typename container_type::iterator iterator
Definition: map.hpp:195
void erase(iterator it)
Definition: map.hpp:252
iterator end() const
Definition: map.hpp:283