5 Copyright (c) 2006-2007 Matias Capeletto
7 Distributed under the Boost Software License, Version 1.0.
8 (See accompanying file LICENSE_1_0.txt or copy at
9 http://www.boost.org/LICENSE_1_0.txt)
13 [/ QuickBook Document version 1.4 ]
17 [section Examples list]
19 In the folder [@../../example libs/bimap/example] you can find all the examples
20 used in bimap documentation. Here is a list of them:
23 [table Tutorial examples
24 [[Program ][Description ]]
26 [[[@../../example/simple_bimap.cpp
28 [Soccer world cup example ]]
30 [[[@../../example/tagged_simple_bimap.cpp
31 tagged_simple_bimap.cpp ]]
32 [Soccer world cup example using user defined names ]]
34 [[[@../../example/step_by_step.cpp
36 [Basic example of the three views of bimap ]]
38 [[[@../../example/population_bimap.cpp
39 population_bimap.cpp ]]
40 [Countries populations, using `unordered_set_of` and `multiset_of` ]]
42 [[[@../../example/repetitions_counter.cpp
43 repetitions_counter.cpp ]]
44 [Word repetitions counter, using `unordered_set_of` and `list_of` ]]
46 [[[@../../example/mighty_bimap.cpp
48 [Dictionary using `list_of_relation` ]]
50 [[[@../../example/user_defined_names.cpp
51 user_defined_names.cpp ]]
52 [Equivalence between code with tagged and untagged code ]]
54 [[[@../../example/standard_map_comparison.cpp
55 standard_map_comparison.cpp ]]
56 [Comparison between standard maps and bimap map views ]]
58 [[[@../../example/at_function_examples.cpp
59 at_function_examples.cpp ]]
60 [Functions `at(key)` and `operator[](key)` examples ]]
62 [[[@../../example/tutorial_modify_and_replace.cpp
63 tutorial_modify_and_replace.cpp ]]
64 [`modify` and `replace` examples ]]
66 [[[@../../example/tutorial_range.cpp
68 [`range()` tutorial ]]
70 [[[@../../example/tutorial_info_hook.cpp
71 tutorial_info_hook.cpp ]]
72 [Additional information hooking ]]
74 [[[@../../example/unconstrained_collection.cpp
75 unconstrained_collection.cpp ]]
76 [Using `unconstrained_set_of` collection type ]]
80 [table Bimap and Boost examples
81 [[Program ][Description ]]
83 [[[@../../example/bimap_and_boost/assign.cpp
85 [Bimap and Boost.Assign: Methods to insert elements ]]
87 [[[@../../example/bimap_and_boost/lambda.cpp
89 [Bimap and Boost.Lambda: new lambda placeholders ]]
91 [[[@../../example/bimap_and_boost/property_map.cpp
93 [Bimap and Boost.PropertyMap: PropertyMap support ]]
95 [[[@../../example/bimap_and_boost/range.cpp
97 [Bimap and Boost.Range: Using bimaps in the new range framework ]]
99 [[[@../../example/bimap_and_boost/foreach.cpp
101 [Bimap and Boost.Foreach: Iterating over bimaps ]]
103 [[[@../../example/bimap_and_boost/typeof.cpp
105 [Bimap and Boost.Typeof: using BOOST_AUTO while we wait for C++0x ]]
107 [[[@../../example/bimap_and_boost/xpressive.cpp
109 [Bimap and Boost.Xpressive: Inserting elements in a bimap ]]
111 [[[@../../example/bimap_and_boost/serialization.cpp
112 serialization.cpp: ]]
113 [Bimap and Boost.Serialization: Load and save bimaps and iterators ]]
117 [table Boost.MultiIndex to Boost.Bimap path examples
118 [[Program ][Description ]]
120 [[[@../../example/mi_to_b_path/bidirectional_map.cpp
121 bidirectional_map.cpp ]]
122 [Boost.MultiIndex to Boost.Bimap path example ]]
124 [[[@../../example/mi_to_b_path/hashed_indices.cpp
125 hashed_indices.cpp ]]
126 [Boost.MultiIndex to Boost.Bimap path example ]]
128 [[[@../../example/mi_to_b_path/tagged_bidirectional_map.cpp
129 tagged_bidirectional_map.cpp ]]
130 [Boost.MultiIndex to Boost.Bimap path example ]]
136 [section Simple Bimap]
138 This is the example from the one minute tutorial section.
140 [@../../example/simple_bimap.cpp Go to source code]
144 You can rewrite it using tags to gain readability.
146 [@../../example/tagged_simple_bimap.cpp Go to source code]
148 [import ../example/tagged_simple_bimap.cpp]
150 [code_tagged_simple_bimap]
155 [section Mighty Bimap]
157 This is the translator example from the tutorial.
158 In this example the collection type of relation is changed to allow the iteration
161 [@../../example/mighty_bimap.cpp Go to source code]
168 [section MultiIndex to Bimap Path - Bidirectional Map]
170 This is example 4 in Boost.MultiIndex documentation.
173 This example shows how to construct a bidirectional map with multi_index_container.
174 By a bidirectional map we mean a container of elements of
175 `std::pair<const FromType,const ToType>` such that no two elements exists with the
176 same first or second value (`std::map` only guarantees uniqueness of the first member).
177 Fast look-up is provided for both keys. The program features a tiny Spanish-English
178 dictionary with on-line query of words in both languages.
181 [heading Boost.MultiIndex]
183 [@../../example/mi_to_b_path/mi_bidirectional_map.cpp Go to source code]
185 [import ../example/mi_to_b_path/mi_bidirectional_map.cpp]
187 [code_mi_to_b_path_mi_bidirectional_map]
189 [heading Boost.Bimap]
191 [@../../example/mi_to_b_path/bidirectional_map.cpp Go to source code]
193 [import ../example/mi_to_b_path/bidirectional_map.cpp]
195 [code_mi_to_b_path_bidirectional_map]
197 Or better, using tags...
199 [@../../example/mi_to_b_path/tagged_bidirectional_map.cpp Go to source code]
201 [import ../example/mi_to_b_path/tagged_bidirectional_map.cpp]
203 [code_mi_to_b_path_tagged_bidirectional_map]
207 [section MultiIndex to Bimap Path - Hashed indices]
209 This is example 8 of Boost.MultiIndex.
212 Hashed indices can be used as an alternative to ordered indices when fast look-up is needed and sorting
213 information is of no interest. The example features a word counter where duplicate entries are checked by
214 means of a hashed index.
217 [heading Boost.MultiIndex]
219 [@../../example/mi_to_b_path/mi_hashed_indices.cpp Go to source code]
221 [import ../example/mi_to_b_path/mi_hashed_indices.cpp]
223 [code_mi_to_b_path_mi_hashed_indices]
225 [heading Boost.Bimap]
227 [@../../example/mi_to_b_path/hashed_indices.cpp Go to source code]
229 [import ../example/mi_to_b_path/hashed_indices.cpp]
231 [code_mi_to_b_path_hashed_indices]