chunkedseq
container library for large in-memory data sets
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
examples
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
{
25
pasl::data::map::map<char,int>
mymap;
26
pasl::data::map::map<char,int>::iterator
it;
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
}
main
int main()
[map_example2]
Definition:
map_2.cpp:23
map.hpp
STL-style map data structure.
pasl::data::map::map::begin
iterator begin() const
Definition:
map.hpp:279
pasl::data::map::map::find
iterator find(const key_type &k) const
Definition:
map.hpp:230
pasl::data::map::map::iterator
typename container_type::iterator iterator
Definition:
map.hpp:195
pasl::data::map::map::erase
void erase(iterator it)
Definition:
map.hpp:252
pasl::data::map::map::end
iterator end() const
Definition:
map.hpp:283
pasl::data::map::map
[swap]
Definition:
map.hpp:171
Generated on Mon Mar 9 2015 22:07:07 for chunkedseq by
1.8.8