examples.qbk 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. [/license
  2. Boost.Bimap
  3. Copyright (c) 2006-2007 Matias Capeletto
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENSE_1_0.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. ]
  8. [/ QuickBook Document version 1.4 ]
  9. [section Examples]
  10. [section Examples list]
  11. In the folder [@../../example libs/bimap/example] you can find all the examples
  12. used in bimap documentation. Here is a list of them:
  13. [table Tutorial examples
  14. [[Program ][Description ]]
  15. [[[@../../example/simple_bimap.cpp
  16. simple_bimap.cpp ]]
  17. [Soccer world cup example ]]
  18. [[[@../../example/tagged_simple_bimap.cpp
  19. tagged_simple_bimap.cpp ]]
  20. [Soccer world cup example using user defined names ]]
  21. [[[@../../example/step_by_step.cpp
  22. step_by_step.cpp ]]
  23. [Basic example of the three views of bimap ]]
  24. [[[@../../example/population_bimap.cpp
  25. population_bimap.cpp ]]
  26. [Countries populations, using `unordered_set_of` and `multiset_of` ]]
  27. [[[@../../example/repetitions_counter.cpp
  28. repetitions_counter.cpp ]]
  29. [Word repetitions counter, using `unordered_set_of` and `list_of` ]]
  30. [[[@../../example/mighty_bimap.cpp
  31. mighty_bimap.cpp ]]
  32. [Dictionary using `list_of_relation` ]]
  33. [[[@../../example/user_defined_names.cpp
  34. user_defined_names.cpp ]]
  35. [Equivalence between code with tagged and untagged code ]]
  36. [[[@../../example/standard_map_comparison.cpp
  37. standard_map_comparison.cpp ]]
  38. [Comparison between standard maps and bimap map views ]]
  39. [[[@../../example/at_function_examples.cpp
  40. at_function_examples.cpp ]]
  41. [Functions `at(key)` and `operator[](key)` examples ]]
  42. [[[@../../example/tutorial_modify_and_replace.cpp
  43. tutorial_modify_and_replace.cpp ]]
  44. [`modify` and `replace` examples ]]
  45. [[[@../../example/tutorial_range.cpp
  46. tutorial_range.cpp ]]
  47. [`range()` tutorial ]]
  48. [[[@../../example/tutorial_info_hook.cpp
  49. tutorial_info_hook.cpp ]]
  50. [Additional information hooking ]]
  51. [[[@../../example/unconstrained_collection.cpp
  52. unconstrained_collection.cpp ]]
  53. [Using `unconstrained_set_of` collection type ]]
  54. ]
  55. [table Bimap and Boost examples
  56. [[Program ][Description ]]
  57. [[[@../../example/bimap_and_boost/assign.cpp
  58. assign.cpp ]]
  59. [Bimap and Boost.Assign: Methods to insert elements ]]
  60. [[[@../../example/bimap_and_boost/lambda.cpp
  61. lambda.cpp ]]
  62. [Bimap and Boost.Lambda: new lambda placeholders ]]
  63. [[[@../../example/bimap_and_boost/property_map.cpp
  64. property_map.cpp ]]
  65. [Bimap and Boost.PropertyMap: PropertyMap support ]]
  66. [[[@../../example/bimap_and_boost/range.cpp
  67. range.cpp ]]
  68. [Bimap and Boost.Range: Using bimaps in the new range framework ]]
  69. [[[@../../example/bimap_and_boost/foreach.cpp
  70. foreach.cpp ]]
  71. [Bimap and Boost.Foreach: Iterating over bimaps ]]
  72. [[[@../../example/bimap_and_boost/typeof.cpp
  73. typeof.cpp ]]
  74. [Bimap and Boost.Typeof: using BOOST_AUTO while we wait for C++0x ]]
  75. [[[@../../example/bimap_and_boost/xpressive.cpp
  76. xpressive.cpp ]]
  77. [Bimap and Boost.Xpressive: Inserting elements in a bimap ]]
  78. [[[@../../example/bimap_and_boost/serialization.cpp
  79. serialization.cpp: ]]
  80. [Bimap and Boost.Serialization: Load and save bimaps and iterators ]]
  81. ]
  82. [table Boost.MultiIndex to Boost.Bimap path examples
  83. [[Program ][Description ]]
  84. [[[@../../example/mi_to_b_path/bidirectional_map.cpp
  85. bidirectional_map.cpp ]]
  86. [Boost.MultiIndex to Boost.Bimap path example ]]
  87. [[[@../../example/mi_to_b_path/hashed_indices.cpp
  88. hashed_indices.cpp ]]
  89. [Boost.MultiIndex to Boost.Bimap path example ]]
  90. [[[@../../example/mi_to_b_path/tagged_bidirectional_map.cpp
  91. tagged_bidirectional_map.cpp ]]
  92. [Boost.MultiIndex to Boost.Bimap path example ]]
  93. ]
  94. [endsect]
  95. [section Simple Bimap]
  96. This is the example from the one minute tutorial section.
  97. [@../../example/simple_bimap.cpp Go to source code]
  98. [code_simple_bimap]
  99. You can rewrite it using tags to gain readability.
  100. [@../../example/tagged_simple_bimap.cpp Go to source code]
  101. [import ../example/tagged_simple_bimap.cpp]
  102. [code_tagged_simple_bimap]
  103. [endsect]
  104. [section Mighty Bimap]
  105. This is the translator example from the tutorial.
  106. In this example the collection type of relation is changed to allow the iteration
  107. of the container.
  108. [@../../example/mighty_bimap.cpp Go to source code]
  109. [code_mighty_bimap]
  110. [endsect]
  111. [section MultiIndex to Bimap Path - Bidirectional Map]
  112. This is example 4 in Boost.MultiIndex documentation.
  113. [blurb
  114. This example shows how to construct a bidirectional map with multi_index_container.
  115. By a bidirectional map we mean a container of elements of
  116. `std::pair<const FromType,const ToType>` such that no two elements exists with the
  117. same first or second value (`std::map` only guarantees uniqueness of the first member).
  118. Fast look-up is provided for both keys. The program features a tiny Spanish-English
  119. dictionary with on-line query of words in both languages.
  120. ]
  121. [heading Boost.MultiIndex]
  122. [@../../example/mi_to_b_path/mi_bidirectional_map.cpp Go to source code]
  123. [import ../example/mi_to_b_path/mi_bidirectional_map.cpp]
  124. [code_mi_to_b_path_mi_bidirectional_map]
  125. [heading Boost.Bimap]
  126. [@../../example/mi_to_b_path/bidirectional_map.cpp Go to source code]
  127. [import ../example/mi_to_b_path/bidirectional_map.cpp]
  128. [code_mi_to_b_path_bidirectional_map]
  129. Or better, using tags...
  130. [@../../example/mi_to_b_path/tagged_bidirectional_map.cpp Go to source code]
  131. [import ../example/mi_to_b_path/tagged_bidirectional_map.cpp]
  132. [code_mi_to_b_path_tagged_bidirectional_map]
  133. [endsect]
  134. [section MultiIndex to Bimap Path - Hashed indices]
  135. This is example 8 of Boost.MultiIndex.
  136. [blurb
  137. Hashed indices can be used as an alternative to ordered indices when fast look-up is needed and sorting
  138. information is of no interest. The example features a word counter where duplicate entries are checked by
  139. means of a hashed index.
  140. ]
  141. [heading Boost.MultiIndex]
  142. [@../../example/mi_to_b_path/mi_hashed_indices.cpp Go to source code]
  143. [import ../example/mi_to_b_path/mi_hashed_indices.cpp]
  144. [code_mi_to_b_path_mi_hashed_indices]
  145. [heading Boost.Bimap]
  146. [@../../example/mi_to_b_path/hashed_indices.cpp Go to source code]
  147. [import ../example/mi_to_b_path/hashed_indices.cpp]
  148. [code_mi_to_b_path_hashed_indices]
  149. [endsect]
  150. [endsect]