From cda74605fc40f8d23f775f5fd39bd243a4c2dbfc Mon Sep 17 00:00:00 2001
From: Christopher Schmidt
Date: Fri, 1 Jan 2010 22:00:21 +0000
Subject: [PATCH] fusion: merge of associative iterators/views and the new fold
interface
[SVN r58618]
---
changelist.txt | 7 +-
doc/algorithm.qbk | 211 +++++++++++-----
doc/changelog.qbk | 6 +-
doc/extension.qbk | 36 +--
doc/fusion.qbk | 6 +-
doc/html/fusion/acknowledgements.html | 4 +
doc/html/fusion/adapted.html | 11 +
doc/html/fusion/adapted/adapt_assoc.html | 43 ++++
doc/html/fusion/adapted/adapt_struct.html | 43 ++++
doc/html/fusion/adapted/boost__array.html | 33 +++
doc/html/fusion/adapted/boost__tuple.html | 30 +++
doc/html/fusion/adapted/mpl_sequence.html | 35 +++
doc/html/fusion/adapted/std__pair.html | 33 +++
doc/html/fusion/algorithm.html | 25 ++
doc/html/fusion/algorithm/iteration.html | 11 +
.../fusion/algorithm/iteration/functions.html | 4 +
.../iteration/functions/accumulate.html | 225 ++++++++++++++++-
.../algorithm/iteration/functions/fold.html | 222 ++++++++++++++++-
.../iteration/functions/for_each.html | 168 ++++++++++++-
.../algorithm/iteration/metafunctions.html | 4 +
.../iteration/metafunctions/accumulate.html | 162 +++++++++++-
.../iteration/metafunctions/fold.html | 162 +++++++++++-
.../iteration/metafunctions/for_each.html | 143 ++++++++++-
doc/html/fusion/algorithm/query.html | 11 +
.../fusion/algorithm/query/functions.html | 4 +
.../fusion/algorithm/query/functions/all.html | 168 ++++++++++++-
.../fusion/algorithm/query/functions/any.html | 168 ++++++++++++-
.../algorithm/query/functions/count.html | 168 ++++++++++++-
.../algorithm/query/functions/count_if.html | 168 ++++++++++++-
.../algorithm/query/functions/find.html | 168 ++++++++++++-
.../algorithm/query/functions/find_if.html | 154 +++++++++++-
.../algorithm/query/functions/none.html | 168 ++++++++++++-
.../fusion/algorithm/query/metafunctions.html | 4 +
.../algorithm/query/metafunctions/all.html | 143 ++++++++++-
.../algorithm/query/metafunctions/any.html | 143 ++++++++++-
.../algorithm/query/metafunctions/count.html | 143 ++++++++++-
.../query/metafunctions/count_if.html | 143 ++++++++++-
.../algorithm/query/metafunctions/find.html | 148 ++++++++++-
.../query/metafunctions/find_if.html | 148 ++++++++++-
.../algorithm/query/metafunctions/none.html | 143 ++++++++++-
doc/html/fusion/algorithm/transformation.html | 11 +
.../algorithm/transformation/functions.html | 4 +
.../transformation/functions/clear.html | 168 ++++++++++++-
.../transformation/functions/erase.html | 200 ++++++++++++++-
.../transformation/functions/erase_key.html | 192 +++++++++++++-
.../transformation/functions/filter.html | 184 +++++++++++++-
.../transformation/functions/filter_if.html | 184 +++++++++++++-
.../transformation/functions/insert.html | 187 +++++++++++++-
.../functions/insert_range.html | 184 +++++++++++++-
.../transformation/functions/join.html | 187 +++++++++++++-
.../transformation/functions/pop_back.html | 184 +++++++++++++-
.../transformation/functions/pop_front.html | 184 +++++++++++++-
.../transformation/functions/push_back.html | 184 +++++++++++++-
.../transformation/functions/push_front.html | 184 +++++++++++++-
.../transformation/functions/remove.html | 184 +++++++++++++-
.../transformation/functions/remove_if.html | 184 +++++++++++++-
.../transformation/functions/replace.html | 168 ++++++++++++-
.../transformation/functions/replace_if.html | 168 ++++++++++++-
.../transformation/functions/reverse.html | 189 +++++++++++++-
.../transformation/functions/transform.html | 218 +++++++++++++++-
.../transformation/functions/zip.html | 168 ++++++++++++-
.../transformation/metafunctions.html | 4 +
.../transformation/metafunctions/clear.html | 143 ++++++++++-
.../transformation/metafunctions/erase.html | 159 +++++++++++-
.../metafunctions/erase_key.html | 160 +++++++++++-
.../transformation/metafunctions/filter.html | 159 +++++++++++-
.../metafunctions/filter_if.html | 159 +++++++++++-
.../transformation/metafunctions/insert.html | 159 +++++++++++-
.../metafunctions/insert_range.html | 159 +++++++++++-
.../transformation/metafunctions/join.html | 154 +++++++++++-
.../metafunctions/pop_back.html | 161 +++++++++++-
.../metafunctions/pop_front.html | 144 ++++++++++-
.../metafunctions/push_back.html | 144 ++++++++++-
.../metafunctions/push_front.html | 144 ++++++++++-
.../transformation/metafunctions/remove.html | 159 +++++++++++-
.../metafunctions/remove_if.html | 159 +++++++++++-
.../transformation/metafunctions/replace.html | 143 ++++++++++-
.../metafunctions/replace_if.html | 143 ++++++++++-
.../transformation/metafunctions/reverse.html | 164 +++++++++++-
.../metafunctions/transform.html | 234 +++++++++++++++++-
.../transformation/metafunctions/zip.html | 137 +++++++++-
doc/html/fusion/change_log.html | 4 +
doc/html/fusion/container.html | 11 +
doc/html/fusion/container/cons.html | 61 +++++
doc/html/fusion/container/conversion.html | 11 +
.../container/conversion/functions.html | 4 +
.../conversion/functions/as_list.html | 162 +++++++++++-
.../conversion/functions/as_map.html | 162 +++++++++++-
.../conversion/functions/as_set.html | 162 +++++++++++-
.../conversion/functions/as_vector.html | 162 +++++++++++-
.../container/conversion/metafunctions.html | 4 +
.../conversion/metafunctions/as_list.html | 162 +++++++++++-
.../conversion/metafunctions/as_map.html | 162 +++++++++++-
.../conversion/metafunctions/as_set.html | 162 +++++++++++-
.../conversion/metafunctions/as_vector.html | 162 +++++++++++-
doc/html/fusion/container/generation.html | 11 +
.../container/generation/functions.html | 4 +
.../generation/functions/list_tie.html | 162 +++++++++++-
.../generation/functions/make_cons.html | 187 +++++++++++++-
.../generation/functions/make_list.html | 187 +++++++++++++-
.../generation/functions/make_map.html | 187 +++++++++++++-
.../generation/functions/make_set.html | 187 +++++++++++++-
.../generation/functions/make_vector.html | 187 +++++++++++++-
.../generation/functions/map_tie.html | 162 +++++++++++-
.../container/generation/functions/tiers.html | 69 +++++-
.../generation/functions/vector_tie.html | 162 +++++++++++-
.../container/generation/metafunctions.html | 4 +
.../generation/metafunctions/list_tie.html | 162 +++++++++++-
.../generation/metafunctions/make_cons.html | 162 +++++++++++-
.../generation/metafunctions/make_list.html | 162 +++++++++++-
.../generation/metafunctions/make_map.html | 187 +++++++++++++-
.../generation/metafunctions/make_set.html | 162 +++++++++++-
.../generation/metafunctions/make_vector.html | 162 +++++++++++-
.../generation/metafunctions/map_tie.html | 162 +++++++++++-
.../generation/metafunctions/vector_tie.html | 162 +++++++++++-
doc/html/fusion/container/list.html | 61 +++++
doc/html/fusion/container/map.html | 59 +++++
doc/html/fusion/container/set.html | 59 +++++
doc/html/fusion/container/vector.html | 58 +++++
doc/html/fusion/extension.html | 4 +
doc/html/fusion/extension/ext_full.html | 98 +++++++-
.../fusion/extension/iterator_facade.html | 152 +++++++++++-
.../fusion/extension/sequence_facade.html | 82 +++++-
doc/html/fusion/functional.html | 29 +++
doc/html/fusion/functional/adapters.html | 4 +
.../fusion/functional/adapters/fused.html | 72 ++++++
.../adapters/fused_function_object.html | 60 +++++
.../functional/adapters/fused_procedure.html | 60 +++++
.../fusion/functional/adapters/limits.html | 22 ++
.../fusion/functional/adapters/unfused.html | 67 +++++
.../functional/adapters/unfused_typed.html | 67 +++++
doc/html/fusion/functional/concepts.html | 4 +
.../fusion/functional/concepts/callable.html | 31 +++
.../functional/concepts/def_callable.html | 41 +++
doc/html/fusion/functional/concepts/poly.html | 40 +++
.../functional/concepts/reg_callable.html | 40 +++
doc/html/fusion/functional/generation.html | 4 +
.../functional/generation/functions.html | 4 +
.../generation/functions/mk_fused.html | 187 +++++++++++++-
.../generation/functions/mk_fused_fobj.html | 187 +++++++++++++-
.../generation/functions/mk_fused_proc.html | 187 +++++++++++++-
.../generation/functions/mk_unfused.html | 187 +++++++++++++-
.../functional/generation/metafunctions.html | 4 +
.../generation/metafunctions/mk_fused.html | 112 ++++++++-
.../metafunctions/mk_fused_fobj.html | 112 ++++++++-
.../metafunctions/mk_fused_proc.html | 112 ++++++++-
.../generation/metafunctions/mk_unfused.html | 112 ++++++++-
doc/html/fusion/functional/invocation.html | 4 +
.../functional/invocation/functions.html | 4 +
.../invocation/functions/invoke.html | 187 +++++++++++++-
.../invocation/functions/invoke_fobj.html | 187 +++++++++++++-
.../invocation/functions/invoke_proc.html | 187 +++++++++++++-
.../fusion/functional/invocation/limits.html | 22 ++
.../functional/invocation/metafunctions.html | 4 +
.../invocation/metafunctions/invoke.html | 87 ++++++-
.../invocation/metafunctions/invoke_fobj.html | 87 ++++++-
.../invocation/metafunctions/invoke_proc.html | 87 ++++++-
doc/html/fusion/introduction.html | 61 ++++-
doc/html/fusion/iterator.html | 17 ++
doc/html/fusion/iterator/concepts.html | 12 +-
.../concepts/associative_iterator.html | 228 +++++++++++++++++
.../concepts/bidirectional_iterator.html | 53 ++++
.../iterator/concepts/forward_iterator.html | 47 ++++
.../concepts/random_access_iterator.html | 46 +++-
doc/html/fusion/iterator/functions.html | 13 +-
.../fusion/iterator/functions/advance.html | 76 +++++-
.../fusion/iterator/functions/advance_c.html | 82 +++++-
doc/html/fusion/iterator/functions/deref.html | 76 +++++-
.../fusion/iterator/functions/deref_data.html | 138 +++++++++++
.../fusion/iterator/functions/distance.html | 76 +++++-
doc/html/fusion/iterator/functions/next.html | 76 +++++-
doc/html/fusion/iterator/functions/prior.html | 76 +++++-
doc/html/fusion/iterator/metafunctions.html | 7 +
.../iterator/metafunctions/advance.html | 79 +++++-
.../iterator/metafunctions/advance_c.html | 85 ++++++-
.../fusion/iterator/metafunctions/deref.html | 76 +++++-
.../iterator/metafunctions/deref_data.html | 139 +++++++++++
.../iterator/metafunctions/distance.html | 80 +++++-
.../iterator/metafunctions/equal_to.html | 80 +++++-
.../fusion/iterator/metafunctions/key_of.html | 139 +++++++++++
.../fusion/iterator/metafunctions/next.html | 77 +++++-
.../fusion/iterator/metafunctions/prior.html | 77 +++++-
.../iterator/metafunctions/value_of.html | 79 +++++-
.../iterator/metafunctions/value_of_data.html | 140 +++++++++++
doc/html/fusion/iterator/operator.html | 13 +-
.../iterator/operator/operator_equality.html | 65 ++++-
.../operator/operator_inequality.html | 65 ++++-
.../operator/operator_unary_star.html | 73 +++++-
doc/html/fusion/notes.html | 106 +++++++-
doc/html/fusion/organization.html | 65 ++++-
doc/html/fusion/preface.html | 67 ++++-
doc/html/fusion/quick_start.html | 100 +++++++-
doc/html/fusion/references.html | 4 +
doc/html/fusion/sequence.html | 19 +-
doc/html/fusion/sequence/concepts.html | 18 ++
.../concepts/associative_sequence.html | 50 +++-
.../concepts/bidirectional_sequence.html | 50 ++++
.../sequence/concepts/forward_sequence.html | 59 +++++
.../concepts/random_access_sequence.html | 53 ++++
doc/html/fusion/sequence/intrinsic.html | 50 +++-
.../fusion/sequence/intrinsic/functions.html | 4 +
.../sequence/intrinsic/functions/at.html | 162 +++++++++++-
.../sequence/intrinsic/functions/at_c.html | 162 +++++++++++-
.../sequence/intrinsic/functions/at_key.html | 162 +++++++++++-
.../sequence/intrinsic/functions/back.html | 162 +++++++++++-
.../sequence/intrinsic/functions/begin.html | 186 +++++++++++++-
.../sequence/intrinsic/functions/empty.html | 162 +++++++++++-
.../sequence/intrinsic/functions/end.html | 186 +++++++++++++-
.../sequence/intrinsic/functions/front.html | 162 +++++++++++-
.../sequence/intrinsic/functions/has_key.html | 162 +++++++++++-
.../sequence/intrinsic/functions/size.html | 162 +++++++++++-
.../sequence/intrinsic/functions/swap.html | 137 +++++++++-
.../sequence/intrinsic/metafunctions.html | 4 +
.../sequence/intrinsic/metafunctions/at.html | 161 +++++++++++-
.../intrinsic/metafunctions/at_c.html | 161 +++++++++++-
.../intrinsic/metafunctions/at_key.html | 161 +++++++++++-
.../intrinsic/metafunctions/back.html | 128 +++++++++-
.../intrinsic/metafunctions/begin.html | 152 +++++++++++-
.../intrinsic/metafunctions/empty.html | 128 +++++++++-
.../sequence/intrinsic/metafunctions/end.html | 152 +++++++++++-
.../intrinsic/metafunctions/front.html | 128 +++++++++-
.../intrinsic/metafunctions/has_key.html | 128 +++++++++-
.../intrinsic/metafunctions/size.html | 128 +++++++++-
.../intrinsic/metafunctions/swap.html | 103 +++++++-
.../intrinsic/metafunctions/value_at.html | 128 +++++++++-
.../intrinsic/metafunctions/value_at_c.html | 128 +++++++++-
.../intrinsic/metafunctions/value_at_key.html | 128 +++++++++-
doc/html/fusion/sequence/operator.html | 4 +
.../fusion/sequence/operator/comparison.html | 11 +
.../sequence/operator/comparison/equal.html | 162 +++++++++++-
.../operator/comparison/greater_than.html | 137 +++++++++-
.../comparison/greater_than_equal.html | 137 +++++++++-
.../operator/comparison/less_than.html | 137 +++++++++-
.../operator/comparison/less_than_equal.html | 137 +++++++++-
.../operator/comparison/not_equal.html | 137 +++++++++-
doc/html/fusion/sequence/operator/i_o.html | 11 +
doc/html/fusion/sequence/operator/i_o/in.html | 162 +++++++++++-
.../fusion/sequence/operator/i_o/out.html | 162 +++++++++++-
doc/html/fusion/support.html | 4 +
doc/html/fusion/support/category_of.html | 73 ++++--
doc/html/fusion/support/deduce.html | 44 ++++
doc/html/fusion/support/deduce_sequence.html | 44 ++++
doc/html/fusion/support/is_sequence.html | 49 ++++
doc/html/fusion/support/is_view.html | 50 ++++
doc/html/fusion/support/pair.html | 53 +++-
doc/html/fusion/support/tag_of.html | 54 ++++
doc/html/fusion/tuple.html | 4 +
.../fusion/tuple/class_template_tuple.html | 11 +
.../class_template_tuple/construction.html | 23 ++
.../class_template_tuple/element_access.html | 19 ++
.../relational_operators.html | 20 ++
.../tuple_creation_functions.html | 19 ++
.../tuple_helper_classes.html | 19 ++
doc/html/fusion/tuple/pairs.html | 22 ++
doc/html/fusion/view.html | 11 +
doc/html/fusion/view/filter_view.html | 71 ++++++
doc/html/fusion/view/iterator_range.html | 75 +++++-
doc/html/fusion/view/joint_view.html | 74 ++++++
doc/html/fusion/view/nview.html | 61 +++++
doc/html/fusion/view/reverse_view.html | 70 ++++++
doc/html/fusion/view/single_view.html | 48 ++++
doc/html/fusion/view/transform_view.html | 49 ++++
doc/html/fusion/view/zip_view.html | 63 +++++
doc/html/index.html | 56 ++++-
doc/iterator.qbk | 198 ++++++++++++++-
doc/sequence.qbk | 110 ++++++--
doc/support.qbk | 25 +-
doc/view.qbk | 15 +-
example/extension/detail/category_of_impl.hpp | 2 +-
example/extension/detail/deref_data_impl.hpp | 30 +++
example/extension/detail/key_of_impl.hpp | 42 ++++
.../extension/detail/value_of_data_impl.hpp | 30 +++
example/extension/example_struct_iterator.hpp | 12 +-
example/extension/test_example.cpp | 3 +
example/performance/accumulate.cpp | 4 +-
example/performance/inner_product2.cpp | 4 +-
include/boost/fusion/adapted/array/tag_of.hpp | 19 ++
.../fusion/adapted/boost_tuple/tag_of.hpp | 51 ++++
.../adapted/class/adapt_assoc_class.hpp | 94 -------
.../fusion/adapted/class/adapt_class.hpp | 104 --------
.../fusion/adapted/class/class_iterator.hpp | 105 --------
.../fusion/adapted/class/detail/at_impl.hpp | 70 ------
.../adapted/class/detail/at_key_impl.hpp | 54 ----
.../adapted/class/detail/begin_impl.hpp | 40 ---
.../adapted/class/detail/category_of_impl.hpp | 35 ---
include/boost/fusion/adapted/std_pair.hpp | 91 ++++---
.../boost/fusion/adapted/std_pair/tag_of.hpp | 19 ++
.../adapted/struct/adapt_assoc_struct.hpp | 19 ++
.../fusion/adapted/struct/adapt_struct.hpp | 19 ++
.../boost/fusion/adapted/struct/extension.hpp | 87 ++++---
.../algorithm/iteration/detail/fold.hpp | 98 ++++----
.../algorithm/query/detail/assoc_find.hpp | 35 ---
.../fusion/algorithm/query/detail/find_if.hpp | 26 +-
include/boost/fusion/algorithm/query/find.hpp | 35 ++-
.../boost/fusion/algorithm/query/find_if.hpp | 35 ++-
.../algorithm/transformation/erase_key.hpp | 11 +-
.../boost/fusion/container/deque/deque.hpp | 1 +
.../container/map/detail/at_key_impl.hpp | 49 ----
.../container/map/detail/begin_impl.hpp | 69 +++---
.../container/map/detail/deref_data_impl.hpp | 48 ++++
.../container/map/detail/deref_impl.hpp | 45 ++++
.../fusion/container/map/detail/end_impl.hpp | 66 +++--
.../container/map/detail/key_of_impl.hpp | 32 +++
.../container/map/detail/lookup_key.hpp | 99 --------
.../container/map/detail/map_lookup.hpp | 128 ----------
.../map/detail/value_at_key_impl.hpp | 33 ---
.../map/detail/value_of_data_impl.hpp | 32 +++
.../container/map/detail/value_of_impl.hpp | 39 +++
include/boost/fusion/container/map/map.hpp | 12 +-
.../boost/fusion/container/map/map_fwd.hpp | 2 +
.../container/set/detail/at_key_impl.hpp | 49 ----
.../container/set/detail/begin_impl.hpp | 69 +++---
.../container/set/detail/deref_data_impl.hpp | 24 ++
.../container/set/detail/deref_impl.hpp | 45 ++++
.../fusion/container/set/detail/end_impl.hpp | 66 +++--
.../container/set/detail/key_of_impl.hpp | 24 ++
.../container/set/detail/lookup_key.hpp | 93 -------
.../container/set/detail/set_lookup.hpp | 128 ----------
.../set/detail/value_at_key_impl.hpp | 35 ---
.../set/detail/value_of_data_impl.hpp | 24 ++
.../container/set/detail/value_of_impl.hpp | 34 +++
include/boost/fusion/container/set/set.hpp | 12 +-
.../boost/fusion/container/set/set_fwd.hpp | 2 +
include/boost/fusion/include/deref_data.hpp | 13 +
include/boost/fusion/include/key_of.hpp | 13 +
.../boost/fusion/include/value_of_data.hpp | 13 +
.../boost/fusion/iterator/basic_iterator.hpp | 136 ++++++++++
include/boost/fusion/iterator/deref_data.hpp | 49 ++++
.../boost/fusion/iterator/iterator_facade.hpp | 3 +-
include/boost/fusion/iterator/key_of.hpp | 42 ++++
.../boost/fusion/iterator/value_of_data.hpp | 42 ++++
.../fusion/sequence/intrinsic/at_key.hpp | 21 +-
.../fusion/sequence/intrinsic/ext_/size_s.hpp | 4 +-
.../fusion/sequence/intrinsic/has_key.hpp | 16 +-
.../sequence/intrinsic/value_at_key.hpp | 10 +-
include/boost/fusion/support/category_of.hpp | 4 +-
.../view/detail/strictest_traversal.hpp | 4 +-
.../fusion/view/ext_/segmented_iterator.hpp | 56 +++--
.../view/filter_view/detail/begin_impl.hpp | 5 +-
.../filter_view/detail/deref_data_impl.hpp | 37 +++
.../view/filter_view/detail/end_impl.hpp | 5 +-
.../view/filter_view/detail/key_of_impl.hpp | 28 +++
.../view/filter_view/detail/next_impl.hpp | 21 +-
.../filter_view/detail/value_of_data_impl.hpp | 28 +++
.../fusion/view/filter_view/filter_view.hpp | 12 +-
.../view/filter_view/filter_view_iterator.hpp | 28 ++-
.../view/iterator_range/iterator_range.hpp | 1 -
.../view/joint_view/detail/begin_impl.hpp | 5 +-
.../joint_view/detail/deref_data_impl.hpp | 37 +++
.../view/joint_view/detail/key_of_impl.hpp | 28 +++
.../view/joint_view/detail/next_impl.hpp | 5 +-
.../joint_view/detail/value_of_data_impl.hpp | 28 +++
.../fusion/view/joint_view/joint_view.hpp | 14 +-
.../view/joint_view/joint_view_iterator.hpp | 9 +-
.../view/reverse_view/detail/at_impl.hpp | 41 +++
.../reverse_view/detail/deref_data_impl.hpp | 37 +++
.../view/reverse_view/detail/key_of_impl.hpp | 28 +++
.../reverse_view/detail/value_at_impl.hpp | 33 +++
.../detail/value_of_data_impl.hpp | 28 +++
.../fusion/view/reverse_view/reverse_view.hpp | 6 +
.../reverse_view/reverse_view_iterator.hpp | 3 +
test/algorithm/erase_key.cpp | 4 +-
test/algorithm/fold.cpp | 36 +--
test/compile_time/fold.cpp | 2 +-
test/functional/make_unfused.cpp | 2 +-
test/functional/unfused.cpp | 2 +-
test/functional/unfused_typed.cpp | 4 +-
test/sequence/adapt_assoc_struct.cpp | 11 +
test/sequence/adapt_struct.cpp | 12 +
test/sequence/array.cpp | 7 +
test/sequence/as_set.cpp | 2 +-
test/sequence/boost_tuple.cpp | 9 +
test/sequence/filter_view.cpp | 39 +--
test/sequence/iterator_range.cpp | 33 +++
test/sequence/joint_view.cpp | 45 +++-
test/sequence/map.cpp | 16 ++
test/sequence/reverse_view.cpp | 23 ++
test/sequence/set.cpp | 18 +-
test/sequence/std_pair.cpp | 9 +
379 files changed, 28481 insertions(+), 2185 deletions(-)
create mode 100644 doc/html/fusion/iterator/concepts/associative_iterator.html
create mode 100644 doc/html/fusion/iterator/functions/deref_data.html
create mode 100644 doc/html/fusion/iterator/metafunctions/deref_data.html
create mode 100644 doc/html/fusion/iterator/metafunctions/key_of.html
create mode 100644 doc/html/fusion/iterator/metafunctions/value_of_data.html
create mode 100644 example/extension/detail/deref_data_impl.hpp
create mode 100644 example/extension/detail/key_of_impl.hpp
create mode 100644 example/extension/detail/value_of_data_impl.hpp
delete mode 100644 include/boost/fusion/adapted/class/adapt_assoc_class.hpp
delete mode 100644 include/boost/fusion/adapted/class/adapt_class.hpp
delete mode 100644 include/boost/fusion/adapted/class/class_iterator.hpp
delete mode 100644 include/boost/fusion/adapted/class/detail/at_impl.hpp
delete mode 100644 include/boost/fusion/adapted/class/detail/at_key_impl.hpp
delete mode 100644 include/boost/fusion/adapted/class/detail/begin_impl.hpp
delete mode 100644 include/boost/fusion/adapted/class/detail/category_of_impl.hpp
delete mode 100644 include/boost/fusion/algorithm/query/detail/assoc_find.hpp
delete mode 100644 include/boost/fusion/container/map/detail/at_key_impl.hpp
create mode 100644 include/boost/fusion/container/map/detail/deref_data_impl.hpp
create mode 100644 include/boost/fusion/container/map/detail/deref_impl.hpp
create mode 100644 include/boost/fusion/container/map/detail/key_of_impl.hpp
delete mode 100644 include/boost/fusion/container/map/detail/lookup_key.hpp
delete mode 100644 include/boost/fusion/container/map/detail/map_lookup.hpp
delete mode 100644 include/boost/fusion/container/map/detail/value_at_key_impl.hpp
create mode 100644 include/boost/fusion/container/map/detail/value_of_data_impl.hpp
create mode 100644 include/boost/fusion/container/map/detail/value_of_impl.hpp
delete mode 100644 include/boost/fusion/container/set/detail/at_key_impl.hpp
create mode 100644 include/boost/fusion/container/set/detail/deref_data_impl.hpp
create mode 100644 include/boost/fusion/container/set/detail/deref_impl.hpp
create mode 100644 include/boost/fusion/container/set/detail/key_of_impl.hpp
delete mode 100644 include/boost/fusion/container/set/detail/lookup_key.hpp
delete mode 100644 include/boost/fusion/container/set/detail/set_lookup.hpp
delete mode 100644 include/boost/fusion/container/set/detail/value_at_key_impl.hpp
create mode 100644 include/boost/fusion/container/set/detail/value_of_data_impl.hpp
create mode 100644 include/boost/fusion/container/set/detail/value_of_impl.hpp
create mode 100644 include/boost/fusion/include/deref_data.hpp
create mode 100644 include/boost/fusion/include/key_of.hpp
create mode 100644 include/boost/fusion/include/value_of_data.hpp
create mode 100644 include/boost/fusion/iterator/basic_iterator.hpp
create mode 100644 include/boost/fusion/iterator/deref_data.hpp
create mode 100644 include/boost/fusion/iterator/key_of.hpp
create mode 100644 include/boost/fusion/iterator/value_of_data.hpp
mode change 100755 => 100644 include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp
create mode 100644 include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp
create mode 100644 include/boost/fusion/view/filter_view/detail/key_of_impl.hpp
create mode 100644 include/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp
create mode 100644 include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp
create mode 100644 include/boost/fusion/view/joint_view/detail/key_of_impl.hpp
create mode 100644 include/boost/fusion/view/joint_view/detail/value_of_data_impl.hpp
create mode 100644 include/boost/fusion/view/reverse_view/detail/at_impl.hpp
create mode 100644 include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp
create mode 100644 include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp
create mode 100644 include/boost/fusion/view/reverse_view/detail/value_at_impl.hpp
create mode 100644 include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp
diff --git a/changelist.txt b/changelist.txt
index eb272413..3e7712b2 100644
--- a/changelist.txt
+++ b/changelist.txt
@@ -3,5 +3,8 @@ Interface Changes
- June 12, 2009: vector0 is now vector0<> as per Boost Trac Ticket #1608
to follow MPL more closely.
- September 24, 2009: added nview and friends
-
-
+- October 12, 2009: the accumulator is the first argument to the functor of
+ fold and accumulate. Fixes Boost Trac Ticket #2355.
+- October 30, 2009: Added support for associative iterators & views.
+ Renamed associative_sequence_tag to associative_tag. Fixes Boost Trac
+ Ticket #3473.
diff --git a/doc/algorithm.qbk b/doc/algorithm.qbk
index cfaf92b7..3fa194b2 100644
--- a/doc/algorithm.qbk
+++ b/doc/algorithm.qbk
@@ -62,7 +62,7 @@ a sequence repeatedly applying an operation to its elements.
[section fold]
[heading Description]
-For a sequence `Seq`, initial state, and binary function object or function pointer `f`, fold repeatedly applies binary `f` to each element of `Seq` and the previous state.
+For a sequence `seq`, initial state `initial_state`, and binary function object or function pointer `f`, fold returns the result of the repeated application of binary `f` to the result of the previous `f` invocation (`inital_state` if it is the first call) and each element of `seq`.
[heading Synopsis]
template<
@@ -75,9 +75,9 @@ For a sequence `Seq`, initial state, and binary function object or function poin
[table Parameters
[[Parameter][Requirement][Description]]
- [[`seq`][A model of __forward_sequence__,`f(e,s)` must be a valid expression for each element `e` in `seq`, and current state `s`][Operation's argument]]
+ [[`seq`][A model of __forward_sequence__, `f(s,e)` must be a valid expression for current state `s`, and each element `e` in `seq`][Operation's argument]]
[[`initial_state`][Any type][Initial state]]
- [[`f`][`__boost_result_of_call__::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`][Operation's argument]]
+ [[`f`][`__boost_result_of_call__::type` is the return type of `f(s,e)` current state `s` of type `S`, and for each element `e` of type `E` in `seq`][Operation's argument]]
]
[heading Expression Semantics]
@@ -85,7 +85,7 @@ For a sequence `Seq`, initial state, and binary function object or function poin
[*Return type]: Any type
-[*Semantics]: Equivalent to `f(eN ....f(e2,f(e1,initial_state)))` where `e1 ...eN` are the elements of `seq`.
+[*Semantics]: Equivalent to `f(... f(f(initial_state,e1),e2) ...eN)` where `e1 ...eN` are the elements of `seq`.
[heading Complexity]
Linear, exactly `__result_of_size__::value` applications of `f`.
@@ -101,7 +101,7 @@ Linear, exactly `__result_of_size__::value` applications of `f`.
typedef std::string result_type;
template
- std::string operator()(const T& t, const std::string& str) const
+ std::string operator()(const std::string& str, const T& t) const
{
return str + boost::lexical_cast(t);
}
@@ -115,7 +115,7 @@ Linear, exactly `__result_of_size__::value` applications of `f`.
[section accumulate]
[heading Description]
-For a sequence `Seq`, initial state, and binary function object or function pointer `f`, accumulate repeatedly applies binary `f` to each element of `Seq` and the previous state.
+For a sequence `seq`, initial state `initial_state`, and binary function object or function pointer `f`, accumulate returns the result of the repeated application of binary `f` to the result of the previous `f` invocation (`inital_state` if it is the first call) and each element of `seq`.
[heading Synopsis]
template<
@@ -128,9 +128,9 @@ For a sequence `Seq`, initial state, and binary function object or function poin
[table Parameters
[[Parameter][Requirement][Description]]
- [[`seq`][A model of __forward_sequence__, `f(eN ....f(e2,f(e1,initial_state)))` must be a valid expression for each element `e1` to `eN` in `seq`][Operation's argument]]
+ [[`seq`][A model of __forward_sequence__, `f(s,e)` must be a valid expression for current state `s`, and each element `e` in `seq`][Operation's argument]]
[[`initial_state`][Any type][Initial state]]
- [[`f`][`__boost_result_of_call__::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`][Operation's argument]]
+ [[`f`][`__boost_result_of_call__::type` is the return type of `f(s,e)` current state `s` of type `S`, and for each element `e` of type `E` in `seq`][Operation's argument]]
]
[heading Expression Semantics]
@@ -138,7 +138,7 @@ For a sequence `Seq`, initial state, and binary function object or function poin
[*Return type]: Any type
-[*Semantics]: Equivalent to `f(eN ....f(e2,f(e1,initial_state)))` where `e1 ...eN` are the elements of `seq`.
+[*Semantics]: Equivalent to `f(... f(f(initial_state,e1),e2) ...eN)` where `e1 ...eN` are the elements of `seq`.
[heading Complexity]
Linear, exactly `__result_of_size__::value` applications of `f`.
@@ -154,7 +154,7 @@ Linear, exactly `__result_of_size__::value` applications of `f`.
typedef std::string result_type;
template
- std::string operator()(const T& t, const std::string& str) const
+ std::string operator()(const std::string& str, const T& t) const
{
return str + boost::lexical_cast(t);
}
@@ -238,7 +238,7 @@ Returns the result type of __fold__.
[[Parameter] [Requirement] [Description]]
[[`Sequence`] [A model of __forward_sequence__] [The sequence to iterate]]
[[`State`] [Any type] [The initial state for the first application of `F`]]
- [[`F`] [`__boost_result_of_call__::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`] [The operation to be applied on forward traversal]]
+ [[`F`] [`__boost_result_of_call__::type` is the return type of `f(s,e)` for current state `s` of type `S`, and for each element `e` of type `E` in `seq`] [The operation to be applied on forward traversal]]
]
[heading Expression Semantics]
@@ -278,7 +278,7 @@ Returns the result type of __accumulate__.
[[Parameter] [Requirement] [Description]]
[[`Sequence`] [A model of __forward_sequence__] [The sequence to iterate]]
[[`State`] [Any type] [The initial state for the first application of `F`]]
- [[`F`] [`__boost_result_of_call__::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`] [The operation to be applied on forward traversal]]
+ [[`F`] [`__boost_result_of_call__::type` is the return type of `f(s,e)` for current state `s` of type `S`, and for each element `e` of type `E` in `seq`] [The operation to be applied on forward traversal]]
]
[heading Expression Semantics]
@@ -583,8 +583,8 @@ or `__end__(seq)` if there is no such element.
[heading Complexity]
Linear. At most `__result_of_size__::value` comparisons.
-
-/algorithm/query/find_if.hpp>
+#include
+#include
[heading Example]
const __vector__ vec(1.0,2);
@@ -795,7 +795,7 @@ Constant.
[section find]
[heading Description]
-Returns the result type of `find`, given the sequence and search types.
+Returns the result type of __find__, given the sequence and search types.
[heading Synopsis]
template<
@@ -833,7 +833,7 @@ Linear, at most `__result_of_size__::value` comparisons.
[section find_if]
[heading Description]
-Returns the result type of `find_if` given the sequence and predicate types.
+Returns the result type of __find_if__ given the sequence and predicate types.
[heading Synopsis]
template<
@@ -983,7 +983,10 @@ For a given sequence, filter returns a new sequences containing only the element
[heading Expression Semantics]
__filter__(seq);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence containing all the elements of `seq` of type `T`.
Equivalent to `__filter_if__ >(seq)`.
@@ -1024,7 +1027,10 @@ only the elements with types for which a given __mpl_lambda_expression__ evaluat
[heading Expression Semantics]
__filter_if__(seq);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence containing all the elements of `seq` with types for which `Pred` evaluates
to `boost::mpl::true_`. The order of the retained elements is the same as in the original sequence.
@@ -1225,7 +1231,10 @@ Returns a new sequence, with all the elements of the original sequence, except t
[heading Expression Semantics]
__remove__(seq);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing all the elements of `seq`, in their original order, except
those of type `T`. Equivalent to `__remove_if__ >(seq)`.
@@ -1266,7 +1275,10 @@ function object evaluates to `true`.
[heading Expression Semantics]
__remove_if__(seq);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing all the elements of `seq`, in their original order, except
those elements with types for which `Pred` evaluates to `boost::mpl::true_`.
@@ -1305,7 +1317,11 @@ Returns a new sequence with the elements of the original in reverse order.
[heading Expression Semantics]
__reverse__(seq);
-[*Return type]: A model of __bidirectional_sequence__.
+[*Return type]:
+
+* A model of __bidirectional_sequence__ if `seq` is a __bidirectional_sequence__
+else, __random_access_sequence__ if `seq` is a __random_access_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence containing all the elements of `seq` in reverse order.
@@ -1390,13 +1406,19 @@ between two iterators.
[heading Expression Semantics]
__erase__(seq, pos);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing all the elements of `seq` except the element at `pos`.
__erase__(seq, first, last);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, with all the elements of `seq`, in their original order, except those
in the range [`first`,`last`).
@@ -1419,26 +1441,27 @@ Constant. Returns a view which is lazily evaluated.
[section erase_key]
[heading Description]
-For an __associative_sequence__ `seq`, returns a __forward_sequence__ containing all the
-elements of the original except those with a given key.
+For an [link fusion.sequence.concepts.associative_sequence associative]] __forward_sequence__ `seq`,
+returns a [link fusion.sequence.concepts.associative_sequence associative]] __forward_sequence__ containing
+all the elements of the original except those with a given key.
[heading Synposis]
template<
typename Key,
typename Sequence
>
- typename result_of::erase_key::type erase_key(Sequence const& seq);
+ typename __result_of_erase_key__::type erase_key(Sequence const& seq);
[table Parameters
[[Parameter][Requirement][Description]]
- [[`seq`][A model of __associative_sequence__][Operation's argument]]
+ [[`seq`][A model of __forward_sequence__ and __associative_sequence__][Operation's argument]]
[[`Key`][Any type][Key to erase]]
]
[heading Expression Semantics]
__erase_key__(seq);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]: A model of __forward_sequence__ and __associative_sequence__.
[*Semantics]: Returns a new sequence, containing all the elements of `seq`, except those with key `Key`.
@@ -1467,7 +1490,8 @@ position described by a given iterator.
typename Pos,
typename T
>
- __unspecified__ insert(Sequence const& seq, Pos const& pos, T const& t);
+ typename __result_of_insert__::type insert(
+ Sequence const& seq, Pos const& pos, T const& t);
[table Parameters
[[Parameter][Requirement][Description]]
@@ -1479,7 +1503,10 @@ position described by a given iterator.
[heading Expression Semantics]
__insert__(seq, p, t);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing all the elements of `seq`, in their original order, and a new element with the
type and value of `t` inserted at iterator `pos`.
@@ -1522,7 +1549,10 @@ Returns a new sequence with another sequence inserted at a specified iterator.
[heading Expression Semantics]
__insert__(seq, pos, range);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing all the elements of `seq`, and the elements of
`range` inserted at iterator `pos`. All elements retaining their ordering from the orignal sequences.
@@ -1561,9 +1591,12 @@ Takes 2 sequences and returns a sequence containing the elements of the first fo
[heading Expression Semantics]
__join__(lhs, rhs);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
-[*Semantics]: Returns a sequence containing all the elements of `lhs` followed by all the elements of `rhs`. The order of th elements is preserved.
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `lhs` and `rhs` implement the __associative_sequence__ model.
+
+[*Semantics]: Returns a sequence containing all the elements of `lhs` followed by all the elements of `rhs`. The order of the elements is preserved.
[heading Complexity]
Constant. Returns a view which is lazily evaluated.
@@ -1641,7 +1674,10 @@ Returns a new sequence, with the last element of the original removed.
[heading Expression Semantics]
__pop_back__(seq);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence containing all the elements of `seq`, except the last element. The elements in the new sequence are in the same order as they were in `seq`.
@@ -1678,7 +1714,10 @@ Returns a new sequence, with the first element of the original removed.
[heading Expression Semantics]
__pop_front__(seq);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence containing all the elements of `seq`, except the first element. The elements in the new sequence are in the same order as they were in `seq`.
@@ -1717,7 +1756,10 @@ Returns a new sequence with an element added at the end.
[heading Expression Semantics]
__push_back__(seq, t);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing all the elements of `seq`, and new element `t` appended to the end. The elements are in the same order as they were in `seq`.
@@ -1756,7 +1798,10 @@ Returns a new sequence with an element added at the beginning.
[heading Expression Semantics]
__push_back__(seq, t);
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `seq` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing all the elements of `seq`, and new element `t` appended to the beginning. The elements are in the same order as they were in `seq`.
@@ -1801,7 +1846,10 @@ Returns the result type of __filter__ given the sequence type and type to retain
[heading Expression Semantics]
__result_of_filter__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence containing the elements of `Sequence` that are of type `T`. Equivalent to `__result_of_filter_if__ >::type`.
@@ -1839,7 +1887,10 @@ Returns the result type of __filter_if__ given the sequence and unary __mpl_lamb
[heading Expression Semantics]
__result_of_filter_if__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence containing the elements of `Sequence` for which `Pred` evaluates to `boost::mpl::true_`.
@@ -1876,7 +1927,10 @@ with elements created by applying `f(e)` to each element of `e` of `seq`.
[heading Expression Semantics]
__transform__(seq, f);
-[*Return type]: A model of __forward_sequence__
+[*Return type]:
+
+* A model of __forward_sequence__
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence, containing the return values of `f(e)` for each element `e` within `seq`.
@@ -2024,7 +2078,10 @@ Returns the result type of __remove__, given the sequence and removal types.
[heading Expression Semantics]
__result_of_remove__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence containing the elements of `Sequence` not of type `T`. Equivalent to `__result_of_replace_if__ >::type`.
@@ -2062,7 +2119,10 @@ Returns the result type of __remove_if__, given the input sequence and unary __m
[heading Expression Semantics]
__result_of_remove_if__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence containing the elements of `Sequence` for which `Pred` evaluates to `boost::mpl::false_`.
@@ -2098,7 +2158,11 @@ Returns the result type of __reverse__, given the input sequence type.
[heading Expression Semantics]
__result_of_reverse__::type
-[*Return type]: A model of __bidirectional_sequence__.
+[*Return type]:
+
+* A model of __bidirectional_sequence__ if `Sequence` is a __bidirectional_sequence__
+else, __random_access_sequence__ if `Sequence` is a __random_access_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence with the elements in the reverse order to `Sequence`.
@@ -2173,7 +2237,10 @@ Returns the result type of __erase__, given the input sequence and range delimit
[heading Expression Semantics]
__result_of_erase__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a new sequence with the element at `It1` removed.
@@ -2210,14 +2277,14 @@ Returns the result type of __erase_key__, given the sequence and key types.
[table Parameters
[[Parameter][Requirement][Description]]
- [[`Sequence`][A model of __associative_sequence__][Operation's argument]]
+ [[`Sequence`][A model of __forward_sequence__ and __associative_sequence__][Operation's argument]]
[[`Key`][Any type][Key type]]
]
[heading Expression Semantics]
__result_of_erase_key__::type
-[*Return type]: A model of __associative_sequence__.
+[*Return type]: A model of __forward_sequence__ and __associative_sequence__.
[*Semantics]: Returns a sequence with the elements of `Sequence`, except those with key `Key`.
@@ -2257,7 +2324,10 @@ Returns the result type of __insert__, given the sequence, position iterator and
[heading Expression Semantics]
__result_of_insert__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence with an element of type `T` inserted at position `Position` in `Sequence`.
@@ -2297,7 +2367,10 @@ Returns the result type of __insert_range__, given the input sequence, position
[heading Expression Semantics]
__result_of_insert_range__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence with the elements of `Range` inserted at position `Position` into `Sequence`.
@@ -2329,7 +2402,10 @@ Returns the result of joining 2 sequences, given the sequence types.
[heading Expression Semantics]
__result_of_join__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `LhSequence` amd `RhSequence` implement the __associative_sequence__ model.
[*Semantics]: Returns a sequence containing the elements of `LhSequence` followed by the elements of `RhSequence`. The order of the elements in the 2 sequences is preserved.
@@ -2399,7 +2475,10 @@ Returns the result type of __pop_back__, given the input sequence type.
[heading Expression Semantics]
__result_of_pop_back__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence with all the elements of `Sequence` except the last element.
@@ -2408,7 +2487,7 @@ Constant.
[heading Header]
- #include
+ #include
#include
[endsect]
@@ -2435,14 +2514,20 @@ Returns the result type of __pop_front__, given the input sequence type.
[heading Expression Semantics]
__result_of_pop_front__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence with all the elements of `Sequence` except the first element.
[heading Complexity]
Constant.
-/algorithm/transformation/pop_front.hpp>
+[heading Header]
+
+ #include
+ #include
[endsect]
@@ -2470,14 +2555,20 @@ Returns the result type of __push_back__, given the types of the input sequence
[heading Expression Semantics]
__result_of_push_back__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence with the elements of `Sequence` and an element of type `T` added to the end.
[heading Complexity]
Constant.
-/algorithm/transformation/push_back.hpp>
+[heading Header]
+
+ #include
+ #include
[endsect]
@@ -2505,14 +2596,20 @@ Returns the result type of __push_front__, given the types of the input sequence
[heading Expression Semantics]
__result_of_push_front__::type
-[*Return type]: A model of __forward_sequence__.
+[*Return type]:
+
+* A model of __forward_sequence__.
+* A model of __associative_sequence__ if `Sequence` implements the __associative_sequence__ model.
[*Semantics]: Returns a sequence with the elements of `Sequence` and an element of type `T` added to the beginning.
[heading Complexity]
Constant.
-/algorithm/transformation/push_front.hpp>
+[heading Header]
+
+ #include
+ #include
[endsect]
diff --git a/doc/changelog.qbk b/doc/changelog.qbk
index d3e953ce..7d2a0150 100644
--- a/doc/changelog.qbk
+++ b/doc/changelog.qbk
@@ -12,7 +12,7 @@ This section summarizes significant changes to the Fusion library.
* Sep 27, 2006: Added `boost::tuple` support. (Joel de Guzman)
* Nov 17, 2006: Added `boost::variant` support. (Joel de Guzman)
* Feb 15, 2007: Added functional module. (Tobias Schwinger)
-* APRIL 2, 2007: Added struct adapter. (Joel de Guzman)
+* April 2, 2007: Added struct adapter. (Joel de Guzman)
* May 8, 2007: Added associative struct adapter. (Dan Marsden)
* Dec 20, 2007: Removed `boost::variant` support. After thorough
investigation, I think now that the move to make variant a
@@ -21,5 +21,9 @@ This section summarizes significant changes to the Fusion library.
and there's no way to know at compile time what it contains.
Iterating over its types is simply wrong. All these imply that
the variant is *not* a fusion sequence. (Joel de Guzman)
+* Oct 12, 2009: The accumulator is the first argument to the functor of
+ __fold__ and __accumulate__. (Christopher Schmidt)
+* Oct 30, 2009: Added support for associative iterators and views. (Christopher
+ Schmidt)
[endsect]
diff --git a/doc/extension.qbk b/doc/extension.qbk
index b840259f..b0159072 100644
--- a/doc/extension.qbk
+++ b/doc/extension.qbk
@@ -145,15 +145,15 @@ our iterator's tag type.
The implementation itself is pretty simple, it just uses 2 partial specializations to
provide the type of the 2 different members of `example_struct`, based on the index of the iterator.
-To understand how `value_of_impl` is used by the library we will look at the implementation of __value_of__:
+To understand how `value_of_impl` is used by the library we will look at the implementation of __result_of_value_of__:
template
- struct __value_of__
+ struct value_of
: extension::value_of_impl::type>::
template apply
{};
-So __value_of__ uses __tag_dispatching__ to select an __mpl_metafunction_class__
+So __result_of_value_of__ uses __tag_dispatching__ to select an __mpl_metafunction_class__
to provide its functionality. You will notice this pattern throughout the
implementation of Fusion.
@@ -216,7 +216,7 @@ To see how `deref_impl` is used, lets have a look at the implementation of __der
}
So again __result_of_deref__ uses __tag_dispatching__ in exactly the
-same way as the __value_of__ implementation. The runtime functionality used
+same way as the __result_of_value_of__ implementation. The runtime functionality used
by __deref__ is provided by the `call` static function of the selected
__mpl_metafunction_class__.
@@ -227,14 +227,14 @@ bit of metaprogramming to return `const` references if the underlying sequence
is const.
[note Although there is a fair amount of left to do to produce a fully fledged
-Fusion sequence, __value_of__ and __deref__ illustrate all the signficant concepts
+Fusion sequence, __result_of_value_of__ and __deref__ illustrate all the signficant concepts
required. The remainder of the process is very repetitive, simply requiring
implementation of a suitable `xxxx_impl` for each feature `xxxx`.
]
[heading Implementing the remaining iterator functionality]
-Ok, now we have seen the way __value_of__ and __deref__ work, everything else will work
+Ok, now we have seen the way __result_of_value_of__ and __deref__ work, everything else will work
in pretty much the same way. Lets start with forward iteration,
by providing a `next_impl`:
@@ -317,14 +317,15 @@ is provided in the example code.
For our __random_access_sequence__ we will also need to implement `size_impl`,
`value_at_impl` and `at_impl`.
-[heading Enabling our type as an associative container]
+[heading Enabling our type as an associative sequence]
-In order for `example_struct` to serve as an associative container,
-we need to enable 3 lookup features, __at_key__, __value_at_key__ and __has_key__.
-We also need to provide an implementation of the `is_associative` trait
-so that our sequence can be correctly identified as an associative container.
+In order for `example_struct` to serve as an associative forward sequence,
+we need to adapt the traversal category of our sequence and our iterator
+accordingly and enable 3 intrinsic sequence lookup features, __at_key__,
+__value_at_key__ and __has_key__. We also need to enable 3 iterator lookup
+features, __result_of_key_of__, __result_of_value_of_data__ and __deref_data__.
-To implement `at_key_impl` we need to associate the `fields::age` and `fields::age`
+To implement `at_key_impl` we need to associate the `fields::name` and `fields::age`
types described in the __quick_start__ guide with the appropriate members of `example_struct`.
Our implementation is as follows:
@@ -369,15 +370,14 @@ Its all very similar to the implementations we've seen previously,
such as `deref_impl` and `value_of_impl`. Instead of identifying
the members by index or position, we are now selecting them using
the types `fields::name` and `fields::age`. The implementations of
-`value_at_key_impl` and `has_key_impl` are equally straightforward,
-and are provided in the example code, along with an implementation
-of `is_associative_impl`.
+the other functions are equally straightforward, and are provided in
+the example code.
[heading Summary]
We've now worked through the entire process for adding a new random
access sequence and we've also enabled our type to serve as an associative
-container. The implementation was slightly longwinded, but followed
+sequence. The implementation was slightly longwinded, but followed
a simple repeating pattern.
The support for `std::pair`, __mpl__ sequences, and `boost::array` all
@@ -467,6 +467,10 @@ The user must the implement the key expressions required by their iterator type.
[[`iterator::template distance::call(it1, it2)`][The distance between iterator `it1` and `it2`][None]]
[[`iterator::template equal_to::type`][The distance between iterators of type `It1` and `It2`][`boost::same_type::type`]]
[[`iterator::template equal_to::call(it1, it2)`][The distance between iterators `it1` and `it2`][`boost::same_type::type()`]]
+[[`iterator::template key_of::type`][The key type associated with the element from `It`][None]]
+[[`iterator::template value_of_data::type`][The type of the data property associated with the element from `It`][None]]
+[[`iterator::template deref_data::type`][The type that will be returned by dereferencing the data property of the element from `It`][None]]
+[[`iterator::template deref_data::call(it)`][Deferences the data property associated with the element referenced by `it`][None]]
]
[heading Header]
diff --git a/doc/fusion.qbk b/doc/fusion.qbk
index f48ff84a..f6330d42 100644
--- a/doc/fusion.qbk
+++ b/doc/fusion.qbk
@@ -79,6 +79,7 @@
[def __forward_iterator__ [link fusion.iterator.concepts.forward_iterator Forward Iterator]]
[def __bidirectional_iterator__ [link fusion.iterator.concepts.bidirectional_iterator Bidirectional Iterator]]
[def __random_access_iterator__ [link fusion.iterator.concepts.random_access_iterator Random Access Iterator]]
+[def __associative_iterator__ [link fusion.iterator.concepts.associative_iterator Associative Iterator]]
[def __next__ [link fusion.iterator.functions.next `next`]]
[def __prior__ [link fusion.iterator.functions.prior `prior`]]
@@ -86,6 +87,7 @@
[def __advance_c__ [link fusion.iterator.functions.advance_c `advance_c`]]
[def __distance__ [link fusion.iterator.functions.distance `distance`]]
[def __deref__ [link fusion.iterator.functions.deref `deref`]]
+[def __deref_data__ [link fusion.iterator.functions.deref_data `deref_data`]]
[def __result_of_next__ [link fusion.iterator.metafunctions.next `result_of::next`]]
[def __result_of_prior__ [link fusion.iterator.metafunctions.prior `result_of::prior`]]
@@ -95,7 +97,9 @@
[def __result_of_distance__ [link fusion.iterator.metafunctions.distance `result_of::distance`]]
[def __result_of_deref__ [link fusion.iterator.metafunctions.deref `result_of::deref`]]
[def __result_of_value_of__ [link fusion.iterator.metafunctions.value_of `result_of::value_of`]]
-[def __value_of__ [link fusion.iterator.metafunctions.value_of `value_of`]]
+[def __result_of_key_of__ [link fusion.iterator.metafunctions.key_of `result_of::key_of`]]
+[def __result_of_value_of_data__ [link fusion.iterator.metafunctions.value_of_data `result_of::value_of_data`]]
+[def __result_of_deref_data__ [link fusion.iterator.metafunctions.deref_data `result_of::deref_data`]]
[def __sequence__ [link fusion.sequence Sequence]]
[def __sequence_concepts__ [link fusion.sequence.concepts Sequence Concepts]]
diff --git a/doc/html/fusion/acknowledgements.html b/doc/html/fusion/acknowledgements.html
index 77569ed6..05453358 100644
--- a/doc/html/fusion/acknowledgements.html
+++ b/doc/html/fusion/acknowledgements.html
@@ -3,7 +3,11 @@
Acknowledgements
+<<<<<<< .working
+=======
+
+>>>>>>> .merge-right.r57125
diff --git a/doc/html/fusion/adapted.html b/doc/html/fusion/adapted.html
index bc480000..080ac71c 100644
--- a/doc/html/fusion/adapted.html
+++ b/doc/html/fusion/adapted.html
@@ -3,7 +3,11 @@
Adapted
+<<<<<<< .working
+=======
+
+>>>>>>> .merge-right.r57125
@@ -49,10 +53,17 @@
Fusion also provides various schemes to make it easy for the user to adapt
various data structures, non-intrusively, as full fledged Fusion sequences.
BOOST_FUSION_ADAPT_ASSOC_STRUCT is a macro that can be used to generate all
the necessary boilerplate to make an arbitrary struct into a model of Associative
Sequence.
BOOST_FUSION_ADAPT_STRUCT is a macro that can be used to generate all the
necessary boilerplate to make an arbitrary struct into a Random
Access Sequence.
Unlike MPL, Fusion
algorithms are lazy and non sequence-type preserving. What does that mean?
@@ -69,10 +80,17 @@
lazy evaluation scheme allows us to chain as many algorithms
as we want without incurring a high runtime penalty.
The lazy evaluation scheme where Algorithms
return Views also allows operations such
@@ -92,10 +110,17 @@
are provided. You may use one of the Conversion
functions to convert back to the original sequence type.
diff --git a/doc/html/fusion/algorithm/iteration.html b/doc/html/fusion/algorithm/iteration.html
index c99b7083..cd49cd9a 100644
--- a/doc/html/fusion/algorithm/iteration.html
+++ b/doc/html/fusion/algorithm/iteration.html
@@ -3,7 +3,11 @@
Iteration
+<<<<<<< .working
+=======
+
+>>>>>>> .merge-right.r57125
@@ -37,10 +41,17 @@
The iteration algorithms provide the fundamental algorithms for traversing
a sequence repeatedly applying an operation to its elements.
+<<<<<<< .working
+<<<<<<< .working
For a sequence Seq, initial
state, and binary function object or function pointer f,
accumulate repeatedly applies binary f
to each element of Seq
and the previous state.
+=======
+ For a sequence seq, initial
+ state initial_state,
+ and binary function object or function pointer f,
+ accumulate returns the result of the repeated application of binary
+ f to the result of the
+ previous f invocation
+ (inital_state if it is
+ the first call) and each element of seq.
+>>>>>>> .merge-right.r57125
accumulate(seq,initial_state,f);
@@ -126,33 +264,114 @@
Return type: Any type
+<<<<<<< .working
Semantics: Equivalent to f(eN....f(e2,f(e1,initial_state)))
where e1...eN are the elements of seq.
+=======
+ Semantics: Equivalent to f(...f(f(initial_state,e1),e2)...eN) where e1
+ ...eN
+ are the elements of seq.
+>>>>>>> .merge-right.r57125