From 32f1c58ce72e17b78a8106488d2c447f1411f266 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 00:52:09 +0000 Subject: [PATCH] branch for creating branch for fusion 2.1 [SVN r40237] --- include/boost/fusion/adapted.hpp | 17 + include/boost/fusion/adapted/array.hpp | 22 + .../fusion/adapted/array/array_iterator.hpp | 107 ++++ .../fusion/adapted/array/detail/at_impl.hpp | 45 ++ .../adapted/array/detail/begin_impl.hpp | 40 ++ .../adapted/array/detail/category_of_impl.hpp | 35 ++ .../fusion/adapted/array/detail/end_impl.hpp | 40 ++ .../adapted/array/detail/is_sequence_impl.hpp | 31 ++ .../adapted/array/detail/is_view_impl.hpp | 32 ++ .../fusion/adapted/array/detail/size_impl.hpp | 29 + .../adapted/array/detail/value_at_impl.hpp | 32 ++ include/boost/fusion/adapted/array/tag_of.hpp | 35 ++ include/boost/fusion/adapted/boost_tuple.hpp | 20 + .../boost_tuple/boost_tuple_iterator.hpp | 149 +++++ .../adapted/boost_tuple/detail/at_impl.hpp | 50 ++ .../adapted/boost_tuple/detail/begin_impl.hpp | 39 ++ .../boost_tuple/detail/category_of_impl.hpp | 32 ++ .../adapted/boost_tuple/detail/end_impl.hpp | 54 ++ .../boost_tuple/detail/is_sequence_impl.hpp | 30 + .../boost_tuple/detail/is_view_impl.hpp | 30 + .../adapted/boost_tuple/detail/size_impl.hpp | 31 ++ .../boost_tuple/detail/value_at_impl.hpp | 30 + .../fusion/adapted/boost_tuple/tag_of.hpp | 55 ++ include/boost/fusion/adapted/mpl.hpp | 21 + .../fusion/adapted/mpl/detail/at_impl.hpp | 40 ++ .../fusion/adapted/mpl/detail/begin_impl.hpp | 45 ++ .../adapted/mpl/detail/category_of_impl.hpp | 54 ++ .../fusion/adapted/mpl/detail/empty_impl.hpp | 28 + .../fusion/adapted/mpl/detail/end_impl.hpp | 45 ++ .../adapted/mpl/detail/has_key_impl.hpp | 31 ++ .../adapted/mpl/detail/is_sequence_impl.hpp | 31 ++ .../adapted/mpl/detail/is_view_impl.hpp | 32 ++ .../fusion/adapted/mpl/detail/size_impl.hpp | 31 ++ .../adapted/mpl/detail/value_at_impl.hpp | 31 ++ .../boost/fusion/adapted/mpl/mpl_iterator.hpp | 113 ++++ include/boost/fusion/adapted/std_pair.hpp | 66 +++ .../adapted/std_pair/detail/at_impl.hpp | 71 +++ .../adapted/std_pair/detail/begin_impl.hpp | 40 ++ .../std_pair/detail/category_of_impl.hpp | 35 ++ .../adapted/std_pair/detail/end_impl.hpp | 40 ++ .../std_pair/detail/is_sequence_impl.hpp | 31 ++ .../adapted/std_pair/detail/is_view_impl.hpp | 32 ++ .../adapted/std_pair/detail/size_impl.hpp | 31 ++ .../adapted/std_pair/detail/value_at_impl.hpp | 43 ++ .../adapted/std_pair/std_pair_iterator.hpp | 127 +++++ .../boost/fusion/adapted/std_pair/tag_of.hpp | 29 + include/boost/fusion/adapted/struct.hpp | 23 + .../adapted/struct/adapt_assoc_struct.hpp | 94 ++++ .../fusion/adapted/struct/adapt_struct.hpp | 75 +++ .../fusion/adapted/struct/detail/at_impl.hpp | 63 +++ .../adapted/struct/detail/at_key_impl.hpp | 54 ++ .../adapted/struct/detail/begin_impl.hpp | 40 ++ .../struct/detail/category_of_impl.hpp | 35 ++ .../fusion/adapted/struct/detail/end_impl.hpp | 40 ++ .../adapted/struct/detail/has_key_impl.hpp | 40 ++ .../struct/detail/is_sequence_impl.hpp | 31 ++ .../adapted/struct/detail/is_view_impl.hpp | 32 ++ .../adapted/struct/detail/size_impl.hpp | 37 ++ .../adapted/struct/detail/value_at_impl.hpp | 47 ++ .../struct/detail/value_at_key_impl.hpp | 39 ++ .../boost/fusion/adapted/struct/extension.hpp | 68 +++ .../fusion/adapted/struct/struct_iterator.hpp | 103 ++++ include/boost/fusion/adapted/variant.hpp | 20 + .../adapted/variant/detail/begin_impl.hpp | 45 ++ .../variant/detail/category_of_impl.hpp | 33 ++ .../adapted/variant/detail/end_impl.hpp | 45 ++ .../variant/detail/is_sequence_impl.hpp | 31 ++ .../adapted/variant/detail/is_view_impl.hpp | 31 ++ .../adapted/variant/detail/size_impl.hpp | 32 ++ .../boost/fusion/adapted/variant/tag_of.hpp | 28 + .../adapted/variant/variant_iterator.hpp | 117 ++++ include/boost/fusion/algorithm.hpp | 14 + include/boost/fusion/algorithm/iteration.hpp | 14 + .../fusion/algorithm/iteration/accumulate.hpp | 40 ++ .../algorithm/iteration/detail/fold.hpp | 271 +++++++++ .../algorithm/iteration/detail/for_each.hpp | 130 +++++ .../algorithm/iteration/ext_/for_each_s.hpp | 91 +++ .../boost/fusion/algorithm/iteration/fold.hpp | 48 ++ .../fusion/algorithm/iteration/for_each.hpp | 43 ++ include/boost/fusion/algorithm/query.hpp | 18 + include/boost/fusion/algorithm/query/all.hpp | 34 ++ include/boost/fusion/algorithm/query/any.hpp | 35 ++ .../boost/fusion/algorithm/query/count.hpp | 35 ++ .../boost/fusion/algorithm/query/count_if.hpp | 35 ++ .../fusion/algorithm/query/detail/all.hpp | 127 +++++ .../fusion/algorithm/query/detail/any.hpp | 130 +++++ .../algorithm/query/detail/assoc_find.hpp | 35 ++ .../fusion/algorithm/query/detail/count.hpp | 68 +++ .../algorithm/query/detail/count_if.hpp | 170 ++++++ .../fusion/algorithm/query/detail/find_if.hpp | 252 +++++++++ .../fusion/algorithm/query/ext_/find_if_s.hpp | 222 ++++++++ include/boost/fusion/algorithm/query/find.hpp | 75 +++ .../boost/fusion/algorithm/query/find_if.hpp | 69 +++ include/boost/fusion/algorithm/query/none.hpp | 33 ++ .../boost/fusion/algorithm/transformation.hpp | 28 + .../fusion/algorithm/transformation/clear.hpp | 32 ++ .../transformation/detail/replace.hpp | 73 +++ .../transformation/detail/replace_if.hpp | 73 +++ .../fusion/algorithm/transformation/erase.hpp | 108 ++++ .../algorithm/transformation/erase_key.hpp | 37 ++ .../algorithm/transformation/filter.hpp | 34 ++ .../algorithm/transformation/filter_if.hpp | 32 ++ .../algorithm/transformation/insert.hpp | 63 +++ .../algorithm/transformation/insert_range.hpp | 55 ++ .../fusion/algorithm/transformation/join.hpp | 33 ++ .../algorithm/transformation/pop_back.hpp | 43 ++ .../algorithm/transformation/pop_front.hpp | 43 ++ .../algorithm/transformation/push_back.hpp | 39 ++ .../algorithm/transformation/push_front.hpp | 39 ++ .../algorithm/transformation/remove.hpp | 35 ++ .../algorithm/transformation/remove_if.hpp | 35 ++ .../algorithm/transformation/replace.hpp | 35 ++ .../algorithm/transformation/replace_if.hpp | 37 ++ .../algorithm/transformation/reverse.hpp | 32 ++ .../algorithm/transformation/transform.hpp | 47 ++ .../fusion/algorithm/transformation/zip.hpp | 79 +++ include/boost/fusion/container.hpp | 16 + include/boost/fusion/container/deque.hpp | 15 + .../container/deque/back_extended_deque.hpp | 37 ++ .../boost/fusion/container/deque/convert.hpp | 48 ++ .../boost/fusion/container/deque/deque.hpp | 93 ++++ .../fusion/container/deque/deque_fwd.hpp | 24 + .../fusion/container/deque/deque_iterator.hpp | 106 ++++ .../container/deque/detail/as_deque.hpp | 102 ++++ .../fusion/container/deque/detail/at_impl.hpp | 59 ++ .../container/deque/detail/begin_impl.hpp | 46 ++ .../container/deque/detail/convert_impl.hpp | 45 ++ .../deque/detail/deque_forward_ctor.hpp | 31 ++ .../deque/detail/deque_initial_size.hpp | 33 ++ .../deque/detail/deque_keyed_values.hpp | 75 +++ .../deque/detail/deque_keyed_values_call.hpp | 38 ++ .../container/deque/detail/end_impl.hpp | 46 ++ .../container/deque/detail/keyed_element.hpp | 111 ++++ .../container/deque/detail/value_at_impl.hpp | 43 ++ .../container/deque/front_extended_deque.hpp | 39 ++ .../boost/fusion/container/deque/limits.hpp | 15 + include/boost/fusion/container/ext_/tree.hpp | 130 +++++ include/boost/fusion/container/list.hpp | 17 + include/boost/fusion/container/list/cons.hpp | 143 +++++ .../fusion/container/list/cons_iterator.hpp | 85 +++ .../boost/fusion/container/list/convert.hpp | 56 ++ .../fusion/container/list/detail/at_impl.hpp | 79 +++ .../container/list/detail/begin_impl.hpp | 49 ++ .../container/list/detail/build_cons.hpp | 57 ++ .../container/list/detail/convert_impl.hpp | 51 ++ .../container/list/detail/deref_impl.hpp | 52 ++ .../container/list/detail/empty_impl.hpp | 37 ++ .../fusion/container/list/detail/end_impl.hpp | 51 ++ .../container/list/detail/equal_to_impl.hpp | 39 ++ .../list/detail/list_forward_ctor.hpp | 47 ++ .../container/list/detail/list_to_cons.hpp | 49 ++ .../list/detail/list_to_cons_call.hpp | 43 ++ .../container/list/detail/next_impl.hpp | 59 ++ .../container/list/detail/value_at_impl.hpp | 42 ++ .../container/list/detail/value_of_impl.hpp | 36 ++ .../boost/fusion/container/list/limits.hpp | 19 + include/boost/fusion/container/list/list.hpp | 68 +++ .../boost/fusion/container/list/list_fwd.hpp | 24 + include/boost/fusion/container/map.hpp | 15 + .../boost/fusion/container/map/convert.hpp | 47 ++ .../fusion/container/map/detail/as_map.hpp | 101 ++++ .../container/map/detail/at_key_impl.hpp | 49 ++ .../container/map/detail/begin_impl.hpp | 56 ++ .../container/map/detail/convert_impl.hpp | 45 ++ .../fusion/container/map/detail/end_impl.hpp | 53 ++ .../container/map/detail/lookup_key.hpp | 99 ++++ .../container/map/detail/map_forward_ctor.hpp | 38 ++ .../container/map/detail/map_lookup.hpp | 128 +++++ .../map/detail/value_at_key_impl.hpp | 33 ++ include/boost/fusion/container/map/limits.hpp | 25 + include/boost/fusion/container/map/map.hpp | 71 +++ .../boost/fusion/container/map/map_fwd.hpp | 24 + include/boost/fusion/container/set.hpp | 15 + .../boost/fusion/container/set/convert.hpp | 47 ++ .../fusion/container/set/detail/as_set.hpp | 101 ++++ .../container/set/detail/at_key_impl.hpp | 49 ++ .../container/set/detail/begin_impl.hpp | 56 ++ .../container/set/detail/convert_impl.hpp | 45 ++ .../fusion/container/set/detail/end_impl.hpp | 53 ++ .../container/set/detail/lookup_key.hpp | 93 ++++ .../container/set/detail/set_forward_ctor.hpp | 39 ++ .../container/set/detail/set_lookup.hpp | 128 +++++ .../set/detail/value_at_key_impl.hpp | 35 ++ include/boost/fusion/container/set/limits.hpp | 25 + include/boost/fusion/container/set/set.hpp | 71 +++ .../boost/fusion/container/set/set_fwd.hpp | 24 + include/boost/fusion/container/vector.hpp | 21 + .../boost/fusion/container/vector/convert.hpp | 47 ++ .../container/vector/detail/advance_impl.hpp | 42 ++ .../container/vector/detail/as_vector.hpp | 101 ++++ .../container/vector/detail/at_impl.hpp | 49 ++ .../container/vector/detail/begin_impl.hpp | 39 ++ .../container/vector/detail/convert_impl.hpp | 45 ++ .../container/vector/detail/deref_impl.hpp | 53 ++ .../container/vector/detail/distance_impl.hpp | 41 ++ .../container/vector/detail/end_impl.hpp | 40 ++ .../container/vector/detail/equal_to_impl.hpp | 39 ++ .../container/vector/detail/next_impl.hpp | 43 ++ .../container/vector/detail/prior_impl.hpp | 43 ++ .../container/vector/detail/value_at_impl.hpp | 33 ++ .../container/vector/detail/value_of_impl.hpp | 37 ++ .../vector/detail/vector_forward_ctor.hpp | 39 ++ .../container/vector/detail/vector_n.hpp | 150 +++++ .../vector/detail/vector_n_chooser.hpp | 99 ++++ .../boost/fusion/container/vector/limits.hpp | 19 + .../boost/fusion/container/vector/vector.hpp | 152 +++++ .../fusion/container/vector/vector10.hpp | 66 +++ .../fusion/container/vector/vector20.hpp | 50 ++ .../fusion/container/vector/vector30.hpp | 50 ++ .../fusion/container/vector/vector40.hpp | 50 ++ .../fusion/container/vector/vector50.hpp | 50 ++ .../fusion/container/vector/vector_fwd.hpp | 25 + .../container/vector/vector_iterator.hpp | 46 ++ include/boost/fusion/functional.hpp | 17 + include/boost/fusion/functional/adapter.hpp | 18 + .../functional/adapter/detail/access.hpp | 41 ++ .../adapter/detail/pow2_explode.hpp | 118 ++++ .../functional/adapter/detail/pt_def.hpp | 71 +++ .../functional/adapter/detail/pt_undef.hpp | 23 + .../boost/fusion/functional/adapter/fused.hpp | 85 +++ .../adapter/fused_function_object.hpp | 90 +++ .../functional/adapter/fused_procedure.hpp | 70 +++ .../fusion/functional/adapter/limits.hpp | 39 ++ .../functional/adapter/unfused_generic.hpp | 175 ++++++ .../adapter/unfused_lvalue_args.hpp | 136 +++++ .../adapter/unfused_rvalue_args.hpp | 137 +++++ .../functional/adapter/unfused_typed.hpp | 155 ++++++ .../boost/fusion/functional/generation.hpp | 19 + .../generation/detail/gen_make_adapter.hpp | 44 ++ .../functional/generation/make_fused.hpp | 18 + .../generation/make_fused_function_object.hpp | 18 + .../generation/make_fused_procedure.hpp | 18 + .../generation/make_unfused_generic.hpp | 18 + .../generation/make_unfused_lvalue_args.hpp | 18 + .../generation/make_unfused_rvalue_args.hpp | 18 + .../boost/fusion/functional/invocation.hpp | 16 + .../functional/invocation/detail/that_ptr.hpp | 87 +++ .../fusion/functional/invocation/invoke.hpp | 306 ++++++++++ .../invocation/invoke_function_object.hpp | 178 ++++++ .../invocation/invoke_procedure.hpp | 171 ++++++ .../fusion/functional/invocation/limits.hpp | 23 + include/boost/fusion/include/adapt_struct.hpp | 12 + include/boost/fusion/include/any.hpp | 12 + include/boost/fusion/include/as_vector.hpp | 12 + include/boost/fusion/include/at.hpp | 12 + include/boost/fusion/include/begin.hpp | 12 + include/boost/fusion/include/deref.hpp | 12 + include/boost/fusion/include/end.hpp | 12 + include/boost/fusion/include/equal_to.hpp | 13 + include/boost/fusion/include/filter_if.hpp | 12 + include/boost/fusion/include/for_each.hpp | 12 + include/boost/fusion/include/io.hpp | 12 + include/boost/fusion/include/is_sequence.hpp | 12 + include/boost/fusion/include/join.hpp | 12 + include/boost/fusion/include/joint_view.hpp | 12 + include/boost/fusion/include/list.hpp | 12 + include/boost/fusion/include/make_cons.hpp | 12 + include/boost/fusion/include/make_vector.hpp | 12 + include/boost/fusion/include/mpl.hpp | 13 + include/boost/fusion/include/next.hpp | 12 + include/boost/fusion/include/push_front.hpp | 12 + include/boost/fusion/include/single_view.hpp | 12 + include/boost/fusion/include/std_pair.hpp | 12 + include/boost/fusion/include/swap.hpp | 12 + include/boost/fusion/include/transform.hpp | 12 + .../boost/fusion/include/transform_view.hpp | 12 + include/boost/fusion/include/value_at.hpp | 12 + include/boost/fusion/include/value_of.hpp | 12 + include/boost/fusion/include/variant.hpp | 12 + include/boost/fusion/include/vector.hpp | 12 + include/boost/fusion/include/vector_tie.hpp | 12 + include/boost/fusion/iterator.hpp | 20 + include/boost/fusion/iterator/advance.hpp | 92 +++ include/boost/fusion/iterator/deref.hpp | 72 +++ .../iterator/detail/adapt_deref_traits.hpp | 34 ++ .../iterator/detail/adapt_value_traits.hpp | 28 + .../boost/fusion/iterator/detail/advance.hpp | 102 ++++ .../boost/fusion/iterator/detail/distance.hpp | 64 +++ include/boost/fusion/iterator/distance.hpp | 81 +++ include/boost/fusion/iterator/equal_to.hpp | 93 ++++ .../boost/fusion/iterator/iterator_facade.hpp | 50 ++ include/boost/fusion/iterator/mpl.hpp | 13 + .../fusion/iterator/mpl/convert_iterator.hpp | 58 ++ .../fusion/iterator/mpl/fusion_iterator.hpp | 57 ++ include/boost/fusion/iterator/next.hpp | 63 +++ include/boost/fusion/iterator/prior.hpp | 63 +++ include/boost/fusion/iterator/value_of.hpp | 57 ++ include/boost/fusion/mpl.hpp | 32 ++ include/boost/fusion/mpl/at.hpp | 33 ++ include/boost/fusion/mpl/back.hpp | 32 ++ include/boost/fusion/mpl/begin.hpp | 31 ++ include/boost/fusion/mpl/clear.hpp | 33 ++ include/boost/fusion/mpl/detail/clear.hpp | 46 ++ include/boost/fusion/mpl/empty.hpp | 26 + include/boost/fusion/mpl/end.hpp | 31 ++ include/boost/fusion/mpl/erase.hpp | 39 ++ include/boost/fusion/mpl/erase_key.hpp | 39 ++ include/boost/fusion/mpl/front.hpp | 28 + include/boost/fusion/mpl/has_key.hpp | 27 + include/boost/fusion/mpl/insert.hpp | 39 ++ include/boost/fusion/mpl/insert_range.hpp | 39 ++ include/boost/fusion/mpl/pop_back.hpp | 39 ++ include/boost/fusion/mpl/pop_front.hpp | 39 ++ include/boost/fusion/mpl/push_back.hpp | 39 ++ include/boost/fusion/mpl/push_front.hpp | 39 ++ include/boost/fusion/mpl/size.hpp | 26 + include/boost/fusion/sequence.hpp | 17 + include/boost/fusion/sequence/comparison.hpp | 17 + .../comparison/detail/enable_comparison.hpp | 38 ++ .../sequence/comparison/detail/equal_to.hpp | 60 ++ .../sequence/comparison/detail/greater.hpp | 50 ++ .../comparison/detail/greater_equal.hpp | 49 ++ .../sequence/comparison/detail/less.hpp | 50 ++ .../sequence/comparison/detail/less_equal.hpp | 49 ++ .../comparison/detail/not_equal_to.hpp | 60 ++ .../fusion/sequence/comparison/equal_to.hpp | 46 ++ .../fusion/sequence/comparison/greater.hpp | 52 ++ .../sequence/comparison/greater_equal.hpp | 52 ++ .../boost/fusion/sequence/comparison/less.hpp | 43 ++ .../fusion/sequence/comparison/less_equal.hpp | 80 +++ .../sequence/comparison/not_equal_to.hpp | 55 ++ include/boost/fusion/sequence/convert.hpp | 48 ++ include/boost/fusion/sequence/generation.hpp | 20 + .../fusion/sequence/generation/cons_tie.hpp | 43 ++ .../fusion/sequence/generation/deque_tie.hpp | 72 +++ .../fusion/sequence/generation/ignore.hpp | 32 ++ .../fusion/sequence/generation/list_tie.hpp | 72 +++ .../fusion/sequence/generation/make_cons.hpp | 43 ++ .../fusion/sequence/generation/make_deque.hpp | 91 +++ .../fusion/sequence/generation/make_list.hpp | 84 +++ .../fusion/sequence/generation/make_map.hpp | 99 ++++ .../fusion/sequence/generation/make_set.hpp | 86 +++ .../sequence/generation/make_vector.hpp | 84 +++ .../fusion/sequence/generation/map_tie.hpp | 102 ++++ .../fusion/sequence/generation/pair_tie.hpp | 43 ++ .../fusion/sequence/generation/vector_tie.hpp | 71 +++ include/boost/fusion/sequence/intrinsic.hpp | 22 + .../boost/fusion/sequence/intrinsic/at.hpp | 106 ++++ .../fusion/sequence/intrinsic/at_key.hpp | 77 +++ .../boost/fusion/sequence/intrinsic/back.hpp | 42 ++ .../boost/fusion/sequence/intrinsic/begin.hpp | 74 +++ .../boost/fusion/sequence/intrinsic/empty.hpp | 60 ++ .../boost/fusion/sequence/intrinsic/end.hpp | 74 +++ .../sequence/intrinsic/ext_/segments.hpp | 56 ++ .../fusion/sequence/intrinsic/ext_/size_s.hpp | 57 ++ .../boost/fusion/sequence/intrinsic/front.hpp | 41 ++ .../fusion/sequence/intrinsic/has_key.hpp | 72 +++ .../boost/fusion/sequence/intrinsic/size.hpp | 74 +++ .../boost/fusion/sequence/intrinsic/swap.hpp | 59 ++ .../fusion/sequence/intrinsic/value_at.hpp | 67 +++ .../sequence/intrinsic/value_at_key.hpp | 59 ++ include/boost/fusion/sequence/io.hpp | 13 + .../boost/fusion/sequence/io/detail/in.hpp | 85 +++ .../boost/fusion/sequence/io/detail/manip.hpp | 316 +++++++++++ .../boost/fusion/sequence/io/detail/out.hpp | 85 +++ include/boost/fusion/sequence/io/in.hpp | 42 ++ include/boost/fusion/sequence/io/out.hpp | 44 ++ .../boost/fusion/sequence/sequence_facade.hpp | 27 + include/boost/fusion/sequence/utility.hpp | 14 + include/boost/fusion/support.hpp | 22 + include/boost/fusion/support/category_of.hpp | 112 ++++ include/boost/fusion/support/deduce.hpp | 87 +++ .../boost/fusion/support/deduce_sequence.hpp | 43 ++ .../boost/fusion/support/detail/access.hpp | 55 ++ .../support/detail/as_fusion_element.hpp | 47 ++ .../fusion/support/detail/category_of.hpp | 19 + .../fusion/support/detail/is_mpl_sequence.hpp | 27 + .../boost/fusion/support/detail/is_view.hpp | 19 + .../support/detail/mpl_iterator_category.hpp | 66 +++ .../fusion/support/detail/unknown_key.hpp | 16 + .../fusion/support/ext_/is_segmented.hpp | 48 ++ include/boost/fusion/support/is_iterator.hpp | 20 + include/boost/fusion/support/is_sequence.hpp | 65 +++ include/boost/fusion/support/is_view.hpp | 63 +++ .../boost/fusion/support/iterator_base.hpp | 31 ++ include/boost/fusion/support/pair.hpp | 102 ++++ .../boost/fusion/support/sequence_base.hpp | 45 ++ include/boost/fusion/support/tag_of.hpp | 110 ++++ include/boost/fusion/support/tag_of_fwd.hpp | 20 + include/boost/fusion/support/unused.hpp | 62 +++ include/boost/fusion/support/void.hpp | 15 + include/boost/fusion/tuple.hpp | 15 + .../tuple/detail/tuple_forward_ctor.hpp | 39 ++ include/boost/fusion/tuple/make_tuple.hpp | 56 ++ include/boost/fusion/tuple/tuple.hpp | 72 +++ include/boost/fusion/tuple/tuple_fwd.hpp | 24 + include/boost/fusion/tuple/tuple_tie.hpp | 49 ++ include/boost/fusion/view.hpp | 17 + .../boost/fusion/view/ext_/multiple_view.hpp | 178 ++++++ .../fusion/view/ext_/segmented_iterator.hpp | 425 ++++++++++++++ .../view/ext_/segmented_iterator_range.hpp | 524 ++++++++++++++++++ include/boost/fusion/view/filter_view.hpp | 13 + .../view/filter_view/detail/begin_impl.hpp | 45 ++ .../view/filter_view/detail/deref_impl.hpp | 29 + .../view/filter_view/detail/end_impl.hpp | 44 ++ .../view/filter_view/detail/equal_to_impl.hpp | 34 ++ .../view/filter_view/detail/next_impl.hpp | 64 +++ .../view/filter_view/detail/size_impl.hpp | 38 ++ .../view/filter_view/detail/value_of_impl.hpp | 29 + .../fusion/view/filter_view/filter_view.hpp | 51 ++ .../view/filter_view/filter_view_iterator.hpp | 48 ++ include/boost/fusion/view/iterator_range.hpp | 12 + .../view/iterator_range/detail/at_impl.hpp | 44 ++ .../view/iterator_range/detail/begin_impl.hpp | 39 ++ .../view/iterator_range/detail/end_impl.hpp | 39 ++ .../iterator_range/detail/value_at_impl.hpp | 38 ++ .../view/iterator_range/iterator_range.hpp | 50 ++ include/boost/fusion/view/joint_view.hpp | 13 + .../view/joint_view/detail/begin_impl.hpp | 66 +++ .../view/joint_view/detail/deref_impl.hpp | 29 + .../view/joint_view/detail/end_impl.hpp | 40 ++ .../view/joint_view/detail/next_impl.hpp | 70 +++ .../view/joint_view/detail/value_of_impl.hpp | 29 + .../fusion/view/joint_view/joint_view.hpp | 61 ++ .../view/joint_view/joint_view_iterator.hpp | 52 ++ include/boost/fusion/view/repetitive_view.hpp | 15 + .../repetitive_view/detail/begin_impl.hpp | 49 ++ .../repetitive_view/detail/deref_impl.hpp | 44 ++ .../view/repetitive_view/detail/end_impl.hpp | 49 ++ .../view/repetitive_view/detail/next_impl.hpp | 90 +++ .../repetitive_view/detail/value_of_impl.hpp | 34 ++ .../view/repetitive_view/repetitive_view.hpp | 48 ++ .../repetitive_view/repetitive_view_fwd.hpp | 19 + .../repetitive_view_iterator.hpp | 51 ++ include/boost/fusion/view/reverse_view.hpp | 13 + .../view/reverse_view/detail/advance_impl.hpp | 47 ++ .../view/reverse_view/detail/begin_impl.hpp | 42 ++ .../view/reverse_view/detail/deref_impl.hpp | 48 ++ .../reverse_view/detail/distance_impl.hpp | 45 ++ .../view/reverse_view/detail/end_impl.hpp | 42 ++ .../view/reverse_view/detail/next_impl.hpp | 47 ++ .../view/reverse_view/detail/prior_impl.hpp | 47 ++ .../reverse_view/detail/value_of_impl.hpp | 42 ++ .../fusion/view/reverse_view/reverse_view.hpp | 58 ++ .../reverse_view/reverse_view_iterator.hpp | 49 ++ include/boost/fusion/view/single_view.hpp | 13 + .../view/single_view/detail/begin_impl.hpp | 42 ++ .../view/single_view/detail/deref_impl.hpp | 43 ++ .../view/single_view/detail/end_impl.hpp | 42 ++ .../view/single_view/detail/next_impl.hpp | 47 ++ .../view/single_view/detail/value_of_impl.hpp | 34 ++ .../fusion/view/single_view/single_view.hpp | 54 ++ .../view/single_view/single_view_iterator.hpp | 47 ++ include/boost/fusion/view/transform_view.hpp | 13 + .../transform_view/detail/advance_impl.hpp | 75 +++ .../detail/apply_transform_result.hpp | 37 ++ .../view/transform_view/detail/at_impl.hpp | 63 +++ .../view/transform_view/detail/begin_impl.hpp | 68 +++ .../view/transform_view/detail/deref_impl.hpp | 76 +++ .../transform_view/detail/distance_impl.hpp | 59 ++ .../view/transform_view/detail/end_impl.hpp | 68 +++ .../transform_view/detail/equal_to_impl.hpp | 42 ++ .../view/transform_view/detail/next_impl.hpp | 74 +++ .../view/transform_view/detail/prior_impl.hpp | 73 +++ .../transform_view/detail/value_at_impl.hpp | 53 ++ .../transform_view/detail/value_of_impl.hpp | 63 +++ .../view/transform_view/transform_view.hpp | 99 ++++ .../transform_view/transform_view_fwd.hpp | 22 + .../transform_view_iterator.hpp | 69 +++ include/boost/fusion/view/zip_view.hpp | 14 + .../view/zip_view/detail/advance_impl.hpp | 69 +++ .../fusion/view/zip_view/detail/at_impl.hpp | 92 +++ .../view/zip_view/detail/begin_impl.hpp | 92 +++ .../view/zip_view/detail/deref_impl.hpp | 83 +++ .../view/zip_view/detail/distance_impl.hpp | 82 +++ .../fusion/view/zip_view/detail/end_impl.hpp | 103 ++++ .../view/zip_view/detail/equal_to_impl.hpp | 62 +++ .../fusion/view/zip_view/detail/next_impl.hpp | 83 +++ .../view/zip_view/detail/prior_impl.hpp | 83 +++ .../fusion/view/zip_view/detail/size_impl.hpp | 35 ++ .../zip_view/detail/strictest_traversal.hpp | 68 +++ .../view/zip_view/detail/value_at_impl.hpp | 61 ++ .../view/zip_view/detail/value_of_impl.hpp | 61 ++ .../boost/fusion/view/zip_view/zip_view.hpp | 115 ++++ .../view/zip_view/zip_view_iterator.hpp | 47 ++ .../view/zip_view/zip_view_iterator_fwd.hpp | 22 + 476 files changed, 25709 insertions(+) create mode 100644 include/boost/fusion/adapted.hpp create mode 100644 include/boost/fusion/adapted/array.hpp create mode 100644 include/boost/fusion/adapted/array/array_iterator.hpp create mode 100644 include/boost/fusion/adapted/array/detail/at_impl.hpp create mode 100644 include/boost/fusion/adapted/array/detail/begin_impl.hpp create mode 100644 include/boost/fusion/adapted/array/detail/category_of_impl.hpp create mode 100644 include/boost/fusion/adapted/array/detail/end_impl.hpp create mode 100644 include/boost/fusion/adapted/array/detail/is_sequence_impl.hpp create mode 100644 include/boost/fusion/adapted/array/detail/is_view_impl.hpp create mode 100644 include/boost/fusion/adapted/array/detail/size_impl.hpp create mode 100644 include/boost/fusion/adapted/array/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/adapted/array/tag_of.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/adapted/boost_tuple/tag_of.hpp create mode 100644 include/boost/fusion/adapted/mpl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/at_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/begin_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/empty_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/end_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/size_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/adapted/mpl/mpl_iterator.hpp create mode 100644 include/boost/fusion/adapted/std_pair.hpp create mode 100644 include/boost/fusion/adapted/std_pair/detail/at_impl.hpp create mode 100644 include/boost/fusion/adapted/std_pair/detail/begin_impl.hpp create mode 100644 include/boost/fusion/adapted/std_pair/detail/category_of_impl.hpp create mode 100644 include/boost/fusion/adapted/std_pair/detail/end_impl.hpp create mode 100644 include/boost/fusion/adapted/std_pair/detail/is_sequence_impl.hpp create mode 100644 include/boost/fusion/adapted/std_pair/detail/is_view_impl.hpp create mode 100644 include/boost/fusion/adapted/std_pair/detail/size_impl.hpp create mode 100644 include/boost/fusion/adapted/std_pair/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/adapted/std_pair/std_pair_iterator.hpp create mode 100644 include/boost/fusion/adapted/std_pair/tag_of.hpp create mode 100644 include/boost/fusion/adapted/struct.hpp create mode 100644 include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp create mode 100644 include/boost/fusion/adapted/struct/adapt_struct.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/at_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/at_key_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/begin_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/category_of_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/end_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/has_key_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/is_view_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/size_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/detail/value_at_key_impl.hpp create mode 100644 include/boost/fusion/adapted/struct/extension.hpp create mode 100644 include/boost/fusion/adapted/struct/struct_iterator.hpp create mode 100644 include/boost/fusion/adapted/variant.hpp create mode 100644 include/boost/fusion/adapted/variant/detail/begin_impl.hpp create mode 100644 include/boost/fusion/adapted/variant/detail/category_of_impl.hpp create mode 100644 include/boost/fusion/adapted/variant/detail/end_impl.hpp create mode 100644 include/boost/fusion/adapted/variant/detail/is_sequence_impl.hpp create mode 100644 include/boost/fusion/adapted/variant/detail/is_view_impl.hpp create mode 100644 include/boost/fusion/adapted/variant/detail/size_impl.hpp create mode 100644 include/boost/fusion/adapted/variant/tag_of.hpp create mode 100644 include/boost/fusion/adapted/variant/variant_iterator.hpp create mode 100644 include/boost/fusion/algorithm.hpp create mode 100644 include/boost/fusion/algorithm/iteration.hpp create mode 100644 include/boost/fusion/algorithm/iteration/accumulate.hpp create mode 100644 include/boost/fusion/algorithm/iteration/detail/fold.hpp create mode 100644 include/boost/fusion/algorithm/iteration/detail/for_each.hpp create mode 100755 include/boost/fusion/algorithm/iteration/ext_/for_each_s.hpp create mode 100644 include/boost/fusion/algorithm/iteration/fold.hpp create mode 100644 include/boost/fusion/algorithm/iteration/for_each.hpp create mode 100644 include/boost/fusion/algorithm/query.hpp create mode 100644 include/boost/fusion/algorithm/query/all.hpp create mode 100644 include/boost/fusion/algorithm/query/any.hpp create mode 100644 include/boost/fusion/algorithm/query/count.hpp create mode 100644 include/boost/fusion/algorithm/query/count_if.hpp create mode 100644 include/boost/fusion/algorithm/query/detail/all.hpp create mode 100644 include/boost/fusion/algorithm/query/detail/any.hpp create mode 100644 include/boost/fusion/algorithm/query/detail/assoc_find.hpp create mode 100644 include/boost/fusion/algorithm/query/detail/count.hpp create mode 100644 include/boost/fusion/algorithm/query/detail/count_if.hpp create mode 100644 include/boost/fusion/algorithm/query/detail/find_if.hpp create mode 100755 include/boost/fusion/algorithm/query/ext_/find_if_s.hpp create mode 100644 include/boost/fusion/algorithm/query/find.hpp create mode 100644 include/boost/fusion/algorithm/query/find_if.hpp create mode 100644 include/boost/fusion/algorithm/query/none.hpp create mode 100644 include/boost/fusion/algorithm/transformation.hpp create mode 100644 include/boost/fusion/algorithm/transformation/clear.hpp create mode 100644 include/boost/fusion/algorithm/transformation/detail/replace.hpp create mode 100644 include/boost/fusion/algorithm/transformation/detail/replace_if.hpp create mode 100644 include/boost/fusion/algorithm/transformation/erase.hpp create mode 100644 include/boost/fusion/algorithm/transformation/erase_key.hpp create mode 100644 include/boost/fusion/algorithm/transformation/filter.hpp create mode 100644 include/boost/fusion/algorithm/transformation/filter_if.hpp create mode 100644 include/boost/fusion/algorithm/transformation/insert.hpp create mode 100644 include/boost/fusion/algorithm/transformation/insert_range.hpp create mode 100644 include/boost/fusion/algorithm/transformation/join.hpp create mode 100644 include/boost/fusion/algorithm/transformation/pop_back.hpp create mode 100644 include/boost/fusion/algorithm/transformation/pop_front.hpp create mode 100644 include/boost/fusion/algorithm/transformation/push_back.hpp create mode 100644 include/boost/fusion/algorithm/transformation/push_front.hpp create mode 100644 include/boost/fusion/algorithm/transformation/remove.hpp create mode 100644 include/boost/fusion/algorithm/transformation/remove_if.hpp create mode 100644 include/boost/fusion/algorithm/transformation/replace.hpp create mode 100644 include/boost/fusion/algorithm/transformation/replace_if.hpp create mode 100644 include/boost/fusion/algorithm/transformation/reverse.hpp create mode 100644 include/boost/fusion/algorithm/transformation/transform.hpp create mode 100644 include/boost/fusion/algorithm/transformation/zip.hpp create mode 100644 include/boost/fusion/container.hpp create mode 100644 include/boost/fusion/container/deque.hpp create mode 100644 include/boost/fusion/container/deque/back_extended_deque.hpp create mode 100644 include/boost/fusion/container/deque/convert.hpp create mode 100644 include/boost/fusion/container/deque/deque.hpp create mode 100644 include/boost/fusion/container/deque/deque_fwd.hpp create mode 100644 include/boost/fusion/container/deque/deque_iterator.hpp create mode 100644 include/boost/fusion/container/deque/detail/as_deque.hpp create mode 100644 include/boost/fusion/container/deque/detail/at_impl.hpp create mode 100644 include/boost/fusion/container/deque/detail/begin_impl.hpp create mode 100644 include/boost/fusion/container/deque/detail/convert_impl.hpp create mode 100644 include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp create mode 100644 include/boost/fusion/container/deque/detail/deque_initial_size.hpp create mode 100644 include/boost/fusion/container/deque/detail/deque_keyed_values.hpp create mode 100644 include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp create mode 100644 include/boost/fusion/container/deque/detail/end_impl.hpp create mode 100644 include/boost/fusion/container/deque/detail/keyed_element.hpp create mode 100644 include/boost/fusion/container/deque/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/container/deque/front_extended_deque.hpp create mode 100644 include/boost/fusion/container/deque/limits.hpp create mode 100755 include/boost/fusion/container/ext_/tree.hpp create mode 100644 include/boost/fusion/container/list.hpp create mode 100644 include/boost/fusion/container/list/cons.hpp create mode 100644 include/boost/fusion/container/list/cons_iterator.hpp create mode 100644 include/boost/fusion/container/list/convert.hpp create mode 100644 include/boost/fusion/container/list/detail/at_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/begin_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/build_cons.hpp create mode 100644 include/boost/fusion/container/list/detail/convert_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/deref_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/empty_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/end_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/equal_to_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/list_forward_ctor.hpp create mode 100644 include/boost/fusion/container/list/detail/list_to_cons.hpp create mode 100644 include/boost/fusion/container/list/detail/list_to_cons_call.hpp create mode 100644 include/boost/fusion/container/list/detail/next_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/container/list/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/container/list/limits.hpp create mode 100644 include/boost/fusion/container/list/list.hpp create mode 100644 include/boost/fusion/container/list/list_fwd.hpp create mode 100644 include/boost/fusion/container/map.hpp create mode 100644 include/boost/fusion/container/map/convert.hpp create mode 100644 include/boost/fusion/container/map/detail/as_map.hpp create mode 100644 include/boost/fusion/container/map/detail/at_key_impl.hpp create mode 100644 include/boost/fusion/container/map/detail/begin_impl.hpp create mode 100644 include/boost/fusion/container/map/detail/convert_impl.hpp create mode 100644 include/boost/fusion/container/map/detail/end_impl.hpp create mode 100644 include/boost/fusion/container/map/detail/lookup_key.hpp create mode 100644 include/boost/fusion/container/map/detail/map_forward_ctor.hpp create mode 100644 include/boost/fusion/container/map/detail/map_lookup.hpp create mode 100644 include/boost/fusion/container/map/detail/value_at_key_impl.hpp create mode 100644 include/boost/fusion/container/map/limits.hpp create mode 100644 include/boost/fusion/container/map/map.hpp create mode 100644 include/boost/fusion/container/map/map_fwd.hpp create mode 100644 include/boost/fusion/container/set.hpp create mode 100644 include/boost/fusion/container/set/convert.hpp create mode 100644 include/boost/fusion/container/set/detail/as_set.hpp create mode 100644 include/boost/fusion/container/set/detail/at_key_impl.hpp create mode 100644 include/boost/fusion/container/set/detail/begin_impl.hpp create mode 100644 include/boost/fusion/container/set/detail/convert_impl.hpp create mode 100644 include/boost/fusion/container/set/detail/end_impl.hpp create mode 100644 include/boost/fusion/container/set/detail/lookup_key.hpp create mode 100644 include/boost/fusion/container/set/detail/set_forward_ctor.hpp create mode 100644 include/boost/fusion/container/set/detail/set_lookup.hpp create mode 100644 include/boost/fusion/container/set/detail/value_at_key_impl.hpp create mode 100644 include/boost/fusion/container/set/limits.hpp create mode 100644 include/boost/fusion/container/set/set.hpp create mode 100644 include/boost/fusion/container/set/set_fwd.hpp create mode 100644 include/boost/fusion/container/vector.hpp create mode 100644 include/boost/fusion/container/vector/convert.hpp create mode 100644 include/boost/fusion/container/vector/detail/advance_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/as_vector.hpp create mode 100644 include/boost/fusion/container/vector/detail/at_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/begin_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/convert_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/deref_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/distance_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/end_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/equal_to_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/next_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/prior_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp create mode 100644 include/boost/fusion/container/vector/detail/vector_n.hpp create mode 100644 include/boost/fusion/container/vector/detail/vector_n_chooser.hpp create mode 100644 include/boost/fusion/container/vector/limits.hpp create mode 100644 include/boost/fusion/container/vector/vector.hpp create mode 100644 include/boost/fusion/container/vector/vector10.hpp create mode 100644 include/boost/fusion/container/vector/vector20.hpp create mode 100644 include/boost/fusion/container/vector/vector30.hpp create mode 100644 include/boost/fusion/container/vector/vector40.hpp create mode 100644 include/boost/fusion/container/vector/vector50.hpp create mode 100644 include/boost/fusion/container/vector/vector_fwd.hpp create mode 100644 include/boost/fusion/container/vector/vector_iterator.hpp create mode 100644 include/boost/fusion/functional.hpp create mode 100644 include/boost/fusion/functional/adapter.hpp create mode 100644 include/boost/fusion/functional/adapter/detail/access.hpp create mode 100644 include/boost/fusion/functional/adapter/detail/pow2_explode.hpp create mode 100644 include/boost/fusion/functional/adapter/detail/pt_def.hpp create mode 100644 include/boost/fusion/functional/adapter/detail/pt_undef.hpp create mode 100644 include/boost/fusion/functional/adapter/fused.hpp create mode 100644 include/boost/fusion/functional/adapter/fused_function_object.hpp create mode 100644 include/boost/fusion/functional/adapter/fused_procedure.hpp create mode 100644 include/boost/fusion/functional/adapter/limits.hpp create mode 100644 include/boost/fusion/functional/adapter/unfused_generic.hpp create mode 100644 include/boost/fusion/functional/adapter/unfused_lvalue_args.hpp create mode 100644 include/boost/fusion/functional/adapter/unfused_rvalue_args.hpp create mode 100644 include/boost/fusion/functional/adapter/unfused_typed.hpp create mode 100644 include/boost/fusion/functional/generation.hpp create mode 100644 include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp create mode 100644 include/boost/fusion/functional/generation/make_fused.hpp create mode 100644 include/boost/fusion/functional/generation/make_fused_function_object.hpp create mode 100644 include/boost/fusion/functional/generation/make_fused_procedure.hpp create mode 100644 include/boost/fusion/functional/generation/make_unfused_generic.hpp create mode 100644 include/boost/fusion/functional/generation/make_unfused_lvalue_args.hpp create mode 100644 include/boost/fusion/functional/generation/make_unfused_rvalue_args.hpp create mode 100644 include/boost/fusion/functional/invocation.hpp create mode 100644 include/boost/fusion/functional/invocation/detail/that_ptr.hpp create mode 100644 include/boost/fusion/functional/invocation/invoke.hpp create mode 100644 include/boost/fusion/functional/invocation/invoke_function_object.hpp create mode 100644 include/boost/fusion/functional/invocation/invoke_procedure.hpp create mode 100644 include/boost/fusion/functional/invocation/limits.hpp create mode 100644 include/boost/fusion/include/adapt_struct.hpp create mode 100644 include/boost/fusion/include/any.hpp create mode 100644 include/boost/fusion/include/as_vector.hpp create mode 100644 include/boost/fusion/include/at.hpp create mode 100644 include/boost/fusion/include/begin.hpp create mode 100644 include/boost/fusion/include/deref.hpp create mode 100644 include/boost/fusion/include/end.hpp create mode 100644 include/boost/fusion/include/equal_to.hpp create mode 100644 include/boost/fusion/include/filter_if.hpp create mode 100644 include/boost/fusion/include/for_each.hpp create mode 100644 include/boost/fusion/include/io.hpp create mode 100644 include/boost/fusion/include/is_sequence.hpp create mode 100644 include/boost/fusion/include/join.hpp create mode 100644 include/boost/fusion/include/joint_view.hpp create mode 100644 include/boost/fusion/include/list.hpp create mode 100644 include/boost/fusion/include/make_cons.hpp create mode 100644 include/boost/fusion/include/make_vector.hpp create mode 100644 include/boost/fusion/include/mpl.hpp create mode 100644 include/boost/fusion/include/next.hpp create mode 100644 include/boost/fusion/include/push_front.hpp create mode 100644 include/boost/fusion/include/single_view.hpp create mode 100644 include/boost/fusion/include/std_pair.hpp create mode 100644 include/boost/fusion/include/swap.hpp create mode 100644 include/boost/fusion/include/transform.hpp create mode 100644 include/boost/fusion/include/transform_view.hpp create mode 100644 include/boost/fusion/include/value_at.hpp create mode 100644 include/boost/fusion/include/value_of.hpp create mode 100644 include/boost/fusion/include/variant.hpp create mode 100644 include/boost/fusion/include/vector.hpp create mode 100644 include/boost/fusion/include/vector_tie.hpp create mode 100644 include/boost/fusion/iterator.hpp create mode 100644 include/boost/fusion/iterator/advance.hpp create mode 100644 include/boost/fusion/iterator/deref.hpp create mode 100644 include/boost/fusion/iterator/detail/adapt_deref_traits.hpp create mode 100644 include/boost/fusion/iterator/detail/adapt_value_traits.hpp create mode 100644 include/boost/fusion/iterator/detail/advance.hpp create mode 100644 include/boost/fusion/iterator/detail/distance.hpp create mode 100644 include/boost/fusion/iterator/distance.hpp create mode 100644 include/boost/fusion/iterator/equal_to.hpp create mode 100644 include/boost/fusion/iterator/iterator_facade.hpp create mode 100644 include/boost/fusion/iterator/mpl.hpp create mode 100644 include/boost/fusion/iterator/mpl/convert_iterator.hpp create mode 100644 include/boost/fusion/iterator/mpl/fusion_iterator.hpp create mode 100644 include/boost/fusion/iterator/next.hpp create mode 100644 include/boost/fusion/iterator/prior.hpp create mode 100644 include/boost/fusion/iterator/value_of.hpp create mode 100644 include/boost/fusion/mpl.hpp create mode 100644 include/boost/fusion/mpl/at.hpp create mode 100644 include/boost/fusion/mpl/back.hpp create mode 100644 include/boost/fusion/mpl/begin.hpp create mode 100644 include/boost/fusion/mpl/clear.hpp create mode 100644 include/boost/fusion/mpl/detail/clear.hpp create mode 100644 include/boost/fusion/mpl/empty.hpp create mode 100644 include/boost/fusion/mpl/end.hpp create mode 100644 include/boost/fusion/mpl/erase.hpp create mode 100644 include/boost/fusion/mpl/erase_key.hpp create mode 100644 include/boost/fusion/mpl/front.hpp create mode 100644 include/boost/fusion/mpl/has_key.hpp create mode 100644 include/boost/fusion/mpl/insert.hpp create mode 100644 include/boost/fusion/mpl/insert_range.hpp create mode 100644 include/boost/fusion/mpl/pop_back.hpp create mode 100644 include/boost/fusion/mpl/pop_front.hpp create mode 100644 include/boost/fusion/mpl/push_back.hpp create mode 100644 include/boost/fusion/mpl/push_front.hpp create mode 100644 include/boost/fusion/mpl/size.hpp create mode 100644 include/boost/fusion/sequence.hpp create mode 100644 include/boost/fusion/sequence/comparison.hpp create mode 100644 include/boost/fusion/sequence/comparison/detail/enable_comparison.hpp create mode 100644 include/boost/fusion/sequence/comparison/detail/equal_to.hpp create mode 100644 include/boost/fusion/sequence/comparison/detail/greater.hpp create mode 100644 include/boost/fusion/sequence/comparison/detail/greater_equal.hpp create mode 100644 include/boost/fusion/sequence/comparison/detail/less.hpp create mode 100644 include/boost/fusion/sequence/comparison/detail/less_equal.hpp create mode 100644 include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp create mode 100644 include/boost/fusion/sequence/comparison/equal_to.hpp create mode 100644 include/boost/fusion/sequence/comparison/greater.hpp create mode 100644 include/boost/fusion/sequence/comparison/greater_equal.hpp create mode 100644 include/boost/fusion/sequence/comparison/less.hpp create mode 100644 include/boost/fusion/sequence/comparison/less_equal.hpp create mode 100644 include/boost/fusion/sequence/comparison/not_equal_to.hpp create mode 100644 include/boost/fusion/sequence/convert.hpp create mode 100644 include/boost/fusion/sequence/generation.hpp create mode 100644 include/boost/fusion/sequence/generation/cons_tie.hpp create mode 100644 include/boost/fusion/sequence/generation/deque_tie.hpp create mode 100644 include/boost/fusion/sequence/generation/ignore.hpp create mode 100644 include/boost/fusion/sequence/generation/list_tie.hpp create mode 100644 include/boost/fusion/sequence/generation/make_cons.hpp create mode 100644 include/boost/fusion/sequence/generation/make_deque.hpp create mode 100644 include/boost/fusion/sequence/generation/make_list.hpp create mode 100644 include/boost/fusion/sequence/generation/make_map.hpp create mode 100644 include/boost/fusion/sequence/generation/make_set.hpp create mode 100644 include/boost/fusion/sequence/generation/make_vector.hpp create mode 100644 include/boost/fusion/sequence/generation/map_tie.hpp create mode 100644 include/boost/fusion/sequence/generation/pair_tie.hpp create mode 100644 include/boost/fusion/sequence/generation/vector_tie.hpp create mode 100644 include/boost/fusion/sequence/intrinsic.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/at.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/at_key.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/back.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/begin.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/empty.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/end.hpp create mode 100755 include/boost/fusion/sequence/intrinsic/ext_/segments.hpp create mode 100755 include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/front.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/has_key.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/size.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/swap.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/value_at.hpp create mode 100644 include/boost/fusion/sequence/intrinsic/value_at_key.hpp create mode 100644 include/boost/fusion/sequence/io.hpp create mode 100644 include/boost/fusion/sequence/io/detail/in.hpp create mode 100644 include/boost/fusion/sequence/io/detail/manip.hpp create mode 100644 include/boost/fusion/sequence/io/detail/out.hpp create mode 100644 include/boost/fusion/sequence/io/in.hpp create mode 100644 include/boost/fusion/sequence/io/out.hpp create mode 100644 include/boost/fusion/sequence/sequence_facade.hpp create mode 100644 include/boost/fusion/sequence/utility.hpp create mode 100644 include/boost/fusion/support.hpp create mode 100644 include/boost/fusion/support/category_of.hpp create mode 100644 include/boost/fusion/support/deduce.hpp create mode 100644 include/boost/fusion/support/deduce_sequence.hpp create mode 100644 include/boost/fusion/support/detail/access.hpp create mode 100644 include/boost/fusion/support/detail/as_fusion_element.hpp create mode 100644 include/boost/fusion/support/detail/category_of.hpp create mode 100644 include/boost/fusion/support/detail/is_mpl_sequence.hpp create mode 100644 include/boost/fusion/support/detail/is_view.hpp create mode 100644 include/boost/fusion/support/detail/mpl_iterator_category.hpp create mode 100644 include/boost/fusion/support/detail/unknown_key.hpp create mode 100755 include/boost/fusion/support/ext_/is_segmented.hpp create mode 100644 include/boost/fusion/support/is_iterator.hpp create mode 100644 include/boost/fusion/support/is_sequence.hpp create mode 100644 include/boost/fusion/support/is_view.hpp create mode 100644 include/boost/fusion/support/iterator_base.hpp create mode 100644 include/boost/fusion/support/pair.hpp create mode 100644 include/boost/fusion/support/sequence_base.hpp create mode 100644 include/boost/fusion/support/tag_of.hpp create mode 100644 include/boost/fusion/support/tag_of_fwd.hpp create mode 100644 include/boost/fusion/support/unused.hpp create mode 100644 include/boost/fusion/support/void.hpp create mode 100644 include/boost/fusion/tuple.hpp create mode 100644 include/boost/fusion/tuple/detail/tuple_forward_ctor.hpp create mode 100644 include/boost/fusion/tuple/make_tuple.hpp create mode 100644 include/boost/fusion/tuple/tuple.hpp create mode 100644 include/boost/fusion/tuple/tuple_fwd.hpp create mode 100644 include/boost/fusion/tuple/tuple_tie.hpp create mode 100644 include/boost/fusion/view.hpp create mode 100755 include/boost/fusion/view/ext_/multiple_view.hpp create mode 100755 include/boost/fusion/view/ext_/segmented_iterator.hpp create mode 100755 include/boost/fusion/view/ext_/segmented_iterator_range.hpp create mode 100644 include/boost/fusion/view/filter_view.hpp create mode 100644 include/boost/fusion/view/filter_view/detail/begin_impl.hpp create mode 100644 include/boost/fusion/view/filter_view/detail/deref_impl.hpp create mode 100644 include/boost/fusion/view/filter_view/detail/end_impl.hpp create mode 100644 include/boost/fusion/view/filter_view/detail/equal_to_impl.hpp create mode 100644 include/boost/fusion/view/filter_view/detail/next_impl.hpp create mode 100644 include/boost/fusion/view/filter_view/detail/size_impl.hpp create mode 100644 include/boost/fusion/view/filter_view/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/view/filter_view/filter_view.hpp create mode 100644 include/boost/fusion/view/filter_view/filter_view_iterator.hpp create mode 100644 include/boost/fusion/view/iterator_range.hpp create mode 100644 include/boost/fusion/view/iterator_range/detail/at_impl.hpp create mode 100644 include/boost/fusion/view/iterator_range/detail/begin_impl.hpp create mode 100644 include/boost/fusion/view/iterator_range/detail/end_impl.hpp create mode 100644 include/boost/fusion/view/iterator_range/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/view/iterator_range/iterator_range.hpp create mode 100644 include/boost/fusion/view/joint_view.hpp create mode 100644 include/boost/fusion/view/joint_view/detail/begin_impl.hpp create mode 100644 include/boost/fusion/view/joint_view/detail/deref_impl.hpp create mode 100644 include/boost/fusion/view/joint_view/detail/end_impl.hpp create mode 100644 include/boost/fusion/view/joint_view/detail/next_impl.hpp create mode 100644 include/boost/fusion/view/joint_view/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/view/joint_view/joint_view.hpp create mode 100644 include/boost/fusion/view/joint_view/joint_view_iterator.hpp create mode 100644 include/boost/fusion/view/repetitive_view.hpp create mode 100644 include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp create mode 100644 include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp create mode 100644 include/boost/fusion/view/repetitive_view/detail/end_impl.hpp create mode 100644 include/boost/fusion/view/repetitive_view/detail/next_impl.hpp create mode 100644 include/boost/fusion/view/repetitive_view/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/view/repetitive_view/repetitive_view.hpp create mode 100644 include/boost/fusion/view/repetitive_view/repetitive_view_fwd.hpp create mode 100644 include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp create mode 100644 include/boost/fusion/view/reverse_view.hpp create mode 100644 include/boost/fusion/view/reverse_view/detail/advance_impl.hpp create mode 100644 include/boost/fusion/view/reverse_view/detail/begin_impl.hpp create mode 100644 include/boost/fusion/view/reverse_view/detail/deref_impl.hpp create mode 100644 include/boost/fusion/view/reverse_view/detail/distance_impl.hpp create mode 100644 include/boost/fusion/view/reverse_view/detail/end_impl.hpp create mode 100644 include/boost/fusion/view/reverse_view/detail/next_impl.hpp create mode 100644 include/boost/fusion/view/reverse_view/detail/prior_impl.hpp create mode 100644 include/boost/fusion/view/reverse_view/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/view/reverse_view/reverse_view.hpp create mode 100644 include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp create mode 100644 include/boost/fusion/view/single_view.hpp create mode 100644 include/boost/fusion/view/single_view/detail/begin_impl.hpp create mode 100644 include/boost/fusion/view/single_view/detail/deref_impl.hpp create mode 100644 include/boost/fusion/view/single_view/detail/end_impl.hpp create mode 100644 include/boost/fusion/view/single_view/detail/next_impl.hpp create mode 100644 include/boost/fusion/view/single_view/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/view/single_view/single_view.hpp create mode 100644 include/boost/fusion/view/single_view/single_view_iterator.hpp create mode 100644 include/boost/fusion/view/transform_view.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/advance_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/apply_transform_result.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/at_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/begin_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/deref_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/distance_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/end_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/equal_to_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/next_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/prior_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/view/transform_view/transform_view.hpp create mode 100644 include/boost/fusion/view/transform_view/transform_view_fwd.hpp create mode 100644 include/boost/fusion/view/transform_view/transform_view_iterator.hpp create mode 100644 include/boost/fusion/view/zip_view.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/advance_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/at_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/begin_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/deref_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/distance_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/end_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/equal_to_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/next_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/prior_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/size_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/strictest_traversal.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/value_at_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/detail/value_of_impl.hpp create mode 100644 include/boost/fusion/view/zip_view/zip_view.hpp create mode 100644 include/boost/fusion/view/zip_view/zip_view_iterator.hpp create mode 100644 include/boost/fusion/view/zip_view/zip_view_iterator_fwd.hpp diff --git a/include/boost/fusion/adapted.hpp b/include/boost/fusion/adapted.hpp new file mode 100644 index 00000000..23693645 --- /dev/null +++ b/include/boost/fusion/adapted.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_ADAPTED_30122005_1420) +#define BOOST_FUSION_ADAPTED_30122005_1420 + +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/adapted/array.hpp b/include/boost/fusion/adapted/array.hpp new file mode 100644 index 00000000..2be9d4ba --- /dev/null +++ b/include/boost/fusion/adapted/array.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_ARRAY_27122005_1035) +#define BOOST_FUSION_ARRAY_27122005_1035 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/adapted/array/array_iterator.hpp b/include/boost/fusion/adapted/array/array_iterator.hpp new file mode 100644 index 00000000..dbad7763 --- /dev/null +++ b/include/boost/fusion/adapted/array/array_iterator.hpp @@ -0,0 +1,107 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_ARRAY_ITERATOR_26122005_2250) +#define BOOST_FUSION_ARRAY_ITERATOR_26122005_2250 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + template + struct array_iterator + : iterator_facade, random_access_traversal_tag> + { + BOOST_MPL_ASSERT_RELATION(Pos, >=, 0); + BOOST_MPL_ASSERT_RELATION(Pos, <=, Array::static_size); + + typedef mpl::int_ index; + typedef Array array_type; + + array_iterator(Array& a) + : array(a) {} + + Array& array; + + template + struct value_of + { + typedef typename Iterator::array_type array_type; + typedef typename array_type::value_type type; + }; + + template + struct deref + { + typedef typename Iterator::array_type array_type; + typedef typename + mpl::if_< + is_const + , typename array_type::const_reference + , typename array_type::reference + >::type + type; + + static type + call(Iterator const & it) + { + return it.array[Iterator::index::value]; + } + }; + + template + struct advance + { + typedef typename Iterator::index index; + typedef typename Iterator::array_type array_type; + typedef array_iterator type; + + static type + call(Iterator const& i) + { + return type(i.array); + } + }; + + template + struct next : advance > {}; + + template + struct prior : advance > {}; + + template + struct distance : mpl::minus + { + typedef typename + mpl::minus< + typename I2::index, typename I1::index + >::type + type; + + static type + call(I1 const&, I2 const&) + { + return type(); + } + }; + + private: + + array_iterator& operator=(array_iterator const&); + }; +}} + +#endif diff --git a/include/boost/fusion/adapted/array/detail/at_impl.hpp b/include/boost/fusion/adapted/array/detail/at_impl.hpp new file mode 100644 index 00000000..3c427059 --- /dev/null +++ b/include/boost/fusion/adapted/array/detail/at_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_IMPL_27122005_1241) +#define BOOST_FUSION_AT_IMPL_27122005_1241 + +#include + +#include + +namespace boost { namespace fusion { + + struct array_tag; + + namespace extension + { + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply + { + typedef typename mpl::if_< + is_const, + typename Sequence::const_reference, + typename Sequence::reference>::type type; + + static type + call(Sequence& seq) + { + return seq[N::value]; + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/array/detail/begin_impl.hpp b/include/boost/fusion/adapted/array/detail/begin_impl.hpp new file mode 100644 index 00000000..06dc8c51 --- /dev/null +++ b/include/boost/fusion/adapted/array/detail/begin_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BEGIN_IMPL_27122005_1117) +#define BOOST_FUSION_BEGIN_IMPL_27122005_1117 + +#include + +namespace boost { namespace fusion { + + struct array_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef array_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/array/detail/category_of_impl.hpp b/include/boost/fusion/adapted/array/detail/category_of_impl.hpp new file mode 100644 index 00000000..4c6b040e --- /dev/null +++ b/include/boost/fusion/adapted/array/detail/category_of_impl.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_27122005_1044) +#define BOOST_FUSION_CATEGORY_OF_IMPL_27122005_1044 + +#include + +namespace boost { namespace fusion { + + struct array_tag; + struct random_access_traversal_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + { + typedef random_access_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/array/detail/end_impl.hpp b/include/boost/fusion/adapted/array/detail/end_impl.hpp new file mode 100644 index 00000000..c9432c9b --- /dev/null +++ b/include/boost/fusion/adapted/array/detail/end_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_END_IMPL_27122005_1120) +#define BOOST_FUSION_END_IMPL_27122005_1120 + +#include + +namespace boost { namespace fusion { + + struct array_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef array_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/array/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/array/detail/is_sequence_impl.hpp new file mode 100644 index 00000000..a248c314 --- /dev/null +++ b/include/boost/fusion/adapted/array/detail/is_sequence_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1648) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1648 + +#include + +namespace boost { namespace fusion { + + struct array_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/array/detail/is_view_impl.hpp b/include/boost/fusion/adapted/array/detail/is_view_impl.hpp new file mode 100644 index 00000000..bc821fa6 --- /dev/null +++ b/include/boost/fusion/adapted/array/detail/is_view_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_VIEW_IMPL_27042006_2221) +#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2221 + +#include + +namespace boost { namespace fusion +{ + struct array_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::false_ + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/array/detail/size_impl.hpp b/include/boost/fusion/adapted/array/detail/size_impl.hpp new file mode 100644 index 00000000..63661573 --- /dev/null +++ b/include/boost/fusion/adapted/array/detail/size_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SIZE_IMPL_27122005_1251) +#define BOOST_FUSION_SIZE_IMPL_27122005_1251 + +namespace boost { namespace fusion { + + struct array_tag; + + namespace extension + { + template + struct size_impl; + + template<> + struct size_impl + { + template + struct apply : mpl::int_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/array/detail/value_at_impl.hpp b/include/boost/fusion/adapted/array/detail/value_at_impl.hpp new file mode 100644 index 00000000..f465b1d6 --- /dev/null +++ b/include/boost/fusion/adapted/array/detail/value_at_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_IMPL_27122005_1256) +#define BOOST_FUSION_VALUE_AT_IMPL_27122005_1256 + +namespace boost { namespace fusion { + + struct array_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename Sequence::value_type type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/array/tag_of.hpp b/include/boost/fusion/adapted/array/tag_of.hpp new file mode 100644 index 00000000..96f6d35c --- /dev/null +++ b/include/boost/fusion/adapted/array/tag_of.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_TAG_OF_27122005_1030) +#define FUSION_SEQUENCE_TAG_OF_27122005_1030 + +#include + +#include + +namespace boost +{ + template + class array; +} + +namespace boost { namespace fusion +{ + struct array_tag; + + namespace traits + { + template + struct tag_of > + { + typedef array_tag type; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple.hpp b/include/boost/fusion/adapted/boost_tuple.hpp new file mode 100644 index 00000000..2924df07 --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BOOST_TUPLE_09272006_0732) +#define BOOST_FUSION_BOOST_TUPLE_09272006_0732 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp b/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp new file mode 100644 index 00000000..fca135e5 --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp @@ -0,0 +1,149 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BOOST_TUPLE_ITERATOR_09262006_1851) +#define FUSION_BOOST_TUPLE_ITERATOR_09262006_1851 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct forward_traversal_tag; + + namespace detail + { + template + struct boost_tuple_is_empty : mpl::false_ {}; + + template <> + struct boost_tuple_is_empty : mpl::true_ {}; + + template <> + struct boost_tuple_is_empty : mpl::true_ {}; + + template <> + struct boost_tuple_is_empty > : mpl::true_ {}; + + template <> + struct boost_tuple_is_empty const> : mpl::true_ {}; + } + + template + struct boost_tuple_iterator + : iterator_facade, forward_traversal_tag> + { + typedef Cons cons_type; + + explicit boost_tuple_iterator(Cons& cons) + : cons(cons) {} + Cons& cons; + + template + struct value_of : mpl::identity {}; + + template + struct deref + { + typedef typename value_of::type element; + + typedef typename + mpl::if_< + is_const + , typename tuples::access_traits::const_type + , typename tuples::access_traits::non_const_type + >::type + type; + + static type + call(Iterator const& iter) + { + return iter.cons.get_head(); + } + }; + + template + struct next + { + typedef typename Iterator::cons_type cons_type; + typedef typename cons_type::tail_type tail_type; + + typedef boost_tuple_iterator< + typename mpl::eval_if< + is_const + , add_const + , mpl::identity + >::type> + type; + + static type + call(Iterator const& iter) + { + return type(iter.cons.get_tail()); + } + }; + }; + + template + struct boost_tuple_null_iterator + : iterator_facade, forward_traversal_tag> + { + typedef Null cons_type; + + template + struct equal_to + : mpl::or_< + is_same + , mpl::and_< + detail::boost_tuple_is_empty + , detail::boost_tuple_is_empty + > + > + {}; + }; + + template <> + struct boost_tuple_iterator + : boost_tuple_null_iterator + { + template + explicit boost_tuple_iterator(Cons const&) {} + }; + + template <> + struct boost_tuple_iterator + : boost_tuple_null_iterator + { + template + explicit boost_tuple_iterator(Cons const&) {} + }; + + template <> + struct boost_tuple_iterator > + : boost_tuple_null_iterator > + { + template + explicit boost_tuple_iterator(Cons const&) {} + }; + + template <> + struct boost_tuple_iterator const> + : boost_tuple_null_iterator const> + { + template + explicit boost_tuple_iterator(Cons const&) {} + }; +}} + +#endif + + diff --git a/include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp b/include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp new file mode 100644 index 00000000..b594dfd8 --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_IMPL_09262006_1920) +#define BOOST_FUSION_AT_IMPL_09262006_1920 + +#include +#include + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef typename + tuples::element::type + element; + + typedef typename + mpl::if_< + is_const + , typename tuples::access_traits::const_type + , typename tuples::access_traits::non_const_type + >::type + type; + + static type + call(Sequence& seq) + { + return tuples::get(seq); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp b/include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp new file mode 100644 index 00000000..ee9a89eb --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BEGIN_IMPL_09272006_0719) +#define BOOST_FUSION_BEGIN_IMPL_09272006_0719 + +#include + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef boost_tuple_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp b/include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp new file mode 100644 index 00000000..34f48b1e --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726) +#define BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726 + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + struct forward_traversal_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + { + typedef forward_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp b/include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp new file mode 100644 index 00000000..2fb27a7a --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_END_IMPL_09272006_0721) +#define BOOST_FUSION_END_IMPL_09272006_0721 + +#include +#include +#include + +namespace boost { namespace tuples +{ + struct null_type; +}} + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef + boost_tuple_iterator< + typename mpl::if_< + is_const + , tuples::null_type const + , tuples::null_type + >::type + > + type; + + static type + call(Sequence& seq) + { + return type(seq); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp new file mode 100644 index 00000000..43d73115 --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_09272006_0726) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_09272006_0726 + +#include + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp b/include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp new file mode 100644 index 00000000..2927df7b --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_VIEW_IMPL_09272006_0725) +#define BOOST_FUSION_IS_VIEW_IMPL_09272006_0725 + +#include + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::false_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp b/include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp new file mode 100644 index 00000000..167a5035 --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SIZE_IMPL_09272006_0724) +#define BOOST_FUSION_SIZE_IMPL_09272006_0724 + +#include +#include + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply : mpl::int_::value> {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp b/include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp new file mode 100644 index 00000000..d46d51e5 --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_IMPL_09262006_1926) +#define BOOST_FUSION_VALUE_AT_IMPL_09262006_1926 + +#include + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply : tuples::element {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/boost_tuple/tag_of.hpp b/include/boost/fusion/adapted/boost_tuple/tag_of.hpp new file mode 100644 index 00000000..a1a27aa7 --- /dev/null +++ b/include/boost/fusion/adapted/boost_tuple/tag_of.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_TAG_OF_09262006_1900) +#define BOOST_FUSION_TAG_OF_09262006_1900 + +#include + +namespace boost { namespace tuples +{ + struct null_type; + + template < + class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7, class T8, class T9 + > + class tuple; + + template + struct cons; +}} + +namespace boost { namespace fusion +{ + struct boost_tuple_tag; + + namespace traits + { + template < + class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7, class T8, class T9 + > + struct tag_of > + { + typedef boost_tuple_tag type; + }; + + template + struct tag_of > + { + typedef boost_tuple_tag type; + }; + + template <> + struct tag_of + { + typedef boost_tuple_tag type; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl.hpp b/include/boost/fusion/adapted/mpl.hpp new file mode 100644 index 00000000..f8257846 --- /dev/null +++ b/include/boost/fusion/adapted/mpl.hpp @@ -0,0 +1,21 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_MPL_31122005_1152) +#define BOOST_FUSION_MPL_31122005_1152 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/at_impl.hpp b/include/boost/fusion/adapted/mpl/detail/at_impl.hpp new file mode 100644 index 00000000..6f3be1c6 --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/at_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_IMPL_31122005_1642) +#define BOOST_FUSION_AT_IMPL_31122005_1642 + +#include + +namespace boost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef typename mpl::at::type type; + + static type + call(Sequence) + { + return type(); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/begin_impl.hpp b/include/boost/fusion/adapted/mpl/detail/begin_impl.hpp new file mode 100644 index 00000000..1ec77d8b --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/begin_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BEGIN_IMPL_31122005_1209) +#define BOOST_FUSION_BEGIN_IMPL_31122005_1209 + +#include +#include +#include + +namespace boost { namespace fusion { + + struct mpl_sequence_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename mpl::begin< + typename remove_const::type + >::type iterator; + typedef mpl_iterator type; + + static type + call(Sequence) + { + return type(); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp b/include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp new file mode 100644 index 00000000..ad68fcc9 --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_20060217_2141) +#define BOOST_FUSION_CATEGORY_OF_IMPL_20060217_2141 + +#include +#include +#include +#include + +namespace boost { namespace fusion { + + namespace detail + { + template + struct mpl_sequence_category_of + { + // assumes T is an mpl sequence + // there should be no way this will ever be + // called where T is an mpl iterator + + BOOST_STATIC_ASSERT(mpl::is_sequence::value); + typedef typename + mpl_iterator_category< + typename mpl::begin::type::category + >::type + type; + }; + } + + struct mpl_sequence_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + : detail::mpl_sequence_category_of + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/empty_impl.hpp b/include/boost/fusion/adapted/mpl/detail/empty_impl.hpp new file mode 100644 index 00000000..14e8dfa2 --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/empty_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_EMPTY_IMPL_31122005_1554) +#define BOOST_FUSION_EMPTY_IMPL_31122005_1554 + +#include + +namespace boost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template <> + struct empty_impl + { + template + struct apply : mpl::empty {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/end_impl.hpp b/include/boost/fusion/adapted/mpl/detail/end_impl.hpp new file mode 100644 index 00000000..e3466956 --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/end_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_END_IMPL_31122005_1237) +#define BOOST_FUSION_END_IMPL_31122005_1237 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename mpl::end< + typename remove_const::type + >::type iterator; + typedef mpl_iterator type; + + static type + call(Sequence) + { + return type(); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp b/include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp new file mode 100644 index 00000000..bfecbc73 --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_HAS_KEY_IMPL_31122005_1647) +#define BOOST_FUSION_HAS_KEY_IMPL_31122005_1647 + +#include + +namespace boost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct has_key_impl; + + template <> + struct has_key_impl + { + template + struct apply : mpl::has_key {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp new file mode 100644 index 00000000..bf9b349c --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_31122005_1505) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_31122005_1505 + +#include + +namespace boost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp b/include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp new file mode 100644 index 00000000..5ae48c90 --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_VIEW_IMPL_03202006_0048) +#define BOOST_FUSION_IS_VIEW_IMPL_03202006_0048 + +#include + +namespace boost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::true_ + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/size_impl.hpp b/include/boost/fusion/adapted/mpl/detail/size_impl.hpp new file mode 100644 index 00000000..62893517 --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/size_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SIZE_IMPL_31122005_1508) +#define BOOST_FUSION_SIZE_IMPL_31122005_1508 + +#include + +namespace boost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply : mpl::size {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp b/include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp new file mode 100644 index 00000000..5f39e4eb --- /dev/null +++ b/include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_IMPL_31122005_1621) +#define BOOST_FUSION_VALUE_AT_IMPL_31122005_1621 + +#include + +namespace boost { namespace fusion +{ + struct mpl_sequence_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply : mpl::at {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/mpl/mpl_iterator.hpp b/include/boost/fusion/adapted/mpl/mpl_iterator.hpp new file mode 100644 index 00000000..c99b5804 --- /dev/null +++ b/include/boost/fusion/adapted/mpl/mpl_iterator.hpp @@ -0,0 +1,113 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_MPL_ITERATOR_05052005_0731) +#define FUSION_MPL_ITERATOR_05052005_0731 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + template + struct mpl_iterator + : iterator_facade< + mpl_iterator + , typename detail::mpl_iterator_category::type + > + { + typedef typename remove_const::type iterator_type; + + template + struct value_of : mpl::deref {}; + + template + struct deref + { + typedef typename mpl::deref< + typename Iterator::iterator_type>::type + type; + + static type + call(Iterator) + { + return type(); + } + }; + + template + struct next + { + typedef mpl_iterator< + typename mpl::next::type> + type; + + static type + call(Iterator) + { + return type(); + } + }; + + template + struct prior + { + typedef mpl_iterator< + typename mpl::prior::type> + type; + + static type + call(Iterator) + { + return type(); + } + }; + + template + struct advance + { + typedef mpl_iterator< + typename mpl::advance::type> + type; + + static type + call(Iterator const& i) + { + return type(); + } + }; + + template + struct distance : + mpl::distance< + typename I1::iterator_type + , typename I2::iterator_type> + { + typedef typename + mpl::distance< + typename I1::iterator_type + , typename I2::iterator_type + >::type + type; + + static type + call(I1 const&, I2 const&) + { + return type(); + } + }; + }; +}} + +#endif + + diff --git a/include/boost/fusion/adapted/std_pair.hpp b/include/boost/fusion/adapted/std_pair.hpp new file mode 100644 index 00000000..d13b810a --- /dev/null +++ b/include/boost/fusion/adapted/std_pair.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_STD_PAIR_24122005_1744) +#define BOOST_FUSION_STD_PAIR_24122005_1744 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace traits + { + template + struct tag_of > + { + typedef struct_tag type; + }; + } + + namespace extension + { + template + struct struct_member; + + template + struct struct_size; + + template + struct struct_member, 0> + { + typedef T1 type; + + static type& call(std::pair& pair) + { + return pair.first; + } + }; + + template + struct struct_member, 1> + { + typedef T2 type; + + static type& call(std::pair& pair) + { + return pair.second; + } + }; + + template + struct struct_size > : mpl::int_<2> + { + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/detail/at_impl.hpp b/include/boost/fusion/adapted/std_pair/detail/at_impl.hpp new file mode 100644 index 00000000..2f26fa68 --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/detail/at_impl.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_IMPL_24122005_1807) +#define BOOST_FUSION_AT_IMPL_24122005_1807 + +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct std_pair_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + static int const n_value = N::value; + BOOST_STATIC_ASSERT((n_value >= 0 && n_value < 2)); + typedef typename + mpl::if_c< + (n_value == 0) + , typename Sequence::first_type + , typename Sequence::second_type + > + element; + + typedef typename + mpl::eval_if< + is_const + , detail::cref_result + , detail::ref_result + >::type + type; + + template + static RT get(Sequence& p, mpl::int_<0>) + { + return p.first; + } + + template + static RT get(Sequence& p, mpl::int_<1>) + { + return p.second; + } + + static type + call(Sequence& p) + { + return get(p, N()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/detail/begin_impl.hpp b/include/boost/fusion/adapted/std_pair/detail/begin_impl.hpp new file mode 100644 index 00000000..1fd48f51 --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/detail/begin_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BEGIN_IMPL_24122005_1752) +#define BOOST_FUSION_BEGIN_IMPL_24122005_1752 + +#include + +namespace boost { namespace fusion { + + struct std_pair_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef std_pair_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/detail/category_of_impl.hpp b/include/boost/fusion/adapted/std_pair/detail/category_of_impl.hpp new file mode 100644 index 00000000..f207c1c7 --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/detail/category_of_impl.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731) +#define BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731 + +#include + +namespace boost { namespace fusion { + + struct std_pair_tag; + struct random_access_traversal_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + { + typedef random_access_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/detail/end_impl.hpp b/include/boost/fusion/adapted/std_pair/detail/end_impl.hpp new file mode 100644 index 00000000..747f2c6f --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/detail/end_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_END_IMPL_24122005_1755) +#define BOOST_FUSION_END_IMPL_24122005_1755 + +#include + +namespace boost { namespace fusion { + + struct std_pair_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef std_pair_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/std_pair/detail/is_sequence_impl.hpp new file mode 100644 index 00000000..1c669a68 --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/detail/is_sequence_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651 + +#include + +namespace boost { namespace fusion { + + struct std_pair_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/detail/is_view_impl.hpp b/include/boost/fusion/adapted/std_pair/detail/is_view_impl.hpp new file mode 100644 index 00000000..94842bc0 --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/detail/is_view_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_VIEW_IMPL_27042006_2219) +#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2219 + +#include + +namespace boost { namespace fusion +{ + struct std_pair_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::false_ + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/detail/size_impl.hpp b/include/boost/fusion/adapted/std_pair/detail/size_impl.hpp new file mode 100644 index 00000000..5f35bffd --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/detail/size_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SIZE_IMPL_24122005_1759) +#define BOOST_FUSION_SIZE_IMPL_24122005_1759 + +#include + +namespace boost { namespace fusion { + + struct std_pair_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply : mpl::int_<2> {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/detail/value_at_impl.hpp b/include/boost/fusion/adapted/std_pair/detail/value_at_impl.hpp new file mode 100644 index 00000000..16047ec9 --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/detail/value_at_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_IMPL_24122005_1917) +#define BOOST_FUSION_VALUE_AT_IMPL_24122005_1917 + +#include +#include + +namespace boost { namespace fusion { + + struct std_pair_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + static int const n_value = N::value; + BOOST_STATIC_ASSERT((n_value >= 0 && n_value < 2)); + typedef typename + mpl::if_c< + (n_value == 0) + , typename Sequence::first_type + , typename Sequence::second_type + >::type + type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/std_pair/std_pair_iterator.hpp b/include/boost/fusion/adapted/std_pair/std_pair_iterator.hpp new file mode 100644 index 00000000..4aa2daa2 --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/std_pair_iterator.hpp @@ -0,0 +1,127 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_STD_PAIR_ITERATOR_09262005_0934) +#define FUSION_STD_PAIR_ITERATOR_09262005_0934 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + template + struct std_pair_iterator + : iterator_facade, random_access_traversal_tag> + { + BOOST_MPL_ASSERT_RELATION(N_, >=, 0); + BOOST_MPL_ASSERT_RELATION(N_, <=, 2); + + typedef mpl::int_ index; + typedef Pair_ pair_type; + + std_pair_iterator(Pair_& pair) + : pair(pair) {} + Pair_& pair; + + template + struct value_of; + + template + struct value_of > + : mpl::identity {}; + + template + struct value_of > + : mpl::identity {}; + + template + struct deref; + + template + struct deref > + { + typedef typename + mpl::if_< + is_const + , typename Pair::first_type const& + , typename Pair::first_type& + >::type + type; + + static type + call(std_pair_iterator const& iter) + { + return iter.pair.first; + } + }; + + template + struct deref > + { + typedef typename + mpl::if_< + is_const + , typename Pair::second_type const& + , typename Pair::second_type& + >::type + type; + + static type + call(std_pair_iterator const& iter) + { + return iter.pair.second; + } + }; + + template + struct advance + { + typedef typename Iterator::index index; + typedef typename Iterator::pair_type pair_type; + typedef std_pair_iterator type; + + static type + call(Iterator const& iter) + { + return type(iter.pair); + } + }; + + template + struct next : advance > {}; + + template + struct prior : advance > {}; + + template + struct distance : mpl::minus + { + typedef typename + mpl::minus< + typename I2::index, typename I1::index + >::type + type; + + static type + call(I1 const&, I2 const&) + { + return type(); + } + }; + }; +}} + +#endif + + diff --git a/include/boost/fusion/adapted/std_pair/tag_of.hpp b/include/boost/fusion/adapted/std_pair/tag_of.hpp new file mode 100644 index 00000000..3211efad --- /dev/null +++ b/include/boost/fusion/adapted/std_pair/tag_of.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_TAG_OF_24122005_1722) +#define BOOST_FUSION_TAG_OF_24122005_1722 + +#include + +#include + +namespace boost { namespace fusion { + + struct std_pair_tag; + + namespace traits + { + template + struct tag_of > + { + typedef std_pair_tag type; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct.hpp b/include/boost/fusion/adapted/struct.hpp new file mode 100644 index 00000000..4b36f179 --- /dev/null +++ b/include/boost/fusion/adapted/struct.hpp @@ -0,0 +1,23 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_STRUCT_24122005_1744) +#define BOOST_FUSION_STD_STRUCT_24122005_1744 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp new file mode 100644 index 00000000..e621187f --- /dev/null +++ b/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -0,0 +1,94 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_ADAPT_ASSOC_STRUCT_20070508_2207) +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_20070508_2207 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace extension { + template + struct struct_assoc_member; +}}} + + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(name, bseq) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_I( \ + name, BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_X bseq, 0)) \ + /***/ + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_X(x, y, z) ((x, y, z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y(x, y, z) ((x, y, z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_X +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_X0 +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y0 + +// BOOST_FUSION_ADAPT_ASSOC_STRUCT_I generates the overarching structure and uses +// SEQ_FOR_EACH_I to generate the "linear" substructures. +// Thanks to Paul Mensonides for the PP macro help + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_I(name, seq) \ + namespace boost { namespace fusion { namespace traits \ + { \ + template <> \ + struct tag_of \ + { \ + typedef struct_tag type; \ + }; \ + }}} \ + namespace boost { namespace fusion { namespace extension \ + { \ + template <> \ + struct struct_size : mpl::int_ {}; \ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_ASSOC_STRUCT_C, name, seq) \ + }}} \ + /***/ + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C(r, name, i, xy) \ + template <> \ + struct struct_member \ + { \ + typedef BOOST_PP_TUPLE_ELEM(3, 0, xy) type; \ + static type& call(name& struct_) \ + { \ + return struct_.BOOST_PP_TUPLE_ELEM(3, 1, xy); \ + }; \ + }; \ + template<> \ + struct struct_assoc_member \ + { \ + typedef BOOST_PP_TUPLE_ELEM(3, 0, xy) type; \ + static type& call(name& struct_) \ + { \ + return struct_.BOOST_PP_TUPLE_ELEM(3, 1, xy); \ + }; \ + }; + /***/ + +#endif diff --git a/include/boost/fusion/adapted/struct/adapt_struct.hpp b/include/boost/fusion/adapted/struct/adapt_struct.hpp new file mode 100644 index 00000000..e8eb6a67 --- /dev/null +++ b/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_ADAPT_STRUCT_APRIL_2_2007_1158AM) +#define BOOST_FUSION_ADAPT_STRUCT_APRIL_2_2007_1158AM + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_FUSION_ADAPT_STRUCT(name, bseq) \ + BOOST_FUSION_ADAPT_STRUCT_I( \ + name, BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_X bseq, 0)) \ + /***/ + +#define BOOST_FUSION_ADAPT_STRUCT_X(x, y) ((x, y)) BOOST_FUSION_ADAPT_STRUCT_Y +#define BOOST_FUSION_ADAPT_STRUCT_Y(x, y) ((x, y)) BOOST_FUSION_ADAPT_STRUCT_X +#define BOOST_FUSION_ADAPT_STRUCT_X0 +#define BOOST_FUSION_ADAPT_STRUCT_Y0 + +// BOOST_FUSION_ADAPT_STRUCT_I generates the overarching structure and uses +// SEQ_FOR_EACH_I to generate the "linear" substructures. +// Thanks to Paul Mensonides for the PP macro help + +#define BOOST_FUSION_ADAPT_STRUCT_I(name, seq) \ + namespace boost { namespace fusion { namespace traits \ + { \ + template <> \ + struct tag_of \ + { \ + typedef struct_tag type; \ + }; \ + }}} \ + namespace boost { namespace fusion { namespace extension \ + { \ + template <> \ + struct struct_size : mpl::int_ {}; \ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_STRUCT_C, name, seq) \ + }}} \ + /***/ + +#define BOOST_FUSION_ADAPT_STRUCT_C(r, name, i, xy) \ + template <> \ + struct struct_member \ + { \ + typedef BOOST_PP_TUPLE_ELEM(2, 0, xy) type; \ + static type& call(name& struct_) \ + { \ + return struct_.BOOST_PP_TUPLE_ELEM(2, 1, xy); \ + }; \ + }; \ + /***/ + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/at_impl.hpp b/include/boost/fusion/adapted/struct/detail/at_impl.hpp new file mode 100644 index 00000000..809902ae --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/at_impl.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_IMPL_24122005_1807) +#define BOOST_FUSION_AT_IMPL_24122005_1807 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace extension + { + template + struct at_impl; + + template + struct struct_member; + + template + struct struct_size; + + template <> + struct at_impl + { + template + struct apply + { + static int const n_value = N::value; + BOOST_MPL_ASSERT_RELATION( + n_value, <=, extension::struct_size::value); + + typedef typename + extension::struct_member + element; + + typedef typename + mpl::eval_if< + is_const + , detail::cref_result + , detail::ref_result + >::type + type; + + static type + call(Sequence& seq) + { + return extension:: + struct_member::call(seq); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/at_key_impl.hpp b/include/boost/fusion/adapted/struct/detail/at_key_impl.hpp new file mode 100644 index 00000000..4ce0fce9 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/at_key_impl.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2005-2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_KEY_IMPL_20070508_2248) +#define BOOST_FUSION_AT_KEY_IMPL_20070508_2248 + +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace extension + { + template + struct at_key_impl; + + template + struct struct_assoc_member; + + template <> + struct at_key_impl + { + template + struct apply + { + typedef typename + extension::struct_assoc_member + element; + + typedef typename + mpl::eval_if< + is_const + , detail::cref_result + , detail::ref_result + >::type + type; + + static type + call(Sequence& seq) + { + return extension:: + struct_assoc_member::call(seq); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/begin_impl.hpp b/include/boost/fusion/adapted/struct/detail/begin_impl.hpp new file mode 100644 index 00000000..bf5a00bc --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/begin_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BEGIN_IMPL_24122005_1752) +#define BOOST_FUSION_BEGIN_IMPL_24122005_1752 + +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef struct_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp b/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp new file mode 100644 index 00000000..9e7f9df4 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731) +#define BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731 + +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + struct random_access_traversal_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + { + typedef random_access_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/end_impl.hpp b/include/boost/fusion/adapted/struct/detail/end_impl.hpp new file mode 100644 index 00000000..42d7f394 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/end_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_END_IMPL_24122005_1755) +#define BOOST_FUSION_END_IMPL_24122005_1755 + +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef struct_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/has_key_impl.hpp b/include/boost/fusion/adapted/struct/detail/has_key_impl.hpp new file mode 100644 index 00000000..8972f5df --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/has_key_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2005-2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_HAS_KEY_IMPL_20070508_2231) +#define BOOST_FUSION_HAS_KEY_IMPL_20070508_2231 + +#include +#include + +namespace boost { namespace fusion { + + struct struct_tag; + + namespace extension + { + struct no_such_member; + + template + struct has_key_impl; + + template + struct struct_assoc_member; + + template<> + struct has_key_impl + { + template + struct apply + : mpl::not_::type> > + { + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp new file mode 100644 index 00000000..f81e9fb6 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651 + +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp b/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp new file mode 100644 index 00000000..da6f380b --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_VIEW_IMPL_27042006_2219) +#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2219 + +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::false_ + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/size_impl.hpp b/include/boost/fusion/adapted/struct/detail/size_impl.hpp new file mode 100644 index 00000000..12ec14ba --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/size_impl.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SIZE_IMPL_24122005_1759) +#define BOOST_FUSION_SIZE_IMPL_24122005_1759 + +#include + +namespace boost { namespace fusion +{ + namespace extension + { + template + struct struct_size; + } + + struct struct_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply : extension::struct_size {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp b/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp new file mode 100644 index 00000000..8f5d97a0 --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_IMPL_24122005_1917) +#define BOOST_FUSION_VALUE_AT_IMPL_24122005_1917 + +#include +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace extension + { + template + struct value_at_impl; + + template + struct struct_member; + + template + struct struct_size; + + template <> + struct value_at_impl + { + template + struct apply + { + static int const n_value = N::value; + BOOST_MPL_ASSERT_RELATION( + n_value, <=, extension::struct_size::value); + + typedef typename + extension::struct_member::type + type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/detail/value_at_key_impl.hpp b/include/boost/fusion/adapted/struct/detail/value_at_key_impl.hpp new file mode 100644 index 00000000..b1b3dcfb --- /dev/null +++ b/include/boost/fusion/adapted/struct/detail/value_at_key_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2005-2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_KEY_IMPL_20070508_2300) +#define BOOST_FUSION_VALUE_AT_KEY_IMPL_20070508_2300 + +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + + namespace extension + { + template + struct value_at_key_impl; + + template + struct struct_assoc_member; + + template <> + struct value_at_key_impl + { + template + struct apply + { + typedef typename + extension::struct_assoc_member::type + type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/struct/extension.hpp b/include/boost/fusion/adapted/struct/extension.hpp new file mode 100644 index 00000000..da084498 --- /dev/null +++ b/include/boost/fusion/adapted/struct/extension.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_STRUCT_EXTENSION_APRIL_2_2007_1008AM) +#define FUSION_STRUCT_EXTENSION_APRIL_2_2007_1008AM + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct struct_member; + + template + struct struct_size; + + template + struct struct_member + { + typedef typename + add_const::type>::type + type; + + static type& + call(Struct const& struct_) + { + return struct_member::call( + const_cast(struct_)); + } + }; + + template + struct struct_size + : struct_size + {}; + + struct no_such_member; + + template + struct struct_assoc_member + { + typedef no_such_member type; + }; + + template + struct struct_assoc_member + { + typedef typename + add_const::type>::type + type; + + static type& + call(Struct const& struct_) + { + return struct_assoc_member::call( + const_cast(struct_)); + } + }; + +}}} + +#endif + + diff --git a/include/boost/fusion/adapted/struct/struct_iterator.hpp b/include/boost/fusion/adapted/struct/struct_iterator.hpp new file mode 100644 index 00000000..caea895b --- /dev/null +++ b/include/boost/fusion/adapted/struct/struct_iterator.hpp @@ -0,0 +1,103 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_STRUCT_ITERATOR_APRIL_2_2007_1008AM) +#define FUSION_STRUCT_ITERATOR_APRIL_2_2007_1008AM + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + template + struct struct_iterator + : iterator_facade, random_access_traversal_tag> + { + BOOST_MPL_ASSERT_RELATION(N_, >=, 0); + BOOST_MPL_ASSERT_RELATION(N_, <=, extension::struct_size::value); + + typedef mpl::int_ index; + typedef Struct struct_type; + + struct_iterator(Struct& struct_) + : struct_(struct_) {} + Struct& struct_; + + template + struct value_of + : extension::struct_member + { + }; + + template + struct deref + { + typedef typename + add_reference< + typename extension::struct_member::type + >::type + type; + + static type + call(Iterator const& iter) + { + return extension::struct_member:: + call(iter.struct_); + } + }; + + template + struct advance + { + typedef typename Iterator::index index; + typedef typename Iterator::struct_type struct_type; + typedef struct_iterator type; + + static type + call(Iterator const& iter) + { + return type(iter.struct_); + } + }; + + template + struct next : advance > {}; + + template + struct prior : advance > {}; + + template + struct distance : mpl::minus + { + typedef typename + mpl::minus< + typename I2::index, typename I1::index + >::type + type; + + static type + call(I1 const&, I2 const&) + { + return type(); + } + }; + }; +}} + +#endif + + diff --git a/include/boost/fusion/adapted/variant.hpp b/include/boost/fusion/adapted/variant.hpp new file mode 100644 index 00000000..5e711c17 --- /dev/null +++ b/include/boost/fusion/adapted/variant.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_12112006_1614) +#define BOOST_FUSION_VARIANT_12112006_1614 + +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/adapted/variant/detail/begin_impl.hpp b/include/boost/fusion/adapted/variant/detail/begin_impl.hpp new file mode 100644 index 00000000..dc9e2e7f --- /dev/null +++ b/include/boost/fusion/adapted/variant/detail/begin_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_BEGIN_IMPL_12112006_2137) +#define BOOST_FUSION_VARIANT_BEGIN_IMPL_12112006_2137 + +#include + +namespace boost { namespace fusion { + + struct variant_tag; + + template + struct variant_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef variant_iterator< + Seq, + typename mpl::begin::type> type; + + static type + call(Seq& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/variant/detail/category_of_impl.hpp b/include/boost/fusion/adapted/variant/detail/category_of_impl.hpp new file mode 100644 index 00000000..d81d9b3b --- /dev/null +++ b/include/boost/fusion/adapted/variant/detail/category_of_impl.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_CATEGORY_OF_IMPL_13112006_0802) +#define BOOST_FUSION_VARIANT_CATEGORY_OF_IMPL_13112006_0802 + +namespace boost { namespace fusion { + + struct variant_tag; + struct forward_traversal_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + { + typedef forward_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/variant/detail/end_impl.hpp b/include/boost/fusion/adapted/variant/detail/end_impl.hpp new file mode 100644 index 00000000..622df47f --- /dev/null +++ b/include/boost/fusion/adapted/variant/detail/end_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_END_IMPL_12112006_2137) +#define BOOST_FUSION_VARIANT_END_IMPL_12112006_2137 + +#include + +namespace boost { namespace fusion { + + struct variant_tag; + + template + struct variant_iterator; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef variant_iterator< + Seq, + typename mpl::end::type> type; + + static type + call(Seq& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/variant/detail/is_sequence_impl.hpp b/include/boost/fusion/adapted/variant/detail/is_sequence_impl.hpp new file mode 100644 index 00000000..132f88a1 --- /dev/null +++ b/include/boost/fusion/adapted/variant/detail/is_sequence_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_IS_SEQUENCE_IMPL_13112006_0748) +#define BOOST_FUSION_VARIANT_IS_SEQUENCE_IMPL_13112006_0748 + +#include + +namespace boost { namespace fusion { + + struct variant_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/variant/detail/is_view_impl.hpp b/include/boost/fusion/adapted/variant/detail/is_view_impl.hpp new file mode 100644 index 00000000..d58dbd3c --- /dev/null +++ b/include/boost/fusion/adapted/variant/detail/is_view_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_IS_VIEW_IMPL_13112006_0749) +#define BOOST_FUSION_VARIANT_IS_VIEW_IMPL_13112006_0749 + +#include + +namespace boost { namespace fusion { + + struct variant_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::false_ {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/variant/detail/size_impl.hpp b/include/boost/fusion/adapted/variant/detail/size_impl.hpp new file mode 100644 index 00000000..379bac32 --- /dev/null +++ b/include/boost/fusion/adapted/variant/detail/size_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_SIZE_IMPL_12112006_2115) +#define BOOST_FUSION_VARIANT_SIZE_IMPL_12112006_2115 + +#include + +namespace boost { namespace fusion { + + struct variant_tag; + + namespace extension + { + template + struct size_impl; + + template<> + struct size_impl + { + template + struct apply : mpl::size + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/variant/tag_of.hpp b/include/boost/fusion/adapted/variant/tag_of.hpp new file mode 100644 index 00000000..3ec31460 --- /dev/null +++ b/include/boost/fusion/adapted/variant/tag_of.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_TAG_OF_12112006_1704) +#define BOOST_FUSION_VARIANT_TAG_OF_12112006_1704 + +#include +#include + +namespace boost { namespace fusion +{ + struct variant_tag; + + namespace traits + { + template + struct tag_of > + { + typedef variant_tag type; + }; + } +}} + +#endif diff --git a/include/boost/fusion/adapted/variant/variant_iterator.hpp b/include/boost/fusion/adapted/variant/variant_iterator.hpp new file mode 100644 index 00000000..9372002c --- /dev/null +++ b/include/boost/fusion/adapted/variant/variant_iterator.hpp @@ -0,0 +1,117 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VARIANT_ITERATOR_12112006_1617) +#define BOOST_FUSION_VARIANT_ITERATOR_12112006_1617 + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct forward_traversal_tag; + + template + struct variant_iterator + : iterator_facade, forward_traversal_tag> + { + typedef Variant variant_type; + typedef MPLIterator iterator; + + variant_iterator(Variant& var) + : var_(var) {} + Variant& var_; + + template + struct next + { + typedef variant_iterator< + typename Iterator::variant_type, + typename mpl::next::type> type; + + static type + call(Iterator const& i) + { + return type(i.var_); + } + }; + + template + struct distance + : mpl::distance< + typename I1::iterator, + typename I2::iterator> + { + typedef typename mpl::distance< + typename I1::iterator, + typename I2::iterator>::type type; + + static type call(I1 const& i1, I2 const& i2) + { + return type(); + } + }; + + template + struct value_of + : mpl::deref + {}; + + template + struct deref + { + typedef typename + mpl::eval_if< + is_const + , add_const::type> + , mpl::deref + >::type + value_type; + + typedef typename + add_reference::type + type; + +#if BOOST_WORKAROUND(BOOST_MSVC, < 1400) +// for some unknown reason (compiler bug) VC7.1 gets confused with +// variant and optional get functions. + static type + call(Iterator const & it) + { + boost::detail::variant::get_visitor v; + typedef typename mpl::deref::type type; + if (type* result = it.var_.apply_visitor(v)) + return *result; + it.var_ = type(); // prime the variant + return *it.var_.apply_visitor(v); // no-throw! + } +#else + static type + call(Iterator const & it) + { + typedef typename mpl::deref::type type; + if (type* result = boost::get(&it.var_)) + return *result; + it.var_ = type(); // prime the variant + return *boost::get(&it.var_); // no-throw! + } +#endif + }; + }; +}} + +#endif diff --git a/include/boost/fusion/algorithm.hpp b/include/boost/fusion/algorithm.hpp new file mode 100644 index 00000000..74e52723 --- /dev/null +++ b/include/boost/fusion/algorithm.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ALGORITHM_10022005_0549) +#define FUSION_ALGORITHM_10022005_0549 + +#include +#include +#include + +#endif diff --git a/include/boost/fusion/algorithm/iteration.hpp b/include/boost/fusion/algorithm/iteration.hpp new file mode 100644 index 00000000..5d0fefa0 --- /dev/null +++ b/include/boost/fusion/algorithm/iteration.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ALGORITHM_ITERATION_10022005_0549) +#define FUSION_ALGORITHM_ITERATION_10022005_0549 + +#include +#include +#include + +#endif diff --git a/include/boost/fusion/algorithm/iteration/accumulate.hpp b/include/boost/fusion/algorithm/iteration/accumulate.hpp new file mode 100644 index 00000000..3d0685f7 --- /dev/null +++ b/include/boost/fusion/algorithm/iteration/accumulate.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ACCUMULATE_09172005_1032) +#define FUSION_ACCUMULATE_09172005_1032 + +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template + struct accumulate + : result_of::fold + {}; + } + + template + inline typename result_of::accumulate::type + accumulate(Sequence& seq, State const& state, F f) + { + return fusion::fold(seq, state, f); + } + + template + inline typename result_of::accumulate::type + accumulate(Sequence const& seq, State const& state, F f) + { + return fusion::fold(seq, state, f); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/iteration/detail/fold.hpp b/include/boost/fusion/algorithm/iteration/detail/fold.hpp new file mode 100644 index 00000000..542a8114 --- /dev/null +++ b/include/boost/fusion/algorithm/iteration/detail/fold.hpp @@ -0,0 +1,271 @@ +#if !defined(BOOST_FUSION_FOLD_HPP_20070528_1253) +#define BOOST_FUSION_FOLD_HPP_20070528_1253 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace boost { namespace fusion { +namespace result_of +{ + template + struct fold; +} +namespace detail +{ + template + struct apply_fold_result + { + template + struct apply + : boost::result_of + {}; + }; + + template + struct fold_apply + { + typedef typename result_of::deref::type dereferenced; + typedef typename add_reference::type>::type lvalue_state; + typedef typename boost::result_of::type type; + }; + + template + struct static_fold; + + template + struct next_result_of_fold + { + typedef typename + static_fold< + typename result_of::next::type + , Last + , typename fold_apply::type + , F + >::type + type; + }; + + template + struct static_fold + { + typedef typename + mpl::if_< + result_of::equal_to + , mpl::identity + , next_result_of_fold + >::type + result; + + typedef typename result::type type; + }; + + template + struct result_of_unrolled_fold; + + template + struct unrolled_fold + { + template + static typename result_of_unrolled_fold::type + call(I0 const& i0, State const& state, F f) + { + typedef typename result_of::next::type I1; + I1 i1 = fusion::next(i0); + typedef typename result_of::next::type I2; + I2 i2 = fusion::next(i1); + typedef typename result_of::next::type I3; + I3 i3 = fusion::next(i2); + typedef typename result_of::next::type I4; + I4 i4 = fusion::next(i3); + + return unrolled_fold::call(i4, f(*i3, f(*i2, f(*i1, f(*i0, state)))), f); + } + }; + + template<> + struct unrolled_fold<3> + { + template + static typename result_of_unrolled_fold::type + call(I0 const& i0, State const& state, F f) + { + typedef typename result_of::next::type I1; + I1 i1 = fusion::next(i0); + typedef typename result_of::next::type I2; + I2 i2 = fusion::next(i1); + return f(*i2, f(*i1, f(*i0, state))); + } + }; + + template<> + struct unrolled_fold<2> + { + template + static typename result_of_unrolled_fold::type + call(I0 const& i0, State const& state, F f) + { + typedef typename result_of::next::type I1; + I1 i1 = fusion::next(i0); + return f(*i1, f(*i0, state)); + } + }; + + template<> + struct unrolled_fold<1> + { + template + static typename result_of_unrolled_fold::type + call(I0 const& i0, State const& state, F f) + { + return f(*i0, state); + } + }; + + template<> + struct unrolled_fold<0> + { + template + static State call(I0 const&, State const& state, F) + { + return state; + } + }; + + // terminal case + template + inline State const& + linear_fold(First const&, Last const&, State const& state, F, mpl::true_) + { + return state; + } + + // non-terminal case + template + inline typename static_fold::type + linear_fold( + First const& first + , Last const& last + , State const& state + , F f + , mpl::false_) + { + return detail::linear_fold( + fusion::next(first) + , last + , f(*first, state) + , f + , result_of::equal_to::type, Last>() + ); + } + + template + struct result_of_unrolled_fold + { + typedef typename result_of::next::type I1; + typedef typename result_of::next::type I2; + typedef typename result_of::next::type I3; + typedef typename result_of::next::type I4; + typedef typename fold_apply::type Rest1; + typedef typename fold_apply::type Rest2; + typedef typename fold_apply::type Rest3; + typedef typename fold_apply::type Rest4; + + typedef typename result_of_unrolled_fold::type type; + }; + + template + struct result_of_unrolled_fold + { + typedef typename result_of::next::type I1; + typedef typename result_of::next::type I2; + typedef typename fold_apply::type Rest; + typedef typename fold_apply::type Rest2; + typedef typename fold_apply::type type; + }; + + template + struct result_of_unrolled_fold + { + typedef typename result_of::next::type I1; + typedef typename fold_apply::type Rest; + typedef typename fold_apply::type type; + }; + + template + struct result_of_unrolled_fold + { + typedef typename fold_apply::type type; + }; + + template + struct result_of_unrolled_fold + { + typedef State type; + }; + + template + struct choose_fold; + + template + struct choose_fold + { + typedef typename result_of::begin::type begin; + typedef typename result_of::end::type end; + typedef typename result_of_unrolled_fold< + begin, State, F, result_of::distance::type::value>::type type; + }; + + template + struct choose_fold + { + typedef typename + detail::static_fold< + typename result_of::begin::type + , typename result_of::end::type + , State + , F + >::type + type; + }; + + template + typename result_of::fold::type + fold(Sequence& seq, State const& state, F f, Tag) + { + return linear_fold( + fusion::begin(seq) + , fusion::end(seq) + , state + , f + , result_of::equal_to< + typename result_of::begin::type + , typename result_of::end::type>() + ); + } + + template + typename result_of::fold::type + fold(Sequence& seq, State const& state, F f, random_access_traversal_tag) + { + typedef typename result_of::begin::type begin; + typedef typename result_of::end::type end; + return unrolled_fold::type::value>::call( + fusion::begin(seq) + , state + , f); + } +}}} + +#endif diff --git a/include/boost/fusion/algorithm/iteration/detail/for_each.hpp b/include/boost/fusion/algorithm/iteration/detail/for_each.hpp new file mode 100644 index 00000000..a23517c8 --- /dev/null +++ b/include/boost/fusion/algorithm/iteration/detail/for_each.hpp @@ -0,0 +1,130 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FOR_EACH_05052005_1028) +#define FUSION_FOR_EACH_05052005_1028 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { +namespace detail +{ + template + inline void + for_each_linear(First const&, Last const&, F const&, mpl::true_) + { + } + + template + inline void + for_each_linear(First const& first, Last const& last, F const& f, mpl::false_) + { + f(*first); + detail::for_each_linear(fusion::next(first), last, f, + result_of::equal_to::type, Last>()); + } + + + template + inline void + for_each(Sequence& seq, F const& f, Tag) + { + detail::for_each_linear( + fusion::begin(seq) + , fusion::end(seq) + , f + , result_of::equal_to< + typename result_of::begin::type + , typename result_of::end::type>()); + } + + template + struct for_each_unrolled + { + template + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + typedef typename result_of::next::type I2; + I2 i2(fusion::next(i1)); + f(*i2); + typedef typename result_of::next::type I3; + I3 i3(fusion::next(i2)); + f(*i3); + for_each_unrolled::call(fusion::next(i3), f); + } + }; + + template<> + struct for_each_unrolled<3> + { + template + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + typedef typename result_of::next::type I2; + I2 i2(fusion::next(i1)); + f(*i2); + } + }; + + template<> + struct for_each_unrolled<2> + { + template + static void call(I0 const& i0, F const& f) + { + f(*i0); + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + f(*i1); + } + }; + + template<> + struct for_each_unrolled<1> + { + template + static void call(I0 const& i0, F const& f) + { + f(*i0); + } + }; + + template<> + struct for_each_unrolled<0> + { + template + static void call(It const&, F const&) + { + } + }; + + template + inline void + for_each(Sequence& seq, F const& f, random_access_traversal_tag) + { + typedef typename result_of::begin::type begin; + typedef typename result_of::end::type end; + for_each_unrolled::type::value>::call(fusion::begin(seq), f); + } +}}} + + +#endif + diff --git a/include/boost/fusion/algorithm/iteration/ext_/for_each_s.hpp b/include/boost/fusion/algorithm/iteration/ext_/for_each_s.hpp new file mode 100755 index 00000000..9e571d0f --- /dev/null +++ b/include/boost/fusion/algorithm/iteration/ext_/for_each_s.hpp @@ -0,0 +1,91 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FOR_EACH_S_05022006_1027) +#define FUSION_FOR_EACH_S_05022006_1027 + +#include +#include +#include +#include +#include + +// fwd declarations +namespace boost { namespace fusion +{ + template + void + for_each_s(Sequence& seq, F const& f); + + template + void + for_each_s(Sequence const& seq, F const& f); +}} + +namespace boost { namespace fusion { namespace detail +{ + template + struct for_each_s_bind + { + explicit for_each_s_bind(F const &f) + : f_(f) + {} + + template + void operator ()(Sequence &seq) const + { + fusion::for_each_s(seq, this->f_); + } + + template + void operator ()(Sequence const &seq) const + { + fusion::for_each_s(seq, this->f_); + } + private: + F const &f_; + }; + + template + void for_each_s(Sequence &seq, F const &f, mpl::true_) + { + fusion::for_each_s(fusion::segments(seq), for_each_s_bind(f)); + } + + template + void for_each_s(Sequence &seq, F const &f, mpl::false_) + { + fusion::for_each(seq, f); + } +}}} + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct for_each_s + { + typedef void type; + }; + } + + template + inline void + for_each_s(Sequence& seq, F const& f) + { + detail::for_each_s(seq, f, traits::is_segmented()); + } + + template + inline void + for_each_s(Sequence const& seq, F const& f) + { + detail::for_each_s(seq, f, traits::is_segmented()); + } +}} + +#endif diff --git a/include/boost/fusion/algorithm/iteration/fold.hpp b/include/boost/fusion/algorithm/iteration/fold.hpp new file mode 100644 index 00000000..75c63b8f --- /dev/null +++ b/include/boost/fusion/algorithm/iteration/fold.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_FOLD_05052005_1214) +#define BOOST_FUSION_FOLD_05052005_1214 + +#include +#include +#include + +#include +#include + +namespace boost { namespace fusion { + + struct random_access_traversal_tag; + + namespace result_of + { + template + struct fold + : fusion::detail::choose_fold< + Sequence, State, F + , is_base_of::type>::value> + {}; + } + + template + inline typename result_of::fold::type + fold(Sequence& seq, State const& state, F f) + { + return detail::fold(seq, state, f, typename traits::category_of::type()); + } + + template + inline typename result_of::fold::type + fold(Sequence const& seq, State const& state, F f) + { + return detail::fold(seq, state, f, typename traits::category_of::type()); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/iteration/for_each.hpp b/include/boost/fusion/algorithm/iteration/for_each.hpp new file mode 100644 index 00000000..fffb0f00 --- /dev/null +++ b/include/boost/fusion/algorithm/iteration/for_each.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_FOR_EACH_20070527_0943) +#define BOOST_FUSION_FOR_EACH_20070527_0943 + +#include + +#include + +namespace boost { namespace fusion { + + namespace result_of + { + template + struct for_each + { + typedef void type; + }; + } + + struct random_access_traversal_tag; + + template + inline void + for_each(Sequence& seq, F const& f) + { + detail::for_each(seq, f, typename traits::category_of::type()); + } + + template + inline void + for_each(Sequence const& seq, F const& f) + { + detail::for_each(seq, f, typename traits::category_of::type()); + } +}} + +#endif diff --git a/include/boost/fusion/algorithm/query.hpp b/include/boost/fusion/algorithm/query.hpp new file mode 100644 index 00000000..488a62a8 --- /dev/null +++ b/include/boost/fusion/algorithm/query.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ALGORITHM_QUERY_10022005_0549) +#define FUSION_ALGORITHM_QUERY_10022005_0549 + +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/algorithm/query/all.hpp b/include/boost/fusion/algorithm/query/all.hpp new file mode 100644 index 00000000..9d78867c --- /dev/null +++ b/include/boost/fusion/algorithm/query/all.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_ALL_05052005_1238) +#define BOOST_FUSION_ALL_05052005_1238 + +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct all + { + typedef bool type; + }; + } + + template + inline bool + all(Sequence const& seq, F f) + { + return detail::all(seq, f, typename traits::category_of::type()); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/any.hpp b/include/boost/fusion/algorithm/query/any.hpp new file mode 100644 index 00000000..be4ef099 --- /dev/null +++ b/include/boost/fusion/algorithm/query/any.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005 Eric Niebler + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ANY_05052005_1230) +#define FUSION_ANY_05052005_1230 + +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct any + { + typedef bool type; + }; + } + + template + inline bool + any(Sequence const& seq, F f) + { + return detail::any(seq, f, typename traits::category_of::type()); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/count.hpp b/include/boost/fusion/algorithm/query/count.hpp new file mode 100644 index 00000000..27e3370e --- /dev/null +++ b/include/boost/fusion/algorithm/query/count.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_COUNT_09162005_0150) +#define BOOST_FUSION_COUNT_09162005_0150 + +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct count + { + typedef int type; + }; + } + + template + inline int + count(Sequence const& seq, T const& x) + { + detail::count_compare f(x); + return fusion::count_if(seq, f); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/count_if.hpp b/include/boost/fusion/algorithm/query/count_if.hpp new file mode 100644 index 00000000..a080b3b2 --- /dev/null +++ b/include/boost/fusion/algorithm/query/count_if.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_COUNT_IF_09162005_0137) +#define BOOST_FUSION_COUNT_IF_09162005_0137 + +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct count_if + { + typedef int type; + }; + } + + template + inline int + count_if(Sequence const& seq, F f) + { + return detail::count_if( + seq, f, typename traits::category_of::type()); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/detail/all.hpp b/include/boost/fusion/algorithm/query/detail/all.hpp new file mode 100644 index 00000000..979cfb11 --- /dev/null +++ b/include/boost/fusion/algorithm/query/detail/all.hpp @@ -0,0 +1,127 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ALL_05052005_1237) +#define FUSION_ALL_05052005_1237 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + inline bool + linear_all(First const&, Last const&, F const&, mpl::true_) + { + return true; + } + + template + inline bool + linear_all(First const& first, Last const& last, F& f, mpl::false_) + { + typename result_of::deref::type x = *first; + return f(x) && + detail::linear_all( + fusion::next(first) + , last + , f + , result_of::equal_to::type, Last>()); + } + + template + inline bool + all(Sequence const& seq, F f, Tag) + { + return detail::linear_all( + fusion::begin(seq) + , fusion::end(seq) + , f + , result_of::equal_to< + typename result_of::begin::type + , typename result_of::end::type>()); + } + + template + struct unrolled_all + { + template + static bool call(It const& it, F f) + { + return + f(*it) && + f(*fusion::advance_c<1>(it))&& + f(*fusion::advance_c<2>(it)) && + f(*fusion::advance_c<3>(it)) && + detail::unrolled_all::call(fusion::advance_c<4>(it), f); + } + }; + + template<> + struct unrolled_all<3> + { + template + static bool call(It const& it, F f) + { + return + f(*it) && + f(*fusion::advance_c<1>(it)) && + f(*fusion::advance_c<2>(it)); + } + }; + + template<> + struct unrolled_all<2> + { + template + static bool call(It const& it, F f) + { + return + f(*it) && + f(*fusion::advance_c<1>(it)); + } + }; + + template<> + struct unrolled_all<1> + { + template + static bool call(It const& it, F f) + { + return f(*it); + } + }; + + template<> + struct unrolled_all<0> + { + template + static bool call(It const& it, F f) + { + return false; + } + }; + + template + inline bool + all(Sequence const& seq, F f, random_access_traversal_tag) + { + typedef typename result_of::begin::type begin; + typedef typename result_of::end::type end; + return detail::unrolled_all::type::value>::call( + fusion::begin(seq), f); + } +}}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/detail/any.hpp b/include/boost/fusion/algorithm/query/detail/any.hpp new file mode 100644 index 00000000..31bbaa58 --- /dev/null +++ b/include/boost/fusion/algorithm/query/detail/any.hpp @@ -0,0 +1,130 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005 Eric Niebler + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ANY_05052005_1229) +#define FUSION_ANY_05052005_1229 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + struct random_access_traversal_tag; +namespace detail +{ + template + inline bool + linear_any(First const&, Last const&, F const&, mpl::true_) + { + return false; + } + + template + inline bool + linear_any(First const& first, Last const& last, F& f, mpl::false_) + { + typename result_of::deref::type x = *first; + return f(x) || + detail::linear_any( + fusion::next(first) + , last + , f + , result_of::equal_to::type, Last>()); + } + + template + inline bool + any(Sequence const& seq, F f, Tag) + { + return detail::linear_any( + fusion::begin(seq) + , fusion::end(seq) + , f + , result_of::equal_to< + typename result_of::begin::type + , typename result_of::end::type>()); + } + + template + struct unrolled_any + { + template + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it))|| + f(*fusion::advance_c<2>(it)) || + f(*fusion::advance_c<3>(it)) || + detail::unrolled_any::call(fusion::advance_c<4>(it), f); + } + }; + + template<> + struct unrolled_any<3> + { + template + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it)) || + f(*fusion::advance_c<2>(it)); + } + }; + + template<> + struct unrolled_any<2> + { + template + static bool call(It const& it, F f) + { + return + f(*it) || + f(*fusion::advance_c<1>(it)); + } + }; + + template<> + struct unrolled_any<1> + { + template + static bool call(It const& it, F f) + { + return f(*it); + } + }; + + template<> + struct unrolled_any<0> + { + template + static bool call(It const& it, F f) + { + return false; + } + }; + + template + inline bool + any(Sequence const& seq, F f, random_access_traversal_tag) + { + typedef typename result_of::begin::type begin; + typedef typename result_of::end::type end; + return detail::unrolled_any::type::value>::call( + fusion::begin(seq), f); + } +}}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/detail/assoc_find.hpp b/include/boost/fusion/algorithm/query/detail/assoc_find.hpp new file mode 100644 index 00000000..7591405f --- /dev/null +++ b/include/boost/fusion/algorithm/query/detail/assoc_find.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ASSOC_FIND_09242005_1133) +#define FUSION_ASSOC_FIND_09242005_1133 + +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct assoc_find + { + typedef typename + mpl::if_< + is_const + , typename Sequence::template meta_find_impl_const::type + , typename Sequence::template meta_find_impl::type + >::type + type; + + static type + call(Sequence& s) + { + return s.find_impl(mpl::identity()); + } + }; +}}} + +#endif diff --git a/include/boost/fusion/algorithm/query/detail/count.hpp b/include/boost/fusion/algorithm/query/detail/count.hpp new file mode 100644 index 00000000..ff17adbd --- /dev/null +++ b/include/boost/fusion/algorithm/query/detail/count.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_COUNT_09162005_0158) +#define FUSION_COUNT_09162005_0158 + +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct compare_convertible; + + // T1 is convertible to T2 or vice versa + template <> + struct compare_convertible + { + template + static bool + call(T1 const& x, T2 const& y) + { + return x == y; + } + }; + + // T1 is NOT convertible to T2 NOR vice versa + template <> + struct compare_convertible + { + template + static bool + call(T1 const&, T2 const&) + { + return false; + } + }; + + template + struct count_compare + { + typedef typename detail::call_param::type param; + count_compare(param x) + : x(x) {} + + template + bool + operator()(T2 const& y) + { + return + compare_convertible< + mpl::or_< + is_convertible + , is_convertible + >::value + >::call(x, y); + } + + param x; + }; +}}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/detail/count_if.hpp b/include/boost/fusion/algorithm/query/detail/count_if.hpp new file mode 100644 index 00000000..d270b591 --- /dev/null +++ b/include/boost/fusion/algorithm/query/detail/count_if.hpp @@ -0,0 +1,170 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_COUNT_IF_09162005_0141) +#define BOOST_FUSION_COUNT_IF_09162005_0141 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + struct random_access_traversal_tag; +namespace detail +{ + template + inline int + linear_count_if(First const&, Last const&, F const&, mpl::true_) + { + return 0; + } + + template + inline int + linear_count_if(First const& first, Last const& last, F& f, mpl::false_) + { + int n = + detail::linear_count_if( + fusion::next(first) + , last + , f + , result_of::equal_to::type, Last>()); + if (f(*first)) + ++n; + return n; + } + + template + inline int + count_if(Sequence const& seq, F f, Tag) + { + return detail::linear_count_if( + fusion::begin(seq) + , fusion::end(seq) + , f + , result_of::equal_to< + typename result_of::begin::type + , typename result_of::end::type>()); + } + + template + struct unrolled_count_if + { + template + static int call(I0 const& i0, F f) + { + int ct = unrolled_count_if:: + call(fusion::advance_c<4>(i0), f); + if(f(*i0)) + ++ct; + + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + if(f(*i1)) + ++ct; + + typedef typename result_of::next::type I2; + I2 i2(fusion::next(i1)); + if(f(*i2)) + ++ct; + + typedef typename result_of::next::type I3; + I3 i3(fusion::next(i2)); + if(f(*i3)) + ++ct; + + return ct; + } + }; + + template<> + struct unrolled_count_if<3> + { + template + static int call(I0 const& i0, F f) + { + int ct = 0; + if(f(*i0)) + ++ct; + + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + if(f(*i1)) + ++ct; + + typedef typename result_of::next::type I2; + I2 i2(fusion::next(i1)); + if(f(*i2)) + ++ct; + + return ct; + } + }; + + template<> + struct unrolled_count_if<2> + { + template + static int call(I0 const& i0, F f) + { + int ct = 0; + + if(f(*i0)) + ++ct; + + typedef typename result_of::next::type I1; + I1 i1(fusion::next(i0)); + if(f(*i1)) + ++ct; + + return ct; + } + }; + + template<> + struct unrolled_count_if<1> + { + template + static int call(I0 const& i0, F f) + { + int ct = 0; + if(f(*i0)) + ++ct; + return ct; + } + }; + + + template<> + struct unrolled_count_if<0> + { + template + static int call(I0 const&, F) + { + return 0; + } + }; + + template + inline int + count_if(Sequence const& seq, F f, random_access_traversal_tag) + { + typedef typename result_of::begin::type begin; + typedef typename result_of::end::type end; + return detail::unrolled_count_if::type::value>:: + call(fusion::begin(seq), f); + } +}}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/detail/find_if.hpp b/include/boost/fusion/algorithm/query/detail/find_if.hpp new file mode 100644 index 00000000..cf0cc6b7 --- /dev/null +++ b/include/boost/fusion/algorithm/query/detail/find_if.hpp @@ -0,0 +1,252 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FIND_IF_05052005_1107) +#define FUSION_FIND_IF_05052005_1107 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + struct random_access_traversal_tag; +namespace detail +{ + template + struct apply_filter + { + typedef typename mpl::apply1< + Pred, typename result_of::value_of::type>::type type; + BOOST_STATIC_CONSTANT(int, value = type::value); + }; + + template + struct main_find_if; + + template + struct recursive_find_if + { + typedef typename + main_find_if< + typename result_of::next::type, Last, Pred + >::type + type; + }; + + template + struct main_find_if + { + typedef mpl::or_< + result_of::equal_to + , apply_filter > + filter; + + typedef typename + mpl::eval_if< + filter + , mpl::identity + , recursive_find_if + >::type + type; + }; + + template< + typename First, typename Last, + typename Pred, bool> + struct choose_find_if; + + template + struct choose_find_if + : main_find_if + {}; + + template + struct unroll_again; + + template + struct apply_offset_filter + { + typedef typename result_of::advance_c::type Shifted; + typedef typename + mpl::apply1< + Pred + , typename result_of::value_of::type + >::type + type; + BOOST_STATIC_CONSTANT(int, value = type::value); + }; + + template + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter, + mpl::identity, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + unroll_again< + Iter, + Pred, + n, + 4> > > > >::type type; + }; + + template + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter, + mpl::identity, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + result_of::advance_c > > >::type type; + }; + + template + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter, + mpl::identity, + mpl::eval_if< + apply_offset_filter, + result_of::advance_c, + result_of::advance_c > >::type type; + }; + + template + struct unrolled_find_if + { + typedef typename mpl::eval_if< + apply_filter, + mpl::identity, + result_of::advance_c >::type type; + }; + + template + struct unroll_again + { + typedef typename unrolled_find_if< + typename result_of::advance_c::type, + Pred, + n-unrolling>::type type; + }; + + template + struct unrolled_find_if + { + typedef Iter type; + }; + + template + struct choose_find_if + { + typedef typename result_of::distance::type N; + typedef typename unrolled_find_if::type type; + }; + + template + struct static_find_if + { + typedef typename + choose_find_if< + First + , Last + , typename mpl::lambda::type + , is_base_of::type>::value + >::type + type; + + template + static type + recursive_call(Iterator const& iter, mpl::true_) + { + return iter; + } + + template + static type + recursive_call(Iterator const& iter, mpl::false_) + { + return recursive_call(fusion::next(iter)); + } + + template + static type + recursive_call(Iterator const& iter) + { + typedef result_of::equal_to found; + return recursive_call(iter, found()); + } + + template + static type + choose_call(Iterator const& iter, Tag) + { + return recursive_call(iter); + } + + template + static type + choose_call(Iterator const& iter, random_access_traversal_tag) + { + typedef typename result_of::distance::type N; + return fusion::advance(iter); + } + + template + static type + call(Iterator const& iter) + { + return choose_call(iter, typename traits::category_of::type()); + } + }; + + template + struct static_seq_find_if : static_find_if + { + typedef typename static_find_if::type type; + + template + static type + call(Sequence const& seq) + { + return static_find_if::call(fusion::begin(seq)); + } + + template + static type + call(Sequence& seq) + { + return static_find_if::call(fusion::begin(seq)); + } + }; +}}} + +#endif diff --git a/include/boost/fusion/algorithm/query/ext_/find_if_s.hpp b/include/boost/fusion/algorithm/query/ext_/find_if_s.hpp new file mode 100755 index 00000000..82c20b4c --- /dev/null +++ b/include/boost/fusion/algorithm/query/ext_/find_if_s.hpp @@ -0,0 +1,222 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FIND_IF_S_05152006_1027) +#define FIND_IF_S_05152006_1027 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// fwd declarations +namespace boost { namespace fusion +{ + namespace detail + { + template::value> + struct static_find_if_s_recurse; + } + + namespace result_of + { + template + struct find_if_s; + } +}} + +namespace boost { namespace fusion { namespace detail +{ + + template::value> + struct is_found + : mpl::not_::type> > + {}; + + template + struct is_found + : mpl::not_ > + {}; + + template< + typename SegmentedRange + , typename Where + , typename Sequence = typename remove_reference< + typename result_of::deref< + typename SegmentedRange::iterator_type + >::type + >::type + , bool IsSegmented = traits::is_segmented::value + > + struct as_segmented_cons + { + typedef cons< + SegmentedRange + , cons > + > type; + + static type call(SegmentedRange const &range, Where const &where) + { + return fusion::make_cons( + range + , fusion::make_cons( + segmented_range(*fusion::begin(range), where) + ) + ); + } + }; + + template< + typename SegmentedRange + , typename Where + , typename Sequence + > + struct as_segmented_cons + { + typedef cons type; + + static type call(SegmentedRange const &range, Where const &where) + { + return fusion::make_cons(range, where); + } + }; + + template< + typename SegmentedRange + , typename Pred + , bool IsEmpty = is_empty::value + > + struct static_find_if_s_seg + { + typedef typename SegmentedRange::iterator_type first; + typedef typename result_of::deref::type segment_ref; + typedef typename remove_reference::type segment; + typedef static_find_if_s_recurse where; + typedef range_next next; + typedef is_found is_found; + typedef as_segmented_cons found; + typedef static_find_if_s_seg not_found; + typedef typename mpl::eval_if::type type; + + static type call(SegmentedRange const &range) + { + return call_(range, is_found()); + } + + private: + static type call_(SegmentedRange const &range, mpl::true_) + { + return found::call(range, where::call(*range.where)); + } + + static type call_(SegmentedRange const &range, mpl::false_) + { + return not_found::call(next::call(range)); + } + }; + + template< + typename SegmentedRange + , typename Pred + > + struct static_find_if_s_seg + { + typedef nil type; + + static type call(SegmentedRange const &) + { + return nil(); + } + }; + + template + struct static_find_if_s_recurse + { + typedef typename as_segmented_range::type range; + typedef static_find_if_s_seg find_if; + typedef typename find_if::type type; + + static type call(Sequence &seq) + { + return find_if::call(range(fusion::segments(seq))); + } + }; + + template + struct static_find_if_s_recurse + { + typedef typename result_of::find_if::type type; + + static type call(Sequence &seq) + { + return fusion::find_if(seq); + } + }; + + template::value> + struct static_find_if_s + : static_find_if_s_recurse + {}; + + template + struct static_find_if_s + { + typedef typename as_segmented_range::type range; + typedef static_find_if_s_recurse find_if; + typedef typename find_if::type found; + + typedef segmented_iterator::type> type; + + static type call(Sequence &seq) + { + return type(reverse_cons::call(find_if::call(seq))); + } + }; +}}} + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct find_if_s + { + typedef typename + detail::static_find_if_s< + Sequence + , Pred + >::type + type; + }; + } + + template + typename lazy_disable_if< + is_const + , result_of::find_if_s + >::type + find_if_s(Sequence& seq) + { + return detail::static_find_if_s::call(seq); + } + + template + typename result_of::find_if_s::type + find_if_s(Sequence const& seq) + { + return detail::static_find_if_s::call(seq); + } +}} + +#endif diff --git a/include/boost/fusion/algorithm/query/find.hpp b/include/boost/fusion/algorithm/query/find.hpp new file mode 100644 index 00000000..ece8cdd6 --- /dev/null +++ b/include/boost/fusion/algorithm/query/find.hpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FIND_05052005_1107) +#define FUSION_FIND_05052005_1107 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct associative_sequence_tag; + + namespace result_of + { + template < + typename Sequence + , typename T + , bool is_associative_sequence = traits::is_associative::value > + struct find; + + template + struct find + { + typedef + detail::static_seq_find_if< + typename result_of::begin::type + , typename result_of::end::type + , is_same + > + filter; + + typedef typename filter::type type; + }; + + template + struct find + { + typedef detail::assoc_find filter; + typedef typename filter::type type; + }; + } + + template + inline typename + lazy_disable_if< + is_const + , result_of::find + >::type const + find(Sequence& seq) + { + typedef typename result_of::find::filter filter; + return filter::call(seq); + } + + template + inline typename result_of::find::type const + find(Sequence const& seq) + { + typedef typename result_of::find::filter filter; + return filter::call(seq); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/find_if.hpp b/include/boost/fusion/algorithm/query/find_if.hpp new file mode 100644 index 00000000..4340d688 --- /dev/null +++ b/include/boost/fusion/algorithm/query/find_if.hpp @@ -0,0 +1,69 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FIND_IF_05052005_1108) +#define FUSION_FIND_IF_05052005_1108 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct find_if + { + typedef typename + detail::static_find_if< + typename result_of::begin::type + , typename result_of::end::type + , Pred + >::type + type; + }; + } + + template + inline typename + lazy_disable_if< + is_const + , result_of::find_if + >::type + find_if(Sequence& seq) + { + typedef + detail::static_find_if< + typename result_of::begin::type + , typename result_of::end::type + , Pred + > + filter; + + return filter::call(fusion::begin(seq)); + } + + template + inline typename result_of::find_if::type const + find_if(Sequence const& seq) + { + typedef + detail::static_find_if< + typename result_of::begin::type + , typename result_of::end::type + , Pred + > + filter; + + return filter::call(fusion::begin(seq)); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/query/none.hpp b/include/boost/fusion/algorithm/query/none.hpp new file mode 100644 index 00000000..f31f4c9c --- /dev/null +++ b/include/boost/fusion/algorithm/query/none.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_NONE_07062005_1128) +#define BOOST_FUSION_NONE_07062005_1128 + +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct none + { + typedef bool type; + }; + } + + template + inline bool + none(Sequence const& seq, F f) + { + return !fusion::any(seq, f); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation.hpp b/include/boost/fusion/algorithm/transformation.hpp new file mode 100644 index 00000000..0757b5ee --- /dev/null +++ b/include/boost/fusion/algorithm/transformation.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ALGORITHM_TRANSFORMATION_10022005_0551) +#define FUSION_ALGORITHM_TRANSFORMATION_10022005_0551 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/algorithm/transformation/clear.hpp b/include/boost/fusion/algorithm/transformation/clear.hpp new file mode 100644 index 00000000..75328232 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/clear.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CLEAR_09172005_1127) +#define FUSION_CLEAR_09172005_1127 + +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct clear + { + typedef vector0 type; + }; + } + + template + inline typename result_of::clear::type + clear(Sequence const& seq) + { + return vector0(); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/detail/replace.hpp b/include/boost/fusion/algorithm/transformation/detail/replace.hpp new file mode 100644 index 00000000..9e20f79f --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/detail/replace.hpp @@ -0,0 +1,73 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REPLACE_08182005_0841) +#define FUSION_REPLACE_08182005_0841 + +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct replacer_helper; + + template <> + struct replacer_helper + { + template + static U& + call(U& x, T const&, T const&) + { + return x; + } + }; + + template <> + struct replacer_helper + { + template + static U + call(U& x, T const& old_value, T const& new_value) + { + return (x == old_value) ? new_value : x; + } + }; + + template + struct replacer + { + replacer(T const& old_value, T const& new_value) + : old_value(old_value), new_value(new_value) {} + + template + struct result; + + template + struct result(U2)> + { + typedef typename remove_reference::type value; + typedef typename + mpl::if_, value, value const&>::type + type; + }; + + template + typename result::type + operator()(U const& x) const + { + return replacer_helper::value>:: + call(x, old_value, new_value); + } + + T old_value; + T new_value; + }; +}}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp b/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp new file mode 100644 index 00000000..db0434c6 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp @@ -0,0 +1,73 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REPLACE_IF_08182005_0946) +#define FUSION_REPLACE_IF_08182005_0946 + +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct replacer_if_helper; + + template <> + struct replacer_if_helper + { + template + static U& + call(U& x, F&, T const&) + { + return x; + } + }; + + template <> + struct replacer_if_helper + { + template + static U + call(U& x, F& f, T const& new_value) + { + return f(x) ? new_value : x; + } + }; + + template + struct replacer_if + { + replacer_if(F f, T const& new_value) + : f(f), new_value(new_value) {} + + template + struct result; + + template + struct result(U)> + { + typedef typename remove_reference::type value; + typedef typename + mpl::if_, value, value const&>::type + type; + }; + + template + typename result::type + operator()(U const& x) const + { + return replacer_if_helper::value>:: + call(x, f, new_value); + } + + F f; + T new_value; + }; +}}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/erase.hpp b/include/boost/fusion/algorithm/transformation/erase.hpp new file mode 100644 index 00000000..d0405c30 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/erase.hpp @@ -0,0 +1,108 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ERASE_07232005_0534) +#define FUSION_ERASE_07232005_0534 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct compute_erase_last // put this in detail!!! + { + typedef typename result_of::end::type seq_last_type; + typedef typename convert_iterator::type first_type; + typedef typename + mpl::if_< + result_of::equal_to + , first_type + , typename result_of::next::type + >::type + type; + + static type + call(First const& first, mpl::false_) + { + return fusion::next(convert_iterator::call(first)); + } + + static type + call(First const& first, mpl::true_) + { + return convert_iterator::call(first); + } + + static type + call(First const& first) + { + return call(first, result_of::equal_to()); + } + }; + + template < + typename Sequence + , typename First + , typename Last = typename compute_erase_last::type> + struct erase + { + typedef typename result_of::begin::type seq_first_type; + typedef typename result_of::end::type seq_last_type; + BOOST_STATIC_ASSERT((!result_of::equal_to::value)); + + typedef typename convert_iterator::type first_type; + typedef typename convert_iterator::type last_type; + typedef iterator_range left_type; + typedef iterator_range right_type; + typedef joint_view type; + }; + } + + template + typename result_of::erase::type + erase(Sequence const& seq, First const& first) + { + typedef result_of::erase result_of; + typedef typename result_of::left_type left_type; + typedef typename result_of::right_type right_type; + typedef typename result_of::type result_type; + + left_type left( + fusion::begin(seq) + , convert_iterator::call(first)); + right_type right( + fusion::result_of::compute_erase_last::call(first) + , fusion::end(seq)); + return result_type(left, right); + } + + template + typename result_of::erase::type + erase(Sequence const& seq, First const& first, Last const& last) + { + typedef result_of::erase result_of; + typedef typename result_of::left_type left_type; + typedef typename result_of::right_type right_type; + typedef typename result_of::type result_type; + + left_type left(fusion::begin(seq), first); + right_type right(last, fusion::end(seq)); + return result_type(left, right); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/erase_key.hpp b/include/boost/fusion/algorithm/transformation/erase_key.hpp new file mode 100644 index 00000000..dcdc6f09 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/erase_key.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ERASE_KEY_10022005_1851) +#define FUSION_ERASE_KEY_10022005_1851 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct erase_key + { + typedef detail::assoc_find filter; + typedef typename erase::type type; + }; + } + + template + inline typename result_of::erase_key::type + erase_key(Sequence const& seq) + { + typedef typename result_of::erase_key::filter filter; + return erase(seq, filter::call(seq)); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/filter.hpp b/include/boost/fusion/algorithm/transformation/filter.hpp new file mode 100644 index 00000000..52bf6af3 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/filter.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FILTER_02122005_1839) +#define FUSION_FILTER_02122005_1839 + +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct filter + { + typedef filter_view > type; + }; + } + + template + inline typename result_of::filter::type + filter(Sequence const& seq) + { + return filter_view >(seq); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/filter_if.hpp b/include/boost/fusion/algorithm/transformation/filter_if.hpp new file mode 100644 index 00000000..d13113b1 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/filter_if.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FILTER_IF_07172005_0818) +#define FUSION_FILTER_IF_07172005_0818 + +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct filter_if + { + typedef filter_view type; + }; + } + + template + inline typename result_of::filter_if::type + filter_if(Sequence const& seq) + { + return filter_view(seq); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/insert.hpp b/include/boost/fusion/algorithm/transformation/insert.hpp new file mode 100644 index 00000000..1702bc19 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/insert.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INSERT_07222005_0730) +#define FUSION_INSERT_07222005_0730 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct insert + { + typedef typename detail::as_fusion_element::type element_type; + typedef typename convert_iterator::type pos_type; + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + + typedef iterator_range left_type; + typedef iterator_range right_type; + typedef fusion::single_view single_view; + typedef joint_view left_insert_type; + typedef joint_view type; + }; + } + + template + inline typename result_of::insert< + Sequence const, Position, T>::type + insert(Sequence const& seq, Position const& pos, T const& x) + { + typedef result_of::insert< + Sequence const, Position, T> + result_of; + typedef typename result_of::left_type left_type; + typedef typename result_of::right_type right_type; + typedef typename result_of::single_view single_view; + typedef typename result_of::left_insert_type left_insert_type; + typedef typename result_of::type result; + + left_type left(fusion::begin(seq), convert_iterator::call(pos)); + right_type right(convert_iterator::call(pos), fusion::end(seq)); + single_view insert(x); + left_insert_type left_insert(left, insert); + return result(left_insert, right); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/insert_range.hpp b/include/boost/fusion/algorithm/transformation/insert_range.hpp new file mode 100644 index 00000000..1915c413 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/insert_range.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INSERT_RANGE_009172005_1147) +#define FUSION_INSERT_RANGE_009172005_1147 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct insert_range + { + typedef typename convert_iterator::type pos_type; + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + + typedef iterator_range left_type; + typedef iterator_range right_type; + typedef joint_view left_insert_type; + typedef joint_view type; + }; + } + + template + inline typename result_of::insert_range::type + insert_range(Sequence const& seq, Position const& pos, Range const& range) + { + typedef result_of::insert_range result_of; + typedef typename result_of::left_type left_type; + typedef typename result_of::right_type right_type; + typedef typename result_of::left_insert_type left_insert_type; + typedef typename result_of::type result; + + left_type left(fusion::begin(seq), convert_iterator::call(pos)); + right_type right(convert_iterator::call(pos), fusion::end(seq)); + left_insert_type left_insert(left, range); + return result(left_insert, right); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/join.hpp b/include/boost/fusion/algorithm/transformation/join.hpp new file mode 100644 index 00000000..4ed78b5f --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/join.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_JOIN_200601222109) +#define FUSION_JOIN_200601222109 + +#include + +namespace boost { namespace fusion { + + namespace result_of + { + template + struct join + { + typedef joint_view type; + }; + } + + template + inline typename result_of::join::type + join(LhSequence const& lhs, RhSequence const& rhs) + { + return typename result_of::join::type( + lhs, rhs); + } +}} + +#endif diff --git a/include/boost/fusion/algorithm/transformation/pop_back.hpp b/include/boost/fusion/algorithm/transformation/pop_back.hpp new file mode 100644 index 00000000..6eb743fd --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/pop_back.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_POP_BACK_09172005_1038) +#define FUSION_POP_BACK_09172005_1038 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct pop_back + { + typedef + iterator_range< + typename begin::type + , typename prior< + typename end::type + >::type + > + type; + }; + } + + template + inline typename result_of::pop_back::type + pop_back(Sequence const& seq) + { + typedef typename result_of::pop_back::type result; + return result(fusion::begin(seq), fusion::prior(fusion::end(seq))); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/pop_front.hpp b/include/boost/fusion/algorithm/transformation/pop_front.hpp new file mode 100644 index 00000000..aed524d3 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/pop_front.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_POP_FRONT_09172005_1115) +#define FUSION_POP_FRONT_09172005_1115 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct pop_front + { + typedef + iterator_range< + typename next< + typename begin::type + >::type + , typename end::type + > + type; + }; + } + + template + inline typename result_of::pop_front::type + pop_front(Sequence const& seq) + { + typedef typename result_of::pop_front::type result; + return result(fusion::next(fusion::begin(seq)), fusion::end(seq)); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/push_back.hpp b/include/boost/fusion/algorithm/transformation/push_back.hpp new file mode 100644 index 00000000..4fadc79c --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/push_back.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PUSH_BACK_07162005_0235) +#define FUSION_PUSH_BACK_07162005_0235 + +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct push_back + { + typedef fusion::single_view::type> single_view; + typedef joint_view type; + }; + } + + template + inline typename result_of::push_back::type + push_back(Sequence const& seq, T const& x) + { + typedef typename result_of::push_back push_back; + typedef typename push_back::single_view single_view; + typedef typename push_back::type result; + single_view x_(x); + return result(seq, x_); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/push_front.hpp b/include/boost/fusion/algorithm/transformation/push_front.hpp new file mode 100644 index 00000000..10f9fc10 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/push_front.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PUSH_FRONT_07162005_0749) +#define FUSION_PUSH_FRONT_07162005_0749 + +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct push_front + { + typedef fusion::single_view::type> single_view; + typedef joint_view type; + }; + } + + template + inline typename result_of::push_front::type + push_front(Sequence const& seq, T const& x) + { + typedef typename result_of::push_front push_front; + typedef typename push_front::single_view single_view; + typedef typename push_front::type result; + single_view x_(x); + return result(x_, seq); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/remove.hpp b/include/boost/fusion/algorithm/transformation/remove.hpp new file mode 100644 index 00000000..01718d32 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/remove.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REMOVE_07162005_0818) +#define FUSION_REMOVE_07162005_0818 + +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct remove + { + typedef filter_view > > type; + }; + } + + template + inline typename result_of::remove::type + remove(Sequence const& seq) + { + typedef typename result_of::remove::type result_type; + return result_type(seq); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/remove_if.hpp b/include/boost/fusion/algorithm/transformation/remove_if.hpp new file mode 100644 index 00000000..ab13694d --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/remove_if.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REMOVE_IF_07162005_0818) +#define FUSION_REMOVE_IF_07162005_0818 + +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct remove_if + { + typedef filter_view > type; + }; + } + + template + inline typename result_of::remove_if::type + remove_if(Sequence const& seq) + { + typedef typename result_of::remove_if::type result_type; + return result_type(seq); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/replace.hpp b/include/boost/fusion/algorithm/transformation/replace.hpp new file mode 100644 index 00000000..780f1a45 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/replace.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REPLACE_08182005_0830) +#define FUSION_REPLACE_08182005_0830 + +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct replace + { + typedef transform_view > type; + }; + } + + template + inline typename result_of::replace::type + replace(Sequence const& seq, T const& old_value, T const& new_value) + { + typedef typename result_of::replace::type result; + detail::replacer f(old_value, new_value); + return result(seq, f); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/replace_if.hpp b/include/boost/fusion/algorithm/transformation/replace_if.hpp new file mode 100644 index 00000000..90db5683 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/replace_if.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REPLACE_IF_08182005_0939) +#define FUSION_REPLACE_IF_08182005_0939 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct replace_if + { + typedef transform_view > type; + }; + } + + template + inline typename result_of::replace_if::type + replace_if(Sequence const& seq, F pred, T const& new_value) + { + typedef typename result_of::replace_if::type result; + detail::replacer_if f(pred, new_value); + return result(seq, f); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/reverse.hpp b/include/boost/fusion/algorithm/transformation/reverse.hpp new file mode 100644 index 00000000..b95461c8 --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/reverse.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REVERSE_07212005_1230) +#define FUSION_REVERSE_07212005_1230 + +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct reverse + { + typedef reverse_view type; + }; + } + + template + inline reverse_view + reverse(Sequence const& view) + { + return reverse_view(view); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/transform.hpp b/include/boost/fusion/algorithm/transformation/transform.hpp new file mode 100644 index 00000000..d9f06e7c --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/transform.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_TRANSFORM_07052005_1057) +#define FUSION_TRANSFORM_07052005_1057 + +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template + struct transform + { + typedef transform_view type; + }; + + template + struct transform + { + typedef transform_view type; + }; + } + + template + inline typename result_of::transform::type + transform(Sequence const& seq, F f) + { + return transform_view(seq, f); + } + + template + inline typename result_of::transform::type + transform(Sequence1 const& seq1, Sequence2 const& seq2, F f) + { + return transform_view(seq1, seq2, f); + } +}} + +#endif + diff --git a/include/boost/fusion/algorithm/transformation/zip.hpp b/include/boost/fusion/algorithm/transformation/zip.hpp new file mode 100644 index 00000000..a2f66bfd --- /dev/null +++ b/include/boost/fusion/algorithm/transformation/zip.hpp @@ -0,0 +1,79 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_ZIP_HPP_20060125_2058) +#define FUSION_ZIP_HPP_20060125_2058 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(FUSION_MAX_ZIP_SEQUENCES) +#define FUSION_MAX_ZIP_SEQUENCES 10 +#endif + +namespace boost { namespace fusion { + + struct void_; + + namespace result_of + { + template + struct zip; + } + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_ZIP_SEQUENCES) +#include BOOST_PP_ITERATE() + +}} + +#endif + +#else + +#define ZIP_ITERATION BOOST_PP_ITERATION() + + namespace result_of + { + template< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, typename T) > + struct zip< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > + { + typedef mpl::vector< BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, T) > sequences; + typedef typename mpl::transform >::type ref_params; + typedef zip_view::type> type; + }; + } + +#define FUSION_REF_PARAM(z, n, data) const T ## n& + + template + inline typename result_of::zip::type + zip(BOOST_PP_ENUM_BINARY_PARAMS(ZIP_ITERATION, T, const& t)) + { + fusion::vector seqs( + BOOST_PP_ENUM_PARAMS(ZIP_ITERATION, t)); + return typename result_of::zip::type( + seqs); + } + +#undef FUSION_REF_PARAM +#undef ZIP_ITERATION + +#endif diff --git a/include/boost/fusion/container.hpp b/include/boost/fusion/container.hpp new file mode 100644 index 00000000..e41c9cb3 --- /dev/null +++ b/include/boost/fusion/container.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_CLASS_10022005_0614) +#define FUSION_SEQUENCE_CLASS_10022005_0614 + +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/container/deque.hpp b/include/boost/fusion/container/deque.hpp new file mode 100644 index 00000000..bb29ce2f --- /dev/null +++ b/include/boost/fusion/container/deque.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SEQUENCE_CONTAINER_DEQUE_24112006_2036) +#define BOOST_FUSION_SEQUENCE_CONTAINER_DEQUE_24112006_2036 + +#include +#include + +#endif + diff --git a/include/boost/fusion/container/deque/back_extended_deque.hpp b/include/boost/fusion/container/deque/back_extended_deque.hpp new file mode 100644 index 00000000..28d5ceca --- /dev/null +++ b/include/boost/fusion/container/deque/back_extended_deque.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BACK_EXTENDED_DEQUE_26112006_2209) +#define BOOST_FUSION_BACK_EXTENDED_DEQUE_26112006_2209 + +#include +#include +#include +#include +#include + +#include +#include + +namespace boost { namespace fusion { + template + struct back_extended_deque + : detail::keyed_element, + sequence_base > + { + typedef detail::keyed_element base; + typedef typename Deque::next_down next_down; + typedef mpl::int_ >::value> next_up; + typedef mpl::plus::type, mpl::int_<1> > size; + + back_extended_deque(Deque const& deque, typename add_reference::type>::type t) + : base(t, deque) + {} + }; +}} + +#endif diff --git a/include/boost/fusion/container/deque/convert.hpp b/include/boost/fusion/container/deque/convert.hpp new file mode 100644 index 00000000..0f3a75e2 --- /dev/null +++ b/include/boost/fusion/container/deque/convert.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_20061213_2207) +#define FUSION_CONVERT_20061213_2207 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct as_deque + { + typedef typename detail::as_deque::value> gen; + typedef typename gen:: + template apply::type>::type + type; + }; + } + + template + inline typename result_of::as_deque::type + as_deque(Sequence& seq) + { + typedef typename result_of::as_deque::gen gen; + return gen::call(fusion::begin(seq)); + } + + template + inline typename result_of::as_deque::type + as_deque(Sequence const& seq) + { + typedef typename result_of::as_deque::gen gen; + return gen::call(fusion::begin(seq)); + } +}} + +#endif diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp new file mode 100644 index 00000000..27d9ce78 --- /dev/null +++ b/include/boost/fusion/container/deque/deque.hpp @@ -0,0 +1,93 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_26112006_1649) +#define BOOST_FUSION_DEQUE_26112006_1649 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace boost { namespace fusion { + + struct deque_tag; + + template + struct deque + : + detail::deque_keyed_values::type, + sequence_base > + { + typedef deque_tag fusion_tag; + typedef typename detail::deque_keyed_values::type base; + typedef typename detail::deque_initial_size::type size; + typedef mpl::int_ next_up; + typedef mpl::int_< + mpl::if_ >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down; + typedef mpl::false_ is_view; + +#include + + deque() + {} + + explicit deque(typename add_reference::type>::type t0) + : base(t0, detail::nil_keyed_element()) + {} + + template + deque(deque const& seq) + : base(seq) + {} + + template + deque(Sequence const& seq, typename disable_if >::type* dummy = 0) + : base(base::from_iterator(fusion::begin(seq))) + {} + + template + deque& + operator=(deque const& rhs) + { + base::operator=(rhs); + return *this; + } + + template + deque& + operator=(T const& rhs) + { + base::operator=(rhs); + return *this; + } + + }; +}} + +#endif diff --git a/include/boost/fusion/container/deque/deque_fwd.hpp b/include/boost/fusion/container/deque/deque_fwd.hpp new file mode 100644 index 00000000..415bb2f2 --- /dev/null +++ b/include/boost/fusion/container/deque/deque_fwd.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2005-2007 Joel de Guzman + Copyright (c) 2005-2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEQUE_FORWARD_02092007_0749) +#define FUSION_DEQUE_FORWARD_02092007_0749 + +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + template< + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_DEQUE_SIZE, typename T, void_)> + struct deque; +}} + +#endif diff --git a/include/boost/fusion/container/deque/deque_iterator.hpp b/include/boost/fusion/container/deque/deque_iterator.hpp new file mode 100644 index 00000000..90c68918 --- /dev/null +++ b/include/boost/fusion/container/deque/deque_iterator.hpp @@ -0,0 +1,106 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_ITERATOR_26112006_2154) +#define BOOST_FUSION_DEQUE_ITERATOR_26112006_2154 + +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct bidirectional_traversal_tag; + + template + struct deque_iterator + : iterator_facade, bidirectional_traversal_tag> + { + typedef Seq sequence; + typedef mpl::int_ index; + + deque_iterator(Seq& seq) + : seq_(seq) + {} + + template + struct value_of + : detail::keyed_element_value_at< + typename Iterator::sequence, typename Iterator::index> + {}; + + template + struct deref + { + typedef typename detail::keyed_element_value_at< + typename Iterator::sequence, typename Iterator::index>::type element_type; + + typedef typename add_reference< + typename mpl::eval_if< + is_const, + add_const, + mpl::identity >::type>::type type; + + static type + call(Iterator const& it) + { + return it.seq_.get(typename Iterator::index()); + } + }; + + template + struct advance + { + typedef typename Iterator::index index; + typedef typename Iterator::sequence sequence; + typedef deque_iterator type; + + static type + call(Iterator const& i) + { + return type(i.seq_); + } + }; + + template + struct next + : advance > + {}; + + template + struct prior + : advance > + {}; + + template + struct distance : mpl::minus + { + typedef typename + mpl::minus< + typename I2::index, typename I1::index + >::type + type; + + static type + call(I1 const&, I2 const&) + { + return type(); + } + }; + + template + struct equal_to + : mpl::equal_to + {}; + + Seq& seq_; + }; + +}} + +#endif diff --git a/include/boost/fusion/container/deque/detail/as_deque.hpp b/include/boost/fusion/container/deque/detail/as_deque.hpp new file mode 100644 index 00000000..e48b7910 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/as_deque.hpp @@ -0,0 +1,102 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_AS_DEQUE_20061213_2210) +#define FUSION_AS_DEQUE_20061213_2210 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct as_deque; + + template <> + struct as_deque<0> + { + template + struct apply + { + typedef deque<> type; + }; + + template + static typename apply::type + call(Iterator) + { + return deque<>(); + } + }; + +#define BOOST_FUSION_NEXT_ITERATOR(z, n, data) \ + typedef typename fusion::result_of::next::type \ + BOOST_PP_CAT(I, BOOST_PP_INC(n)); + +#define BOOST_FUSION_NEXT_CALL_ITERATOR(z, n, data) \ + typename gen::BOOST_PP_CAT(I, BOOST_PP_INC(n)) \ + BOOST_PP_CAT(i, BOOST_PP_INC(n)) = fusion::next(BOOST_PP_CAT(i, n)); + +#define BOOST_FUSION_VALUE_OF_ITERATOR(z, n, data) \ + typedef typename fusion::result_of::value_of::type \ + BOOST_PP_CAT(T, n); + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_NEXT_ITERATOR +#undef BOOST_FUSION_NEXT_CALL_ITERATOR +#undef BOOST_FUSION_VALUE_OF_ITERATOR + +}}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + template <> + struct as_deque + { + template + struct apply + { + BOOST_PP_REPEAT(N, BOOST_FUSION_NEXT_ITERATOR, _) + BOOST_PP_REPEAT(N, BOOST_FUSION_VALUE_OF_ITERATOR, _) + typedef deque type; + }; + + template + static typename apply::type + call(Iterator const& i0) + { + typedef apply gen; + typedef typename gen::type result; + BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _) + return result(BOOST_PP_ENUM_PARAMS(N, *i)); + } + }; + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/deque/detail/at_impl.hpp b/include/boost/fusion/container/deque/detail/at_impl.hpp new file mode 100644 index 00000000..3dc7cde9 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/at_impl.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_AT_IMPL_09122006_2017) +#define BOOST_FUSION_DEQUE_AT_IMPL_09122006_2017 + +#include + +#include +#include +#include +#include + +#include +#include +#include + +namespace boost { namespace fusion { + + struct deque_tag; + + namespace extension + { + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply + { + typedef typename Sequence::next_up next_up; + typedef typename Sequence::next_down next_down; + BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value); + + typedef mpl::plus > offset; + typedef mpl::int_::value> adjusted_index; + typedef typename detail::keyed_element_value_at::type element_type; + typedef typename add_reference< + typename mpl::eval_if< + is_const, + add_const, + mpl::identity >::type>::type type; + + static type call(Sequence& seq) + { + return seq.get(adjusted_index()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/deque/detail/begin_impl.hpp b/include/boost/fusion/container/deque/detail/begin_impl.hpp new file mode 100644 index 00000000..13b50143 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/begin_impl.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_BEGIN_IMPL_09122006_2034) +#define BOOST_FUSION_DEQUE_BEGIN_IMPL_09122006_2034 + +#include + +#include +#include + +namespace boost { namespace fusion { + + struct deque_tag; + + namespace extension + { + template + struct begin_impl; + + template<> + struct begin_impl + { + template + struct apply + { + typedef typename mpl::if_< + mpl::equal_to, + deque_iterator, + deque_iterator< + Sequence, mpl::plus >::value> >::type type; + + static type call(Sequence& seq) + { + return type(seq); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/deque/detail/convert_impl.hpp b/include/boost/fusion/container/deque/detail/convert_impl.hpp new file mode 100644 index 00000000..ac310a19 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/convert_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_IMPL_20061213_2207) +#define FUSION_CONVERT_IMPL_20061213_2207 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct deque_tag; + + namespace extension + { + template + struct convert_impl; + + template <> + struct convert_impl + { + template + struct apply + { + typedef typename detail::as_deque::value> gen; + typedef typename gen:: + template apply::type>::type + type; + + static type call(Sequence& seq) + { + return gen::call(fusion::begin(seq)); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp b/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp new file mode 100644 index 00000000..813c0491 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_PP_IS_ITERATING) +#if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_FORWARD_CTOR_04122006_2212) +#define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_FORWARD_CTOR_04122006_2212 + +#include +#include +#include + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_DEQUE_SIZE) +#include BOOST_PP_ITERATE() + +#endif +#else + +#define N BOOST_PP_ITERATION() + +deque(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference::type>::type t)) + : base(detail::deque_keyed_values::call(BOOST_PP_ENUM_PARAMS(N, t))) +{} + +#undef N +#endif diff --git a/include/boost/fusion/container/deque/detail/deque_initial_size.hpp b/include/boost/fusion/container/deque/detail/deque_initial_size.hpp new file mode 100644 index 00000000..8fa56292 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/deque_initial_size.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_INITIAL_SIZE_26112006_2139) +#define BOOST_FUSION_DEQUE_DETAIL_DEQUE_INITIAL_SIZE_26112006_2139 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct void_; + +namespace detail { + + template + struct deque_initial_size + { + typedef mpl::vector args; + typedef typename mpl::find::type first_void; + typedef typename mpl::distance::type, first_void>::type type; + }; +}}} + +#endif diff --git a/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp new file mode 100644 index 00000000..11b229b2 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330) +#define BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330 + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define FUSION_VOID(z, n, _) void_ + +namespace boost { namespace fusion { + + struct void_; + +namespace detail { + + template + struct keyed_element; + + struct nil_keyed_element; + + template + struct deque_keyed_values_impl; + + template + struct deque_keyed_values_impl + { + typedef nil_keyed_element type; + + static type call() + { + return type(); + } + }; + + template + struct deque_keyed_values_impl + { + typedef mpl::int_ >::value> next_index; + + typedef typename deque_keyed_values_impl< + next_index, + BOOST_PP_ENUM_SHIFTED_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type tail; + typedef keyed_element type; + +#include + + }; + + template + struct deque_keyed_values + : deque_keyed_values_impl, BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> + {}; + +}}} + +#undef FUSION_VOID + +#endif diff --git a/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp b/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp new file mode 100644 index 00000000..0a39add6 --- /dev/null +++ b/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_PP_IS_ITERATING) +#if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211) +#define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211 + +#include +#include +#include + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE) +#include BOOST_PP_ITERATE() + +#endif +#else + +#define N BOOST_PP_ITERATION() + +static type call(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference::type>::type t)) +{ + return type(t0, + deque_keyed_values_impl< + next_index +#if N > 1 + , BOOST_PP_ENUM_SHIFTED_PARAMS(N, T) +#endif + >::call(BOOST_PP_ENUM_SHIFTED_PARAMS(N, t))); +} + +#undef N +#endif diff --git a/include/boost/fusion/container/deque/detail/end_impl.hpp b/include/boost/fusion/container/deque/detail/end_impl.hpp new file mode 100644 index 00000000..96a1b17d --- /dev/null +++ b/include/boost/fusion/container/deque/detail/end_impl.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_END_IMPL_09122006_2034) +#define BOOST_FUSION_DEQUE_END_IMPL_09122006_2034 + +#include + +#include +#include + +namespace boost { namespace fusion { + + struct deque_tag; + + namespace extension + { + template + struct end_impl; + + template<> + struct end_impl + { + template + struct apply + { + typedef typename mpl::if_< + mpl::equal_to, + deque_iterator, + deque_iterator< + Sequence, Sequence::next_up::value> >::type type; + + static type call(Sequence& seq) + { + return type(seq); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp new file mode 100644 index 00000000..177f68ac --- /dev/null +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -0,0 +1,111 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330) +#define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330 + +#include +#include + +#include +#include + +namespace boost { namespace fusion { + + struct fusion_sequence_tag; + +namespace detail { + + struct nil_keyed_element + { + typedef fusion_sequence_tag tag; + void get(); + + template + static nil_keyed_element + from_iterator(It const&) + { + return nil_keyed_element(); + } + }; + + template + struct keyed_element + : Rest + { + typedef Rest base; + typedef fusion_sequence_tag tag; + using Rest::get; + + template + static keyed_element + from_iterator(It const& it) + { + return keyed_element( + *it, base::from_iterator(fusion::next(it))); + } + + template + keyed_element(keyed_element const& rhs) + : Rest(rhs.get_base()), value_(rhs.value_) + {} + + Rest const get_base() const + { + return *this; + } + + typename add_reference::type>::type get(Key) const + { + return value_; + } + + typename add_reference::type get(Key) + { + return value_; + } + + keyed_element(typename add_reference::type>::type value, Rest const& rest) + : Rest(rest), value_(value) + {} + + keyed_element() + : Rest(), value_() + {} + + template + keyed_element& operator=(keyed_element const& rhs) + { + base::operator=(static_cast(rhs)); // cast for msvc-7.1 + value_ = rhs.value_; + return *this; + } + + keyed_element& operator=(keyed_element const& rhs) + { + base::operator=(rhs); + value_ = rhs.value_; + return *this; + } + + Value value_; + }; + + template + struct keyed_element_value_at + : keyed_element_value_at + {}; + + template + struct keyed_element_value_at, Key> + { + typedef Value type; + }; + +}}} + +#endif diff --git a/include/boost/fusion/container/deque/detail/value_at_impl.hpp b/include/boost/fusion/container/deque/detail/value_at_impl.hpp new file mode 100644 index 00000000..ec0351de --- /dev/null +++ b/include/boost/fusion/container/deque/detail/value_at_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_VALUE_AT_IMPL_08122006_0756) +#define BOOST_FUSION_DEQUE_VALUE_AT_IMPL_08122006_0756 + +#include + +#include +#include + +namespace boost { namespace fusion { + + struct deque_tag; + + namespace extension + { + template + struct value_at_impl; + + template<> + struct value_at_impl + { + template + struct apply + { + typedef typename Sequence::next_up next_up; + typedef typename Sequence::next_down next_down; + BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value); + + typedef mpl::plus > offset; + typedef mpl::int_::value> adjusted_index; + typedef typename detail::keyed_element_value_at::type type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/deque/front_extended_deque.hpp b/include/boost/fusion/container/deque/front_extended_deque.hpp new file mode 100644 index 00000000..156e66a4 --- /dev/null +++ b/include/boost/fusion/container/deque/front_extended_deque.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_FRONT_EXTENDED_DEQUE_26112006_2209) +#define BOOST_FUSION_FRONT_EXTENDED_DEQUE_26112006_2209 + +#include +#include +#include +#include +#include + +#include +#include + +#include + +namespace boost { namespace fusion { + template + struct front_extended_deque + : detail::keyed_element, + sequence_base > + { + typedef detail::keyed_element base; + typedef mpl::int_ >::value> next_down; + typedef typename Deque::next_up next_up; + typedef mpl::plus::type, mpl::int_<1> > size; + + front_extended_deque(Deque const& deque, typename add_reference::type>::type t) + : base(t, deque) + {} + }; +}} + +#endif diff --git a/include/boost/fusion/container/deque/limits.hpp b/include/boost/fusion/container/deque/limits.hpp new file mode 100644 index 00000000..2262f17c --- /dev/null +++ b/include/boost/fusion/container/deque/limits.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_DEQUE_LIMITS_26112006_1737) +#define BOOST_FUSION_DEQUE_LIMITS_26112006_1737 + +#if !defined(FUSION_MAX_DEQUE_SIZE) +#define FUSION_MAX_DEQUE_SIZE 10 +#endif + +#endif diff --git a/include/boost/fusion/container/ext_/tree.hpp b/include/boost/fusion/container/ext_/tree.hpp new file mode 100755 index 00000000..cd8c5dcd --- /dev/null +++ b/include/boost/fusion/container/ext_/tree.hpp @@ -0,0 +1,130 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef FUSION_BINARY_TREE_EAN_05032006_1027 +#define FUSION_BINARY_TREE_EAN_05032006_1027 + +#include +#include +#include +#include +#include +#include +#include +#include // for nil +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct tree_tag; + + namespace detail + { + template + struct reference : add_reference {}; + + template + struct reference : reference::type, false> {}; + + template + struct reference : reference {}; + } + + template + struct tree + : sequence_base > + { + typedef Data data_type; + typedef Left left_type; + typedef Right right_type; + typedef tree_tag fusion_tag; + typedef forward_traversal_tag category; + typedef mpl::false_ is_view; + + typedef typename mpl::if_< + traits::is_sequence + , Data + , single_view + >::type data_view; + + explicit tree( + typename fusion::detail::call_param::type data_ + , typename fusion::detail::call_param::type left_ = Left() + , typename fusion::detail::call_param::type right_ = Right() + ) + : segments(left_, data_view(data_), right_) + {} + + typedef vector3 segments_type; + segments_type segments; + }; + + template + tree make_tree(Data const &data) + { + return tree(data); + } + + template + tree make_tree(Data const &data, Left const &left, Right const &right) + { + return tree(data, left, right); + } + + namespace extension + { + template<> + struct is_segmented_impl + { + template + struct apply : mpl::true_ {}; + }; + + template<> + struct segments_impl + { + template + struct apply + { + typedef typename mpl::if_< + is_const + , typename Sequence::segments_type const & + , typename Sequence::segments_type & + >::type type; + + static type call(Sequence &seq) + { + return seq.segments; + } + }; + }; + + template<> + struct begin_impl + { + template + struct apply + : segmented_begin + {}; + }; + + template<> + struct end_impl + { + template + struct apply + : segmented_end + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/list.hpp b/include/boost/fusion/container/list.hpp new file mode 100644 index 00000000..8a0d6456 --- /dev/null +++ b/include/boost/fusion/container/list.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_CLASS_LIST_10022005_0605) +#define FUSION_SEQUENCE_CLASS_LIST_10022005_0605 + +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp new file mode 100644 index 00000000..8e500f66 --- /dev/null +++ b/include/boost/fusion/container/list/cons.hpp @@ -0,0 +1,143 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONS_07172005_0843) +#define FUSION_CONS_07172005_0843 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + struct cons_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + struct nil : sequence_base + { + typedef mpl::int_<0> size; + typedef cons_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + typedef forward_traversal_tag category; + typedef void_ car_type; + typedef void_ cdr_type; + + nil() {} + + template + nil(Iterator const& iter, mpl::true_ /*this_is_an_iterator*/) + {} + + template + void assign_from_iter(Iterator const& iter) + { + } + }; + + template + struct cons : sequence_base > + { + typedef mpl::int_ size; + typedef cons_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + typedef forward_traversal_tag category; + typedef Car car_type; + typedef Cdr cdr_type; + + cons() + : car(), cdr() {} + + explicit cons(typename detail::call_param::type car) + : car(car), cdr() {} + + cons( + typename detail::call_param::type car + , typename detail::call_param::type cdr) + : car(car), cdr(cdr) {} + + template + cons(cons const& rhs) + : car(rhs.car), cdr(rhs.cdr) {} + + cons(cons const& rhs) + : car(rhs.car), cdr(rhs.cdr) {} + + template + cons( + Sequence const& seq + , typename disable_if< + mpl::or_< + is_convertible // use copy ctor instead + , is_convertible // use copy to car instead + > + >::type* dummy = 0 + ) + : car(*fusion::begin(seq)) + , cdr(fusion::next(fusion::begin(seq)), mpl::true_()) {} + + template + cons(Iterator const& iter, mpl::true_ /*this_is_an_iterator*/) + : car(*iter) + , cdr(fusion::next(iter), mpl::true_()) {} + + template + cons& operator=(cons const& rhs) + { + car = rhs.car; + cdr = rhs.cdr; + return *this; + } + + cons& operator=(cons const& rhs) + { + car = rhs.car; + cdr = rhs.cdr; + return *this; + } + + template + typename disable_if, cons&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type Iterator; + Iterator iter = fusion::begin(seq); + this->assign_from_iter(iter); + return *this; + } + + template + void assign_from_iter(Iterator const& iter) + { + car = *iter; + cdr.assign_from_iter(fusion::next(iter)); + } + + car_type car; + cdr_type cdr; + }; +}} + +#endif + diff --git a/include/boost/fusion/container/list/cons_iterator.hpp b/include/boost/fusion/container/list/cons_iterator.hpp new file mode 100644 index 00000000..7ef034e3 --- /dev/null +++ b/include/boost/fusion/container/list/cons_iterator.hpp @@ -0,0 +1,85 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONS_ITERATOR_07172005_0849) +#define FUSION_CONS_ITERATOR_07172005_0849 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct nil; + struct cons_iterator_tag; + struct forward_traversal_tag; + + template + struct cons_iterator_identity; + + template + struct cons_iterator : iterator_base > + { + typedef cons_iterator_tag fusion_tag; + typedef forward_traversal_tag category; + typedef Cons cons_type; + typedef cons_iterator_identity< + typename add_const::type> + identity; + + explicit cons_iterator(cons_type& cons) + : cons(cons) {} + + cons_type& cons; + }; + + struct nil_iterator : iterator_base + { + typedef forward_traversal_tag category; + typedef cons_iterator_tag fusion_tag; + typedef nil cons_type; + typedef cons_iterator_identity< + add_const::type> + identity; + nil_iterator() {} + explicit nil_iterator(nil const&) {} + }; + + template <> + struct cons_iterator : nil_iterator + { + cons_iterator() {} + explicit cons_iterator(nil const&) {} + }; + + template <> + struct cons_iterator : nil_iterator + { + cons_iterator() {} + explicit cons_iterator(nil const&) {} + }; + + template <> + struct cons_iterator > : nil_iterator + { + cons_iterator() {} + explicit cons_iterator(nil const&) {} + }; + + template <> + struct cons_iterator const> : nil_iterator + { + cons_iterator() {} + explicit cons_iterator(nil const&) {} + }; +}} + +#endif diff --git a/include/boost/fusion/container/list/convert.hpp b/include/boost/fusion/container/list/convert.hpp new file mode 100644 index 00000000..418158cf --- /dev/null +++ b/include/boost/fusion/container/list/convert.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_09232005_1215) +#define FUSION_CONVERT_09232005_1215 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct as_list + { + typedef typename + detail::build_cons< + typename result_of::begin::type + , typename result_of::end::type + > + build_cons; + + typedef typename build_cons::type type; + + static type + call(Sequence& seq) + { + return build_cons::call(fusion::begin(seq), fusion::end(seq)); + } + }; + } + + template + inline typename result_of::as_list::type + as_list(Sequence& seq) + { + return result_of::as_list::call(seq); + } + + template + inline typename result_of::as_list::type + as_list(Sequence const& seq) + { + return result_of::as_list::call(seq); + } +}} + +#endif diff --git a/include/boost/fusion/container/list/detail/at_impl.hpp b/include/boost/fusion/container/list/detail/at_impl.hpp new file mode 100644 index 00000000..54ba6bb8 --- /dev/null +++ b/include/boost/fusion/container/list/detail/at_impl.hpp @@ -0,0 +1,79 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_AT_IMPL_07172005_0726) +#define FUSION_AT_IMPL_07172005_0726 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct cons_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef typename + mpl::eval_if< + is_const + , add_const + , mpl::identity + >::type + cdr_type; + + typedef typename + mpl::eval_if< + mpl::bool_ + , mpl::identity + , apply > + > + element; + + typedef typename + mpl::eval_if< + is_const + , detail::cref_result + , detail::ref_result + >::type + type; + + template + static type + call(Cons& s, mpl::int_) + { + return call(s.cdr, mpl::int_()); + } + + template + static type + call(Cons& s, mpl::int_<0>) + { + return s.car; + } + + static type + call(Sequence& s) + { + return call(s, mpl::int_()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/list/detail/begin_impl.hpp b/include/boost/fusion/container/list/detail/begin_impl.hpp new file mode 100644 index 00000000..a22c9a3d --- /dev/null +++ b/include/boost/fusion/container/list/detail/begin_impl.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_07172005_0824) +#define FUSION_BEGIN_IMPL_07172005_0824 + +#include +#include + +namespace boost { namespace fusion +{ + struct nil; + + struct cons_tag; + + template + struct cons; + + template + struct cons_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef cons_iterator type; + + static type + call(Sequence& t) + { + return type(t); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/list/detail/build_cons.hpp b/include/boost/fusion/container/list/detail/build_cons.hpp new file mode 100644 index 00000000..befbd4e9 --- /dev/null +++ b/include/boost/fusion/container/list/detail/build_cons.hpp @@ -0,0 +1,57 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BUILD_CONS_09232005_1222) +#define FUSION_BUILD_CONS_09232005_1222 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template < + typename First + , typename Last + , bool is_empty = result_of::equal_to::value> + struct build_cons; + + template + struct build_cons + { + typedef nil type; + + static nil + call(First const&, Last const&) + { + return nil(); + } + }; + + template + struct build_cons + { + typedef + build_cons::type, Last> + next_build_cons; + + typedef cons< + typename result_of::value_of::type + , typename next_build_cons::type> + type; + + static type + call(First const& f, Last const& l) + { + return type(*f, next_build_cons::call(fusion::next(f), l)); + } + }; + +}}} + +#endif diff --git a/include/boost/fusion/container/list/detail/convert_impl.hpp b/include/boost/fusion/container/list/detail/convert_impl.hpp new file mode 100644 index 00000000..cfe7a1df --- /dev/null +++ b/include/boost/fusion/container/list/detail/convert_impl.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_IMPL_09232005_1215) +#define FUSION_CONVERT_IMPL_09232005_1215 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct cons_tag; + + namespace extension + { + template + struct convert_impl; + + template <> + struct convert_impl + { + template + struct apply + { + typedef typename + detail::build_cons< + typename result_of::begin::type + , typename result_of::end::type + > + build_cons; + + typedef typename build_cons::type type; + + static type + call(Sequence& seq) + { + return build_cons::call(fusion::begin(seq), fusion::end(seq)); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/list/detail/deref_impl.hpp b/include/boost/fusion/container/list/detail/deref_impl.hpp new file mode 100644 index 00000000..5292dced --- /dev/null +++ b/include/boost/fusion/container/list/detail/deref_impl.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_IMPL_07172005_0831) +#define FUSION_DEREF_IMPL_07172005_0831 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct cons_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename Iterator::cons_type cons_type; + typedef typename cons_type::car_type value_type; + + typedef typename mpl::eval_if< + is_const + , add_reference::type> + , add_reference >::type + type; + + static type + call(Iterator const& i) + { + return i.cons.car; + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/container/list/detail/empty_impl.hpp b/include/boost/fusion/container/list/detail/empty_impl.hpp new file mode 100644 index 00000000..5c92c733 --- /dev/null +++ b/include/boost/fusion/container/list/detail/empty_impl.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SEQUENCE_EMPTY_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_SEQUENCE_EMPTY_IMPL_HPP_INCLUDED + +#include + +namespace boost { namespace fusion +{ + struct cons_tag; + + struct nil; + + template + struct cons; + + namespace extension + { + template + struct empty_impl; + + template <> + struct empty_impl + { + template + struct apply + : boost::is_convertible + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/list/detail/end_impl.hpp b/include/boost/fusion/container/list/detail/end_impl.hpp new file mode 100644 index 00000000..49dca855 --- /dev/null +++ b/include/boost/fusion/container/list/detail/end_impl.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_07172005_0828) +#define FUSION_END_IMPL_07172005_0828 + +#include +#include + +namespace boost { namespace fusion +{ + struct nil; + + struct cons_tag; + + template + struct cons; + + template + struct cons_iterator; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef cons_iterator< + typename mpl::if_, nil const, nil>::type> + type; + + static type + call(Sequence& t) + { + return type(); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/list/detail/equal_to_impl.hpp b/include/boost/fusion/container/list/detail/equal_to_impl.hpp new file mode 100644 index 00000000..11925880 --- /dev/null +++ b/include/boost/fusion/container/list/detail/equal_to_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_EQUAL_TO_IMPL_09172005_1120) +#define FUSION_EQUAL_TO_IMPL_09172005_1120 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct cons_iterator_tag; + + namespace extension + { + template + struct equal_to_impl; + + template <> + struct equal_to_impl + { + template + struct apply + : is_same< + typename I1::identity + , typename I2::identity + > + { + }; + }; + } +}} + +#endif + diff --git a/include/boost/fusion/container/list/detail/list_forward_ctor.hpp b/include/boost/fusion/container/list/detail/list_forward_ctor.hpp new file mode 100644 index 00000000..39471809 --- /dev/null +++ b/include/boost/fusion/container/list/detail/list_forward_ctor.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_LIST_FORWARD_CTOR_07172005_0113) +#define FUSION_LIST_FORWARD_CTOR_07172005_0113 + +#include +#include +#include +#include +#include + +#define FUSION_LIST_CTOR_MAKE_CONS(z, n, type) tie_cons(BOOST_PP_CAT(_, n) +#define FUSION_LIST_CL_PAREN(z, n, type) ) + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE) +#include BOOST_PP_ITERATE() + +#undef FUSION_LIST_CTOR_MAKE_CONS +#undef FUSION_LIST_CL_PAREN + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// +#define N BOOST_PP_ITERATION() + +#if N == 1 + explicit +#endif + list(BOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + : inherited_type(list_to_cons::call(BOOST_PP_ENUM_PARAMS(N, _))) + {} + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/list/detail/list_to_cons.hpp b/include/boost/fusion/container/list/detail/list_to_cons.hpp new file mode 100644 index 00000000..8e6d6912 --- /dev/null +++ b/include/boost/fusion/container/list/detail/list_to_cons.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LIST_TO_CONS_07172005_1041) +#define FUSION_LIST_TO_CONS_07172005_1041 + +#include +#include +#include +#include +#include +#include + +#define FUSION_VOID(z, n, _) void_ + +namespace boost { namespace fusion +{ + struct nil; + struct void_; +}} + +namespace boost { namespace fusion { namespace detail +{ + template + struct list_to_cons + { + typedef T0 head_type; + typedef list_to_cons< + BOOST_PP_ENUM_SHIFTED_PARAMS(FUSION_MAX_LIST_SIZE, T), void_> + tail_list_to_cons; + typedef typename tail_list_to_cons::type tail_type; + + typedef cons type; + + #include + }; + + template <> + struct list_to_cons + { + typedef nil type; + }; +}}} + +#undef FUSION_VOID +#endif diff --git a/include/boost/fusion/container/list/detail/list_to_cons_call.hpp b/include/boost/fusion/container/list/detail/list_to_cons_call.hpp new file mode 100644 index 00000000..069f0598 --- /dev/null +++ b/include/boost/fusion/container/list/detail/list_to_cons_call.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_LIST_TO_CONS_CALL_07192005_0138) +#define FUSION_LIST_TO_CONS_CALL_07192005_0138 + +#include +#include +#include + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE) +#include BOOST_PP_ITERATE() + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// +#define N BOOST_PP_ITERATION() + + static type + call(BOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + { + return type(_0 +#if N > 1 + , tail_list_to_cons::call(BOOST_PP_ENUM_SHIFTED_PARAMS(N, _))); +#else + ); +#endif + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/list/detail/next_impl.hpp b/include/boost/fusion/container/list/detail/next_impl.hpp new file mode 100644 index 00000000..dafa83cc --- /dev/null +++ b/include/boost/fusion/container/list/detail/next_impl.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_IMPL_07172005_0836) +#define FUSION_NEXT_IMPL_07172005_0836 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct cons_iterator_tag; + + template + struct cons_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::cons_type cons_type; + typedef typename cons_type::cdr_type cdr_type; + + typedef cons_iterator< + typename mpl::eval_if< + is_const + , add_const + , mpl::identity + >::type> + type; + + static type + call(Iterator const& i) + { + return type(i.cons.cdr); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/container/list/detail/value_at_impl.hpp b/include/boost/fusion/container/list/detail/value_at_impl.hpp new file mode 100644 index 00000000..5f0ff166 --- /dev/null +++ b/include/boost/fusion/container/list/detail/value_at_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_AT_IMPL_07172005_0952) +#define FUSION_VALUE_AT_IMPL_07172005_0952 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct cons_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename + mpl::eval_if< + mpl::bool_ + , mpl::identity + , apply > + >::type + type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/list/detail/value_of_impl.hpp b/include/boost/fusion/container/list/detail/value_of_impl.hpp new file mode 100644 index 00000000..f8175c6d --- /dev/null +++ b/include/boost/fusion/container/list/detail/value_of_impl.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_OF_IMPL_07172005_0838) +#define FUSION_VALUE_OF_IMPL_07172005_0838 + +namespace boost { namespace fusion +{ + struct cons_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename Iterator::cons_type cons_type; + typedef typename cons_type::car_type type; + }; + }; + } + +}} + +#endif + + diff --git a/include/boost/fusion/container/list/limits.hpp b/include/boost/fusion/container/list/limits.hpp new file mode 100644 index 00000000..20ff6dd2 --- /dev/null +++ b/include/boost/fusion/container/list/limits.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LIST_LIMITS_07172005_0112) +#define FUSION_LIST_LIMITS_07172005_0112 + +#if !defined(FUSION_MAX_LIST_SIZE) +# define FUSION_MAX_LIST_SIZE 10 +#else +# if FUSION_MAX_LIST_SIZE < 3 +# undef FUSION_MAX_LIST_SIZE +# define FUSION_MAX_LIST_SIZE 10 +# endif +#endif + +#endif diff --git a/include/boost/fusion/container/list/list.hpp b/include/boost/fusion/container/list/list.hpp new file mode 100644 index 00000000..7516df48 --- /dev/null +++ b/include/boost/fusion/container/list/list.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LIST_07172005_1153) +#define FUSION_LIST_07172005_1153 + +#include +#include + +namespace boost { namespace fusion +{ + struct nil; + struct void_; + + template + struct list + : detail::list_to_cons::type + { + private: + typedef + detail::list_to_cons + list_to_cons; + + public: + typedef typename list_to_cons::type inherited_type; + + list() + : inherited_type() {} + + template + list(list const& rhs) + : inherited_type(rhs) {} + + template + list(Sequence const& rhs) + : inherited_type(rhs) {} + + // Expand a couple of forwarding constructors for arguments + // of type (T0), (T0, T1), (T0, T1, T2) etc. Exanple: + // + // list( + // typename detail::call_param::type _0 + // , typename detail::call_param::type _1) + // : inherited_type(list_to_cons::call(_0, _1)) {} + #include + + template + list& + operator=(list const& rhs) + { + inherited_type::operator=(rhs); + return *this; + } + + template + list& + operator=(T const& rhs) + { + inherited_type::operator=(rhs); + return *this; + } + }; +}} + +#endif diff --git a/include/boost/fusion/container/list/list_fwd.hpp b/include/boost/fusion/container/list/list_fwd.hpp new file mode 100644 index 00000000..90c088b4 --- /dev/null +++ b/include/boost/fusion/container/list/list_fwd.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LIST_FORWARD_07172005_0224) +#define FUSION_LIST_FORWARD_07172005_0224 + +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_LIST_SIZE, typename T, void_) + > + struct list; +}} + +#endif diff --git a/include/boost/fusion/container/map.hpp b/include/boost/fusion/container/map.hpp new file mode 100644 index 00000000..69518311 --- /dev/null +++ b/include/boost/fusion/container/map.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_CLASS_MAP_10022005_0606) +#define FUSION_SEQUENCE_CLASS_MAP_10022005_0606 + +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/container/map/convert.hpp b/include/boost/fusion/container/map/convert.hpp new file mode 100644 index 00000000..f174da58 --- /dev/null +++ b/include/boost/fusion/container/map/convert.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_09232005_1340) +#define FUSION_CONVERT_09232005_1340 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct as_map + { + typedef typename detail::as_map::value> gen; + typedef typename gen:: + template apply::type>::type + type; + }; + } + + template + inline typename result_of::as_map::type + as_map(Sequence& seq) + { + typedef typename result_of::as_map::gen gen; + return gen::call(fusion::begin(seq)); + } + + template + inline typename result_of::as_map::type + as_map(Sequence const& seq) + { + typedef typename result_of::as_map::gen gen; + return gen::call(fusion::begin(seq)); + } +}} + +#endif diff --git a/include/boost/fusion/container/map/detail/as_map.hpp b/include/boost/fusion/container/map/detail/as_map.hpp new file mode 100644 index 00000000..326877f9 --- /dev/null +++ b/include/boost/fusion/container/map/detail/as_map.hpp @@ -0,0 +1,101 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_AS_MAP_0932005_1339) +#define FUSION_AS_MAP_0932005_1339 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct as_map; + + template <> + struct as_map<0> + { + template + struct apply + { + typedef map<> type; + }; + + template + static typename apply::type + call(Iterator) + { + return map<>(); + } + }; + +#define BOOST_FUSION_NEXT_ITERATOR(z, n, data) \ + typedef typename fusion::result_of::next::type \ + BOOST_PP_CAT(I, BOOST_PP_INC(n)); + +#define BOOST_FUSION_NEXT_CALL_ITERATOR(z, n, data) \ + typename gen::BOOST_PP_CAT(I, BOOST_PP_INC(n)) \ + BOOST_PP_CAT(i, BOOST_PP_INC(n)) = fusion::next(BOOST_PP_CAT(i, n)); + +#define BOOST_FUSION_VALUE_OF_ITERATOR(z, n, data) \ + typedef typename fusion::result_of::value_of::type \ + BOOST_PP_CAT(T, n); + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_MAP_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_NEXT_ITERATOR +#undef BOOST_FUSION_NEXT_CALL_ITERATOR +#undef BOOST_FUSION_VALUE_OF_ITERATOR + +}}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + template <> + struct as_map + { + template + struct apply + { + BOOST_PP_REPEAT(N, BOOST_FUSION_NEXT_ITERATOR, _) + BOOST_PP_REPEAT(N, BOOST_FUSION_VALUE_OF_ITERATOR, _) + typedef map type; + }; + + template + static typename apply::type + call(Iterator const& i0) + { + typedef apply gen; + typedef typename gen::type result; + BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _) + return result(BOOST_PP_ENUM_PARAMS(N, *i)); + } + }; + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/map/detail/at_key_impl.hpp b/include/boost/fusion/container/map/detail/at_key_impl.hpp new file mode 100644 index 00000000..8b0d70aa --- /dev/null +++ b/include/boost/fusion/container/map/detail/at_key_impl.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_AT_KEY_IMPL_05222005_0254) +#define FUSION_AT_KEY_IMPL_05222005_0254 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct map_tag; + + namespace extension + { + template + struct at_key_impl; + + template <> + struct at_key_impl + { + template + struct apply + { + typedef typename Sequence::template meta_at_impl element; + + typedef typename + mpl::eval_if< + is_const + , detail::cref_result + , detail::ref_result + >::type + type; + + static type + call(Sequence& m) + { + return m.at_impl(mpl::identity()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/map/detail/begin_impl.hpp b/include/boost/fusion/container/map/detail/begin_impl.hpp new file mode 100644 index 00000000..5fe25caf --- /dev/null +++ b/include/boost/fusion/container/map/detail/begin_impl.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_05222005_1108) +#define FUSION_BEGIN_IMPL_05222005_1108 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct map_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename + result_of::begin::type + iterator_type; + + typedef typename + result_of::begin::type + const_iterator_type; + + typedef typename + mpl::eval_if< + is_const + , mpl::identity + , mpl::identity + >::type + type; + + static type + call(Sequence& m) + { + return fusion::begin(m.get_data()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/map/detail/convert_impl.hpp b/include/boost/fusion/container/map/detail/convert_impl.hpp new file mode 100644 index 00000000..aedd3e3d --- /dev/null +++ b/include/boost/fusion/container/map/detail/convert_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_IMPL_09232005_1340) +#define FUSION_CONVERT_IMPL_09232005_1340 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct map_tag; + + namespace extension + { + template + struct convert_impl; + + template <> + struct convert_impl + { + template + struct apply + { + typedef typename detail::as_map::value> gen; + typedef typename gen:: + template apply::type>::type + type; + + static type call(Sequence& seq) + { + return gen::call(fusion::begin(seq)); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/map/detail/end_impl.hpp b/include/boost/fusion/container/map/detail/end_impl.hpp new file mode 100644 index 00000000..0cafc92c --- /dev/null +++ b/include/boost/fusion/container/map/detail/end_impl.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_05222005_1108) +#define FUSION_END_IMPL_05222005_1108 + +#include + +namespace boost { namespace fusion +{ + struct map_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename + result_of::end::type + iterator_type; + + typedef typename + result_of::end::type + const_iterator_type; + + typedef typename + mpl::eval_if< + is_const + , mpl::identity + , mpl::identity + >::type + type; + + static type + call(Sequence& m) + { + return fusion::end(m.get_data()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/map/detail/lookup_key.hpp b/include/boost/fusion/container/map/detail/lookup_key.hpp new file mode 100644 index 00000000..17774362 --- /dev/null +++ b/include/boost/fusion/container/map/detail/lookup_key.hpp @@ -0,0 +1,99 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LOOKUP_KEY_07222005_1248) +#define FUSION_LOOKUP_KEY_07222005_1248 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; +}} + +namespace boost { namespace fusion { namespace detail +{ + template + struct map_data_type + { + typedef typename + add_reference< + typename T::second_type + >::type + type; + }; + + template <> + struct map_data_type + { + typedef void_& type; + }; + + template + struct map_const_data_type + { + typedef typename + add_reference< + typename add_const< + typename T::second_type + >::type + >::type + type; + }; + + template <> + struct map_const_data_type + { + typedef void_ const& type; + }; + + template + struct map_value_type + { + typedef typename T::second_type type; + }; + + template <> + struct map_value_type + { + typedef void_ type; + }; + + template + struct map_key_type + { + typedef typename T::first_type type; + }; + + template + struct map_key_type + { + typedef unknown_key type; + }; + + template + struct map_lookup_key + { + static RT + call(Vector& vec) + { + return vec.at_impl(mpl::int_()).second; + } + }; + + template + struct map_lookup_key, Vector> + { + static void_& + call(Vector& vec); // intentionally undefined + }; +}}} + +#endif + diff --git a/include/boost/fusion/container/map/detail/map_forward_ctor.hpp b/include/boost/fusion/container/map/detail/map_forward_ctor.hpp new file mode 100644 index 00000000..c35168ba --- /dev/null +++ b/include/boost/fusion/container/map/detail/map_forward_ctor.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAP_FORWARD_CTOR_07222005_0106) +#define FUSION_MAP_FORWARD_CTOR_07222005_0106 + +#include +#include +#include + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_MAP_SIZE) +#include BOOST_PP_ITERATE() + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + +#if N == 1 + explicit +#endif + map(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _)) + : data(BOOST_PP_ENUM_PARAMS(N, _)) {} + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/map/detail/map_lookup.hpp b/include/boost/fusion/container/map/detail/map_lookup.hpp new file mode 100644 index 00000000..2f792cbd --- /dev/null +++ b/include/boost/fusion/container/map/detail/map_lookup.hpp @@ -0,0 +1,128 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAP_LOOKUP_07212005_1118) +#define FUSION_MAP_LOOKUP_07212005_1118 + +#include +#include +#include +#include +#include + +#if defined(BOOST_MSVC) && (BOOST_MSVC == 1310) +#pragma warning (push) +#pragma warning(disable: 4348) // redefinition of default parameter +#endif + + template + struct meta_at_impl + { + typedef void_ type; + }; + + template + struct meta_find_impl + { + typedef vector_iterator type; + }; + + template + struct meta_find_impl_const + { + typedef vector_iterator type; + }; + + template + vector_iterator + find_impl(mpl::identity) const + { + return vector_iterator(data); + } + + template + vector_iterator + find_impl(mpl::identity) + { + return vector_iterator(data); + } + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_DEC(FUSION_MAX_MAP_SIZE)) +#include BOOST_PP_ITERATE() + +#if defined(BOOST_MSVC) && (BOOST_MSVC == 1310) +#pragma warning (pop) +#endif + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + template + struct meta_at_impl< + typename detail::map_key_type::type, dummy> + { + typedef typename detail::map_value_type::type type; + }; + + typename detail::map_data_type::type + at_impl(mpl::identity::type>) + { + return detail::map_lookup_key< + N + , typename detail::map_data_type::type + , typename detail::map_key_type::type + , storage_type>::call(data); + } + + typename detail::map_const_data_type::type + at_impl(mpl::identity::type>) const + { + return detail::map_lookup_key< + N + , typename detail::map_const_data_type::type + , typename detail::map_key_type::type + , storage_type const>::call(data); + } + + template + struct meta_find_impl< + typename detail::map_key_type::type, dummy> + { + typedef vector_iterator type; + }; + + template + struct meta_find_impl_const< + typename detail::map_key_type::type, dummy> + { + typedef vector_iterator type; + }; + + vector_iterator + find_impl(mpl::identity::type>) + { + return vector_iterator(data); + } + + vector_iterator + find_impl(mpl::identity::type>) const + { + return vector_iterator(data); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/map/detail/value_at_key_impl.hpp b/include/boost/fusion/container/map/detail/value_at_key_impl.hpp new file mode 100644 index 00000000..6c516462 --- /dev/null +++ b/include/boost/fusion/container/map/detail/value_at_key_impl.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_AT_KEY_IMPL_05222005_0325) +#define FUSION_VALUE_AT_KEY_IMPL_05222005_0325 + +namespace boost { namespace fusion +{ + struct map_tag; + + namespace extension + { + template + struct value_at_key_impl; + + template <> + struct value_at_key_impl + { + template + struct apply + { + typedef typename Sequence:: + template meta_at_impl::type type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/map/limits.hpp b/include/boost/fusion/container/map/limits.hpp new file mode 100644 index 00000000..738abff4 --- /dev/null +++ b/include/boost/fusion/container/map/limits.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_MAP_LIMITS_07212005_1104) +#define FUSION_MAP_LIMITS_07212005_1104 + +#include + +#if !defined(FUSION_MAX_MAP_SIZE) +# define FUSION_MAX_MAP_SIZE FUSION_MAX_VECTOR_SIZE +#else +# if FUSION_MAX_MAP_SIZE < 3 +# undef FUSION_MAX_MAP_SIZE +# if (FUSION_MAX_VECTOR_SIZE > 10) +# define FUSION_MAX_MAP_SIZE 10 +# else +# define FUSION_MAX_MAP_SIZE FUSION_MAX_VECTOR_SIZE +# endif +# endif +#endif + +#endif diff --git a/include/boost/fusion/container/map/map.hpp b/include/boost/fusion/container/map/map.hpp new file mode 100644 index 00000000..5f5fb1cc --- /dev/null +++ b/include/boost/fusion/container/map/map.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_MAP_07212005_1106) +#define FUSION_MAP_07212005_1106 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + struct map_tag; + struct fusion_sequence_tag; + + template + struct map : sequence_base > + { + struct category : forward_traversal_tag, associative_sequence_tag {}; + + typedef map_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + + typedef vector< + BOOST_PP_ENUM_PARAMS(FUSION_MAX_MAP_SIZE, T)> + storage_type; + + typedef typename storage_type::size size; + + map() + : data() {} + + template + map(Sequence const& rhs) + : data(rhs) {} + + #include + #include + + template + map& + operator=(T const& rhs) + { + data = rhs; + return *this; + } + + storage_type& get_data() { return data; } + storage_type const& get_data() const { return data; } + + private: + + storage_type data; + }; +}} + +#endif diff --git a/include/boost/fusion/container/map/map_fwd.hpp b/include/boost/fusion/container/map/map_fwd.hpp new file mode 100644 index 00000000..660466bd --- /dev/null +++ b/include/boost/fusion/container/map/map_fwd.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_MAP_FORWARD_07212005_1105) +#define FUSION_MAP_FORWARD_07212005_1105 + +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_MAP_SIZE, typename T, void_) + > + struct map; +}} + +#endif diff --git a/include/boost/fusion/container/set.hpp b/include/boost/fusion/container/set.hpp new file mode 100644 index 00000000..6b7674d6 --- /dev/null +++ b/include/boost/fusion/container/set.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_CLASS_SET_10022005_0607) +#define FUSION_SEQUENCE_CLASS_SET_10022005_0607 + +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/container/set/convert.hpp b/include/boost/fusion/container/set/convert.hpp new file mode 100644 index 00000000..1aaddf0c --- /dev/null +++ b/include/boost/fusion/container/set/convert.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_09232005_1341) +#define FUSION_CONVERT_09232005_1341 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct as_set + { + typedef typename detail::as_set::value> gen; + typedef typename gen:: + template apply::type>::type + type; + }; + } + + template + inline typename result_of::as_set::type + as_set(Sequence& seq) + { + typedef typename result_of::as_set::gen gen; + return gen::call(fusion::begin(seq)); + } + + template + inline typename result_of::as_set::type + as_set(Sequence const& seq) + { + typedef typename result_of::as_set::gen gen; + return gen::call(fusion::begin(seq)); + } +}} + +#endif diff --git a/include/boost/fusion/container/set/detail/as_set.hpp b/include/boost/fusion/container/set/detail/as_set.hpp new file mode 100644 index 00000000..33786338 --- /dev/null +++ b/include/boost/fusion/container/set/detail/as_set.hpp @@ -0,0 +1,101 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_AS_SET_0932005_1341) +#define FUSION_AS_SET_0932005_1341 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct as_set; + + template <> + struct as_set<0> + { + template + struct apply + { + typedef set<> type; + }; + + template + static typename apply::type + call(Iterator) + { + return set<>(); + } + }; + +#define BOOST_FUSION_NEXT_ITERATOR(z, n, data) \ + typedef typename fusion::result_of::next::type \ + BOOST_PP_CAT(I, BOOST_PP_INC(n)); + +#define BOOST_FUSION_NEXT_CALL_ITERATOR(z, n, data) \ + typename gen::BOOST_PP_CAT(I, BOOST_PP_INC(n)) \ + BOOST_PP_CAT(i, BOOST_PP_INC(n)) = fusion::next(BOOST_PP_CAT(i, n)); + +#define BOOST_FUSION_VALUE_OF_ITERATOR(z, n, data) \ + typedef typename fusion::result_of::value_of::type \ + BOOST_PP_CAT(T, n); + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_SET_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_NEXT_ITERATOR +#undef BOOST_FUSION_NEXT_CALL_ITERATOR +#undef BOOST_FUSION_VALUE_OF_ITERATOR + +}}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + template <> + struct as_set + { + template + struct apply + { + BOOST_PP_REPEAT(N, BOOST_FUSION_NEXT_ITERATOR, _) + BOOST_PP_REPEAT(N, BOOST_FUSION_VALUE_OF_ITERATOR, _) + typedef set type; + }; + + template + static typename apply::type + call(Iterator const& i0) + { + typedef apply gen; + typedef typename gen::type result; + BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _) + return result(BOOST_PP_ENUM_PARAMS(N, *i)); + } + }; + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/set/detail/at_key_impl.hpp b/include/boost/fusion/container/set/detail/at_key_impl.hpp new file mode 100644 index 00000000..d0c1de00 --- /dev/null +++ b/include/boost/fusion/container/set/detail/at_key_impl.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_AT_KEY_IMPL_09162005_1118) +#define FUSION_AT_KEY_IMPL_09162005_1118 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct set_tag; + + namespace extension + { + template + struct at_key_impl; + + template <> + struct at_key_impl + { + template + struct apply + { + typedef typename Sequence::template meta_at_impl element; + + typedef typename + mpl::eval_if< + is_const + , detail::cref_result + , detail::ref_result + >::type + type; + + static type + call(Sequence& s) + { + return s.at_impl(mpl::identity()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/set/detail/begin_impl.hpp b/include/boost/fusion/container/set/detail/begin_impl.hpp new file mode 100644 index 00000000..9b42df72 --- /dev/null +++ b/include/boost/fusion/container/set/detail/begin_impl.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_09162005_1120) +#define FUSION_BEGIN_IMPL_09162005_1120 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct set_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename + result_of::begin::type + iterator_type; + + typedef typename + result_of::begin::type + const_iterator_type; + + typedef typename + mpl::eval_if< + is_const + , mpl::identity + , mpl::identity + >::type + type; + + static type + call(Sequence& s) + { + return fusion::begin(s.get_data()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/set/detail/convert_impl.hpp b/include/boost/fusion/container/set/detail/convert_impl.hpp new file mode 100644 index 00000000..1aa79fb1 --- /dev/null +++ b/include/boost/fusion/container/set/detail/convert_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_IMPL_09232005_1341) +#define FUSION_CONVERT_IMPL_09232005_1341 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct set_tag; + + namespace extension + { + template + struct convert_impl; + + template <> + struct convert_impl + { + template + struct apply + { + typedef typename detail::as_set::value> gen; + typedef typename gen:: + template apply::type>::type + type; + + static type call(Sequence& seq) + { + return gen::call(fusion::begin(seq)); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/set/detail/end_impl.hpp b/include/boost/fusion/container/set/detail/end_impl.hpp new file mode 100644 index 00000000..4df78a3f --- /dev/null +++ b/include/boost/fusion/container/set/detail/end_impl.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_09162005_1121) +#define FUSION_END_IMPL_09162005_1121 + +#include + +namespace boost { namespace fusion +{ + struct set_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename + result_of::end::type + iterator_type; + + typedef typename + result_of::end::type + const_iterator_type; + + typedef typename + mpl::eval_if< + is_const + , mpl::identity + , mpl::identity + >::type + type; + + static type + call(Sequence& s) + { + return fusion::end(s.get_data()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/set/detail/lookup_key.hpp b/include/boost/fusion/container/set/detail/lookup_key.hpp new file mode 100644 index 00000000..a1b9e8b9 --- /dev/null +++ b/include/boost/fusion/container/set/detail/lookup_key.hpp @@ -0,0 +1,93 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LOOKUP_KEY_09162005_1111) +#define FUSION_LOOKUP_KEY_09162005_1111 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; +}} + +namespace boost { namespace fusion { namespace detail +{ + template + struct set_data_type + { + typedef typename add_reference::type type; + }; + + template <> + struct set_data_type + { + typedef void_& type; + }; + + template + struct set_const_data_type + { + typedef typename + add_reference< + typename add_const::type + >::type + type; + }; + + template <> + struct set_const_data_type + { + typedef void_ const& type; + }; + + template + struct set_value_type + { + typedef T type; + }; + + template <> + struct set_value_type + { + typedef void_ type; + }; + + template + struct set_key_type + { + typedef T type; + }; + + template + struct set_key_type + { + typedef unknown_key type; + }; + + template + struct set_lookup_key + { + static RT + call(Vector& vec) + { + return vec.at_impl(mpl::int_()); + } + }; + + template + struct set_lookup_key, Vector> + { + static void_& + call(Vector& vec); // intentionally undefined + }; +}}} + +#endif + diff --git a/include/boost/fusion/container/set/detail/set_forward_ctor.hpp b/include/boost/fusion/container/set/detail/set_forward_ctor.hpp new file mode 100644 index 00000000..d105b150 --- /dev/null +++ b/include/boost/fusion/container/set/detail/set_forward_ctor.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_SET_FORWARD_CTOR_09162005_1115) +#define FUSION_SET_FORWARD_CTOR_09162005_1115 + +#include +#include +#include + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_SET_SIZE) +#include BOOST_PP_ITERATE() + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + +#if N == 1 + explicit +#endif + set(BOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + : data(BOOST_PP_ENUM_PARAMS(N, _)) {} + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/set/detail/set_lookup.hpp b/include/boost/fusion/container/set/detail/set_lookup.hpp new file mode 100644 index 00000000..6df4b401 --- /dev/null +++ b/include/boost/fusion/container/set/detail/set_lookup.hpp @@ -0,0 +1,128 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_SET_LOOKUP_09162005_1116) +#define FUSION_SET_LOOKUP_09162005_1116 + +#include +#include +#include +#include +#include + +#if defined(BOOST_MSVC) && (BOOST_MSVC == 1310) +#pragma warning (push) +#pragma warning(disable: 4348) // redefinition of default parameter +#endif + + template + struct meta_at_impl + { + typedef void_ type; + }; + + template + struct meta_find_impl + { + typedef vector_iterator type; + }; + + template + struct meta_find_impl_const + { + typedef vector_iterator type; + }; + + template + vector_iterator + find_impl(mpl::identity) const + { + return vector_iterator(data); + } + + template + vector_iterator + find_impl(mpl::identity) + { + return vector_iterator(data); + } + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (0, BOOST_PP_DEC(FUSION_MAX_SET_SIZE)) +#include BOOST_PP_ITERATE() + +#if defined(BOOST_MSVC) && (BOOST_MSVC == 1310) +#pragma warning (pop) +#endif + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + template + struct meta_at_impl< + typename detail::set_key_type::type, dummy> + { + typedef typename detail::set_value_type::type type; + }; + + typename detail::set_data_type::type + at_impl(mpl::identity::type>) + { + return detail::set_lookup_key< + N + , typename detail::set_data_type::type + , typename detail::set_key_type::type + , storage_type>::call(data); + } + + typename detail::set_const_data_type::type + at_impl(mpl::identity::type>) const + { + return detail::set_lookup_key< + N + , typename detail::set_const_data_type::type + , typename detail::set_key_type::type + , storage_type const>::call(data); + } + + template + struct meta_find_impl< + typename detail::set_key_type::type, dummy> + { + typedef vector_iterator type; + }; + + template + struct meta_find_impl_const< + typename detail::set_key_type::type, dummy> + { + typedef vector_iterator type; + }; + + vector_iterator + find_impl(mpl::identity::type>) + { + return vector_iterator(data); + } + + vector_iterator + find_impl(mpl::identity::type>) const + { + return vector_iterator(data); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/set/detail/value_at_key_impl.hpp b/include/boost/fusion/container/set/detail/value_at_key_impl.hpp new file mode 100644 index 00000000..40f68ba0 --- /dev/null +++ b/include/boost/fusion/container/set/detail/value_at_key_impl.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_AT_KEY_IMPL_09162005_1123) +#define FUSION_VALUE_AT_KEY_IMPL_09162005_1123 + +#include + +namespace boost { namespace fusion +{ + struct set_tag; + + namespace extension + { + template + struct value_at_key_impl; + + template <> + struct value_at_key_impl + { + template + struct apply + { + typedef typename Sequence:: + template meta_at_impl::type type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/set/limits.hpp b/include/boost/fusion/container/set/limits.hpp new file mode 100644 index 00000000..35eb0803 --- /dev/null +++ b/include/boost/fusion/container/set/limits.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SET_LIMITS_09162005_1103) +#define FUSION_SET_LIMITS_09162005_1103 + +#include + +#if !defined(FUSION_MAX_SET_SIZE) +# define FUSION_MAX_SET_SIZE FUSION_MAX_VECTOR_SIZE +#else +# if FUSION_MAX_SET_SIZE < 3 +# undef FUSION_MAX_SET_SIZE +# if (FUSION_MAX_VECTOR_SIZE > 10) +# define FUSION_MAX_SET_SIZE 10 +# else +# define FUSION_MAX_SET_SIZE FUSION_MAX_VECTOR_SIZE +# endif +# endif +#endif + +#endif diff --git a/include/boost/fusion/container/set/set.hpp b/include/boost/fusion/container/set/set.hpp new file mode 100644 index 00000000..07580bb6 --- /dev/null +++ b/include/boost/fusion/container/set/set.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SET_09162005_1104) +#define FUSION_SET_09162005_1104 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + struct set_tag; + struct fusion_sequence_tag; + + template + struct set : sequence_base > + { + struct category : forward_traversal_tag, associative_sequence_tag {}; + + typedef set_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + + typedef vector< + BOOST_PP_ENUM_PARAMS(FUSION_MAX_SET_SIZE, T)> + storage_type; + + typedef typename storage_type::size size; + + set() + : data() {} + + template + set(Sequence const& rhs) + : data(rhs) {} + + #include + #include + + template + set& + operator=(T const& rhs) + { + data = rhs; + return *this; + } + + storage_type& get_data() { return data; } + storage_type const& get_data() const { return data; } + + private: + + storage_type data; + }; +}} + +#endif diff --git a/include/boost/fusion/container/set/set_fwd.hpp b/include/boost/fusion/container/set/set_fwd.hpp new file mode 100644 index 00000000..7facb513 --- /dev/null +++ b/include/boost/fusion/container/set/set_fwd.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SET_FORWARD_09162005_1102) +#define FUSION_SET_FORWARD_09162005_1102 + +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_SET_SIZE, typename T, void_) + > + struct set; +}} + +#endif diff --git a/include/boost/fusion/container/vector.hpp b/include/boost/fusion/container/vector.hpp new file mode 100644 index 00000000..389a102e --- /dev/null +++ b/include/boost/fusion/container/vector.hpp @@ -0,0 +1,21 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_CLASS_VECTOR_10022005_0602) +#define FUSION_SEQUENCE_CLASS_VECTOR_10022005_0602 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/container/vector/convert.hpp b/include/boost/fusion/container/vector/convert.hpp new file mode 100644 index 00000000..a31578a2 --- /dev/null +++ b/include/boost/fusion/container/vector/convert.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_09222005_1104) +#define FUSION_CONVERT_09222005_1104 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template + struct as_vector + { + typedef typename detail::as_vector::value> gen; + typedef typename gen:: + template apply::type>::type + type; + }; + } + + template + inline typename result_of::as_vector::type + as_vector(Sequence& seq) + { + typedef typename result_of::as_vector::gen gen; + return gen::call(fusion::begin(seq)); + } + + template + inline typename result_of::as_vector::type + as_vector(Sequence const& seq) + { + typedef typename result_of::as_vector::gen gen; + return gen::call(fusion::begin(seq)); + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/advance_impl.hpp b/include/boost/fusion/container/vector/detail/advance_impl.hpp new file mode 100644 index 00000000..c2c97b18 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/advance_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ADVANCE_IMPL_09172005_1156) +#define FUSION_ADVANCE_IMPL_09172005_1156 + +namespace boost { namespace fusion +{ + struct vector_iterator_tag; + + template + struct vector_iterator; + + namespace extension + { + template + struct advance_impl; + + template <> + struct advance_impl + { + template + struct apply + { + typedef typename Iterator::index index; + typedef typename Iterator::vector vector; + typedef vector_iterator type; + + static type + call(Iterator const& i) + { + return type(i.vec); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/as_vector.hpp b/include/boost/fusion/container/vector/detail/as_vector.hpp new file mode 100644 index 00000000..fa8dadcf --- /dev/null +++ b/include/boost/fusion/container/vector/detail/as_vector.hpp @@ -0,0 +1,101 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_AS_VECTOR_09222005_0950) +#define FUSION_AS_VECTOR_09222005_0950 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct as_vector; + + template <> + struct as_vector<0> + { + template + struct apply + { + typedef vector<> type; + }; + + template + static typename apply::type + call(Iterator) + { + return vector<>(); + } + }; + +#define BOOST_FUSION_NEXT_ITERATOR(z, n, data) \ + typedef typename fusion::result_of::next::type \ + BOOST_PP_CAT(I, BOOST_PP_INC(n)); + +#define BOOST_FUSION_NEXT_CALL_ITERATOR(z, n, data) \ + typename gen::BOOST_PP_CAT(I, BOOST_PP_INC(n)) \ + BOOST_PP_CAT(i, BOOST_PP_INC(n)) = fusion::next(BOOST_PP_CAT(i, n)); + +#define BOOST_FUSION_VALUE_OF_ITERATOR(z, n, data) \ + typedef typename fusion::result_of::value_of::type \ + BOOST_PP_CAT(T, n); + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_NEXT_ITERATOR +#undef BOOST_FUSION_NEXT_CALL_ITERATOR +#undef BOOST_FUSION_VALUE_OF_ITERATOR + +}}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + template <> + struct as_vector + { + template + struct apply + { + BOOST_PP_REPEAT(N, BOOST_FUSION_NEXT_ITERATOR, _) + BOOST_PP_REPEAT(N, BOOST_FUSION_VALUE_OF_ITERATOR, _) + typedef vector type; + }; + + template + static typename apply::type + call(Iterator const& i0) + { + typedef apply gen; + typedef typename gen::type result; + BOOST_PP_REPEAT(BOOST_PP_DEC(N), BOOST_FUSION_NEXT_CALL_ITERATOR, _) + return result(BOOST_PP_ENUM_PARAMS(N, *i)); + } + }; + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/vector/detail/at_impl.hpp b/include/boost/fusion/container/vector/detail/at_impl.hpp new file mode 100644 index 00000000..1a00f428 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/at_impl.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_AT_IMPL_05042005_0741) +#define FUSION_AT_IMPL_05042005_0741 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef mpl::at element; + typedef typename + mpl::eval_if< + is_const + , detail::cref_result + , detail::ref_result + >::type + type; + + static type + call(Sequence& v) + { + return v.at_impl(N()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/begin_impl.hpp b/include/boost/fusion/container/vector/detail/begin_impl.hpp new file mode 100644 index 00000000..d2d687be --- /dev/null +++ b/include/boost/fusion/container/vector/detail/begin_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_05042005_1136) +#define FUSION_BEGIN_IMPL_05042005_1136 + +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef vector_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/convert_impl.hpp b/include/boost/fusion/container/vector/detail/convert_impl.hpp new file mode 100644 index 00000000..5e1d080f --- /dev/null +++ b/include/boost/fusion/container/vector/detail/convert_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_IMPL_09222005_1104) +#define FUSION_CONVERT_IMPL_09222005_1104 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct convert_impl; + + template <> + struct convert_impl + { + template + struct apply + { + typedef typename detail::as_vector::value> gen; + typedef typename gen:: + template apply::type>::type + type; + + static type call(Sequence& seq) + { + return gen::call(fusion::begin(seq)); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/deref_impl.hpp b/include/boost/fusion/container/vector/detail/deref_impl.hpp new file mode 100644 index 00000000..bd9f3d06 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/deref_impl.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_IMPL_05042005_1037) +#define FUSION_DEREF_IMPL_05042005_1037 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename Iterator::vector vector; + typedef typename Iterator::index index; + typedef typename mpl::at< + typename vector::types, index> + element; + + typedef typename + mpl::eval_if< + is_const + , fusion::detail::cref_result + , fusion::detail::ref_result + >::type + type; + + static type + call(Iterator const& i) + { + return i.vec.at_impl(index()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/distance_impl.hpp b/include/boost/fusion/container/vector/detail/distance_impl.hpp new file mode 100644 index 00000000..9664d5c2 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/distance_impl.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DISTANCE_IMPL_09172005_0751) +#define FUSION_DISTANCE_IMPL_09172005_0751 + +#include + +namespace boost { namespace fusion +{ + struct vector_iterator_tag; + + namespace extension + { + template + struct distance_impl; + + template <> + struct distance_impl + { + template + struct apply : mpl::minus + { + static typename mpl::minus< + typename Last::index, typename First::index>::type + call(First const&, Last const&) + { + typedef typename mpl::minus< + typename Last::index, typename First::index>::type + result; + return result(); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/end_impl.hpp b/include/boost/fusion/container/vector/detail/end_impl.hpp new file mode 100644 index 00000000..f33282dc --- /dev/null +++ b/include/boost/fusion/container/vector/detail/end_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_05042005_1142) +#define FUSION_END_IMPL_05042005_1142 + +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::size size; + typedef vector_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/equal_to_impl.hpp b/include/boost/fusion/container/vector/detail/equal_to_impl.hpp new file mode 100644 index 00000000..5ff81c61 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/equal_to_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_EQUAL_TO_IMPL_05052005_1215) +#define FUSION_EQUAL_TO_IMPL_05052005_1215 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_iterator_tag; + + namespace extension + { + template + struct equal_to_impl; + + template <> + struct equal_to_impl + { + template + struct apply + : is_same< + typename I1::identity + , typename I2::identity + > + { + }; + }; + } +}} + +#endif + diff --git a/include/boost/fusion/container/vector/detail/next_impl.hpp b/include/boost/fusion/container/vector/detail/next_impl.hpp new file mode 100644 index 00000000..b11cfdb2 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/next_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_IMPL_05042005_1058) +#define FUSION_NEXT_IMPL_05042005_1058 + +#include + +namespace boost { namespace fusion +{ + struct vector_iterator_tag; + template + struct vector_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::vector vector; + typedef typename Iterator::index index; + typedef vector_iterator type; + + static type + call(Iterator const& i) + { + return type(i.vec); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/prior_impl.hpp b/include/boost/fusion/container/vector/detail/prior_impl.hpp new file mode 100644 index 00000000..610591b6 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/prior_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PRIOR_IMPL_05042005_1145) +#define FUSION_PRIOR_IMPL_05042005_1145 + +#include + +namespace boost { namespace fusion +{ + struct vector_iterator_tag; + template + struct vector_iterator; + + namespace extension + { + template + struct prior_impl; + + template <> + struct prior_impl + { + template + struct apply + { + typedef typename Iterator::vector vector; + typedef typename Iterator::index index; + typedef vector_iterator type; + + static type + call(Iterator const& i) + { + return type(i.vec); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/value_at_impl.hpp b/include/boost/fusion/container/vector/detail/value_at_impl.hpp new file mode 100644 index 00000000..0178054b --- /dev/null +++ b/include/boost/fusion/container/vector/detail/value_at_impl.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_AT_IMPL_05052005_0232) +#define FUSION_VALUE_AT_IMPL_05052005_0232 + +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename mpl::at::type type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/value_of_impl.hpp b/include/boost/fusion/container/vector/detail/value_of_impl.hpp new file mode 100644 index 00000000..3a775fbb --- /dev/null +++ b/include/boost/fusion/container/vector/detail/value_of_impl.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_OF_IMPL_05052005_1128) +#define FUSION_VALUE_OF_IMPL_05052005_1128 + +#include + +namespace boost { namespace fusion +{ + struct vector_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename Iterator::vector vector; + typedef typename Iterator::index index; + typedef typename mpl::at< + typename vector::types, index>::type + type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp b/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp new file mode 100644 index 00000000..e4680bb8 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_VECTOR_FORWARD_CTOR_07122005_1123) +#define FUSION_VECTOR_FORWARD_CTOR_07122005_1123 + +#include +#include +#include + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + +#if N == 1 + explicit +#endif + vector(BOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + : vec(BOOST_PP_ENUM_PARAMS(N, _)) {} + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/container/vector/detail/vector_n.hpp b/include/boost/fusion/container/vector/detail/vector_n.hpp new file mode 100644 index 00000000..01981ab3 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/vector_n.hpp @@ -0,0 +1,150 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +// No include guard. This file is meant to be included many times + +#if !defined(FUSION_MACRO_05042005) +#define FUSION_MACRO_05042005 + +#define FUSION_MEMBER_DEFAULT_INIT(z, n, _) m##n(T##n()) +#define FUSION_MEMBER_INIT(z, n, _) m##n(_##n) +#define FUSION_COPY_INIT(z, n, _) m##n(other.m##n) +#define FUSION_MEMBER_DECL(z, n, _) T##n m##n; + +#define FUSION_MEMBER_ASSIGN(z, n, _) \ + this->BOOST_PP_CAT(m, n) = vec.BOOST_PP_CAT(m, n); + +#define FUSION_DEREF_MEMBER_ASSIGN(z, n, _) \ + this->BOOST_PP_CAT(m, n) = *BOOST_PP_CAT(i, n); + +#define FUSION_AT_IMPL(z, n, _) \ + typename add_reference::type \ + at_impl(mpl::int_) { return this->m##n; } \ + typename add_reference::type>::type \ + at_impl(mpl::int_) const { return this->m##n; } + +#define FUSION_ITER_DECL_VAR(z, n, _) \ + typedef typename result_of::next< \ + BOOST_PP_CAT(I, BOOST_PP_DEC(n))>::type BOOST_PP_CAT(I, n); \ + BOOST_PP_CAT(I, n) BOOST_PP_CAT(i, n) \ + = fusion::next(BOOST_PP_CAT(i, BOOST_PP_DEC(n))); + +#endif + +#define N BOOST_PP_ITERATION() + + template + struct BOOST_PP_CAT(vector_data, N) : sequence_base + { + BOOST_PP_CAT(vector_data, N)() + : BOOST_PP_ENUM(N, FUSION_MEMBER_DEFAULT_INIT, _) {} + + BOOST_PP_CAT(vector_data, N)( + BOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + : BOOST_PP_ENUM(N, FUSION_MEMBER_INIT, _) {} + + BOOST_PP_CAT(vector_data, N)( + BOOST_PP_CAT(vector_data, N) const& other) + : BOOST_PP_ENUM(N, FUSION_COPY_INIT, _) {} + + BOOST_PP_CAT(vector_data, N)& + operator=(BOOST_PP_CAT(vector_data, N) const& vec) + { + BOOST_PP_REPEAT(N, FUSION_MEMBER_ASSIGN, _) + return *this; + } + + template + static BOOST_PP_CAT(vector_data, N) + init_from_sequence(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_ITER_DECL_VAR, _) + return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i)); + } + + BOOST_PP_REPEAT(N, FUSION_MEMBER_DECL, _) + }; + + template + struct BOOST_PP_CAT(vector, N) + : BOOST_PP_CAT(vector_data, N)< + BOOST_PP_CAT(vector, N) + , BOOST_PP_ENUM_PARAMS(N, T)> + { + typedef BOOST_PP_CAT(vector, N) this_type; + typedef BOOST_PP_CAT(vector_data, N) base_type; + typedef mpl::BOOST_PP_CAT(vector, N) types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_ size; + + BOOST_PP_CAT(vector, N)() {} + +#if (N == 1) + explicit +#endif + BOOST_PP_CAT(vector, N)( + BOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + : base_type(BOOST_PP_ENUM_PARAMS(N, _)) {} + + template + BOOST_PP_CAT(vector, N)( + BOOST_PP_CAT(vector, N) const& vec) + : base_type(BOOST_PP_ENUM_PARAMS(N, vec.m)) {} + + template + BOOST_PP_CAT(vector, N)( + Sequence const& seq +#if (N == 1) + , typename disable_if >::type* dummy = 0 +#endif + ) + : base_type(base_type::init_from_sequence(seq)) {} + + template + BOOST_PP_CAT(vector, N)& + operator=(BOOST_PP_CAT(vector, N) const& vec) + { + BOOST_PP_REPEAT(N, FUSION_MEMBER_ASSIGN, _) + return *this; + } + + template + typename disable_if, this_type&>::type + operator=(Sequence const& seq) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(seq); + BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_ITER_DECL_VAR, _) + BOOST_PP_REPEAT(N, FUSION_DEREF_MEMBER_ASSIGN, _) + return *this; + } + + BOOST_PP_REPEAT(N, FUSION_AT_IMPL, _) + + template + typename add_reference::type>::type + at_impl(I i) + { + return this->at_impl(mpl::int_()); + } + + template + typename add_reference::type>::type>::type + at_impl(I i) const + { + return this->at_impl(mpl::int_()); + } + }; + +#undef N + diff --git a/include/boost/fusion/container/vector/detail/vector_n_chooser.hpp b/include/boost/fusion/container/vector/detail/vector_n_chooser.hpp new file mode 100644 index 00000000..29248907 --- /dev/null +++ b/include/boost/fusion/container/vector/detail/vector_n_chooser.hpp @@ -0,0 +1,99 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_VECTOR_N_CHOOSER_07072005_1248) +#define FUSION_VECTOR_N_CHOOSER_07072005_1248 + +#include + +// include vector0..N where N is FUSION_MAX_VECTOR_SIZE +#include +#if (FUSION_MAX_VECTOR_SIZE > 10) +#include +#endif +#if (FUSION_MAX_VECTOR_SIZE > 20) +#include +#endif +#if (FUSION_MAX_VECTOR_SIZE > 30) +#include +#endif +#if (FUSION_MAX_VECTOR_SIZE > 40) +#include +#endif + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; +}} + +namespace boost { namespace fusion { namespace detail +{ + template + struct get_vector_n; + + template <> + struct get_vector_n<0> + { + template + struct call + { + typedef vector0 type; + }; + }; + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + + template + struct vector_n_chooser + { + typedef + mpl::BOOST_PP_CAT(vector, FUSION_MAX_VECTOR_SIZE) + + input; + + typedef typename mpl::begin::type begin; + typedef typename mpl::find::type end; + typedef typename mpl::distance::type size; + + typedef typename get_vector_n::template + call::type + type; + }; +}}} + +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// +#else // defined(BOOST_PP_IS_ITERATING) + +#define N BOOST_PP_ITERATION() + + template <> + struct get_vector_n + { + template + struct call + { + typedef BOOST_PP_CAT(vector, N) type; + }; + }; + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) diff --git a/include/boost/fusion/container/vector/limits.hpp b/include/boost/fusion/container/vector/limits.hpp new file mode 100644 index 00000000..0e7e3a03 --- /dev/null +++ b/include/boost/fusion/container/vector/limits.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR_LIMITS_07072005_1246) +#define FUSION_VECTOR_LIMITS_07072005_1246 + +#if !defined(FUSION_MAX_VECTOR_SIZE) +# define FUSION_MAX_VECTOR_SIZE 10 +#else +# if FUSION_MAX_VECTOR_SIZE < 3 +# undef FUSION_MAX_VECTOR_SIZE +# define FUSION_MAX_VECTOR_SIZE 10 +# endif +#endif + +#endif diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp new file mode 100644 index 00000000..bd05badd --- /dev/null +++ b/include/boost/fusion/container/vector/vector.hpp @@ -0,0 +1,152 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR_07072005_1244) +#define FUSION_VECTOR_07072005_1244 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + struct fusion_sequence_tag; + + template + struct vector + : sequence_base > + { + private: + + typedef typename detail::vector_n_chooser< + BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>::type + vector_n; + + template + friend struct vector; + + public: + + typedef typename vector_n::types types; + typedef typename vector_n::fusion_tag fusion_tag; + typedef typename vector_n::tag tag; + typedef typename vector_n::size size; + typedef typename vector_n::category category; + typedef typename vector_n::is_view is_view; + + vector() + : vec() {} + + template + vector(vector const& rhs) + : vec(rhs.vec) {} + + vector(vector const& rhs) + : vec(rhs.vec) {} + + template + vector(Sequence const& rhs) +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1400) + : vec(ctor_helper(rhs, is_base_of())) {} +#else + : vec(rhs) {} +#endif + + // Expand a couple of forwarding constructors for arguments + // of type (T0), (T0, T1), (T0, T1, T2) etc. Example: + // + // vector( + // typename detail::call_param::type _0 + // , typename detail::call_param::type _1) + // : vec(_0, _1) {} + #include + + template + vector& + operator=(vector const& rhs) + { + vec = rhs.vec; + return *this; + } + + template + vector& + operator=(T const& rhs) + { + vec = rhs; + return *this; + } + + template + typename add_reference< + typename mpl::at_c::type + >::type + at_impl(mpl::int_ index) + { + return vec.at_impl(index); + } + + template + typename add_reference< + typename add_const< + typename mpl::at_c::type + >::type + >::type + at_impl(mpl::int_ index) const + { + return vec.at_impl(index); + } + + template + typename add_reference< + typename mpl::at::type + >::type + at_impl(I index) + { + return vec.at_impl(mpl::int_()); + } + + template + typename add_reference< + typename add_const< + typename mpl::at::type + >::type + >::type + at_impl(I index) const + { + return vec.at_impl(mpl::int_()); + } + + private: + +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1400) + static vector_n const& + ctor_helper(vector const& rhs, mpl::true_) + { + return rhs.vec; + } + + template + static T const& + ctor_helper(T const& rhs, mpl::false_) + { + return rhs; + } +#endif + + vector_n vec; + }; +}} + +#endif diff --git a/include/boost/fusion/container/vector/vector10.hpp b/include/boost/fusion/container/vector/vector10.hpp new file mode 100644 index 00000000..28531b6f --- /dev/null +++ b/include/boost/fusion/container/vector/vector10.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR10_05042005_0257) +#define FUSION_VECTOR10_05042005_0257 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + + struct vector0 : sequence_base + { + typedef mpl::vector0<> types; + typedef vector_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::false_ is_view; + typedef random_access_traversal_tag category; + typedef mpl::int_<0> size; + + vector0() {} + + template + vector0(Sequence const& seq) + {} + }; + +// expand vector1 to vector10 +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, 10) +#include BOOST_PP_ITERATE() + +}} + +#endif + diff --git a/include/boost/fusion/container/vector/vector20.hpp b/include/boost/fusion/container/vector/vector20.hpp new file mode 100644 index 00000000..be711006 --- /dev/null +++ b/include/boost/fusion/container/vector/vector20.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR20_05052005_0205) +#define FUSION_VECTOR20_05052005_0205 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +// expand vector11 to vector20 +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (11, 20) +#include BOOST_PP_ITERATE() + +}} + +#endif + diff --git a/include/boost/fusion/container/vector/vector30.hpp b/include/boost/fusion/container/vector/vector30.hpp new file mode 100644 index 00000000..efbe9293 --- /dev/null +++ b/include/boost/fusion/container/vector/vector30.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR30_05052005_0206) +#define FUSION_VECTOR30_05052005_0206 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +// expand vector21 to vector30 +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (21, 30) +#include BOOST_PP_ITERATE() + +}} + +#endif + diff --git a/include/boost/fusion/container/vector/vector40.hpp b/include/boost/fusion/container/vector/vector40.hpp new file mode 100644 index 00000000..b72a23c5 --- /dev/null +++ b/include/boost/fusion/container/vector/vector40.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR40_05052005_0208) +#define FUSION_VECTOR40_05052005_0208 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +// expand vector31 to vector40 +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (31, 40) +#include BOOST_PP_ITERATE() + +}} + +#endif + diff --git a/include/boost/fusion/container/vector/vector50.hpp b/include/boost/fusion/container/vector/vector50.hpp new file mode 100644 index 00000000..ab8515d7 --- /dev/null +++ b/include/boost/fusion/container/vector/vector50.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR50_05052005_0207) +#define FUSION_VECTOR50_05052005_0207 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_tag; + struct fusion_sequence_tag; + struct random_access_traversal_tag; + +// expand vector41 to vector50 +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (41, 50) +#include BOOST_PP_ITERATE() + +}} + +#endif + diff --git a/include/boost/fusion/container/vector/vector_fwd.hpp b/include/boost/fusion/container/vector/vector_fwd.hpp new file mode 100644 index 00000000..a6b9cc66 --- /dev/null +++ b/include/boost/fusion/container/vector/vector_fwd.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR_FORWARD_07072005_0125) +#define FUSION_VECTOR_FORWARD_07072005_0125 + +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_VECTOR_SIZE, typename T, void_) + > + struct vector; +}} + +#endif diff --git a/include/boost/fusion/container/vector/vector_iterator.hpp b/include/boost/fusion/container/vector/vector_iterator.hpp new file mode 100644 index 00000000..9feeb520 --- /dev/null +++ b/include/boost/fusion/container/vector/vector_iterator.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VECTOR_ITERATOR_05042005_0635) +#define FUSION_VECTOR_ITERATOR_05042005_0635 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct vector_iterator_tag; + struct random_access_traversal_tag; + + template + struct vector_iterator_identity; + + template + struct vector_iterator : iterator_base > + { + typedef mpl::int_ index; + typedef Vector vector; + typedef vector_iterator_tag fusion_tag; + typedef random_access_traversal_tag category; + typedef vector_iterator_identity< + typename add_const::type, N> identity; + + vector_iterator(Vector& vec) + : vec(vec) {} + Vector& vec; + }; +}} + +#endif + diff --git a/include/boost/fusion/functional.hpp b/include/boost/fusion/functional.hpp new file mode 100644 index 00000000..12662d97 --- /dev/null +++ b/include/boost/fusion/functional.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_HPP_INCLUDED + +#include +#include +#include + +#endif + diff --git a/include/boost/fusion/functional/adapter.hpp b/include/boost/fusion/functional/adapter.hpp new file mode 100644 index 00000000..734dac39 --- /dev/null +++ b/include/boost/fusion/functional/adapter.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_HPP_INCLUDED +#include +#include +#include +#include +#include +#include +#include +#endif diff --git a/include/boost/fusion/functional/adapter/detail/access.hpp b/include/boost/fusion/functional/adapter/detail/access.hpp new file mode 100644 index 00000000..ee03ffd0 --- /dev/null +++ b/include/boost/fusion/functional/adapter/detail/access.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_DETAIL_ACCESS_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_DETAIL_ACCESS_HPP_INCLUDED + +namespace boost { namespace fusion { namespace detail +{ + // const reference deduction for function templates that accept T const & + template struct cref { typedef T const& type; }; + template struct cref { typedef T const& type; }; + template struct cref { typedef T const& type; }; + + // mutable reference deduction for function templates that accept T & + template struct mref { typedef T & type; }; + template struct mref { typedef T & type; }; + + // generic reference deduction for function templates that are overloaded + // to accept both T const & and T & + template struct gref { typedef T const& type; }; + template struct gref { typedef T & type; }; + template struct gref { typedef T const& type; }; + + // appropriately qualified target function in const context + template struct qf_c { typedef T const type; }; + template struct qf_c { typedef T const type; }; + template struct qf_c { typedef T type; }; + + // appropriately qualified target function in non-const context + template struct qf { typedef T type; }; + template struct qf { typedef T const type; }; + template struct qf { typedef T type; }; +}}} + +#endif + diff --git a/include/boost/fusion/functional/adapter/detail/pow2_explode.hpp b/include/boost/fusion/functional/adapter/detail/pow2_explode.hpp new file mode 100644 index 00000000..2d14ad70 --- /dev/null +++ b/include/boost/fusion/functional/adapter/detail/pow2_explode.hpp @@ -0,0 +1,118 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_PP_IS_ITERATING) +# error "This file has to be included by a preprocessor loop construct!" +#elif BOOST_PP_ITERATION_DEPTH() == 1 + +# if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_DETAIL_POW2_EXPLODE_HPP_INCLUDED) +# include +# include +# include +# define BOOST_FUSION_FUNCTIONAL_ADAPTER_DETAIL_POW2_EXPLODE_HPP_INCLUDED +# endif + +# define BOOST_PP_VALUE 0 +# include BOOST_PP_ASSIGN_SLOT(1) + +# define BOOST_PP_FILENAME_2 \ + +# define BOOST_PP_VALUE (1 << N) >> 4 +# if BOOST_PP_VALUE > BOOST_PP_LIMIT_ITERATION +# error "Preprocessor limit exceeded." +# endif + +# include BOOST_PP_ASSIGN_SLOT(2) +# define BOOST_PP_ITERATION_LIMITS (0,BOOST_PP_DEC(BOOST_PP_SLOT_2())) +# include BOOST_PP_ITERATE() + +#elif BOOST_PP_ITERATION_DEPTH() == 2 + +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# if BOOST_PP_SLOT_1() < 1 << N +# include BOOST_PP_INDIRECT_SELF +# define BOOST_PP_VALUE BOOST_PP_SLOT_1() + 1 +# include BOOST_PP_ASSIGN_SLOT(1) +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif +# endif + +#endif + diff --git a/include/boost/fusion/functional/adapter/detail/pt_def.hpp b/include/boost/fusion/functional/adapter/detail/pt_def.hpp new file mode 100644 index 00000000..8f85cf44 --- /dev/null +++ b/include/boost/fusion/functional/adapter/detail/pt_def.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +// No include guard - this file is included multiple times intentionally. + +#if BOOST_PP_SLOT_1() & 0x001 +# define PT0 T0 & +#else +# define PT0 T0 const & +#endif +#if BOOST_PP_SLOT_1() & 0x002 +# define PT1 T1 & +#else +# define PT1 T1 const & +#endif +#if BOOST_PP_SLOT_1() & 0x004 +# define PT2 T2 & +#else +# define PT2 T2 const & +#endif +#if BOOST_PP_SLOT_1() & 0x008 +# define PT3 T3 & +#else +# define PT3 T3 const & +#endif +#if BOOST_PP_SLOT_1() & 0x010 +# define PT4 T4 & +#else +# define PT4 T4 const & +#endif +#if BOOST_PP_SLOT_1() & 0x020 +# define PT5 T5 & +#else +# define PT5 T5 const & +#endif +#if BOOST_PP_SLOT_1() & 0x040 +# define PT6 T6 & +#else +# define PT6 T6 const & +#endif +#if BOOST_PP_SLOT_1() & 0x080 +# define PT7 T7 & +#else +# define PT7 T7 const & +#endif +#if BOOST_PP_SLOT_1() & 0x100 +# define PT8 T8 & +#else +# define PT8 T8 const & +#endif +#if BOOST_PP_SLOT_1() & 0x200 +# define PT9 T9 & +#else +# define PT9 T9 const & +#endif +#if BOOST_PP_SLOT_1() & 0x400 +# define PT10 T10 & +#else +# define PT10 T10 const & +#endif +#if BOOST_PP_SLOT_1() & 0x800 +# define PT11 T11 & +#else +# define PT11 T11 const & +#endif + diff --git a/include/boost/fusion/functional/adapter/detail/pt_undef.hpp b/include/boost/fusion/functional/adapter/detail/pt_undef.hpp new file mode 100644 index 00000000..dca50043 --- /dev/null +++ b/include/boost/fusion/functional/adapter/detail/pt_undef.hpp @@ -0,0 +1,23 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +// No include guard - this file is included multiple times intentionally. + +#undef PT0 +#undef PT1 +#undef PT2 +#undef PT3 +#undef PT4 +#undef PT5 +#undef PT6 +#undef PT7 +#undef PT8 +#undef PT9 +#undef PT10 +#undef PT11 + diff --git a/include/boost/fusion/functional/adapter/fused.hpp b/include/boost/fusion/functional/adapter/fused.hpp new file mode 100644 index 00000000..08e8897a --- /dev/null +++ b/include/boost/fusion/functional/adapter/fused.hpp @@ -0,0 +1,85 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_HPP_INCLUDED + +#include + +#include +#include + +namespace boost { namespace fusion +{ + template class fused; + + //----- ---- --- -- - - - - + + template + class fused + { + Function fnc_transformed; + + typedef typename detail::qf_c::type & func_const_fwd_t; + typedef typename detail::qf::type & func_fwd_t; + + public: + + inline explicit fused(func_const_fwd_t f = Function()) + : fnc_transformed(f) + { } + + template + inline typename result_of::invoke::type + operator()(Seq const & s) const + { + return fusion::invoke(this->fnc_transformed,s); + } + + template + inline typename result_of::invoke::type + operator()(Seq const & s) + { + return fusion::invoke(this->fnc_transformed,s); + } + + template + inline typename result_of::invoke::type + operator()(Seq & s) const + { + return fusion::invoke(this->fnc_transformed,s); + } + + template + inline typename result_of::invoke::type + operator()(Seq & s) + { + return fusion::invoke(this->fnc_transformed,s); + } + + template + struct result; + + template + struct result< Self const (Seq) > + : result_of::invoke::type > + { }; + + template + struct result< Self(Seq) > + : result_of::invoke::type > + { }; + + }; + +}} + +#endif + diff --git a/include/boost/fusion/functional/adapter/fused_function_object.hpp b/include/boost/fusion/functional/adapter/fused_function_object.hpp new file mode 100644 index 00000000..12cd1e27 --- /dev/null +++ b/include/boost/fusion/functional/adapter/fused_function_object.hpp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP_INCLUDED + +#include + +#include +#include + +namespace boost { namespace fusion +{ + template class fused_function_object; + + //----- ---- --- -- - - - - + + template + class fused_function_object + { + Function fnc_transformed; + + typedef typename detail::qf_c::type & func_const_fwd_t; + typedef typename detail::qf::type & func_fwd_t; + + public: + + inline explicit fused_function_object(func_const_fwd_t f = Function()) + : fnc_transformed(f) + { } + + template + inline typename result_of::invoke_function_object::type operator()(Seq const & s) const + { + return fusion::invoke_function_object< + func_const_fwd_t >(this->fnc_transformed,s); + } + + template + inline typename result_of::invoke_function_object::type + operator()(Seq const & s) + { + return fusion::invoke_function_object< + func_fwd_t >(this->fnc_transformed,s); + } + + template + inline typename result_of::invoke_function_object::type + operator()(Seq & s) const + { + return fusion::invoke_function_object< + func_const_fwd_t >(this->fnc_transformed,s); + } + + template + inline typename result_of::invoke_function_object::type + operator()(Seq & s) + { + return fusion::invoke_function_object< + func_fwd_t >(this->fnc_transformed,s); + } + + template + struct result; + + template + struct result< Self const (Seq) > + : result_of::invoke_function_object::type > + { }; + + template + struct result< Self(Seq) > + : result_of::invoke_function_object::type > + { }; + }; + +}} + +#endif + diff --git a/include/boost/fusion/functional/adapter/fused_procedure.hpp b/include/boost/fusion/functional/adapter/fused_procedure.hpp new file mode 100644 index 00000000..78034b97 --- /dev/null +++ b/include/boost/fusion/functional/adapter/fused_procedure.hpp @@ -0,0 +1,70 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_PROCEDURE_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_PROCEDURE_HPP_INCLUDED + +#include + +#include +#include + +namespace boost { namespace fusion +{ + template class fused_procedure; + + //----- ---- --- -- - - - - + + template + class fused_procedure + { + Function fnc_transformed; + + typedef typename detail::qf_c::type & func_const_fwd_t; + typedef typename detail::qf::type & func_fwd_t; + + public: + + inline explicit fused_procedure(func_const_fwd_t f = Function()) + : fnc_transformed(f) + { } + + template + inline void operator()(Seq const & s) const + { + fusion::invoke_procedure< + func_const_fwd_t >(this->fnc_transformed,s); + } + + template + inline void operator()(Seq const & s) + { + fusion::invoke_procedure< + func_fwd_t >(this->fnc_transformed,s); + } + + template + inline void operator()(Seq & s) const + { + fusion::invoke_procedure< + func_const_fwd_t >(this->fnc_transformed,s); + } + + template + inline void operator()(Seq & s) + { + return fusion::invoke_procedure< + func_fwd_t >(this->fnc_transformed,s); + } + + typedef void result_type; + }; +}} + +#endif + diff --git a/include/boost/fusion/functional/adapter/limits.hpp b/include/boost/fusion/functional/adapter/limits.hpp new file mode 100644 index 00000000..cf6701c4 --- /dev/null +++ b/include/boost/fusion/functional/adapter/limits.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_LIMITS_HPP_INCLUDED) +# define BOOST_FUSION_FUNCTIONAL_ADAPTER_LIMITS_HPP_INCLUDED + +# include + +# if !defined(BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY) +# define BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY 6 +# elif BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY > FUSION_MAX_VECTOR_SIZE +# error "BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY > FUSION_MAX_VECTOR_SIZE" +# endif +# if !defined(BOOST_FUSION_UNFUSED_RVALUE_ARGS_MAX_ARITY) +# define BOOST_FUSION_UNFUSED_RVALUE_ARGS_MAX_ARITY 6 +# elif BOOST_FUSION_UNFUSED_RVALUE_ARGS_MAX_ARITY > FUSION_MAX_VECTOR_SIZE +# error "BOOST_FUSION_UNFUSED_RVALUE_ARGS_MAX_ARITY > FUSION_MAX_VECTOR_SIZE" +# endif +# if !defined(BOOST_FUSION_UNFUSED_LVALUE_ARGS_MAX_ARITY) +# define BOOST_FUSION_UNFUSED_LVALUE_ARGS_MAX_ARITY 6 +# elif BOOST_FUSION_UNFUSED_LVALUE_ARGS_MAX_ARITY > FUSION_MAX_VECTOR_SIZE +# error "BOOST_FUSION_UNFUSED_LVALUE_ARGS_MAX_ARITY > FUSION_MAX_VECTOR_SIZE" +# endif +# if !defined(BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY) +# define BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY 6 +# elif BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY > FUSION_MAX_VECTOR_SIZE +# error "BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY > FUSION_MAX_VECTOR_SIZE" +# endif +# if !defined(BOOST_FUSION_CONSTRUCTOR_MAX_ARITY) +# define BOOST_FUSION_CONSTRUCTOR_MAX_ARITY 6 +# endif + +#endif + diff --git a/include/boost/fusion/functional/adapter/unfused_generic.hpp b/include/boost/fusion/functional/adapter/unfused_generic.hpp new file mode 100644 index 00000000..82b1e4b0 --- /dev/null +++ b/include/boost/fusion/functional/adapter/unfused_generic.hpp @@ -0,0 +1,175 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_GENERIC_HPP_INCLUDED) +#if !defined(BOOST_PP_IS_ITERATING) + +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +namespace boost { namespace fusion +{ + template class unfused_generic; + + //----- ---- --- -- - - - - + + template + class unfused_generic + { + Function fnc_transformed; + + typedef typename detail::qf_c::type function_c; + typedef typename detail::qf::type function; + + typedef typename detail::call_param::type func_const_fwd_t; + + public: + + inline explicit unfused_generic(func_const_fwd_t f = Function()) + : fnc_transformed(f) + { } + + template + struct result; + + typedef typename boost::result_of< + function_c(fusion::vector0 &) >::type call_const_0_result; + + inline call_const_0_result operator()() const + { + fusion::vector0 arg; + return this->fnc_transformed(arg); + } + + typedef typename boost::result_of< + function (fusion::vector0 &) >::type call_0_result; + + inline call_0_result operator()() + { + fusion::vector0 arg; + return this->fnc_transformed(arg); + } + + #define BOOST_FUSION_CODE(tpl_params,arg_types,params,args) \ + template \ + inline typename boost::result_of & )>::type \ + operator()(params) const \ + { \ + BOOST_PP_CAT(fusion::vector,N) arg(args); \ + return this->fnc_transformed(arg); \ + } \ + template \ + inline typename boost::result_of & )>::type \ + operator()(params) \ + { \ + BOOST_PP_CAT(fusion::vector,N) arg(args); \ + return this->fnc_transformed(arg); \ + } + + #define BOOST_PP_INDIRECT_SELF \ + + #define BOOST_PP_FILENAME_1 \ + + #define BOOST_PP_ITERATION_LIMITS \ + (1,BOOST_FUSION_UNFUSED_GENERIC_MAX_ARITY) + #define N BOOST_PP_ITERATION_1 + #include BOOST_PP_ITERATE() + #undef N + + #undef BOOST_FUSION_CODE + }; +}} + +namespace boost +{ + template + struct result_of const ()> + { + typedef typename boost::fusion::unfused_generic::call_const_0_result type; + }; + template + struct result_of()> + { + typedef typename boost::fusion::unfused_generic::call_0_result type; + }; +} + +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_GENERIC_HPP_INCLUDED +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#include + +#if BOOST_PP_SLOT_1() == 0 + template + struct result + < Self const (BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of::type BOOST_PP_INTERCEPT) > & )> + { }; + + template + struct result + < Self(BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of::type BOOST_PP_INTERCEPT) > & )> + { }; +#endif + +#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1400)) + template + inline typename boost::result_of & )>::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a)) const + { + BOOST_PP_CAT(fusion::vector,N) + arg(BOOST_PP_ENUM_PARAMS(N,a)); + return this->fnc_transformed(arg); + } + template + inline typename boost::result_of & )>::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a)) + { + BOOST_PP_CAT(fusion::vector,N) + arg(BOOST_PP_ENUM_PARAMS(N,a)); + return this->fnc_transformed(arg); + } +#else + BOOST_FUSION_CODE(BOOST_PP_ENUM_PARAMS(N,typename T), + BOOST_PP_ENUM_PARAMS(N,PT), BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a), + BOOST_PP_ENUM_PARAMS(N,a) ) + // ...generates uglier code but is faster - it caches ENUM_* +#endif + +#include + +#endif // defined(BOOST_PP_IS_ITERATING) +#endif + diff --git a/include/boost/fusion/functional/adapter/unfused_lvalue_args.hpp b/include/boost/fusion/functional/adapter/unfused_lvalue_args.hpp new file mode 100644 index 00000000..ba2f31b6 --- /dev/null +++ b/include/boost/fusion/functional/adapter/unfused_lvalue_args.hpp @@ -0,0 +1,136 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_LVALUE_ARGS_HPP_INCLUDED) +#if !defined(BOOST_PP_IS_ITERATING) + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +namespace boost { namespace fusion +{ + template class unfused_lvalue_args; + + //----- ---- --- -- - - - - + + template class unfused_lvalue_args + { + Function fnc_transformed; + + typedef typename detail::qf_c::type function_c; + typedef typename detail::qf::type function; + + typedef typename detail::call_param::type func_const_fwd_t; + + public: + + inline explicit unfused_lvalue_args(func_const_fwd_t f = function()) + : fnc_transformed(f) + { } + + template + struct result; + + typedef typename boost::result_of< + function_c(fusion::vector0 &) >::type call_const_0_result; + + inline call_const_0_result operator()() const + { + fusion::vector0 arg; + return this->fnc_transformed(arg); + } + + typedef typename boost::result_of< + function(fusion::vector0 &) >::type call_0_result; + + inline call_0_result operator()() + { + fusion::vector0 arg; + return this->fnc_transformed(arg); + } + + #define BOOST_PP_FILENAME_1 \ + + #define BOOST_PP_ITERATION_LIMITS \ + (1,BOOST_FUSION_UNFUSED_LVALUE_ARGS_MAX_ARITY) + #include BOOST_PP_ITERATE() + }; +}} + +namespace boost +{ + template + struct result_of< boost::fusion::unfused_lvalue_args const () > + { + typedef typename boost::fusion::unfused_lvalue_args::call_const_0_result type; + }; + template + struct result_of< boost::fusion::unfused_lvalue_args() > + { + typedef typename boost::fusion::unfused_lvalue_args::call_0_result type; + }; +} + +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_LVALUE_ARGS_HPP_INCLUDED +#else // defined(BOOST_PP_IS_ITERATING) +//////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +//////////////////////////////////////////////////////////////////////////////// +#define N BOOST_PP_ITERATION() + + template + struct result< Self const (BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of< function_c( + BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N, + typename detail::mref::type BOOST_PP_INTERCEPT) > & )> + { }; + + template + struct result< Self(BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of< function( + BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N, + typename detail::mref::type BOOST_PP_INTERCEPT) > & )> + { }; + + template + inline typename boost::result_of & )>::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const + { + BOOST_PP_CAT(fusion::vector,N)< + BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT) > + arg(BOOST_PP_ENUM_PARAMS(N,a)); + return this->fnc_transformed(arg); + } + + template + inline typename boost::result_of & )>::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) + { + BOOST_PP_CAT(fusion::vector,N)< + BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT) > + arg(BOOST_PP_ENUM_PARAMS(N,a)); + return this->fnc_transformed(arg); + } +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) +#endif + diff --git a/include/boost/fusion/functional/adapter/unfused_rvalue_args.hpp b/include/boost/fusion/functional/adapter/unfused_rvalue_args.hpp new file mode 100644 index 00000000..3c80475e --- /dev/null +++ b/include/boost/fusion/functional/adapter/unfused_rvalue_args.hpp @@ -0,0 +1,137 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_RVALUE_ARGS_HPP_INCLUDED) +#if !defined(BOOST_PP_IS_ITERATING) + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +namespace boost { namespace fusion +{ + template class unfused_rvalue_args; + + //----- ---- --- -- - - - - + + template class unfused_rvalue_args + { + Function fnc_transformed; + + typedef typename detail::qf_c::type function_c; + typedef typename detail::qf::type function; + + typedef typename detail::call_param::type func_const_fwd_t; + + public: + + inline explicit unfused_rvalue_args(func_const_fwd_t f = function()) + : fnc_transformed(f) + { } + + template + struct result; + + typedef typename boost::result_of< + function_c(fusion::vector0 &) >::type call_const_0_result; + + inline call_const_0_result operator()() const + { + fusion::vector0 arg; + return this->fnc_transformed(arg); + } + + typedef typename boost::result_of< + function(fusion::vector0 &) >::type call_0_result; + + inline call_0_result operator()() + { + fusion::vector0 arg; + return this->fnc_transformed(arg); + } + + #define BOOST_PP_FILENAME_1 \ + + #define BOOST_PP_ITERATION_LIMITS \ + (1,BOOST_FUSION_UNFUSED_RVALUE_ARGS_MAX_ARITY) + #include BOOST_PP_ITERATE() + }; +}} + +namespace boost +{ + template + struct result_of const ()> + { + typedef typename boost::fusion::unfused_rvalue_args::call_const_0_result type; + }; + template + struct result_of()> + { + typedef typename boost::fusion::unfused_rvalue_args::call_0_result type; + }; +} + +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_RVALUE_ARGS_HPP_INCLUDED +#else // defined(BOOST_PP_IS_ITERATING) +//////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +//////////////////////////////////////////////////////////////////////////////// +#define N BOOST_PP_ITERATION() + + template + struct result< Self const (BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of< function_c( + BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N, + typename detail::cref::type BOOST_PP_INTERCEPT) > & )> + { }; + + template + struct result< Self (BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of< function( + BOOST_PP_CAT(fusion::vector,N)< BOOST_PP_ENUM_BINARY_PARAMS(N, + typename detail::cref::type BOOST_PP_INTERCEPT) > & )> + { }; + + template + inline typename boost::result_of & )>::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const& a)) const + { + BOOST_PP_CAT(fusion::vector,N)< + BOOST_PP_ENUM_BINARY_PARAMS(N,T,const& BOOST_PP_INTERCEPT) > + arg(BOOST_PP_ENUM_PARAMS(N,a)); + return this->fnc_transformed(arg); + } + + template + inline typename boost::result_of & )>::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const& a)) + { + BOOST_PP_CAT(fusion::vector,N)< + BOOST_PP_ENUM_BINARY_PARAMS(N,T,const& BOOST_PP_INTERCEPT) > + arg(BOOST_PP_ENUM_PARAMS(N,a)); + return this->fnc_transformed(arg); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) +#endif + diff --git a/include/boost/fusion/functional/adapter/unfused_typed.hpp b/include/boost/fusion/functional/adapter/unfused_typed.hpp new file mode 100644 index 00000000..9ee3a7a6 --- /dev/null +++ b/include/boost/fusion/functional/adapter/unfused_typed.hpp @@ -0,0 +1,155 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_TYPED_HPP_INCLUDED) +#if !defined(BOOST_PP_IS_ITERATING) + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + + +namespace boost { namespace fusion +{ + + template class unfused_typed; + + //----- ---- --- -- - - - - + + namespace detail + { + template + struct unfused_typed_impl; + } + + template + class unfused_typed + : public detail::unfused_typed_impl + < unfused_typed, Function, Sequence, + result_of::size::value > + { + Function fnc_transformed; + + template + friend struct detail::unfused_typed_impl; + + typedef typename detail::call_param::type func_const_fwd_t; + + public: + + inline explicit unfused_typed(func_const_fwd_t f = Function()) + : fnc_transformed(f) + { } + }; + + #define BOOST_PP_FILENAME_1 + #define BOOST_PP_ITERATION_LIMITS (0,BOOST_FUSION_UNFUSED_TYPED_MAX_ARITY) + #include BOOST_PP_ITERATE() + +}} + +namespace boost +{ + template + struct result_of< boost::fusion::unfused_typed const () > + : boost::fusion::unfused_typed::template result< + boost::fusion::unfused_typed const () > + { }; + template + struct result_of< boost::fusion::unfused_typed() > + : boost::fusion::unfused_typed::template result< + boost::fusion::unfused_typed () > + { }; +} + + +#define BOOST_FUSION_FUNCTIONAL_ADAPTER_UNFUSED_TYPED_HPP_INCLUDED +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// +#define N BOOST_PP_ITERATION() + + namespace detail + { + + template + struct unfused_typed_impl + { + typedef typename detail::qf_c::type function_c; + typedef typename detail::qf::type function; + typedef typename result_of::as_vector::type arg_vector_t; + + public: + +#define M(z,i,s) \ + typename call_param::type>::type a##i + + inline typename boost::result_of< + function_c(arg_vector_t &) >::type + operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) const + { +#if N > 0 + arg_vector_t arg(BOOST_PP_ENUM_PARAMS(N,a)); +#else + arg_vector_t arg; +#endif + return static_cast(this)->fnc_transformed(arg); + } + + inline typename boost::result_of< + function(arg_vector_t &) >::type + operator()(BOOST_PP_ENUM(N,M,arg_vector_t)) + { +#if N > 0 + arg_vector_t arg(BOOST_PP_ENUM_PARAMS(N,a)); +#else + arg_vector_t arg; +#endif + return static_cast(this)->fnc_transformed(arg); + } + +#undef M + + template struct result { typedef void type; }; + + template + struct result< Self const (BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of< function_c(arg_vector_t &) > + { }; + + template + struct result< Self (BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of< function(arg_vector_t &) > + { }; + }; + + } // namespace detail + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) +#endif + diff --git a/include/boost/fusion/functional/generation.hpp b/include/boost/fusion/functional/generation.hpp new file mode 100644 index 00000000..3dabd3ee --- /dev/null +++ b/include/boost/fusion/functional/generation.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_GENERATION_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_GENERATION_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp b/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp new file mode 100644 index 00000000..1c2c3e95 --- /dev/null +++ b/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +// No include guard - this file is included multiple times intentionally. + +#include +#include + +#if !defined(BOOST_FUSION_CLASS_TPL_NAME) +# error "BOOST_FUSION_CLASS_TPL_NAME undefined" +#endif + +#define BOOST_FUSION_FUNC_NAME BOOST_PP_CAT(make_,BOOST_FUSION_CLASS_TPL_NAME) + +namespace boost { namespace fusion +{ + + namespace result_of + { + template + struct BOOST_FUSION_FUNC_NAME + { + typedef fusion::BOOST_FUSION_CLASS_TPL_NAME< + typename fusion::detail::as_fusion_element::type > type; + }; + } + + template + inline typename result_of::BOOST_FUSION_FUNC_NAME::type + BOOST_FUSION_FUNC_NAME(F const & f) + { + return typename result_of::BOOST_FUSION_FUNC_NAME::type(f); + } + +}} + +#undef BOOST_FUSION_CLASS_TPL_NAME +#undef BOOST_FUSION_FUNC_NAME + diff --git a/include/boost/fusion/functional/generation/make_fused.hpp b/include/boost/fusion/functional/generation/make_fused.hpp new file mode 100644 index 00000000..12365824 --- /dev/null +++ b/include/boost/fusion/functional/generation/make_fused.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_HPP_INCLUDED + +#include + +#define BOOST_FUSION_CLASS_TPL_NAME fused +#include + +#endif + diff --git a/include/boost/fusion/functional/generation/make_fused_function_object.hpp b/include/boost/fusion/functional/generation/make_fused_function_object.hpp new file mode 100644 index 00000000..4146ddd6 --- /dev/null +++ b/include/boost/fusion/functional/generation/make_fused_function_object.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_FUNCTION_OBJECT_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_FUNCTION_OBJECT_HPP_INCLUDED + +#include + +#define BOOST_FUSION_CLASS_TPL_NAME fused_function_object +#include + +#endif + diff --git a/include/boost/fusion/functional/generation/make_fused_procedure.hpp b/include/boost/fusion/functional/generation/make_fused_procedure.hpp new file mode 100644 index 00000000..0687577c --- /dev/null +++ b/include/boost/fusion/functional/generation/make_fused_procedure.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_PROCEDURE_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_FUSED_PROCEDURE_HPP_INCLUDED + +#include + +#define BOOST_FUSION_CLASS_TPL_NAME fused_procedure +#include + +#endif + diff --git a/include/boost/fusion/functional/generation/make_unfused_generic.hpp b/include/boost/fusion/functional/generation/make_unfused_generic.hpp new file mode 100644 index 00000000..87a99c59 --- /dev/null +++ b/include/boost/fusion/functional/generation/make_unfused_generic.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_UNFUSED_GENERIC_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_UNFUSED_GENERIC_HPP_INCLUDED + +#include + +#define BOOST_FUSION_CLASS_TPL_NAME unfused_generic +#include + +#endif + diff --git a/include/boost/fusion/functional/generation/make_unfused_lvalue_args.hpp b/include/boost/fusion/functional/generation/make_unfused_lvalue_args.hpp new file mode 100644 index 00000000..f3c49e45 --- /dev/null +++ b/include/boost/fusion/functional/generation/make_unfused_lvalue_args.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_UNFUSED_LVALUE_ARGS_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_UNFUSED_LVALUE_ARGS_HPP_INCLUDED + +#include + +#define BOOST_FUSION_CLASS_TPL_NAME unfused_lvalue_args +#include + +#endif + diff --git a/include/boost/fusion/functional/generation/make_unfused_rvalue_args.hpp b/include/boost/fusion/functional/generation/make_unfused_rvalue_args.hpp new file mode 100644 index 00000000..9322e1e0 --- /dev/null +++ b/include/boost/fusion/functional/generation/make_unfused_rvalue_args.hpp @@ -0,0 +1,18 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_UNFUSED_RVALUE_ARGS_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_GENERATION_MAKE_UNFUSED_RVALUE_ARGS_HPP_INCLUDED + +#include + +#define BOOST_FUSION_CLASS_TPL_NAME unfused_rvalue_args +#include + +#endif + diff --git a/include/boost/fusion/functional/invocation.hpp b/include/boost/fusion/functional/invocation.hpp new file mode 100644 index 00000000..3ca68c34 --- /dev/null +++ b/include/boost/fusion/functional/invocation.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_INVOCATION_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_INVOCATION_HPP_INCLUDED + +#include +#include +#include + +#endif diff --git a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp b/include/boost/fusion/functional/invocation/detail/that_ptr.hpp new file mode 100644 index 00000000..a92c436b --- /dev/null +++ b/include/boost/fusion/functional/invocation/detail/that_ptr.hpp @@ -0,0 +1,87 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_INVOCATION_DETAIL_THAT_PTR_HPP_INCLUDED) +#define BOOST_FUSION_FUNCTIONAL_INVOCATION_DETAIL_THAT_PTR_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct that_ptr + { + private: + + typedef typename remove_reference::type pointee; + + template + static inline pointee * do_get_pointer(T &, pointee * x) + { + return x; + } + template + static inline pointee * do_get_pointer(T & x, void const *) + { + return get_pointer(x); + } + + public: + + static inline pointee * get(pointee * x) + { + return x; + } + + static inline pointee * get(pointee & x) + { + return boost::addressof(x); + } + + template static inline pointee * get(T & x) + { + return do_get_pointer(x, boost::addressof(x)); + } + }; + + template struct non_const_pointee; + + namespace adl_barrier + { + using boost::get_pointer; + void const * BOOST_TT_DECL get_pointer(...); // fallback + + template< typename T> char const_tester(T *); + template< typename T> long const_tester(T const *); + + template + struct non_const_pointee_impl + { + static Ptr & what; + + static bool const value = + sizeof(const_tester(get_pointer(what))) == 1; + }; + } + + template struct non_const_pointee + : adl_barrier::non_const_pointee_impl< + typename remove_cv< + typename remove_reference::type >::type > + { + typedef non_const_pointee type; + typedef bool value_type; + }; + +}}} + +#endif + diff --git a/include/boost/fusion/functional/invocation/invoke.hpp b/include/boost/fusion/functional/invocation/invoke.hpp new file mode 100644 index 00000000..bac695cc --- /dev/null +++ b/include/boost/fusion/functional/invocation/invoke.hpp @@ -0,0 +1,306 @@ +/*============================================================================= + Copyright (c) 2005-2006 João Abecasis + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_HPP_INCLUDED) +#if !defined(BOOST_PP_IS_ITERATING) + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template struct invoke; + } + + template + inline typename result_of::invoke::type + invoke(Function, Sequence &); + + template + inline typename result_of::invoke::type + invoke(Function, Sequence const &); + + //----- ---- --- -- - - - - + + namespace detail + { + namespace ft = function_types; + + template< + typename Function, class Sequence, + int N = result_of::size::value, + bool CBI = ft::is_callable_builtin::value, + bool RandomAccess = traits::is_random_access::value + > + struct invoke_impl; + + template + struct invoke_param_types; + + template + struct invoke_data_member; + + template + struct invoke_mem_fn; + + #define BOOST_PP_FILENAME_1 + #define BOOST_PP_ITERATION_LIMITS (0, BOOST_FUSION_INVOKE_MAX_ARITY) + #include BOOST_PP_ITERATE() + + template + struct invoke_nonmember_builtin + // use same implementation as for function objects but... + : invoke_impl< // ...work around boost::result_of bugs + typename mpl::eval_if< ft::is_function, + boost::add_reference, boost::remove_cv >::type, + Sequence, N, false, RandomAccess > + { }; + + template + struct invoke_impl + : mpl::if_< ft::is_member_function_pointer, + invoke_mem_fn, + invoke_nonmember_builtin + >::type + { }; + + template + struct invoke_impl + : mpl::eval_if< ft::is_member_pointer, + mpl::if_< ft::is_member_function_pointer, + invoke_mem_fn, + invoke_data_member >, + mpl::identity< invoke_nonmember_builtin< + Function,Sequence,1,RandomAccess> > + >::type + { }; + + template + struct invoke_data_member< T C::*, Sequence > + { + private: + + typedef typename result_of::front::type that; + + typedef mpl::or_< boost::is_convertible, + boost::is_convertible, + non_const_pointee > non_const_cond; + + typedef typename mpl::eval_if< non_const_cond, + mpl::identity, add_const >::type qualified_class; + + typedef typename mpl::eval_if< non_const_cond, + mpl::identity, add_const >::type qualified_type; + + public: + + typedef typename boost::add_reference::type + result_type; + + static inline result_type call(T C::* f, Sequence & s) + { + typename result_of::front::type c = fusion::front(s); + return that_ptr::get(c)->*f; + } + }; + } + + namespace result_of + { + template struct invoke + { + typedef typename detail::invoke_impl< + typename boost::remove_reference::type, Sequence + >::result_type type; + }; + } + + template + inline typename result_of::invoke::type + invoke(Function f, Sequence & s) + { + return detail::invoke_impl< + typename boost::remove_reference::type,Sequence + >::call(f,s); + } + + template + inline typename result_of::invoke::type + invoke(Function f, Sequence const & s) + { + return detail::invoke_impl< + typename boost::remove_reference::type,Sequence const + >::call(f,s); + } + +}} + +#define BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_HPP_INCLUDED +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// +#define N BOOST_PP_ITERATION() + + template + struct invoke_impl + { + public: + + typedef typename boost::result_of< +#define M(z,j,data) typename result_of::at_c::type + Function(BOOST_PP_ENUM(N,M,~)) >::type result_type; +#undef M + + template + static inline result_type + call(F & f, Sequence & s) + { +#define M(z,j,data) fusion::at_c(s) + return f( BOOST_PP_ENUM(N,M,~) ); + } + }; + + +#if N > 0 + template + struct invoke_mem_fn + { + public: + + typedef typename ft::result_type::type result_type; + + template + static inline result_type + call(F & f, Sequence & s) + { + return (that_ptr >::type + >::get(fusion::at_c<0>(s))->*f)(BOOST_PP_ENUM_SHIFTED(N,M,~)); + } + }; +#endif + +#undef M + +#define M(z,j,data) \ + typename seq::I##j i##j = \ + fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(j))); + + template + struct invoke_impl + { + private: + typedef invoke_param_types seq; + public: + + typedef typename boost::result_of< + Function(BOOST_PP_ENUM_PARAMS(N,typename seq::T)) + >::type result_type; + + template + static inline result_type + call(F & f, Sequence & s) + { +#if N > 0 + typename seq::I0 i0 = fusion::begin(s); + BOOST_PP_REPEAT_FROM_TO(1,N,M,~) +#endif + return f( BOOST_PP_ENUM_PARAMS(N,*i) ); + } + }; + +#if N > 0 + template + struct invoke_mem_fn + { + private: + typedef invoke_param_types seq; + public: + + typedef typename ft::result_type::type result_type; + + template + static inline result_type + call(F & f, Sequence & s) + { + typename seq::I0 i0 = fusion::begin(s); + BOOST_PP_REPEAT_FROM_TO(1,N,M,~) + + return (that_ptr< typename mpl::front< + ft::parameter_types >::type + >::get(*i0)->*f)(BOOST_PP_ENUM_SHIFTED_PARAMS(N,*i)); + } + }; +#endif + +#undef M + + template struct invoke_param_types + { +#if N > 0 + typedef typename result_of::begin::type I0; + typedef typename result_of::deref::type T0; + +#define M(z,i,data) \ + typedef typename result_of::next< \ + BOOST_PP_CAT(I,BOOST_PP_DEC(i))>::type I##i; \ + typedef typename result_of::deref::type T##i; + + BOOST_PP_REPEAT_FROM_TO(1,N,M,~) +#undef M +#endif + }; + + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) +#endif + diff --git a/include/boost/fusion/functional/invocation/invoke_function_object.hpp b/include/boost/fusion/functional/invocation/invoke_function_object.hpp new file mode 100644 index 00000000..ad742265 --- /dev/null +++ b/include/boost/fusion/functional/invocation/invoke_function_object.hpp @@ -0,0 +1,178 @@ +/*============================================================================= + Copyright (c) 2005-2006 João Abecasis + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_FUNCTION_OBJECT_HPP_INCLUDED) +#if !defined(BOOST_PP_IS_ITERATING) + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template struct invoke_function_object; + } + + template + inline typename result_of::invoke_function_object::type + invoke_function_object(Function, Sequence &); + + template + inline typename result_of::invoke_function_object::type invoke_function_object(Function, Sequence const &); + + //----- ---- --- -- - - - - + + namespace detail + { + template< + class Function, class Sequence, + int N = result_of::size::value, + bool RandomAccess = traits::is_random_access::value + > + struct invoke_function_object_impl; + + template + struct invoke_function_object_param_types; + + #define BOOST_PP_FILENAME_1 \ + + #define BOOST_PP_ITERATION_LIMITS \ + (0, BOOST_FUSION_INVOKE_FUNCTION_OBJECT_MAX_ARITY) + #include BOOST_PP_ITERATE() + } + + namespace result_of + { + template struct invoke_function_object + { + typedef typename detail::invoke_function_object_impl< + typename boost::remove_reference::type, Sequence + >::result_type type; + }; + } + + template + inline typename result_of::invoke_function_object::type + invoke_function_object(Function f, Sequence & s) + { + return detail::invoke_function_object_impl< + typename boost::remove_reference::type,Sequence + >::call(f,s); + } + + template + inline typename result_of::invoke_function_object::type + invoke_function_object(Function f, Sequence const & s) + { + return detail::invoke_function_object_impl< + typename boost::remove_reference::type,Sequence const + >::call(f,s); + } + +}} + +#define BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_FUNCTION_OBJECT_HPP_INCLUDED +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// +#define N BOOST_PP_ITERATION() + + template + struct invoke_function_object_impl + { + public: + + typedef typename boost::result_of< +#define M(z,j,data) \ + typename boost::remove_reference< \ + typename result_of::at_c::type >::type + Function (BOOST_PP_ENUM(N,M,~)) >::type result_type; +#undef M + + template + static inline result_type + call(F & f, Sequence & s) + { +#define M(z,j,data) fusion::at_c(s) + return f( BOOST_PP_ENUM(N,M,~) ); +#undef M + } + }; + + template + struct invoke_function_object_impl + { + private: + typedef invoke_function_object_param_types seq; + public: + typedef typename boost::result_of< + Function (BOOST_PP_ENUM_PARAMS(N,typename seq::T)) + >::type result_type; + + template + static inline result_type + call(F & f, Sequence & s) + { +#if N > 0 + typename seq::I0 i0 = fusion::begin(s); +#define M(z,j,data) \ + typename seq::I##j i##j = \ + fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(j))); + BOOST_PP_REPEAT_FROM_TO(1,N,M,~) +#undef M +#endif + return f( BOOST_PP_ENUM_PARAMS(N,*i) ); + } + }; + + template + struct invoke_function_object_param_types + { +#if N > 0 + typedef typename result_of::begin::type I0; + typedef typename result_of::deref::type T0; + +#define M(z,i,data) \ + typedef typename result_of::next< \ + BOOST_PP_CAT(I,BOOST_PP_DEC(i))>::type I##i; \ + typedef typename result_of::deref::type T##i; + + BOOST_PP_REPEAT_FROM_TO(1,N,M,~) +#undef M +#endif + }; + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) +#endif + diff --git a/include/boost/fusion/functional/invocation/invoke_procedure.hpp b/include/boost/fusion/functional/invocation/invoke_procedure.hpp new file mode 100644 index 00000000..31822ade --- /dev/null +++ b/include/boost/fusion/functional/invocation/invoke_procedure.hpp @@ -0,0 +1,171 @@ +/*============================================================================= + Copyright (c) 2005-2006 João Abecasis + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_PROCEDURE_HPP_INCLUDED) +#if !defined(BOOST_PP_IS_ITERATING) + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace result_of + { + template struct invoke_procedure + { + typedef void type; + }; + } + + template + inline void invoke_procedure(Function, Sequence &); + + template + inline void invoke_procedure(Function, Sequence const &); + + //----- ---- --- -- - - - - + + namespace detail + { + namespace ft = function_types; + + template< + typename Function, class Sequence, + int N = result_of::size::value, + bool MFP = ft::is_member_function_pointer::value, + bool RandomAccess = traits::is_random_access::value + > + struct invoke_procedure_impl; + + #define BOOST_PP_FILENAME_1 \ + + #define BOOST_PP_ITERATION_LIMITS \ + (0, BOOST_FUSION_INVOKE_PROCEDURE_MAX_ARITY) + #include BOOST_PP_ITERATE() + + } + + template + inline void invoke_procedure(Function f, Sequence & s) + { + detail::invoke_procedure_impl< + typename boost::remove_reference::type,Sequence + >::call(f,s); + } + + template + inline void invoke_procedure(Function f, Sequence const & s) + { + detail::invoke_procedure_impl< + typename boost::remove_reference::type,Sequence const + >::call(f,s); + } + +}} + +#define BOOST_FUSION_FUNCTIONAL_INVOCATION_INVOKE_PROCEDURE_HPP_INCLUDED +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// +#define N BOOST_PP_ITERATION() + +#define M(z,j,data) fusion::at_c(s) + + template + struct invoke_procedure_impl + { + static inline void call(Function & f, Sequence & s) + { + f(BOOST_PP_ENUM(N,M,~)); + } + }; + +#if N > 0 + template + struct invoke_procedure_impl + { + static inline void call(Function & f, Sequence & s) + { + (that_ptr >::type + >::get(fusion::at_c<0>(s))->*f)(BOOST_PP_ENUM_SHIFTED(N,M,~)); + } + }; +#endif + +#undef M + +#define M(z,j,data) \ + typedef typename result_of::next< BOOST_PP_CAT(I,BOOST_PP_DEC(j)) \ + >::type I ## j ; \ + I##j i##j = fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(j))); + + template + struct invoke_procedure_impl + { + static inline void call(Function & f, Sequence & s) + { +#if N > 0 + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(s); + BOOST_PP_REPEAT_FROM_TO(1,N,M,~) +#endif + f( BOOST_PP_ENUM_PARAMS(N,*i) ); + } + }; + +#if N > 0 + template + struct invoke_procedure_impl + { + static inline void call(Function & f, Sequence & s) + { + typedef typename result_of::begin::type I0; + I0 i0 = fusion::begin(s); + BOOST_PP_REPEAT_FROM_TO(1,N,M,~) + + (that_ptr >::type + >::get(*i0)->*f)(BOOST_PP_ENUM_SHIFTED_PARAMS(N,*i)); + } + }; +#endif + +#undef M + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) +#endif + diff --git a/include/boost/fusion/functional/invocation/limits.hpp b/include/boost/fusion/functional/invocation/limits.hpp new file mode 100644 index 00000000..9cb5a04a --- /dev/null +++ b/include/boost/fusion/functional/invocation/limits.hpp @@ -0,0 +1,23 @@ +/*============================================================================= + Copyright (c) 2006-2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_FUNCTIONAL_INVOCATION_LIMITS_HPP_INCLUDED) +# define BOOST_FUSION_FUNCTIONAL_INVOCATION_LIMITS_HPP_INCLUDED + +# if !defined(BOOST_FUSION_INVOKE_MAX_ARITY) +# define BOOST_FUSION_INVOKE_MAX_ARITY 6 +# endif +# if !defined(BOOST_FUSION_INVOKE_PROCEDURE_MAX_ARITY) +# define BOOST_FUSION_INVOKE_PROCEDURE_MAX_ARITY 6 +# endif +# if !defined(BOOST_FUSION_INVOKE_FUNCTION_OBJECT_MAX_ARITY) +# define BOOST_FUSION_INVOKE_FUNCTION_OBJECT_MAX_ARITY 6 +# endif + +#endif + diff --git a/include/boost/fusion/include/adapt_struct.hpp b/include/boost/fusion/include/adapt_struct.hpp new file mode 100644 index 00000000..facc8970 --- /dev/null +++ b/include/boost/fusion/include/adapt_struct.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_ADAPT_STRUCT) +#define FUSION_INCLUDE_ADAPT_STRUCT + +#include + +#endif diff --git a/include/boost/fusion/include/any.hpp b/include/boost/fusion/include/any.hpp new file mode 100644 index 00000000..e5c73060 --- /dev/null +++ b/include/boost/fusion/include/any.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_ANY) +#define FUSION_INCLUDE_ANY + +#include + +#endif diff --git a/include/boost/fusion/include/as_vector.hpp b/include/boost/fusion/include/as_vector.hpp new file mode 100644 index 00000000..4c9b39d0 --- /dev/null +++ b/include/boost/fusion/include/as_vector.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_AS_VECTOR) +#define FUSION_INCLUDE_AS_VECTOR + +#include + +#endif diff --git a/include/boost/fusion/include/at.hpp b/include/boost/fusion/include/at.hpp new file mode 100644 index 00000000..eacd7bbb --- /dev/null +++ b/include/boost/fusion/include/at.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_AT) +#define FUSION_INCLUDE_AT + +#include + +#endif diff --git a/include/boost/fusion/include/begin.hpp b/include/boost/fusion/include/begin.hpp new file mode 100644 index 00000000..53361fb2 --- /dev/null +++ b/include/boost/fusion/include/begin.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_BEGIN) +#define FUSION_INCLUDE_BEGIN + +#include + +#endif diff --git a/include/boost/fusion/include/deref.hpp b/include/boost/fusion/include/deref.hpp new file mode 100644 index 00000000..9c831f79 --- /dev/null +++ b/include/boost/fusion/include/deref.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_DEREF) +#define FUSION_INCLUDE_DEREF + +#include + +#endif diff --git a/include/boost/fusion/include/end.hpp b/include/boost/fusion/include/end.hpp new file mode 100644 index 00000000..60be1a98 --- /dev/null +++ b/include/boost/fusion/include/end.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_BEGIN) +#define FUSION_INCLUDE_BEGIN + +#include + +#endif diff --git a/include/boost/fusion/include/equal_to.hpp b/include/boost/fusion/include/equal_to.hpp new file mode 100644 index 00000000..5607b8e2 --- /dev/null +++ b/include/boost/fusion/include/equal_to.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_EQUAL_TO) +#define FUSION_INCLUDE_EQUAL_TO + +#include +#include + +#endif diff --git a/include/boost/fusion/include/filter_if.hpp b/include/boost/fusion/include/filter_if.hpp new file mode 100644 index 00000000..31fdec5d --- /dev/null +++ b/include/boost/fusion/include/filter_if.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_FILTER_IF) +#define FUSION_INCLUDE_FILTER_IF + +#include + +#endif diff --git a/include/boost/fusion/include/for_each.hpp b/include/boost/fusion/include/for_each.hpp new file mode 100644 index 00000000..b20578e5 --- /dev/null +++ b/include/boost/fusion/include/for_each.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_FOR_EACH) +#define FUSION_INCLUDE_FOR_EACH + +#include + +#endif diff --git a/include/boost/fusion/include/io.hpp b/include/boost/fusion/include/io.hpp new file mode 100644 index 00000000..d84fdf35 --- /dev/null +++ b/include/boost/fusion/include/io.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Hartmut Kaiser + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_IO) +#define FUSION_INCLUDE_IO + +#include + +#endif diff --git a/include/boost/fusion/include/is_sequence.hpp b/include/boost/fusion/include/is_sequence.hpp new file mode 100644 index 00000000..a7f2b4d8 --- /dev/null +++ b/include/boost/fusion/include/is_sequence.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_IS_SEQUENCE) +#define FUSION_INCLUDE_IS_SEQUENCE + +#include + +#endif diff --git a/include/boost/fusion/include/join.hpp b/include/boost/fusion/include/join.hpp new file mode 100644 index 00000000..5f701ad3 --- /dev/null +++ b/include/boost/fusion/include/join.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_JOIN) +#define FUSION_INCLUDE_JOIN + +#include + +#endif diff --git a/include/boost/fusion/include/joint_view.hpp b/include/boost/fusion/include/joint_view.hpp new file mode 100644 index 00000000..e3d1e204 --- /dev/null +++ b/include/boost/fusion/include/joint_view.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_JOINT_VIEW) +#define FUSION_INCLUDE_JOINT_VIEW + +#include + +#endif diff --git a/include/boost/fusion/include/list.hpp b/include/boost/fusion/include/list.hpp new file mode 100644 index 00000000..4eb8e767 --- /dev/null +++ b/include/boost/fusion/include/list.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_LIST) +#define FUSION_INCLUDE_LIST + +#include + +#endif diff --git a/include/boost/fusion/include/make_cons.hpp b/include/boost/fusion/include/make_cons.hpp new file mode 100644 index 00000000..a0181953 --- /dev/null +++ b/include/boost/fusion/include/make_cons.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_MAKE_CONS) +#define FUSION_INCLUDE_MAKE_CONS + +#include + +#endif diff --git a/include/boost/fusion/include/make_vector.hpp b/include/boost/fusion/include/make_vector.hpp new file mode 100644 index 00000000..d2a90cb4 --- /dev/null +++ b/include/boost/fusion/include/make_vector.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_MAKE_VECTOR) +#define FUSION_INCLUDE_MAKE_VECTOR + +#include + +#endif diff --git a/include/boost/fusion/include/mpl.hpp b/include/boost/fusion/include/mpl.hpp new file mode 100644 index 00000000..8a1cbfd0 --- /dev/null +++ b/include/boost/fusion/include/mpl.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_MPL) +#define FUSION_INCLUDE_MPL + +#include +#include + +#endif diff --git a/include/boost/fusion/include/next.hpp b/include/boost/fusion/include/next.hpp new file mode 100644 index 00000000..6188c65a --- /dev/null +++ b/include/boost/fusion/include/next.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_NEXT) +#define FUSION_INCLUDE_NEXT + +#include + +#endif diff --git a/include/boost/fusion/include/push_front.hpp b/include/boost/fusion/include/push_front.hpp new file mode 100644 index 00000000..5a9cfa5e --- /dev/null +++ b/include/boost/fusion/include/push_front.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_PUSH_FRONT) +#define FUSION_INCLUDE_PUSH_FRONT + +#include + +#endif diff --git a/include/boost/fusion/include/single_view.hpp b/include/boost/fusion/include/single_view.hpp new file mode 100644 index 00000000..a95d04a8 --- /dev/null +++ b/include/boost/fusion/include/single_view.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_SINGLE_VIEW) +#define FUSION_INCLUDE_SINGLE_VIEW + +#include + +#endif diff --git a/include/boost/fusion/include/std_pair.hpp b/include/boost/fusion/include/std_pair.hpp new file mode 100644 index 00000000..98f37c86 --- /dev/null +++ b/include/boost/fusion/include/std_pair.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_STD_PAIR) +#define FUSION_INCLUDE_STD_PAIR + +#include + +#endif diff --git a/include/boost/fusion/include/swap.hpp b/include/boost/fusion/include/swap.hpp new file mode 100644 index 00000000..1f428aa1 --- /dev/null +++ b/include/boost/fusion/include/swap.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_SWAP) +#define FUSION_INCLUDE_SWAP + +#include + +#endif diff --git a/include/boost/fusion/include/transform.hpp b/include/boost/fusion/include/transform.hpp new file mode 100644 index 00000000..2b66c4f7 --- /dev/null +++ b/include/boost/fusion/include/transform.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_TRANSFORM) +#define FUSION_INCLUDE_TRANSFORM + +#include + +#endif diff --git a/include/boost/fusion/include/transform_view.hpp b/include/boost/fusion/include/transform_view.hpp new file mode 100644 index 00000000..3aceaaee --- /dev/null +++ b/include/boost/fusion/include/transform_view.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_TRANSFORM_VIEW) +#define FUSION_INCLUDE_TRANSFORM_VIEW + +#include + +#endif diff --git a/include/boost/fusion/include/value_at.hpp b/include/boost/fusion/include/value_at.hpp new file mode 100644 index 00000000..da5745d9 --- /dev/null +++ b/include/boost/fusion/include/value_at.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Hartmut Kaiser + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_VALUE_AT) +#define FUSION_INCLUDE_VALUE_AT + +#include + +#endif diff --git a/include/boost/fusion/include/value_of.hpp b/include/boost/fusion/include/value_of.hpp new file mode 100644 index 00000000..4f2bef95 --- /dev/null +++ b/include/boost/fusion/include/value_of.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_VALUE_OF) +#define FUSION_INCLUDE_VALUE_OF + +#include + +#endif diff --git a/include/boost/fusion/include/variant.hpp b/include/boost/fusion/include/variant.hpp new file mode 100644 index 00000000..3d013b8e --- /dev/null +++ b/include/boost/fusion/include/variant.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_VARIANT) +#define FUSION_INCLUDE_VARIANT + +#include + +#endif diff --git a/include/boost/fusion/include/vector.hpp b/include/boost/fusion/include/vector.hpp new file mode 100644 index 00000000..d1495c0a --- /dev/null +++ b/include/boost/fusion/include/vector.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_VECTOR) +#define FUSION_INCLUDE_VECTOR + +#include + +#endif diff --git a/include/boost/fusion/include/vector_tie.hpp b/include/boost/fusion/include/vector_tie.hpp new file mode 100644 index 00000000..35f4abed --- /dev/null +++ b/include/boost/fusion/include/vector_tie.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_VECTOR_TIE) +#define FUSION_INCLUDE_VECTOR_TIE + +#include + +#endif diff --git a/include/boost/fusion/iterator.hpp b/include/boost/fusion/iterator.hpp new file mode 100644 index 00000000..c7f8e1eb --- /dev/null +++ b/include/boost/fusion/iterator.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ITERATOR_10022005_0559) +#define FUSION_ITERATOR_10022005_0559 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/iterator/advance.hpp b/include/boost/fusion/iterator/advance.hpp new file mode 100644 index 00000000..2cbafede --- /dev/null +++ b/include/boost/fusion/iterator/advance.hpp @@ -0,0 +1,92 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ADVANCE_09172005_1146) +#define FUSION_ADVANCE_09172005_1146 + +#include +#include + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct array_iterator_tag; // boost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct advance_impl + { + // default implementation + template + struct apply : + mpl::if_c< + (N::value > 0) + , advance_detail::forward + , advance_detail::backward + >::type + { + BOOST_MPL_ASSERT_NOT((traits::is_random_access)); + }; + }; + + template <> + struct advance_impl + { + template + struct apply : Iterator::template advance {}; + }; + + template <> + struct advance_impl; + + template <> + struct advance_impl; + + template <> + struct advance_impl; + } + + namespace result_of + { + template + struct advance_c + : extension::advance_impl::type>::template apply > + {}; + + template + struct advance + : extension::advance_impl::type>::template apply + {}; + } + + template + inline typename result_of::advance_c::type const + advance_c(Iterator const& i) + { + return result_of::advance_c::call(i); + } + + template + inline typename result_of::advance::type const + advance(Iterator const& i) + { + return result_of::advance::call(i); + } + +}} // namespace boost::fusion + +#endif diff --git a/include/boost/fusion/iterator/deref.hpp b/include/boost/fusion/iterator/deref.hpp new file mode 100644 index 00000000..0e6f54d2 --- /dev/null +++ b/include/boost/fusion/iterator/deref.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_05042005_1019) +#define FUSION_DEREF_05042005_1019 + +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct array_iterator_tag; // boost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct deref_impl + { + template + struct apply {}; + }; + + template <> + struct deref_impl + { + template + struct apply : Iterator::template deref {}; + }; + + template <> + struct deref_impl; + + template <> + struct deref_impl; + + template <> + struct deref_impl; + } + + namespace result_of + { + template + struct deref + : extension::deref_impl::type>:: + template apply + {}; + } + + template + typename result_of::deref::type + deref(Iterator const& i) + { + typedef result_of::deref deref_meta; + return deref_meta::call(i); + } + + template + typename result_of::deref::type + operator*(iterator_base const& i) + { + return fusion::deref(i.cast()); + } +}} + +#endif diff --git a/include/boost/fusion/iterator/detail/adapt_deref_traits.hpp b/include/boost/fusion/iterator/detail/adapt_deref_traits.hpp new file mode 100644 index 00000000..d683c289 --- /dev/null +++ b/include/boost/fusion/iterator/detail/adapt_deref_traits.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ADAPT_DEREF_TRAITS_05062005_0900) +#define FUSION_ADAPT_DEREF_TRAITS_05062005_0900 + +#include + +namespace boost { namespace fusion { namespace detail +{ + struct adapt_deref_traits + { + template + struct apply + { + typedef typename + result_of::deref::type + type; + + static type + call(Iterator const& i) + { + return *i.first; + } + }; + }; +}}} + +#endif + + diff --git a/include/boost/fusion/iterator/detail/adapt_value_traits.hpp b/include/boost/fusion/iterator/detail/adapt_value_traits.hpp new file mode 100644 index 00000000..a7d72f53 --- /dev/null +++ b/include/boost/fusion/iterator/detail/adapt_value_traits.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ADAPT_VALUE_TRAITS_05062005_0859) +#define FUSION_ADAPT_VALUE_TRAITS_05062005_0859 + +#include + +namespace boost { namespace fusion { namespace detail +{ + struct adapt_value_traits + { + template + struct apply + { + typedef typename + result_of::value_of::type + type; + }; + }; +}}} + +#endif + + diff --git a/include/boost/fusion/iterator/detail/advance.hpp b/include/boost/fusion/iterator/detail/advance.hpp new file mode 100644 index 00000000..900608fa --- /dev/null +++ b/include/boost/fusion/iterator/detail/advance.hpp @@ -0,0 +1,102 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ADVANCE_09172005_1149) +#define FUSION_ADVANCE_09172005_1149 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace advance_detail +{ + // Default advance implementation, perform next(i) + // or prior(i) N times. + + template + struct forward; + + template + struct next_forward + { + typedef typename + forward< + typename result_of::next::type + , N-1 + >::type + type; + }; + + template + struct forward + { + typedef typename + mpl::eval_if_c< + (N == 0) + , mpl::identity + , next_forward + >::type + type; + + static type const& + call(type const& i) + { + return i; + } + + template + static type + call(I const& i) + { + return call(fusion::next(i)); + } + }; + + template + struct backward; + + template + struct next_backward + { + typedef typename + backward< + typename result_of::prior::type + , N+1 + >::type + type; + }; + + template + struct backward + { + typedef typename + mpl::eval_if_c< + (N == 0) + , mpl::identity + , next_backward + >::type + type; + + static type const& + call(type const& i) + { + return i; + } + + template + static type + call(I const& i) + { + return call(fusion::prior(i)); + } + }; + +}}} + +#endif diff --git a/include/boost/fusion/iterator/detail/distance.hpp b/include/boost/fusion/iterator/detail/distance.hpp new file mode 100644 index 00000000..e4c0a5e7 --- /dev/null +++ b/include/boost/fusion/iterator/detail/distance.hpp @@ -0,0 +1,64 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DISTANCE_09172005_0730) +#define FUSION_DISTANCE_09172005_0730 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace distance_detail +{ + // Default distance implementation, linear + // search for the Last iterator. + + template + struct linear_distance; + + template + struct next_distance + { + typedef typename + mpl::next< + typename linear_distance< + typename result_of::next::type + , Last + >::type + >::type + type; + }; + + template + struct linear_distance + : mpl::eval_if< + result_of::equal_to + , mpl::identity > + , next_distance + >::type + { + typedef typename + mpl::eval_if< + result_of::equal_to + , mpl::identity > + , next_distance + >::type + type; + + static type + call(First const&, Last const&) + { + return type(); + } + }; + +}}} + +#endif diff --git a/include/boost/fusion/iterator/distance.hpp b/include/boost/fusion/iterator/distance.hpp new file mode 100644 index 00000000..44fc4292 --- /dev/null +++ b/include/boost/fusion/iterator/distance.hpp @@ -0,0 +1,81 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DISTANCE_09172005_0721) +#define FUSION_DISTANCE_09172005_0721 + +#include +#include + +#include +#include +#include + +#include + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct array_iterator_tag; // boost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct distance_impl + { + // default implementation + template + struct apply : distance_detail::linear_distance + { + BOOST_MPL_ASSERT_NOT((traits::is_random_access)); + BOOST_MPL_ASSERT_NOT((traits::is_random_access)); + }; + }; + + template <> + struct distance_impl + { + template + struct apply : First::template distance {}; + }; + + template <> + struct distance_impl; + + template <> + struct distance_impl; + + template <> + struct distance_impl; + } + + namespace result_of + { + template + struct distance + : extension::distance_impl::type>:: + template apply + { + typedef typename extension::distance_impl::type>:: + template apply::type distance_application; + BOOST_STATIC_CONSTANT(int, value = distance_application::value); + }; + } + + template + inline typename result_of::distance::type + distance(First const& a, Last const& b) + { + return result_of::distance::call(a,b); + } +}} + +#endif diff --git a/include/boost/fusion/iterator/equal_to.hpp b/include/boost/fusion/iterator/equal_to.hpp new file mode 100644 index 00000000..2db27675 --- /dev/null +++ b/include/boost/fusion/iterator/equal_to.hpp @@ -0,0 +1,93 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_EQUAL_TO_05052005_1208) +#define FUSION_EQUAL_TO_05052005_1208 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct array_iterator_tag; // boost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct equal_to_impl + { + // default implementation + template + struct apply + : is_same::type, typename add_const::type> + {}; + }; + + template <> + struct equal_to_impl + { + template + struct apply : I1::template equal_to {}; + }; + + template <> + struct equal_to_impl; + + template <> + struct equal_to_impl; + + template <> + struct equal_to_impl; + } + + namespace result_of + { + template + struct equal_to + : extension::equal_to_impl::type>:: + template apply + {}; + } + + namespace iterator_operators + { + template + inline typename + enable_if< + mpl::and_, is_fusion_iterator > + , bool + >::type + operator==(Iter1 const&, Iter2 const&) + { + return result_of::equal_to::value; + } + + template + inline typename + enable_if< + mpl::and_, is_fusion_iterator > + , bool + >::type + operator!=(Iter1 const&, Iter2 const&) + { + return !result_of::equal_to::value; + } + } + + using iterator_operators::operator==; + using iterator_operators::operator!=; +}} + +#endif + diff --git a/include/boost/fusion/iterator/iterator_facade.hpp b/include/boost/fusion/iterator/iterator_facade.hpp new file mode 100644 index 00000000..f1720bdb --- /dev/null +++ b/include/boost/fusion/iterator/iterator_facade.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ITERATOR_FACADE_09252006_1011) +#define FUSION_ITERATOR_FACADE_09252006_1011 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct iterator_facade_tag; + + template + struct iterator_facade : iterator_base + { + typedef iterator_facade_tag fusion_tag; + typedef Derived derived_type; + typedef Category category; + + // default implementation + template + struct equal_to // default implementation + : is_same< + typename I1::derived_type + , typename I2::derived_type + > + {}; + + // default implementation + template + struct advance : + mpl::if_c< + (N::value > 0) + , advance_detail::forward + , advance_detail::backward + >::type + { + BOOST_MPL_ASSERT_NOT((traits::is_random_access)); + }; + }; +}} + +#endif diff --git a/include/boost/fusion/iterator/mpl.hpp b/include/boost/fusion/iterator/mpl.hpp new file mode 100644 index 00000000..2709bd29 --- /dev/null +++ b/include/boost/fusion/iterator/mpl.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ITERATOR_MPL_10022005_0557) +#define FUSION_ITERATOR_MPL_10022005_0557 + +#include +#include + +#endif diff --git a/include/boost/fusion/iterator/mpl/convert_iterator.hpp b/include/boost/fusion/iterator/mpl/convert_iterator.hpp new file mode 100644 index 00000000..5716ce4e --- /dev/null +++ b/include/boost/fusion/iterator/mpl/convert_iterator.hpp @@ -0,0 +1,58 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_ITERATOR_05062005_1218) +#define FUSION_CONVERT_ITERATOR_05062005_1218 + +#include +#include +#include + +namespace boost { namespace fusion +{ + template + struct mpl_iterator; // forward declaration + + // Test T. If it is a fusion iterator, return a reference to it. + // else, assume it is an mpl iterator. + + template + struct convert_iterator + { + typedef typename + mpl::if_< + is_fusion_iterator + , T + , mpl_iterator + >::type + type; + + static T const& + call(T const& x, mpl::true_) + { + return x; + } + + static mpl_iterator + call(T const& x, mpl::false_) + { + return mpl_iterator(); + } + + static typename + mpl::if_< + is_fusion_iterator + , T const& + , mpl_iterator + >::type + call(T const& x) + { + return call(x, is_fusion_iterator()); + } + }; +}} + +#endif diff --git a/include/boost/fusion/iterator/mpl/fusion_iterator.hpp b/include/boost/fusion/iterator/mpl/fusion_iterator.hpp new file mode 100644 index 00000000..150db549 --- /dev/null +++ b/include/boost/fusion/iterator/mpl/fusion_iterator.hpp @@ -0,0 +1,57 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FUSION_ITERATOR_10012005_1551) +#define FUSION_FUSION_ITERATOR_10012005_1551 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct fusion_iterator + { + typedef typename fusion::result_of::value_of::type type; + typedef typename fusion::traits::category_of::type category; + typedef Iterator iterator; + }; + + template + struct next > + { + typedef fusion_iterator::type> type; + }; + + template + struct prior > + { + typedef fusion_iterator::type> type; + }; + + template + struct advance, N> + { + typedef fusion_iterator::type> type; + }; + + template + struct distance, fusion_iterator > + : fusion::result_of::distance + {}; + +}} + +#endif + + diff --git a/include/boost/fusion/iterator/next.hpp b/include/boost/fusion/iterator/next.hpp new file mode 100644 index 00000000..9070a9e2 --- /dev/null +++ b/include/boost/fusion/iterator/next.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_05042005_1101) +#define FUSION_NEXT_05042005_1101 + +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct array_iterator_tag; // boost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct next_impl + { + template + struct apply {}; + }; + + template <> + struct next_impl + { + template + struct apply : Iterator::template next {}; + }; + + template <> + struct next_impl; + + template <> + struct next_impl; + + template <> + struct next_impl; + } + + namespace result_of + { + template + struct next + : extension::next_impl::type>:: + template apply + {}; + } + + template + typename result_of::next::type const + next(Iterator const& i) + { + return result_of::next::call(i); + } +}} + +#endif diff --git a/include/boost/fusion/iterator/prior.hpp b/include/boost/fusion/iterator/prior.hpp new file mode 100644 index 00000000..9a261039 --- /dev/null +++ b/include/boost/fusion/iterator/prior.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PRIOR_05042005_1144) +#define FUSION_PRIOR_05042005_1144 + +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct array_iterator_tag; // boost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct prior_impl + { + template + struct apply {}; + }; + + template <> + struct prior_impl + { + template + struct apply : Iterator::template prior {}; + }; + + template <> + struct prior_impl; + + template <> + struct prior_impl; + + template <> + struct prior_impl; + } + + namespace result_of + { + template + struct prior + : extension::prior_impl::type>:: + template apply + {}; + } + + template + typename result_of::prior::type const + prior(Iterator const& i) + { + return result_of::prior::call(i); + } +}} + +#endif diff --git a/include/boost/fusion/iterator/value_of.hpp b/include/boost/fusion/iterator/value_of.hpp new file mode 100644 index 00000000..808c6593 --- /dev/null +++ b/include/boost/fusion/iterator/value_of.hpp @@ -0,0 +1,57 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_OF_05052005_1126) +#define FUSION_VALUE_OF_05052005_1126 + +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct iterator_facade_tag; // iterator facade tag + struct array_iterator_tag; // boost::array iterator tag + struct mpl_iterator_tag; // mpl sequence iterator tag + struct std_pair_iterator_tag; // std::pair iterator tag + + namespace extension + { + template + struct value_of_impl + { + template + struct apply {}; + }; + + template <> + struct value_of_impl + { + template + struct apply : Iterator::template value_of {}; + }; + + template <> + struct value_of_impl; + + template <> + struct value_of_impl; + + template <> + struct value_of_impl; + } + + namespace result_of + { + template + struct value_of + : extension::value_of_impl::type>:: + template apply + {}; + } +}} + +#endif diff --git a/include/boost/fusion/mpl.hpp b/include/boost/fusion/mpl.hpp new file mode 100644 index 00000000..e499df93 --- /dev/null +++ b/include/boost/fusion/mpl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_MPL_09172006_2049) +#define FUSION_MPL_09172006_2049 + +// The fusion <--> MPL link headers +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/mpl/at.hpp b/include/boost/fusion/mpl/at.hpp new file mode 100644 index 00000000..a164bb32 --- /dev/null +++ b/include/boost/fusion/mpl/at.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_AT_10022005_1616) +#define FUSION_AT_10022005_1616 + +#include +#include + +namespace boost { +namespace fusion +{ + struct fusion_sequence_tag; +} + +namespace mpl +{ + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply : fusion::result_of::value_at {}; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/back.hpp b/include/boost/fusion/mpl/back.hpp new file mode 100644 index 00000000..1f5197e2 --- /dev/null +++ b/include/boost/fusion/mpl/back.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BACK_10022005_1620) +#define FUSION_BACK_10022005_1620 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct back_impl; + + template <> + struct back_impl + { + template + struct apply : + fusion::result_of::value_of< + typename fusion::result_of::prior< + typename fusion::result_of::end::type + >::type> {}; + }; +}} + +#endif diff --git a/include/boost/fusion/mpl/begin.hpp b/include/boost/fusion/mpl/begin.hpp new file mode 100644 index 00000000..be8b3142 --- /dev/null +++ b/include/boost/fusion/mpl/begin.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_10022005_1620) +#define FUSION_BEGIN_10022005_1620 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef fusion_iterator::type> type; + }; + }; +}} + +#endif diff --git a/include/boost/fusion/mpl/clear.hpp b/include/boost/fusion/mpl/clear.hpp new file mode 100644 index 00000000..14b3489e --- /dev/null +++ b/include/boost/fusion/mpl/clear.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CLEAR_10022005_1817) +#define FUSION_CLEAR_10022005_1817 + +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct clear_impl; + + template <> + struct clear_impl + { + template + struct apply + { + typedef typename + fusion::detail::clear::type>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/detail/clear.hpp b/include/boost/fusion/mpl/detail/clear.hpp new file mode 100644 index 00000000..d8c32d5a --- /dev/null +++ b/include/boost/fusion/mpl/detail/clear.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CLEAR_10022005_1442) +#define FUSION_CLEAR_10022005_1442 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct cons_tag; + struct map_tag; + struct set_tag; + struct vector_tag; + struct deque_tag; + + namespace detail + { + template + struct clear; + + template <> + struct clear : mpl::identity > {}; + + template <> + struct clear : mpl::identity > {}; + + template <> + struct clear : mpl::identity > {}; + + template <> + struct clear : mpl::identity > {}; + + template <> + struct clear : mpl::identity > {}; + } +}} + +#endif diff --git a/include/boost/fusion/mpl/empty.hpp b/include/boost/fusion/mpl/empty.hpp new file mode 100644 index 00000000..a0e27d66 --- /dev/null +++ b/include/boost/fusion/mpl/empty.hpp @@ -0,0 +1,26 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_EMPTY_10022005_1619) +#define FUSION_EMPTY_10022005_1619 + +#include +#include + +namespace boost { namespace mpl +{ + template + struct empty_impl; + + template <> + struct empty_impl + { + template + struct apply : fusion::result_of::empty {}; + }; +}} + +#endif diff --git a/include/boost/fusion/mpl/end.hpp b/include/boost/fusion/mpl/end.hpp new file mode 100644 index 00000000..ed3320b2 --- /dev/null +++ b/include/boost/fusion/mpl/end.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_10022005_1619) +#define FUSION_END_10022005_1619 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef fusion_iterator::type> type; + }; + }; +}} + +#endif diff --git a/include/boost/fusion/mpl/erase.hpp b/include/boost/fusion/mpl/erase.hpp new file mode 100644 index 00000000..a8b092ae --- /dev/null +++ b/include/boost/fusion/mpl/erase.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ERASE_10022005_1835) +#define FUSION_ERASE_10022005_1835 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct erase_impl; + + template <> + struct erase_impl + { + template + struct apply + { + typedef typename + fusion::result_of::erase::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/erase_key.hpp b/include/boost/fusion/mpl/erase_key.hpp new file mode 100644 index 00000000..3cda2686 --- /dev/null +++ b/include/boost/fusion/mpl/erase_key.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ERASE_KEY_10022005_1907) +#define FUSION_ERASE_KEY_10022005_1907 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct erase_key_impl; + + template <> + struct erase_key_impl + { + template + struct apply + { + typedef typename + fusion::result_of::erase_key::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/front.hpp b/include/boost/fusion/mpl/front.hpp new file mode 100644 index 00000000..97a26f73 --- /dev/null +++ b/include/boost/fusion/mpl/front.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FRONT_10022005_1618) +#define FUSION_FRONT_10022005_1618 + +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct front_impl; + + template <> + struct front_impl + { + template + struct apply : + fusion::result_of::value_of::type> {}; + }; +}} + +#endif diff --git a/include/boost/fusion/mpl/has_key.hpp b/include/boost/fusion/mpl/has_key.hpp new file mode 100644 index 00000000..beac7c64 --- /dev/null +++ b/include/boost/fusion/mpl/has_key.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_HAS_KEY_10022005_1617) +#define FUSION_HAS_KEY_10022005_1617 + +#include +#include + +namespace boost { namespace mpl +{ + template + struct has_key_impl; + + template <> + struct has_key_impl + { + template + struct apply : fusion::result_of::has_key {}; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/insert.hpp b/include/boost/fusion/mpl/insert.hpp new file mode 100644 index 00000000..76918ce9 --- /dev/null +++ b/include/boost/fusion/mpl/insert.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INSERT_10022005_1837) +#define FUSION_INSERT_10022005_1837 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct insert_impl; + + template <> + struct insert_impl + { + template + struct apply + { + typedef typename + fusion::result_of::insert::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/insert_range.hpp b/include/boost/fusion/mpl/insert_range.hpp new file mode 100644 index 00000000..4da39365 --- /dev/null +++ b/include/boost/fusion/mpl/insert_range.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INSERT_RANGE_10022005_1838) +#define FUSION_INSERT_RANGE_10022005_1838 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct insert_range_impl; + + template <> + struct insert_range_impl + { + template + struct apply + { + typedef typename + fusion::result_of::insert_range::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/pop_back.hpp b/include/boost/fusion/mpl/pop_back.hpp new file mode 100644 index 00000000..84bd75a4 --- /dev/null +++ b/include/boost/fusion/mpl/pop_back.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_POP_BACK_10022005_1801) +#define FUSION_POP_BACK_10022005_1801 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct pop_back_impl; + + template <> + struct pop_back_impl + { + template + struct apply + { + typedef typename + fusion::result_of::pop_back::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/pop_front.hpp b/include/boost/fusion/mpl/pop_front.hpp new file mode 100644 index 00000000..ffe6c302 --- /dev/null +++ b/include/boost/fusion/mpl/pop_front.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_POP_FRONT_10022005_1800) +#define FUSION_POP_FRONT_10022005_1800 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct pop_front_impl; + + template <> + struct pop_front_impl + { + template + struct apply + { + typedef typename + fusion::result_of::pop_front::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/push_back.hpp b/include/boost/fusion/mpl/push_back.hpp new file mode 100644 index 00000000..e96faa06 --- /dev/null +++ b/include/boost/fusion/mpl/push_back.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PUSH_BACK_10022005_1647) +#define FUSION_PUSH_BACK_10022005_1647 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct push_back_impl; + + template <> + struct push_back_impl + { + template + struct apply + { + typedef typename + fusion::result_of::push_back::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/push_front.hpp b/include/boost/fusion/mpl/push_front.hpp new file mode 100644 index 00000000..c508d652 --- /dev/null +++ b/include/boost/fusion/mpl/push_front.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PUSH_FRONT_10022005_1720) +#define FUSION_PUSH_FRONT_10022005_1720 + +#include +#include +#include +#include + +namespace boost { namespace mpl +{ + template + struct push_front_impl; + + template <> + struct push_front_impl + { + template + struct apply + { + typedef typename + fusion::result_of::push_front::type + result; + + typedef typename + fusion::result_of::convert< + typename fusion::detail::tag_of::type, result>::type + type; + }; + }; +}} + +#endif + diff --git a/include/boost/fusion/mpl/size.hpp b/include/boost/fusion/mpl/size.hpp new file mode 100644 index 00000000..2c724281 --- /dev/null +++ b/include/boost/fusion/mpl/size.hpp @@ -0,0 +1,26 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SIZE_10022005_1617) +#define FUSION_SIZE_10022005_1617 + +#include +#include + +namespace boost { namespace mpl +{ + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply : fusion::result_of::size {}; + }; +}} + +#endif diff --git a/include/boost/fusion/sequence.hpp b/include/boost/fusion/sequence.hpp new file mode 100644 index 00000000..e60fdd7d --- /dev/null +++ b/include/boost/fusion/sequence.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_10022005_0559) +#define FUSION_ITERATOR_10022005_0559 + +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/sequence/comparison.hpp b/include/boost/fusion/sequence/comparison.hpp new file mode 100644 index 00000000..50e72cb3 --- /dev/null +++ b/include/boost/fusion/sequence/comparison.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_COMPARISON_10022005_0615) +#define FUSION_SEQUENCE_COMPARISON_10022005_0615 + +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/sequence/comparison/detail/enable_comparison.hpp b/include/boost/fusion/sequence/comparison/detail/enable_comparison.hpp new file mode 100644 index 00000000..3e79277e --- /dev/null +++ b/include/boost/fusion/sequence/comparison/detail/enable_comparison.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ENABLE_COMPARISON_09232005_1958) +#define FUSION_ENABLE_COMPARISON_09232005_1958 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct is_native_fusion_sequence : is_base_of {}; + + template + struct enable_equality + : mpl::or_, is_native_fusion_sequence > + {}; + + template + struct enable_comparison + : mpl::and_< + mpl::or_, is_native_fusion_sequence > + , mpl::equal_to, result_of::size > + > + {}; + +}}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/detail/equal_to.hpp b/include/boost/fusion/sequence/comparison/detail/equal_to.hpp new file mode 100644 index 00000000..c4f91238 --- /dev/null +++ b/include/boost/fusion/sequence/comparison/detail/equal_to.hpp @@ -0,0 +1,60 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_EQUAL_TO_05052005_1142) +#define FUSION_EQUAL_TO_05052005_1142 + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct sequence_equal_to + { + typedef typename result_of::end::type end1_type; + typedef typename result_of::end::type end2_type; + + template + static bool + call(I1 const&, I2 const&, mpl::true_) + { + return true; + } + + template + static bool + call(I1 const& a, I2 const& b, mpl::false_) + { + return *a == *b + && call(fusion::next(a), fusion::next(b)); + } + + template + static bool + call(I1 const& a, I2 const& b) + { + typename result_of::equal_to::type eq; + return call(a, b, eq); + } + }; + + template + struct sequence_equal_to + { + template + static bool + call(I1 const& a, I2 const& b) + { + return false; + } + }; +}}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/detail/greater.hpp b/include/boost/fusion/sequence/comparison/detail/greater.hpp new file mode 100644 index 00000000..34cf1448 --- /dev/null +++ b/include/boost/fusion/sequence/comparison/detail/greater.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_GREATER_05052005_1142) +#define FUSION_GREATER_05052005_1142 + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct sequence_greater + { + typedef typename result_of::end::type end1_type; + typedef typename result_of::end::type end2_type; + + template + static bool + call(I1 const&, I2 const&, mpl::true_) + { + return false; + } + + template + static bool + call(I1 const& a, I2 const& b, mpl::false_) + { + return *a > *b + || !(*b > *a) + && call(fusion::next(a), fusion::next(b)); + } + + template + static bool + call(I1 const& a, I2 const& b) + { + typename result_of::equal_to::type eq; + return call(a, b, eq); + } + }; +}}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp b/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp new file mode 100644 index 00000000..0cf4c388 --- /dev/null +++ b/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_GREATER_EQUAL_05052005_1142) +#define FUSION_GREATER_EQUAL_05052005_1142 + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct sequence_greater_equal + { + typedef typename result_of::end::type end1_type; + typedef typename result_of::end::type end2_type; + + template + static bool + call(I1 const&, I2 const&, mpl::true_) + { + return true; + } + + template + static bool + call(I1 const& a, I2 const& b, mpl::false_) + { + return *a >= *b + && (!(*b >= *a) || call(fusion::next(a), fusion::next(b))); + } + + template + static bool + call(I1 const& a, I2 const& b) + { + typename result_of::equal_to::type eq; + return call(a, b, eq); + } + }; +}}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/detail/less.hpp b/include/boost/fusion/sequence/comparison/detail/less.hpp new file mode 100644 index 00000000..3fc6429f --- /dev/null +++ b/include/boost/fusion/sequence/comparison/detail/less.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LESS_05052005_1141) +#define FUSION_LESS_05052005_1141 + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct sequence_less + { + typedef typename result_of::end::type end1_type; + typedef typename result_of::end::type end2_type; + + template + static bool + call(I1 const&, I2 const&, mpl::true_) + { + return false; + } + + template + static bool + call(I1 const& a, I2 const& b, mpl::false_) + { + return *a < *b + || !(*b < *a) + && call(fusion::next(a), fusion::next(b)); + } + + template + static bool + call(I1 const& a, I2 const& b) + { + typename result_of::equal_to::type eq; + return call(a, b, eq); + } + }; +}}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/detail/less_equal.hpp b/include/boost/fusion/sequence/comparison/detail/less_equal.hpp new file mode 100644 index 00000000..3d48ae5c --- /dev/null +++ b/include/boost/fusion/sequence/comparison/detail/less_equal.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LESS_EQUAL_05052005_1141) +#define FUSION_LESS_EQUAL_05052005_1141 + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct sequence_less_equal + { + typedef typename result_of::end::type end1_type; + typedef typename result_of::end::type end2_type; + + template + static bool + call(I1 const&, I2 const&, mpl::true_) + { + return true; + } + + template + static bool + call(I1 const& a, I2 const& b, mpl::false_) + { + return *a <= *b + && (!(*b <= *a) || call(fusion::next(a), fusion::next(b))); + } + + template + static bool + call(I1 const& a, I2 const& b) + { + typename result_of::equal_to::type eq; + return call(a, b, eq); + } + }; +}}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp b/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp new file mode 100644 index 00000000..87911b6d --- /dev/null +++ b/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp @@ -0,0 +1,60 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NOT_EQUAL_TO_05052005_1141) +#define FUSION_NOT_EQUAL_TO_05052005_1141 + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct sequence_not_equal_to + { + typedef typename result_of::end::type end1_type; + typedef typename result_of::end::type end2_type; + + template + static bool + call(I1 const&, I2 const&, mpl::true_) + { + return false; + } + + template + static bool + call(I1 const& a, I2 const& b, mpl::false_) + { + return *a != *b + || call(fusion::next(a), fusion::next(b)); + } + + template + static bool + call(I1 const& a, I2 const& b) + { + typename result_of::equal_to::type eq; + return call(a, b, eq); + } + }; + + template + struct sequence_not_equal_to + { + template + static bool + call(I1 const& a, I2 const& b) + { + return true; + } + }; +}}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/equal_to.hpp b/include/boost/fusion/sequence/comparison/equal_to.hpp new file mode 100644 index 00000000..cea3c9c1 --- /dev/null +++ b/include/boost/fusion/sequence/comparison/equal_to.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_EQUAL_TO_05052005_0431) +#define FUSION_EQUAL_TO_05052005_0431 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + template + inline bool + equal_to(Seq1 const& a, Seq2 const& b) + { + return result_of::size::value == result_of::size::value + && detail::sequence_equal_to< + Seq1 const, Seq2 const + , result_of::size::value == result_of::size::value>:: + call(fusion::begin(a), fusion::begin(b)); + } + + namespace operators + { + template + inline typename + enable_if< + detail::enable_equality + , bool + >::type + operator==(Seq1 const& a, Seq2 const& b) + { + return fusion::equal_to(a, b); + } + } + using operators::operator==; +}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/greater.hpp b/include/boost/fusion/sequence/comparison/greater.hpp new file mode 100644 index 00000000..3ef215a1 --- /dev/null +++ b/include/boost/fusion/sequence/comparison/greater.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_GREATER_05052005_0432) +#define FUSION_GREATER_05052005_0432 + +#include +#include +#include +#include + +#if defined(FUSION_DIRECT_OPERATOR_USAGE) +#include +#else +#include +#endif + +namespace boost { namespace fusion +{ + template + inline bool + greater(Seq1 const& a, Seq2 const& b) + { +#if defined(FUSION_DIRECT_OPERATOR_USAGE) + return detail::sequence_greater:: + call(fusion::begin(a), fusion::begin(b)); +#else + return (b < a); +#endif + } + + namespace operators + { + template + inline typename + enable_if< + detail::enable_comparison + , bool + >::type + operator>(Seq1 const& a, Seq2 const& b) + { + return fusion::greater(a, b); + } + } + using operators::operator>; +}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/greater_equal.hpp b/include/boost/fusion/sequence/comparison/greater_equal.hpp new file mode 100644 index 00000000..df365c3a --- /dev/null +++ b/include/boost/fusion/sequence/comparison/greater_equal.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_GREATER_EQUAL_05052005_0432) +#define FUSION_GREATER_EQUAL_05052005_0432 + +#include +#include +#include +#include + +#if defined(FUSION_DIRECT_OPERATOR_USAGE) +#include +#else +#include +#endif + +namespace boost { namespace fusion +{ + template + inline bool + greater_equal(Seq1 const& a, Seq2 const& b) + { +#if defined(FUSION_DIRECT_OPERATOR_USAGE) + return detail::sequence_greater_equal:: + call(fusion::begin(a), fusion::begin(b)); +#else + return !(a < b); +#endif + } + + namespace operators + { + template + inline typename + enable_if< + detail::enable_comparison + , bool + >::type + operator>=(Seq1 const& a, Seq2 const& b) + { + return fusion::greater_equal(a, b); + } + } + using operators::operator>=; +}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/less.hpp b/include/boost/fusion/sequence/comparison/less.hpp new file mode 100644 index 00000000..4d3c086c --- /dev/null +++ b/include/boost/fusion/sequence/comparison/less.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LESS_05052005_0432) +#define FUSION_LESS_05052005_0432 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + template + inline bool + less(Seq1 const& a, Seq2 const& b) + { + return detail::sequence_less:: + call(fusion::begin(a), fusion::begin(b)); + } + + namespace operators + { + template + inline typename + enable_if< + detail::enable_comparison + , bool + >::type + operator<(Seq1 const& a, Seq2 const& b) + { + return fusion::less(a, b); + } + } + using operators::operator<; +}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/less_equal.hpp b/include/boost/fusion/sequence/comparison/less_equal.hpp new file mode 100644 index 00000000..0f5a953c --- /dev/null +++ b/include/boost/fusion/sequence/comparison/less_equal.hpp @@ -0,0 +1,80 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_LESS_EQUAL_05052005_0432) +#define FUSION_LESS_EQUAL_05052005_0432 + +#include +#include +#include +#include + +#if defined(FUSION_DIRECT_OPERATOR_USAGE) +#include +#else +#include +#endif + +namespace boost { namespace fusion +{ + template + inline bool + less_equal(Seq1 const& a, Seq2 const& b) + { +#if defined(FUSION_DIRECT_OPERATOR_USAGE) + return detail::sequence_less_equal:: + call(fusion::begin(a), fusion::begin(b)); +#else + return !(b < a); +#endif + } + + namespace operators + { +#if defined(BOOST_MSVC) && (BOOST_MSVC <= 1400) +// Workaround for VC8.0 and VC7.1 + template + inline bool + operator<=(sequence_base const& a, sequence_base const& b) + { + return less_equal(a.derived(), b.derived()); + } + + template + inline typename disable_if, bool>::type + operator<=(sequence_base const& a, Seq2 const& b) + { + return less_equal(a.derived(), b); + } + + template + inline typename disable_if, bool>::type + operator<=(Seq1 const& a, sequence_base const& b) + { + return less_equal(a, b.derived()); + } + +#else +// Somehow VC8.0 and VC7.1 does not like this code +// but barfs somewhere else. + + template + inline typename + enable_if< + detail::enable_comparison + , bool + >::type + operator<=(Seq1 const& a, Seq2 const& b) + { + return fusion::less_equal(a, b); + } +#endif + } + using operators::operator<=; +}} + +#endif diff --git a/include/boost/fusion/sequence/comparison/not_equal_to.hpp b/include/boost/fusion/sequence/comparison/not_equal_to.hpp new file mode 100644 index 00000000..34d2cab6 --- /dev/null +++ b/include/boost/fusion/sequence/comparison/not_equal_to.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NOT_EQUAL_TO_05052005_0431) +#define FUSION_NOT_EQUAL_TO_05052005_0431 + +#include +#include +#include +#include + +#if defined(FUSION_DIRECT_OPERATOR_USAGE) +#include +#else +#include +#endif + +namespace boost { namespace fusion +{ + template + inline bool + not_equal_to(Seq1 const& a, Seq2 const& b) + { +#if defined(FUSION_DIRECT_OPERATOR_USAGE) + return result_of::size::value != result_of::size::value + || detail::sequence_not_equal_to< + Seq1 const, Seq2 const + , result_of::size::value == result_of::size::value>:: + call(fusion::begin(a), fusion::begin(b)); +#else + return !(a == b); +#endif + } + + namespace operators + { + template + inline typename + enable_if< + detail::enable_equality + , bool + >::type + operator!=(Seq1 const& a, Seq2 const& b) + { + return fusion::not_equal_to(a, b); + } + } + using operators::operator!=; +}} + +#endif diff --git a/include/boost/fusion/sequence/convert.hpp b/include/boost/fusion/sequence/convert.hpp new file mode 100644 index 00000000..a6e3ccca --- /dev/null +++ b/include/boost/fusion/sequence/convert.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONVERT_10022005_1442) +#define FUSION_CONVERT_10022005_1442 + +namespace boost { namespace fusion +{ + namespace extension + { + template + struct convert_impl; + } + + namespace result_of + { + template + struct convert + { + typedef typename extension::convert_impl gen; + + typedef typename + gen::template apply::type + type; + }; + } + + template + inline typename result_of::convert::type + convert(Sequence& seq) + { + typedef typename result_of::convert::gen gen; + return gen::call(seq); + } + + template + inline typename result_of::convert::type + convert(Sequence const& seq) + { + typedef typename result_of::convert::gen gen; + return gen::call(seq); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/generation.hpp b/include/boost/fusion/sequence/generation.hpp new file mode 100644 index 00000000..2afad632 --- /dev/null +++ b/include/boost/fusion/sequence/generation.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_GENERATION_10022005_0615) +#define FUSION_SEQUENCE_GENERATION_10022005_0615 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/sequence/generation/cons_tie.hpp b/include/boost/fusion/sequence/generation/cons_tie.hpp new file mode 100644 index 00000000..88ce0aa4 --- /dev/null +++ b/include/boost/fusion/sequence/generation/cons_tie.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CONS_TIE_07182005_0854) +#define FUSION_CONS_TIE_07182005_0854 + +#include + +namespace boost { namespace fusion +{ + struct nil; + + namespace result_of + { + template + struct cons_tie + { + typedef cons type; + }; + } + + // $$$ do we really want a cons_tie? $$$ + template + inline cons + cons_tie(Car& car) + { + return cons(car); + } + + // $$$ do we really want a cons_tie? $$$ + template + inline cons + cons_tie(Car& car, Cdr const& cdr) + { + return cons(car, cdr); + } +}} + +#endif + diff --git a/include/boost/fusion/sequence/generation/deque_tie.hpp b/include/boost/fusion/sequence/generation/deque_tie.hpp new file mode 100644 index 00000000..5f8a2f08 --- /dev/null +++ b/include/boost/fusion/sequence/generation/deque_tie.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_DEQUE_TIE_07192005_1242) +#define FUSION_DEQUE_TIE_07192005_1242 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_DEQUE_SIZE, typename T, void_) + , typename Extra = void_ + > + struct deque_tie; + } + +#define BOOST_FUSION_REF(z, n, data) BOOST_PP_CAT(T, n)& + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_REF + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template + struct deque_tie + { + typedef deque type; + }; + } + + template + inline deque + deque_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & _)) + { + return deque( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/generation/ignore.hpp b/include/boost/fusion/sequence/generation/ignore.hpp new file mode 100644 index 00000000..c363a203 --- /dev/null +++ b/include/boost/fusion/sequence/generation/ignore.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001 Doug Gregor + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_IGNORE_07192005_0329) +#define FUSION_IGNORE_07192005_0329 + +namespace boost { namespace fusion +{ + // Swallows any assignment (by Doug Gregor) + namespace detail + { + struct swallow_assign + { + template + swallow_assign const& + operator=(const T&) const + { + return *this; + } + }; + } + + // "ignore" allows tuple positions to be ignored when using "tie". + detail::swallow_assign const ignore = detail::swallow_assign(); +}} + +#endif diff --git a/include/boost/fusion/sequence/generation/list_tie.hpp b/include/boost/fusion/sequence/generation/list_tie.hpp new file mode 100644 index 00000000..946fdbc3 --- /dev/null +++ b/include/boost/fusion/sequence/generation/list_tie.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_LIST_TIE_07192005_0109) +#define FUSION_LIST_TIE_07192005_0109 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_LIST_SIZE, typename T, void_) + , typename Extra = void_ + > + struct list_tie; + } + +// $$$ shouldn't we remove_reference first to allow references? $$$ +#define BOOST_FUSION_REF(z, n, data) BOOST_PP_CAT(T, n)& + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_REF + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template + struct list_tie + { + typedef list type; + }; + } + + template + inline list + list_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & _)) + { + return list( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/generation/make_cons.hpp b/include/boost/fusion/sequence/generation/make_cons.hpp new file mode 100644 index 00000000..47a2f461 --- /dev/null +++ b/include/boost/fusion/sequence/generation/make_cons.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2005 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_MAKE_CONS_07172005_0918) +#define FUSION_MAKE_CONS_07172005_0918 + +#include +#include + +namespace boost { namespace fusion +{ + struct nil; + + namespace result_of + { + template + struct make_cons + { + typedef cons::type, Cdr> type; + }; + } + + template + inline cons::type> + make_cons(Car const& car) + { + return cons::type>(car); + } + + template + inline cons::type, Cdr> + make_cons(Car const& car, Cdr const& cdr) + { + return cons::type, Cdr>(car, cdr); + } +}} + +#endif + diff --git a/include/boost/fusion/sequence/generation/make_deque.hpp b/include/boost/fusion/sequence/generation/make_deque.hpp new file mode 100644 index 00000000..5bcd4962 --- /dev/null +++ b/include/boost/fusion/sequence/generation/make_deque.hpp @@ -0,0 +1,91 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAKE_DEQUE_07162005_0243) +#define FUSION_MAKE_DEQUE_07162005_0243 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_DEQUE_SIZE, typename T, void_) + , typename Extra = void_ + > + struct make_deque; + + template <> + struct make_deque<> + { + typedef deque<> type; + }; + } + + inline deque<> + make_deque() + { + return deque<>(); + } + +#define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data) \ + typename detail::as_fusion_element::type + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_AS_FUSION_ELEMENT + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template + struct make_deque + { + typedef deque type; + }; + } + + template + inline deque + make_deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _)) + { + return deque( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/generation/make_list.hpp b/include/boost/fusion/sequence/generation/make_list.hpp new file mode 100644 index 00000000..122fe751 --- /dev/null +++ b/include/boost/fusion/sequence/generation/make_list.hpp @@ -0,0 +1,84 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAKE_LIST_07192005_1239) +#define FUSION_MAKE_LIST_07192005_1239 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_LIST_SIZE, typename T, void_) + , typename Extra = void_ + > + struct make_list; + + template <> + struct make_list<> + { + typedef list<> type; + }; + } + + inline list<> + make_list() + { + return list<>(); + } + +#define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data) \ + typename detail::as_fusion_element::type + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_LIST_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_AS_FUSION_ELEMENT + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template + struct make_list + { + typedef list type; + }; + } + + template + inline list + make_list(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _)) + { + return list( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/generation/make_map.hpp b/include/boost/fusion/sequence/generation/make_map.hpp new file mode 100644 index 00000000..5bc054e3 --- /dev/null +++ b/include/boost/fusion/sequence/generation/make_map.hpp @@ -0,0 +1,99 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAKE_MAP_07222005_1247) +#define FUSION_MAKE_MAP_07222005_1247 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_VECTOR_SIZE, typename K, void_) + , BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_VECTOR_SIZE, typename D, void_) + , typename Extra = void_ + > + struct make_map; + + template <> + struct make_map<> + { + typedef map<> type; + }; + } + + inline map<> + make_map() + { + return map<>(); + } + +#define BOOST_FUSION_PAIR(z, n, data) \ + fusion::pair< \ + BOOST_PP_CAT(K, n) \ + , typename detail::as_fusion_element::type> + +#define BOOST_FUSION_MAKE_PAIR(z, n, data) \ + fusion::make_pair(BOOST_PP_CAT(_, n)) \ + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_PAIR +#undef BOOST_FUSION_MAKE_PAIR + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS(N, typename K) + , BOOST_PP_ENUM_PARAMS(N, typename D) + > + struct make_map + { + typedef map type; + }; + } + + template < + BOOST_PP_ENUM_PARAMS(N, typename K) + , BOOST_PP_ENUM_PARAMS(N, typename D) + > + inline map + make_map(BOOST_PP_ENUM_BINARY_PARAMS(N, D, const& _)) + { + return map( + BOOST_PP_ENUM(N, BOOST_FUSION_MAKE_PAIR, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/generation/make_set.hpp b/include/boost/fusion/sequence/generation/make_set.hpp new file mode 100644 index 00000000..b434923f --- /dev/null +++ b/include/boost/fusion/sequence/generation/make_set.hpp @@ -0,0 +1,86 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAKE_SET_09162005_1125) +#define FUSION_MAKE_SET_09162005_1125 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_VECTOR_SIZE, typename T, void_) + , typename Extra = void_ + > + struct make_set; + + template <> + struct make_set<> + { + typedef set<> type; + }; + } + + inline set<> + make_set() + { + return set<>(); + } + +#define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data) \ + typename detail::as_fusion_element::type + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_ELEMENT +#undef BOOST_FUSION_AS_ELEMENT + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template + struct make_set + { + typedef set type; + }; + } + + template + inline set + make_set(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _)) + { + return set( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/generation/make_vector.hpp b/include/boost/fusion/sequence/generation/make_vector.hpp new file mode 100644 index 00000000..b73598d6 --- /dev/null +++ b/include/boost/fusion/sequence/generation/make_vector.hpp @@ -0,0 +1,84 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAKE_VECTOR_07162005_0243) +#define FUSION_MAKE_VECTOR_07162005_0243 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_VECTOR_SIZE, typename T, void_) + , typename Extra = void_ + > + struct make_vector; + + template <> + struct make_vector<> + { + typedef vector<> type; + }; + } + + inline vector<> + make_vector() + { + return vector<>(); + } + +#define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data) \ + typename detail::as_fusion_element::type + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_AS_FUSION_ELEMENT + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template + struct make_vector + { + typedef vector type; + }; + } + + template + inline vector + make_vector(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _)) + { + return vector( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/generation/map_tie.hpp b/include/boost/fusion/sequence/generation/map_tie.hpp new file mode 100644 index 00000000..a5cb08c9 --- /dev/null +++ b/include/boost/fusion/sequence/generation/map_tie.hpp @@ -0,0 +1,102 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAP_TIE_20060814_1116) +#define FUSION_MAP_TIE_20060814_1116 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_MAP_SIZE, typename K, void_) + , BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_MAP_SIZE, typename D, void_) + , typename Extra = void_ + > + struct map_tie; + + template <> + struct map_tie<> + { + typedef map<> type; + }; + } + + inline map<> + map_tie() + { + return map<>(); + } + +#define BOOST_FUSION_TIED_PAIR(z, n, data) \ + fusion::pair< \ + BOOST_PP_CAT(K, n) \ + , typename add_reference::type> + +#define BOOST_FUSION_PAIR_TIE(z, n, data) \ + fusion::pair_tie(BOOST_PP_CAT(_, n)) \ + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_MAP_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_PAIR +#undef BOOST_FUSION_MAKE_PAIR + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS(N, typename K) + , BOOST_PP_ENUM_PARAMS(N, typename D) + > + struct map_tie + { + typedef map type; + }; + } + + template < + BOOST_PP_ENUM_PARAMS(N, typename K) + , BOOST_PP_ENUM_PARAMS(N, typename D) + > + inline map + map_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, D, & _)) + { + return map( + BOOST_PP_ENUM(N, BOOST_FUSION_PAIR_TIE, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/generation/pair_tie.hpp b/include/boost/fusion/sequence/generation/pair_tie.hpp new file mode 100644 index 00000000..09437a26 --- /dev/null +++ b/include/boost/fusion/sequence/generation/pair_tie.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined (BOOST_FUSION_PAIR_TIE_20060812_2058) +#define BOOST_FUSION_PAIR_TIE_20060812_2058 + +#include +#include + +namespace boost { namespace fusion { + + template + struct pair; + + namespace result_of + { + template + struct pair_tie + { + typedef fusion::pair type; + }; + } + + template + typename disable_if, typename result_of::pair_tie::type>::type + pair_tie(T& t) + { + return typename result_of::pair_tie::type(t); + } + + template + typename result_of::pair_tie::type + pair_tie(T const& t) + { + return typename result_of::pair_tie::type(t); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/generation/vector_tie.hpp b/include/boost/fusion/sequence/generation/vector_tie.hpp new file mode 100644 index 00000000..f70c4e89 --- /dev/null +++ b/include/boost/fusion/sequence/generation/vector_tie.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_VECTOR_TIE_07192005_1242) +#define FUSION_VECTOR_TIE_07192005_1242 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace result_of + { + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_VECTOR_SIZE, typename T, void_) + , typename Extra = void_ + > + struct vector_tie; + } + +#define BOOST_FUSION_REF(z, n, data) BOOST_PP_CAT(T, n)& + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_REF + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + namespace result_of + { + template + struct vector_tie + { + typedef vector type; + }; + } + + template + inline vector + vector_tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & _)) + { + return vector( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/sequence/intrinsic.hpp b/include/boost/fusion/sequence/intrinsic.hpp new file mode 100644 index 00000000..8c5f4abd --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_INTRINSIC_10022005_0618) +#define FUSION_SEQUENCE_INTRINSIC_10022005_0618 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/at.hpp b/include/boost/fusion/sequence/intrinsic/at.hpp new file mode 100644 index 00000000..4524ace5 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/at.hpp @@ -0,0 +1,106 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_AT_05042005_0722) +#define FUSION_AT_05042005_0722 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct at_impl + { + template + struct apply; + }; + + template <> + struct at_impl + { + template + struct apply : Sequence::template at {}; + }; + + template <> + struct at_impl; + + template <> + struct at_impl; + + template <> + struct at_impl; + + template <> + struct at_impl; + } + + namespace result_of + { + template + struct at + : extension::at_impl::type>:: + template apply + {}; + + template + struct at_c + : at > + {}; + } + + + template + inline typename + lazy_disable_if< + is_const + , result_of::at + >::type + at(Sequence& seq) + { + return result_of::at::call(seq); + } + + template + inline typename result_of::at::type + at(Sequence const& seq) + { + return result_of::at::call(seq); + } + + template + inline typename + lazy_disable_if< + is_const + , result_of::at_c + >::type + at_c(Sequence& seq) + { + return at >(seq); + } + + template + inline typename result_of::at_c::type + at_c(Sequence const& seq) + { + return at >(seq); + } +}} + +#endif + diff --git a/include/boost/fusion/sequence/intrinsic/at_key.hpp b/include/boost/fusion/sequence/intrinsic/at_key.hpp new file mode 100644 index 00000000..849ff294 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/at_key.hpp @@ -0,0 +1,77 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_KEY_20060304_1755) +#define BOOST_FUSION_AT_KEY_20060304_1755 + +#include +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct at_key_impl + { + template + struct apply; + }; + + template <> + struct at_key_impl + { + template + struct apply : Sequence::template at_key {}; + }; + + template <> + struct at_key_impl; + + template <> + struct at_key_impl; + + template <> + struct at_key_impl; + } + + namespace result_of + { + template + struct at_key + : extension::at_key_impl::type>:: + template apply + {}; + } + + template + inline typename + lazy_disable_if< + is_const + , result_of::at_key + >::type + at_key(Sequence& seq) + { + return result_of::at_key::call(seq); + } + + template + inline typename result_of::at_key::type + at_key(Sequence const& seq) + { + return result_of::at_key::call(seq); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/back.hpp b/include/boost/fusion/sequence/intrinsic/back.hpp new file mode 100644 index 00000000..1f3567f9 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/back.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BACK_09162005_0350) +#define FUSION_BACK_09162005_0350 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct fusion_sequence_tag; + + namespace result_of + { + template + struct back + : result_of::deref::type>::type> + {}; + } + + template + inline typename result_of::back::type + back(Sequence& seq) + { + return *fusion::prior(fusion::end(seq)); + } + + template + inline typename result_of::back::type + back(Sequence const& seq) + { + return *fusion::prior(fusion::end(seq)); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/begin.hpp b/include/boost/fusion/sequence/intrinsic/begin.hpp new file mode 100644 index 00000000..715ef9e1 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/begin.hpp @@ -0,0 +1,74 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_04052005_1132) +#define FUSION_BEGIN_04052005_1132 + +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; // iterator facade tag + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct begin_impl + { + template + struct apply; + }; + + template <> + struct begin_impl + { + template + struct apply : Sequence::template begin {}; + }; + + template <> + struct begin_impl; + + template <> + struct begin_impl; + + template <> + struct begin_impl; + + template <> + struct begin_impl; + } + + namespace result_of + { + template + struct begin + : extension::begin_impl::type>:: + template apply + {}; + } + + template + inline typename result_of::begin::type const + begin(Sequence& seq) + { + return result_of::begin::call(seq); + } + + template + inline typename result_of::begin::type const + begin(Sequence const& seq) + { + return result_of::begin::call(seq); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/empty.hpp b/include/boost/fusion/sequence/intrinsic/empty.hpp new file mode 100644 index 00000000..2390a49b --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/empty.hpp @@ -0,0 +1,60 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_EMPTY_09162005_0335) +#define FUSION_EMPTY_09162005_0335 + +#include +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct mpl_sequence_tag; // mpl sequence tag + + namespace extension + { + template + struct empty_impl + { + template + struct apply + : mpl::bool_<(result_of::size::value == 0)> + {}; + }; + + template <> + struct empty_impl + { + template + struct apply : Sequence::template empty {}; + }; + + template <> + struct empty_impl; + } + + namespace result_of + { + template + struct empty + : extension::empty_impl::type>:: + template apply + {}; + } + + template + inline typename result_of::empty::type + empty(Sequence const&) + { + typedef typename result_of::empty::type result; + return result(); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/end.hpp b/include/boost/fusion/sequence/intrinsic/end.hpp new file mode 100644 index 00000000..04232f12 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/end.hpp @@ -0,0 +1,74 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_04052005_1141) +#define FUSION_END_04052005_1141 + +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct end_impl + { + template + struct apply; + }; + + template <> + struct end_impl + { + template + struct apply : Sequence::template end {}; + }; + + template <> + struct end_impl; + + template <> + struct end_impl; + + template <> + struct end_impl; + + template <> + struct end_impl; + } + + namespace result_of + { + template + struct end + : extension::end_impl::type>:: + template apply + {}; + } + + template + inline typename result_of::end::type const + end(Sequence& seq) + { + return result_of::end::call(seq); + } + + template + inline typename result_of::end::type const + end(Sequence const& seq) + { + return result_of::end::call(seq); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/ext_/segments.hpp b/include/boost/fusion/sequence/intrinsic/ext_/segments.hpp new file mode 100755 index 00000000..58f148f2 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/ext_/segments.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEGMENTS_04052005_1141) +#define FUSION_SEGMENTS_04052005_1141 + +#include + +namespace boost { namespace fusion +{ + // segments: returns a sequence of sequences + namespace extension + { + template + struct segments_impl + { + template + struct apply {}; + }; + } + + namespace result_of + { + template + struct segments + { + typedef typename + extension::segments_impl::type>:: + template apply::type + type; + }; + } + + template + typename result_of::segments::type + segments(Sequence & seq) + { + return + extension::segments_impl::type>:: + template apply::call(seq); + } + + template + typename result_of::segments::type + segments(Sequence const& seq) + { + return + extension::segments_impl::type>:: + template apply::call(seq); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp b/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp new file mode 100755 index 00000000..d3c31ccc --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp @@ -0,0 +1,57 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SIZE_S_08112006_1141) +#define FUSION_SIZE_S_08112006_1141 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + /////////////////////////////////////////////////////////////////////////// + // calculates the size of any segmented data structure. + template::value> + struct segmented_size; + + namespace detail + { + struct size_plus + { + template + struct result; + + template + struct result + : mpl::plus< + segmented_size::type> + , typename remove_reference::type + > + {}; + }; + } + + /////////////////////////////////////////////////////////////////////////// + template + struct segmented_size + : result_of::fold< + typename result_of::segments::type + , mpl::size_t<0> + , detail::size_plus + >::type + {}; + + template + struct segmented_size + : result_of::size + {}; +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/front.hpp b/include/boost/fusion/sequence/intrinsic/front.hpp new file mode 100644 index 00000000..bb79cfa9 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/front.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FRONT_09162005_0343) +#define FUSION_FRONT_09162005_0343 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct fusion_sequence_tag; + + namespace result_of + { + template + struct front + : result_of::deref::type> + {}; + } + + template + inline typename result_of::front::type + front(Sequence& seq) + { + return *fusion::begin(seq); + } + + template + inline typename result_of::front::type + front(Sequence const& seq) + { + return *fusion::begin(seq); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/has_key.hpp b/include/boost/fusion/sequence/intrinsic/has_key.hpp new file mode 100644 index 00000000..4c6a3e07 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/has_key.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_HAS_KEY_09232005_1454) +#define FUSION_HAS_KEY_09232005_1454 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + // Special tags: + struct sequence_facade_tag; + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct has_key_impl + { + template + struct apply + : mpl::not_::type, void_> > + {}; + }; + + template <> + struct has_key_impl + { + template + struct apply : Sequence::template has_key {}; + }; + + template <> + struct has_key_impl; + + template <> + struct has_key_impl; + + template <> + struct has_key_impl; + } + + namespace result_of + { + template + struct has_key + : extension::has_key_impl::type>:: + template apply + {}; + } + + template + inline typename result_of::has_key::type + has_key(Sequence const& seq) + { + typedef typename result_of::has_key::type result; + return result(); + } +}} + +#endif + diff --git a/include/boost/fusion/sequence/intrinsic/size.hpp b/include/boost/fusion/sequence/intrinsic/size.hpp new file mode 100644 index 00000000..74e3f53a --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/size.hpp @@ -0,0 +1,74 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SIZE_05052005_0214) +#define FUSION_SIZE_05052005_0214 + +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct size_impl + { + template + struct apply : Sequence::size {}; + }; + + template <> + struct size_impl + { + template + struct apply : Sequence::template size {}; + }; + + template <> + struct size_impl; + + template <> + struct size_impl; + + template <> + struct size_impl; + + template <> + struct size_impl; + } + + namespace result_of + { + template + struct size + : extension::size_impl::type>:: + template apply + + { + typedef typename extension::size_impl::type>:: + template apply::type size_application; + BOOST_STATIC_CONSTANT(int, value = size_application::value); + }; + } + + template + inline typename result_of::size::type + size(Sequence const&) + { + typedef typename result_of::size::type result; + return result(); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/swap.hpp b/include/boost/fusion/sequence/intrinsic/swap.hpp new file mode 100644 index 00000000..7a385ae8 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/swap.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SWAP_20070501_1956) +#define BOOST_FUSION_SWAP_20070501_1956 + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + namespace result_of + { + template + struct swap + { + typedef void type; + }; + } + + namespace detail + { + struct swap + { + template + struct result + { + typedef void type; + }; + + template + void operator()(Elem const& e) const + { + using std::swap; + swap(front(e), back(e)); + } + }; + } + + template + typename enable_if, traits::is_sequence >, void>::type + swap(Seq1& lhs, Seq2& rhs) + { + typedef vector references; + for_each(zip_view(references(lhs, rhs)), detail::swap()); + } +}} + +#endif diff --git a/include/boost/fusion/sequence/intrinsic/value_at.hpp b/include/boost/fusion/sequence/intrinsic/value_at.hpp new file mode 100644 index 00000000..d0868155 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/value_at.hpp @@ -0,0 +1,67 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_AT_05052005_0229) +#define FUSION_VALUE_AT_05052005_0229 + +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct value_at_impl + { + template + struct apply; + }; + + template <> + struct value_at_impl + { + template + struct apply : Sequence::template value_at {}; + }; + + template <> + struct value_at_impl; + + template <> + struct value_at_impl; + + template <> + struct value_at_impl; + + template <> + struct value_at_impl; + } + + namespace result_of + { + template + struct value_at + : extension::value_at_impl::type>:: + template apply + {}; + + template + struct value_at_c + : fusion::result_of::value_at > + {}; + } +}} + +#endif + diff --git a/include/boost/fusion/sequence/intrinsic/value_at_key.hpp b/include/boost/fusion/sequence/intrinsic/value_at_key.hpp new file mode 100644 index 00000000..dbef3e89 --- /dev/null +++ b/include/boost/fusion/sequence/intrinsic/value_at_key.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_AT_KEY_05052005_0229) +#define FUSION_VALUE_AT_KEY_05052005_0229 + +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct value_at_key_impl + { + template + struct apply; + }; + + template <> + struct value_at_key_impl + { + template + struct apply : Sequence::template value_at_key {}; + }; + + template <> + struct value_at_key_impl; + + template <> + struct value_at_key_impl; + + template <> + struct value_at_key_impl; + } + + namespace result_of + { + template + struct value_at_key + : extension::value_at_key_impl::type>:: + template apply + {}; + } +}} + +#endif + diff --git a/include/boost/fusion/sequence/io.hpp b/include/boost/fusion/sequence/io.hpp new file mode 100644 index 00000000..080bae38 --- /dev/null +++ b/include/boost/fusion/sequence/io.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_IO_10032005_0836) +#define FUSION_SEQUENCE_IO_10032005_0836 + +#include +#include + +#endif diff --git a/include/boost/fusion/sequence/io/detail/in.hpp b/include/boost/fusion/sequence/io/detail/in.hpp new file mode 100644 index 00000000..93d63791 --- /dev/null +++ b/include/boost/fusion/sequence/io/detail/in.hpp @@ -0,0 +1,85 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 1999-2003 Jeremiah Willcock + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_IN_05052005_0121) +#define FUSION_IN_05052005_0121 + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct delimiter_in + { + // read a delimiter + template + static void + read(IS& is, char const* delim, mpl::false_ = mpl::false_()) + { + detail::string_ios_manip manip(is); + manip.read(delim); + } + + template + static void + read(IS& is, char const* delim, mpl::true_) + { + } + }; + + struct read_sequence_loop + { + template + static void + call(IS& is, First const&, Last const&, mpl::true_) + { + } + + template + static void + call(IS& is, First const& first, Last const& last, mpl::false_) + { + result_of::equal_to< + typename result_of::next::type + , Last + > + is_last; + + is >> *first; + delimiter_in::read(is, " ", is_last); + call(is, fusion::next(first), last, is_last); + } + + template + static void + call(IS& is, First const& first, Last const& last) + { + result_of::equal_to eq; + call(is, first, last, eq); + } + }; + + template + inline void + read_sequence(IS& is, Sequence& seq) + { + delimiter_in::read(is, "("); + read_sequence_loop::call(is, fusion::begin(seq), fusion::end(seq)); + delimiter_in::read(is, ")"); + } +}}} + +#endif diff --git a/include/boost/fusion/sequence/io/detail/manip.hpp b/include/boost/fusion/sequence/io/detail/manip.hpp new file mode 100644 index 00000000..382eb32f --- /dev/null +++ b/include/boost/fusion/sequence/io/detail/manip.hpp @@ -0,0 +1,316 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jeremiah Willcock + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_MANIP_05052005_1200) +#define FUSION_MANIP_05052005_1200 + +#include +#include +#include +#include + +// Tuple I/O manipulators + +#define FUSION_GET_CHAR_TYPE(T) typename T::char_type +#define FUSION_GET_TRAITS_TYPE(T) typename T::traits_type + +#if defined (BOOST_NO_TEMPLATED_STREAMS) +#define FUSION_STRING_OF_STREAM(Stream) std::string +#else +#define FUSION_STRING_OF_STREAM(Stream) \ + std::basic_string< \ + FUSION_GET_CHAR_TYPE(Stream) \ + , FUSION_GET_TRAITS_TYPE(Stream) \ + > +#endif + +//$$$ these should be part of the public API$$$ +//$$$ rename tuple_open, tuple_close and tuple_delimiter to +// open, close and delimeter and add these synonyms to the +// TR1 tuple module. + +namespace boost { namespace fusion +{ + namespace detail + { + template + int get_xalloc_index(Tag* = 0) + { + // each Tag will have a unique index + static int index = std::ios::xalloc(); + return index; + } + + template + struct stream_data + { + struct arena + { + ~arena() + { + for ( + typename std::vector::iterator i = data.begin() + ; i != data.end() + ; ++i) + { + delete *i; + } + } + + std::vector data; + }; + + static void attach(Stream& stream, T const& data) + { + static arena ar; // our arena + ar.data.push_back(new T(data)); + stream.pword(get_xalloc_index()) = ar.data.back(); + } + + static T const* get(Stream& stream) + { + return (T const*)stream.pword(get_xalloc_index()); + } + }; + + template + class string_ios_manip + { + public: + + typedef FUSION_STRING_OF_STREAM(Stream) string_type; + + typedef stream_data stream_data_t; + + string_ios_manip(Stream& str_) + : stream(str_) + {} + + void + set(string_type const& s) + { + stream_data_t::attach(stream, s); + } + + void + print(char const* default_) const + { + // print a delimiter + string_type const* p = stream_data_t::get(stream); + if (p) + stream << *p; + else + stream << default_; + } + + void + read(char const* default_) const + { + // read a delimiter + string_type const* p = stream_data_t::get(stream); + using namespace std; + ws(stream); + + if (p) + { + typedef typename string_type::const_iterator iterator; + for (iterator i = p->begin(); i != p->end(); ++i) + check_delim(*i); + } + else + { + while (*default_) + check_delim(*default_++); + } + } + + private: + + template + void + check_delim(Char c) const + { + if (!isspace(c)) + { + if (stream.get() != c) + { + stream.unget(); + stream.setstate(std::ios::failbit); + } + } + } + + Stream& stream; + }; + + } // detail + +#if defined (BOOST_NO_TEMPLATED_STREAMS) + +#define STD_TUPLE_DEFINE_MANIPULATOR(name) \ + namespace detail \ + { \ + struct name##_tag; \ + \ + struct name##_type \ + { \ + typedef std::string string_type; \ + string_type data; \ + name##_type(const string_type& d): data(d) {} \ + }; \ + \ + template \ + Stream& operator>>(Stream& s, const name##_type& m) \ + { \ + string_ios_manip(s).set(m.data); \ + return s; \ + } \ + \ + template \ + Stream& operator<<(Stream& s, const name##_type& m) \ + { \ + string_ios_manip(s).set(m.data); \ + return s; \ + } \ + } + +#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ + inline detail::name##_type \ + name(const std::string& s) \ + { \ + return detail::name##_type(s); \ + } \ + \ + inline detail::name##_type \ + name(const char* s) \ + { \ + return detail::name##_type(std::string(s)); \ + } \ + \ + inline detail::name##_type \ + name(char c) \ + { \ + return detail::name##_type(std::string(1, c)); \ + } + +#else // defined(BOOST_NO_TEMPLATED_STREAMS) + +#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) + +#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ + template \ + inline detail::name##_type \ + name(const std::basic_string& s) \ + { \ + return detail::name##_type(s); \ + } \ + \ + inline detail::name##_type \ + name(char const* s) \ + { \ + return detail::name##_type(std::basic_string(s)); \ + } \ + \ + inline detail::name##_type \ + name(wchar_t const* s) \ + { \ + return detail::name##_type(std::basic_string(s)); \ + } \ + \ + inline detail::name##_type \ + name(char c) \ + { \ + return detail::name##_type(std::basic_string(1, c)); \ + } \ + \ + inline detail::name##_type \ + name(wchar_t c) \ + { \ + return detail::name##_type(std::basic_string(1, c)); \ + } + +#else // defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) + +#define STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(name) \ + template \ + inline detail::name##_type \ + name(const std::basic_string& s) \ + { \ + return detail::name##_type(s); \ + } \ + \ + template \ + inline detail::name##_type \ + name(Char s[]) \ + { \ + return detail::name##_type(std::basic_string(s)); \ + } \ + \ + template \ + inline detail::name##_type \ + name(Char const s[]) \ + { \ + return detail::name##_type(std::basic_string(s)); \ + } \ + \ + template \ + inline detail::name##_type \ + name(Char c) \ + { \ + return detail::name##_type(std::basic_string(1, c)); \ + } + +#endif + +#define STD_TUPLE_DEFINE_MANIPULATOR(name) \ + namespace detail \ + { \ + struct name##_tag; \ + \ + template > \ + struct name##_type \ + { \ + typedef std::basic_string string_type; \ + string_type data; \ + name##_type(const string_type& d): data(d) {} \ + }; \ + \ + template \ + Stream& operator>>(Stream& s, const name##_type& m) \ + { \ + string_ios_manip(s).set(m.data); \ + return s; \ + } \ + \ + template \ + Stream& operator<<(Stream& s, const name##_type& m) \ + { \ + string_ios_manip(s).set(m.data); \ + return s; \ + } \ + } \ + +#endif // defined(BOOST_NO_TEMPLATED_STREAMS) + + STD_TUPLE_DEFINE_MANIPULATOR(tuple_open) + STD_TUPLE_DEFINE_MANIPULATOR(tuple_close) + STD_TUPLE_DEFINE_MANIPULATOR(tuple_delimiter) + + STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_open) + STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_close) + STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS(tuple_delimiter) + +#undef STD_TUPLE_DEFINE_MANIPULATOR +#undef STD_TUPLE_DEFINE_MANIPULATOR_FUNCTIONS +#undef FUSION_STRING_OF_STREAM +#undef FUSION_GET_CHAR_TYPE +#undef FUSION_GET_TRAITS_TYPE + +}} + +#endif diff --git a/include/boost/fusion/sequence/io/detail/out.hpp b/include/boost/fusion/sequence/io/detail/out.hpp new file mode 100644 index 00000000..bd74e20a --- /dev/null +++ b/include/boost/fusion/sequence/io/detail/out.hpp @@ -0,0 +1,85 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 1999-2003 Jeremiah Willcock + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_OUT_05052005_0121) +#define FUSION_OUT_05052005_0121 + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct delimiter_out + { + // print a delimiter + template + static void + print(OS& os, char const* delim, mpl::false_ = mpl::false_()) + { + detail::string_ios_manip manip(os); + manip.print(delim); + } + + template + static void + print(OS& os, char const* delim, mpl::true_) + { + } + }; + + struct print_sequence_loop + { + template + static void + call(OS& os, First const&, Last const&, mpl::true_) + { + } + + template + static void + call(OS& os, First const& first, Last const& last, mpl::false_) + { + result_of::equal_to< + typename result_of::next::type + , Last + > + is_last; + + os << *first; + delimiter_out::print(os, " ", is_last); + call(os, fusion::next(first), last, is_last); + } + + template + static void + call(OS& os, First const& first, Last const& last) + { + result_of::equal_to eq; + call(os, first, last, eq); + } + }; + + template + inline void + print_sequence(OS& os, Sequence const& seq) + { + delimiter_out::print(os, "("); + print_sequence_loop::call(os, fusion::begin(seq), fusion::end(seq)); + delimiter_out::print(os, ")"); + } +}}} + +#endif diff --git a/include/boost/fusion/sequence/io/in.hpp b/include/boost/fusion/sequence/io/in.hpp new file mode 100644 index 00000000..039190eb --- /dev/null +++ b/include/boost/fusion/sequence/io/in.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 1999-2003 Jeremiah Willcock + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_IN_05042005_0120) +#define BOOST_IN_05042005_0120 + +#include +#include +#include + +namespace boost { namespace fusion +{ + template + inline std::istream& + in(std::istream& is, Sequence& seq) + { + detail::read_sequence(is, seq); + return is; + } + + namespace operators + { + template + inline typename + enable_if< + fusion::traits::is_sequence + , std::istream& + >::type + operator>>(std::istream& is, Sequence& seq) + { + return fusion::in(is, seq); + } + } + using operators::operator>>; +}} + +#endif diff --git a/include/boost/fusion/sequence/io/out.hpp b/include/boost/fusion/sequence/io/out.hpp new file mode 100644 index 00000000..48098e57 --- /dev/null +++ b/include/boost/fusion/sequence/io/out.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 1999-2003 Jeremiah Willcock + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_OUT_05042005_0120) +#define BOOST_OUT_05042005_0120 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + template + inline std::ostream& + out(std::ostream& os, Sequence& seq) + { + detail::print_sequence(os, seq); + return os; + } + + namespace operators + { + template + inline typename + enable_if< + fusion::traits::is_sequence + , std::ostream& + >::type + operator<<(std::ostream& os, Sequence const& seq) + { + return fusion::out(os, seq); + } + } + using operators::operator<<; +}} + +#endif diff --git a/include/boost/fusion/sequence/sequence_facade.hpp b/include/boost/fusion/sequence/sequence_facade.hpp new file mode 100644 index 00000000..af6faf56 --- /dev/null +++ b/include/boost/fusion/sequence/sequence_facade.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_FACADE_09252006_1044) +#define FUSION_SEQUENCE_FACADE_09252006_1044 + +#include +#include + +namespace boost { namespace fusion +{ + struct sequence_facade_tag; + + template + struct sequence_facade : sequence_base + { + typedef sequence_facade_tag fusion_tag; + typedef Derived derived_type; + typedef Category category; + typedef IsView is_view; + }; +}} + +#endif diff --git a/include/boost/fusion/sequence/utility.hpp b/include/boost/fusion/sequence/utility.hpp new file mode 100644 index 00000000..35a17af9 --- /dev/null +++ b/include/boost/fusion/sequence/utility.hpp @@ -0,0 +1,14 @@ +// +// Copyright (c) 2006 João Abecasis +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#if !defined(BOOST_FUSION_SEQUENCE_UTILITY_HPP_INCLUDED) +#define BOOST_FUSION_SEQUENCE_UTILITY_HPP_INCLUDED + +# include + +#endif // include guard diff --git a/include/boost/fusion/support.hpp b/include/boost/fusion/support.hpp new file mode 100644 index 00000000..012ee107 --- /dev/null +++ b/include/boost/fusion/support.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SUPPORT_10022005_0545) +#define FUSION_SUPPORT_10022005_0545 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/support/category_of.hpp b/include/boost/fusion/support/category_of.hpp new file mode 100644 index 00000000..4d38fb64 --- /dev/null +++ b/include/boost/fusion/support/category_of.hpp @@ -0,0 +1,112 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CATEGORY_OF_07202005_0308) +#define FUSION_CATEGORY_OF_07202005_0308 + +#include +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + struct incrementable_traversal_tag {}; + + struct single_pass_traversal_tag + : incrementable_traversal_tag {}; + + struct forward_traversal_tag + : single_pass_traversal_tag {}; + + struct bidirectional_traversal_tag + : forward_traversal_tag {}; + + struct random_access_traversal_tag + : bidirectional_traversal_tag {}; + + struct associative_sequence_tag {}; + + namespace extension + { + template + struct category_of_impl + { + template + struct apply : detail::fusion_category_of {}; + }; + + template <> + struct category_of_impl; + + template <> + struct category_of_impl; + + template <> + struct category_of_impl; + + template <> + struct category_of_impl; + } + + namespace traits + { + template + struct category_of + : extension::category_of_impl::type>:: + template apply + {}; + + template + struct is_associative + : is_base_of< + associative_sequence_tag + , typename category_of::type> + {}; + + template + struct is_incrementable + : is_base_of< + incrementable_traversal_tag + , typename category_of::type> + {}; + + template + struct is_single_pass + : is_base_of< + single_pass_traversal_tag + , typename category_of::type> + {}; + + template + struct is_forward + : is_base_of< + forward_traversal_tag + , typename category_of::type> + {}; + + template + struct is_bidirectional + : is_base_of< + bidirectional_traversal_tag + , typename category_of::type> + {}; + + template + struct is_random_access + : is_base_of< + random_access_traversal_tag + , typename category_of::type> + {}; + } +}} + +#endif diff --git a/include/boost/fusion/support/deduce.hpp b/include/boost/fusion/support/deduce.hpp new file mode 100644 index 00000000..846fbc4d --- /dev/null +++ b/include/boost/fusion/support/deduce.hpp @@ -0,0 +1,87 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_SUPPORT_DEDUCE_HPP_INCLUDED) +#define BOOST_FUSION_SUPPORT_DEDUCE_HPP_INCLUDED + +#include + +namespace boost { namespace fusion { namespace traits +{ + template struct deduce; + + //----- ---- --- -- - - - - + + // Non-references pass unchanged + + template + struct deduce + { + typedef T type; + }; + + // Keep references on mutable LValues + + template + struct deduce + { + typedef T & type; + }; + + template + struct deduce + { + typedef T volatile& type; + }; + + // Store away potential RValues + + template + struct deduce + { + typedef T type; + }; + + template + struct deduce + { + typedef T type; + }; + + // Unwrap Boost.RefS (referencee cv is deduced) + + template + struct deduce & > + { + typedef T& type; + }; + + template + struct deduce const & > + { + typedef T& type; + }; + + // Keep references on arrays, even if const + + template + struct deduce + { + typedef const T(&type)[N]; + }; + + template + struct deduce + { + typedef const volatile T(&type)[N]; + }; + +}}} + +#endif + diff --git a/include/boost/fusion/support/deduce_sequence.hpp b/include/boost/fusion/support/deduce_sequence.hpp new file mode 100644 index 00000000..9cf97922 --- /dev/null +++ b/include/boost/fusion/support/deduce_sequence.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#if !defined(BOOST_FUSION_SUPPORT_DEDUCE_SEQUENCE_HPP_INCLUDED) +#define BOOST_FUSION_SUPPORT_DEDUCE_SEQUENCE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace traits +{ + template struct deduce_sequence; + + namespace detail + { + struct deducer + { + template + struct apply + : fusion::traits::deduce + { }; + }; + } + + // We cannot use fusion::transform_view here as result_of loses cv qualifiers + // on built in types + template + struct deduce_sequence + : result_of::as_vector< + typename mpl::transform::type> + { }; + +}}} + +#endif + diff --git a/include/boost/fusion/support/detail/access.hpp b/include/boost/fusion/support/detail/access.hpp new file mode 100644 index 00000000..0508e50f --- /dev/null +++ b/include/boost/fusion/support/detail/access.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ACCESS_04182005_0737) +#define FUSION_ACCESS_04182005_0737 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct ref_result + { + typedef typename add_reference::type type; + }; + + template + struct cref_result + { + typedef typename + add_reference< + typename add_const::type + >::type + type; + }; + + template + struct non_ref_parameter + { + typedef typename boost::remove_cv::type const& type; + }; + + template + struct call_param + { + typedef typename + mpl::eval_if< + is_reference + , mpl::identity + , non_ref_parameter + >::type + type; + }; +}}} + +#endif + diff --git a/include/boost/fusion/support/detail/as_fusion_element.hpp b/include/boost/fusion/support/detail/as_fusion_element.hpp new file mode 100644 index 00000000..78e4b631 --- /dev/null +++ b/include/boost/fusion/support/detail/as_fusion_element.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_AS_FUSION_ELEMENT_05052005_0338) +#define FUSION_AS_FUSION_ELEMENT_05052005_0338 + +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct as_fusion_element + { + typedef T type; + }; + + template + struct as_fusion_element > + { + typedef T& type; + }; + + template + struct as_fusion_element + { + typedef const T(&type)[N]; + }; + + template + struct as_fusion_element + { + typedef const volatile T(&type)[N]; + }; + + template + struct as_fusion_element + { + typedef const volatile T(&type)[N]; + }; + +}}} + +#endif diff --git a/include/boost/fusion/support/detail/category_of.hpp b/include/boost/fusion/support/detail/category_of.hpp new file mode 100644 index 00000000..04102cfd --- /dev/null +++ b/include/boost/fusion/support/detail/category_of.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CATEGORY_OF_07212005_1025) +#define FUSION_CATEGORY_OF_07212005_1025 + +namespace boost { namespace fusion { namespace detail +{ + template + struct fusion_category_of + { + typedef typename T::category type; + }; +}}} + +#endif diff --git a/include/boost/fusion/support/detail/is_mpl_sequence.hpp b/include/boost/fusion/support/detail/is_mpl_sequence.hpp new file mode 100644 index 00000000..eeb8f916 --- /dev/null +++ b/include/boost/fusion/support/detail/is_mpl_sequence.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105) +#define FUSION_DETAIL_IS_MPL_SEQUENCE_29122006_1105 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct is_mpl_sequence + : mpl::and_< + mpl::not_ > + , mpl::is_sequence > + {}; +}}} + +#endif diff --git a/include/boost/fusion/support/detail/is_view.hpp b/include/boost/fusion/support/detail/is_view.hpp new file mode 100644 index 00000000..5fa2f241 --- /dev/null +++ b/include/boost/fusion/support/detail/is_view.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_IS_VIEW_03202006_0018) +#define FUSION_IS_VIEW_03202006_0018 + +namespace boost { namespace fusion { namespace detail +{ + template + struct fusion_is_view + { + typedef typename T::is_view type; + }; +}}} + +#endif diff --git a/include/boost/fusion/support/detail/mpl_iterator_category.hpp b/include/boost/fusion/support/detail/mpl_iterator_category.hpp new file mode 100644 index 00000000..37a7fe94 --- /dev/null +++ b/include/boost/fusion/support/detail/mpl_iterator_category.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_MPL_ITERATOR_CATEGORY_07212005_0923) +#define FUSION_MPL_ITERATOR_CATEGORY_07212005_0923 + +namespace boost { namespace mpl +{ + struct forward_iterator_tag; + struct bidirectional_iterator_tag; + struct random_access_iterator_tag; +}} + +namespace boost { namespace fusion +{ + struct forward_traversal_tag; + struct bidirectional_traversal_tag; + struct random_access_traversal_tag; +}} + +namespace boost { namespace fusion { namespace detail +{ + template + struct mpl_iterator_category; + + template <> + struct mpl_iterator_category + { + typedef forward_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef bidirectional_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef random_access_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef forward_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef bidirectional_traversal_tag type; + }; + + template <> + struct mpl_iterator_category + { + typedef random_access_traversal_tag type; + }; +}}} + +#endif diff --git a/include/boost/fusion/support/detail/unknown_key.hpp b/include/boost/fusion/support/detail/unknown_key.hpp new file mode 100644 index 00000000..48ffcc2b --- /dev/null +++ b/include/boost/fusion/support/detail/unknown_key.hpp @@ -0,0 +1,16 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_UNKNOWN_KEY_09242005_1219) +#define FUSION_UNKNOWN_KEY_09242005_1219 + +namespace boost { namespace fusion { namespace detail +{ + template + struct unknown_key {}; +}}} + +#endif diff --git a/include/boost/fusion/support/ext_/is_segmented.hpp b/include/boost/fusion/support/ext_/is_segmented.hpp new file mode 100755 index 00000000..38def075 --- /dev/null +++ b/include/boost/fusion/support/ext_/is_segmented.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_IS_SEGMENTED_03202006_0015) +#define FUSION_IS_SEGMENTED_03202006_0015 + +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + struct iterator_range_tag; + + namespace extension + { + template + struct is_segmented_impl + { + template + struct apply + : mpl::false_ + {}; + }; + + template<> + struct is_segmented_impl; + } + + namespace traits + { + template + struct is_segmented + : extension::is_segmented_impl::type>:: + template apply + { + }; + } +}} + +#endif diff --git a/include/boost/fusion/support/is_iterator.hpp b/include/boost/fusion/support/is_iterator.hpp new file mode 100644 index 00000000..9e775f4e --- /dev/null +++ b/include/boost/fusion/support/is_iterator.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_IS_ITERATOR_05062005_1219) +#define FUSION_IS_ITERATOR_05062005_1219 + +#include + +namespace boost { namespace fusion +{ + struct iterator_root; + + template + struct is_fusion_iterator : is_base_of {}; +}} + +#endif diff --git a/include/boost/fusion/support/is_sequence.hpp b/include/boost/fusion/support/is_sequence.hpp new file mode 100644 index 00000000..84dc2ec1 --- /dev/null +++ b/include/boost/fusion/support/is_sequence.hpp @@ -0,0 +1,65 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_IS_SEQUENCE_05052005_1002) +#define FUSION_IS_SEQUENCE_05052005_1002 + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct non_fusion_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct is_sequence_impl + { + template + struct apply : is_base_of {}; + }; + + template <> + struct is_sequence_impl + { + template + struct apply : mpl::false_ {}; + }; + + template <> + struct is_sequence_impl; + + template <> + struct is_sequence_impl; + + template <> + struct is_sequence_impl; + + template <> + struct is_sequence_impl; + } + + namespace traits + { + template + struct is_sequence + : extension::is_sequence_impl::type>:: + template apply + {}; + } +}} + +#endif diff --git a/include/boost/fusion/support/is_view.hpp b/include/boost/fusion/support/is_view.hpp new file mode 100644 index 00000000..a89291d1 --- /dev/null +++ b/include/boost/fusion/support/is_view.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_IS_VIEW_03202006_0015) +#define FUSION_IS_VIEW_03202006_0015 + +#include +#include + +namespace boost { namespace fusion +{ + // Special tags: + struct sequence_facade_tag; + struct boost_tuple_tag; // boost::tuples::tuple tag + struct array_tag; // boost::array tag + struct mpl_sequence_tag; // mpl sequence tag + struct std_pair_tag; // std::pair tag + + namespace extension + { + template + struct is_view_impl + { + template + struct apply + : detail::fusion_is_view + {}; + }; + + template <> + struct is_view_impl + { + template + struct apply : Sequence::is_view {}; + }; + + template <> + struct is_view_impl; + + template <> + struct is_view_impl; + + template <> + struct is_view_impl; + + template <> + struct is_view_impl; + } + + namespace traits + { + template + struct is_view : + extension::is_view_impl::type>:: + template apply::type + {}; + } +}} + +#endif diff --git a/include/boost/fusion/support/iterator_base.hpp b/include/boost/fusion/support/iterator_base.hpp new file mode 100644 index 00000000..2f909b2e --- /dev/null +++ b/include/boost/fusion/support/iterator_base.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ITERATOR_BASE_05042005_1008) +#define FUSION_ITERATOR_BASE_05042005_1008 + +namespace boost { namespace fusion +{ + struct iterator_root {}; + + template + struct iterator_base : iterator_root + { + Iterator const& + cast() const + { + return static_cast(*this); + } + + Iterator& + cast() + { + return static_cast(*this); + } + }; +}} + +#endif diff --git a/include/boost/fusion/support/pair.hpp b/include/boost/fusion/support/pair.hpp new file mode 100644 index 00000000..cf285714 --- /dev/null +++ b/include/boost/fusion/support/pair.hpp @@ -0,0 +1,102 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + Copyright (c) 2006 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PAIR_07222005_1203) +#define FUSION_PAIR_07222005_1203 + +#include +#include + +namespace boost { namespace fusion +{ + // A half runtime pair where the first type does not have data + template + struct pair + { + pair() + : second() {} + + pair(typename detail::call_param::type val) + : second(val) {} + + template + pair(pair const& rhs) + : second(rhs.second) {} + + template + pair& operator=(pair const& rhs) + { + second = rhs.second; + return *this; + } + + typedef First first_type; + typedef Second second_type; + Second second; + }; + + namespace result_of + { + template + struct make_pair + { + typedef fusion::pair::type> type; + }; + + template + struct first + { + typedef typename Pair::first_type type; + }; + + template + struct second + { + typedef typename Pair::second_type type; + }; + } + + template + inline typename result_of::make_pair::type + make_pair(Second const& val) + { + return pair::type>(val); + } + + template + inline OStream& + operator<<(OStream& os, pair const& p) + { + os << p.second; + return os; + } + + template + inline IStream& + operator>>(IStream& is, pair& p) + { + is >> p.second; + return is; + } + + template + inline bool + operator==(pair const& l, pair const& r) + { + return l.second == r.second; + } + + template + inline bool + operator!=(pair const& l, pair const& r) + { + return l.second != r.second; + } +}} + +#endif diff --git a/include/boost/fusion/support/sequence_base.hpp b/include/boost/fusion/support/sequence_base.hpp new file mode 100644 index 00000000..1d436ef1 --- /dev/null +++ b/include/boost/fusion/support/sequence_base.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_BASE_04182005_0737) +#define FUSION_SEQUENCE_BASE_04182005_0737 + +#include + +namespace boost { namespace fusion +{ + struct sequence_root {}; + + template + struct sequence_base : sequence_root + { + Sequence const& + derived() const + { + return static_cast(*this); + } + + Sequence& + derived() + { + return static_cast(*this); + } + }; + + struct fusion_sequence_tag; +}} + +namespace boost { namespace mpl +{ + // Deliberately break mpl::begin, so it doesn't lie that a Fusion sequence + // is not an MPL sequence by returning mpl::void_. + // In other words: Fusion Sequences are always MPL Sequences, but they can + // be incompletely defined. + template<> struct begin_impl< boost::fusion::fusion_sequence_tag >; +}} + +#endif diff --git a/include/boost/fusion/support/tag_of.hpp b/include/boost/fusion/support/tag_of.hpp new file mode 100644 index 00000000..209ceeff --- /dev/null +++ b/include/boost/fusion/support/tag_of.hpp @@ -0,0 +1,110 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_TAG_OF_09232005_0845) +#define FUSION_TAG_OF_09232005_0845 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + template + class array; // forward + + namespace tuples + { + struct null_type; + + template < + class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7, class T8, class T9 + > + class tuple; + + template + struct cons; + } +} + +namespace boost { namespace fusion +{ + struct non_fusion_tag; + struct mpl_sequence_tag; + + namespace detail + { + BOOST_MPL_HAS_XXX_TRAIT_DEF(fusion_tag) + + template + struct is_specialized + : mpl::false_ + {}; + + template < + class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7, class T8, class T9 + > + struct is_specialized > + : mpl::true_ + {}; + + template + struct is_specialized > + : mpl::true_ + {}; + + template <> + struct is_specialized + : mpl::true_ + {}; + + template + struct is_specialized > + : mpl::true_ + {}; + + template + struct is_specialized > + : mpl::true_ + {}; + } + + namespace traits + { + template + struct tag_of + : mpl::if_< detail::is_mpl_sequence, + mpl::identity, + mpl::identity >::type + { + BOOST_MPL_ASSERT_NOT((detail::is_specialized)); + }; + + template + struct tag_of >::type> + { + typedef typename Sequence::fusion_tag type; + }; + } + + namespace detail + { + template + struct tag_of + : traits::tag_of::type> + {}; + } +}} +#endif diff --git a/include/boost/fusion/support/tag_of_fwd.hpp b/include/boost/fusion/support/tag_of_fwd.hpp new file mode 100644 index 00000000..e6c883d5 --- /dev/null +++ b/include/boost/fusion/support/tag_of_fwd.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_TAG_OF_FWD_31122005_1445) +#define BOOST_FUSION_TAG_OF_FWD_31122005_1445 + +namespace boost { namespace fusion +{ + namespace traits + { + template + struct tag_of; + } +}} + +#endif diff --git a/include/boost/fusion/support/unused.hpp b/include/boost/fusion/support/unused.hpp new file mode 100644 index 00000000..dc2014ec --- /dev/null +++ b/include/boost/fusion/support/unused.hpp @@ -0,0 +1,62 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SUPPORT_UNUSED_20070305_1038) +#define BOOST_FUSION_SUPPORT_UNUSED_20070305_1038 + +#include +#if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable: 4522) // multiple assignment operators specified warning +#endif + +namespace boost { namespace fusion { + struct unused_type + { + unused_type() + { + } + + template + unused_type(T const&) + { + } + + template + unused_type const& + operator=(T const&) const + { + return *this; + } + + template + unused_type& + operator=(T const&) + { + return *this; + } + + unused_type const& + operator=(unused_type const&) const + { + return *this; + } + + unused_type& + operator=(unused_type const&) + { + return *this; + } + }; + + unused_type const unused = unused_type(); +}} + +#if defined(BOOST_MSVC) +# pragma warning(pop) +#endif + +#endif diff --git a/include/boost/fusion/support/void.hpp b/include/boost/fusion/support/void.hpp new file mode 100644 index 00000000..7dd11e5c --- /dev/null +++ b/include/boost/fusion/support/void.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SUPPORT_VOID_20070706_2125) +#define BOOST_FUSION_SUPPORT_VOID_20070706_2125 + +namespace boost { namespace fusion +{ + struct void_ {}; +}} + +#endif diff --git a/include/boost/fusion/tuple.hpp b/include/boost/fusion/tuple.hpp new file mode 100644 index 00000000..c4b56b9e --- /dev/null +++ b/include/boost/fusion/tuple.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_TUPLE_10032005_0806) +#define FUSION_TUPLE_10032005_0806 + +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/tuple/detail/tuple_forward_ctor.hpp b/include/boost/fusion/tuple/detail/tuple_forward_ctor.hpp new file mode 100644 index 00000000..2ff20a2a --- /dev/null +++ b/include/boost/fusion/tuple/detail/tuple_forward_ctor.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_TUPLE_FORWARD_CTOR_10032005_0815) +#define FUSION_TUPLE_FORWARD_CTOR_10032005_0815 + +#include +#include +#include + +#define BOOST_PP_FILENAME_1 \ + +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + +#if N == 1 + explicit +#endif + tuple(BOOST_PP_ENUM_BINARY_PARAMS( + N, typename detail::call_param::type _)) + : base_type(BOOST_PP_ENUM_PARAMS(N, _)) {} + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/tuple/make_tuple.hpp b/include/boost/fusion/tuple/make_tuple.hpp new file mode 100644 index 00000000..32fd912e --- /dev/null +++ b/include/boost/fusion/tuple/make_tuple.hpp @@ -0,0 +1,56 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_MAKE_TUPLE_10032005_0843) +#define FUSION_MAKE_TUPLE_10032005_0843 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + inline tuple<> + make_tuple() + { + return tuple<>(); + } + +#define BOOST_FUSION_AS_FUSION_ELEMENT(z, n, data) \ + typename detail::as_fusion_element::type + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_AS_FUSION_ELEMENT + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + template + inline tuple + make_tuple(BOOST_PP_ENUM_BINARY_PARAMS(N, T, const& _)) + { + return tuple( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/tuple/tuple.hpp b/include/boost/fusion/tuple/tuple.hpp new file mode 100644 index 00000000..d9860323 --- /dev/null +++ b/include/boost/fusion/tuple/tuple.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_TUPLE_10032005_0810) +#define FUSION_TUPLE_10032005_0810 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + template + struct tuple : vector + { + typedef vector< + BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)> + base_type; + + tuple() + : base_type() {} + + template + tuple(Sequence const& rhs) + : base_type(rhs) {} + + #include + + template + tuple& + operator=(T const& rhs) + { + base_type::operator=(rhs); + return *this; + } + }; + + template + struct tuple_size : result_of::size {}; + + template + struct tuple_element : result_of::value_at_c {}; + + template + inline typename + lazy_disable_if< + is_const + , result_of::at_c + >::type + get(Tuple& tup) + { + return at_c(tup); + } + + template + inline typename result_of::at_c::type + get(Tuple const& tup) + { + return at_c(tup); + } +}} + +#endif diff --git a/include/boost/fusion/tuple/tuple_fwd.hpp b/include/boost/fusion/tuple/tuple_fwd.hpp new file mode 100644 index 00000000..1a127cab --- /dev/null +++ b/include/boost/fusion/tuple/tuple_fwd.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2005 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_TUPLE_FORWARD_10032005_0956) +#define FUSION_TUPLE_FORWARD_10032005_0956 + +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + + template < + BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( + FUSION_MAX_VECTOR_SIZE, typename T, void_) + > + struct tuple; +}} + +#endif diff --git a/include/boost/fusion/tuple/tuple_tie.hpp b/include/boost/fusion/tuple/tuple_tie.hpp new file mode 100644 index 00000000..b6c21eff --- /dev/null +++ b/include/boost/fusion/tuple/tuple_tie.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef BOOST_PP_IS_ITERATING +#if !defined(FUSION_TUPLE_TIE_10032005_0846) +#define FUSION_TUPLE_TIE_10032005_0846 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ +#define BOOST_FUSION_REF(z, n, data) BOOST_PP_CAT(T, n)& + +#define BOOST_PP_FILENAME_1 +#define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) +#include BOOST_PP_ITERATE() + +#undef BOOST_FUSION_REF + +}} + +#endif +#else // defined(BOOST_PP_IS_ITERATING) +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocessor vertical repetition code +// +/////////////////////////////////////////////////////////////////////////////// + +#define N BOOST_PP_ITERATION() + + template + inline tuple + tie(BOOST_PP_ENUM_BINARY_PARAMS(N, T, & _)) + { + return tuple( + BOOST_PP_ENUM_PARAMS(N, _)); + } + +#undef N +#endif // defined(BOOST_PP_IS_ITERATING) + diff --git a/include/boost/fusion/view.hpp b/include/boost/fusion/view.hpp new file mode 100644 index 00000000..12d5cc5d --- /dev/null +++ b/include/boost/fusion/view.hpp @@ -0,0 +1,17 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_VIEW_10022005_0620) +#define FUSION_SEQUENCE_VIEW_10022005_0620 + +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/boost/fusion/view/ext_/multiple_view.hpp b/include/boost/fusion/view/ext_/multiple_view.hpp new file mode 100755 index 00000000..e34b1d62 --- /dev/null +++ b/include/boost/fusion/view/ext_/multiple_view.hpp @@ -0,0 +1,178 @@ +/*============================================================================= + Copyright (c) 2001-2006 Eric Niebler + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef FUSION_MULTIPLE_VIEW_05052005_0335 +#define FUSION_MULTIPLE_VIEW_05052005_0335 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct multiple_view_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template + struct multiple_view + : sequence_base > + { + typedef multiple_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef forward_traversal_tag category; + typedef mpl::true_ is_view; + typedef mpl::int_ size; + typedef T value_type; + + multiple_view() + : val() + {} + + explicit multiple_view(typename detail::call_param::type val) + : val(val) + {} + + value_type val; + }; + + template + inline multiple_view::type> + make_multiple_view(T const& v) + { + return multiple_view::type>(v); + } + + struct multiple_view_iterator_tag; + struct forward_traversal_tag; + + template + struct multiple_view_iterator + : iterator_base > + { + typedef multiple_view_iterator_tag fusion_tag; + typedef forward_traversal_tag category; + typedef typename MultipleView::value_type value_type; + typedef MultipleView multiple_view_type; + typedef Index index; + + explicit multiple_view_iterator(multiple_view_type const &view_) + : view(view_) + {} + + multiple_view_type view; + }; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef multiple_view_iterator< + typename mpl::next::type + , typename Iterator::multiple_view_type + > type; + + static type + call(Iterator const &where) + { + return type(where.view); + } + }; + }; + + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef multiple_view_iterator< + typename Sequence::size + , Sequence + > type; + + static type + call(Sequence &seq) + { + return type(seq); + } + }; + }; + + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename Iterator::value_type type; + + static type + call(Iterator const& i) + { + return i.view.val; + } + }; + }; + + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef multiple_view_iterator< + mpl::int_<0> + , Sequence + > type; + + static type + call(Sequence &seq) + { + return type(seq); + } + }; + }; + + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename Iterator::multiple_view_type multiple_view_type; + typedef typename multiple_view_type::value_type type; + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/ext_/segmented_iterator.hpp b/include/boost/fusion/view/ext_/segmented_iterator.hpp new file mode 100755 index 00000000..2216929b --- /dev/null +++ b/include/boost/fusion/view/ext_/segmented_iterator.hpp @@ -0,0 +1,425 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef FUSION_SEGMENTED_ITERATOR_EAN_05032006_1027 +#define FUSION_SEGMENTED_ITERATOR_EAN_05032006_1027 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // for nil +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct fusion_sequence_tag; + + namespace detail + { + using mpl::_; + using mpl::not_; + + //////////////////////////////////////////////////////////////////////////// + template + struct is_empty + : result_of::equal_to< + typename result_of::begin::type + , typename result_of::end::type + > + {}; + + template + struct is_empty + : is_empty + {}; + + struct segmented_range_tag; + + //////////////////////////////////////////////////////////////////////////// + template + struct segmented_range + : sequence_base > + { + BOOST_MPL_ASSERT_NOT((is_reference)); + typedef mpl::bool_ is_segmented; + typedef segmented_range_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + typedef Iterator iterator_type; + + // If this is a range of segments, skip over the empty ones + typedef typename mpl::if_< + is_segmented + , filter_view > > + , Sequence + >::type sequence_non_ref_type; + + typedef typename mpl::if_< + traits::is_view + , sequence_non_ref_type + , sequence_non_ref_type & + >::type sequence_type; + + typedef typename traits::category_of::type category; + + explicit segmented_range(Sequence &sequence_) + : sequence(sequence_type(sequence_)) + , where_(fusion::begin(sequence)) + {} + + segmented_range(sequence_type sequence_, iterator_type const &wh) + : sequence(sequence_) + , where_(wh) + {} + + sequence_type sequence; + iterator_type where_; + }; + } + + namespace extension + { + template<> + struct is_segmented_impl + { + template + struct apply + : Sequence::is_segmented + {}; + }; + + template<> + struct size_impl + { + template + struct apply + : mpl::int_< + result_of::distance< + typename Sequence::iterator_type + , typename result_of::end::type + >::value + > + {}; + }; + + template<> + struct segments_impl + { + template + struct apply + { + typedef Sequence &type; + static type call(Sequence &seq) + { + return seq; + } + }; + }; + + template<> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::iterator_type type; + static type call(Sequence &seq) + { + return seq.where_; + } + }; + }; + + template<> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::sequence_non_ref_type sequence; + typedef typename result_of::end::type type; + + static type call(Sequence &seq) + { + return fusion::end(seq.sequence); + } + }; + }; + } + + namespace detail + { + /////////////////////////////////////////////////////////////////////// + template + struct range_next; + + template + struct range_next > + { + typedef typename result_of::next::type iterator_type; + typedef segmented_range type; + + static type call(segmented_range const &rng) + { + return type(rng.sequence, fusion::next(rng.where_)); + } + }; + + /////////////////////////////////////////////////////////////////////// + template + struct is_range_next_empty + : is_empty::type> + {}; + + template<> + struct is_range_next_empty + : mpl::true_ + {}; + + /////////////////////////////////////////////////////////////////////// + template::value> + struct as_segmented_range + { + typedef typename result_of::segments::type segments; + typedef typename remove_reference::type sequence; + typedef typename result_of::begin > > >::type begin; + typedef segmented_range type; + + static type call(Sequence &seq) + { + segments segs(fusion::segments(seq)); + return type(segs); + } + }; + + template + struct as_segmented_range + { + typedef typename remove_reference::type sequence; + typedef typename result_of::begin::type begin; + typedef segmented_range type; + + static type call(Sequence &seq) + { + return type(seq); + } + }; + + template + struct as_segmented_range, IsSegmented> + { + typedef segmented_range type; + static type &call(type &seq) + { + return seq; + } + }; + + /////////////////////////////////////////////////////////////////////// + template< + typename Sequence + , typename State = nil + , bool IsSegmented = traits::is_segmented::value + > + struct push_segments + { + typedef typename as_segmented_range::type range; + typedef typename result_of::begin::type begin; + typedef typename result_of::deref::type next_ref; + typedef typename remove_reference::type next; + typedef push_segments > push; + typedef typename push::type type; + + static type call(Sequence &seq, State const &state) + { + range rng(as_segmented_range::call(seq)); + next_ref nxt(*fusion::begin(rng)); + return push::call(nxt, fusion::make_cons(rng, state)); + } + }; + + template + struct push_segments + { + typedef typename as_segmented_range::type range; + typedef cons type; + + static type call(Sequence &seq, State const &state) + { + range rng(as_segmented_range::call(seq)); + return fusion::make_cons(rng, state); + } + }; + + /////////////////////////////////////////////////////////////////////// + template::value> + struct pop_segments + { + typedef range_next next; + typedef push_segments push; + typedef typename push::type type; + + static type call(State const &state) + { + typename next::type rng(next::call(state.car)); + return push::call(rng, state.cdr); + } + }; + + template + struct pop_segments + { + typedef pop_segments pop; + typedef typename pop::type type; + + static type call(State const &state) + { + return pop::call(state.cdr); + } + }; + + template<> + struct pop_segments + { + typedef nil type; + + static type call(nil const &) + { + return nil(); + } + }; + } // namespace detail + + struct segmented_iterator_tag; + + //////////////////////////////////////////////////////////////////////////// + template + struct segmented_iterator + : fusion::iterator_base > + { + typedef segmented_iterator_tag fusion_tag; + typedef fusion::forward_traversal_tag category; + + typedef Cons cons_type; + typedef typename Cons::car_type car_type; + typedef typename Cons::cdr_type cdr_type; + + explicit segmented_iterator(Cons const &cons) + : cons_(cons) + {} + + cons_type const &cons() const { return this->cons_; }; + car_type const &car() const { return this->cons_.car; }; + cdr_type const &cdr() const { return this->cons_.cdr; }; + + private: + Cons cons_; + }; + + /////////////////////////////////////////////////////////////////////////// + template + struct segmented_begin + { + typedef typename detail::push_segments push; + typedef segmented_iterator type; + + static type call(Sequence &seq) + { + return type(push::call(seq, nil())); + } + }; + + /////////////////////////////////////////////////////////////////////////// + template + struct segmented_end + { + typedef segmented_iterator type; + + static type call(Sequence &) + { + return type(nil()); + } + }; + + namespace extension + { + template<> + struct value_of_impl + { + template + struct apply + { + typedef typename result_of::begin::type begin; + typedef typename result_of::value_of::type type; + }; + }; + + template<> + struct deref_impl + { + template + struct apply + { + typedef typename result_of::begin::type begin; + typedef typename result_of::deref::type type; + + static type call(Iterator const &it) + { + return *fusion::begin(it.car()); + } + }; + }; + + // discards the old head, expands the right child of the new head + // and pushes the result to the head of the list. + + template<> + struct next_impl + { + template< + typename Iterator + , bool IsSegmentDone = detail::is_range_next_empty::value + > + struct apply + { + typedef typename Iterator::cdr_type cdr_type; + typedef detail::range_next next; + typedef segmented_iterator > type; + + static type call(Iterator const &it) + { + return type(fusion::make_cons(next::call(it.car()), it.cdr())); + } + }; + + template + struct apply // segment done, move to next segment + { + typedef typename Iterator::cdr_type cdr_type; + typedef typename detail::pop_segments pop; + typedef segmented_iterator type; + + static type call(Iterator const &it) + { + return type(pop::call(it.cdr())); + } + }; + }; + } +}} // namespace boost::fusion + +#endif diff --git a/include/boost/fusion/view/ext_/segmented_iterator_range.hpp b/include/boost/fusion/view/ext_/segmented_iterator_range.hpp new file mode 100755 index 00000000..c4dcd01c --- /dev/null +++ b/include/boost/fusion/view/ext_/segmented_iterator_range.hpp @@ -0,0 +1,524 @@ +/*============================================================================= + Copyright (c) 2006 Eric Niebler + + Use, modification and distribution is subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#ifndef FUSION_SEGMENTED_ITERATOR_RANGE_EAN_05032006_1027 +#define FUSION_SEGMENTED_ITERATOR_RANGE_EAN_05032006_1027 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace detail + { + //////////////////////////////////////////////////////////////////////////// + template + struct reverse_cons; + + template + struct reverse_cons, State> + { + typedef reverse_cons > reverse; + typedef typename reverse::type type; + + static type call(cons const &cons, State const &state = State()) + { + return reverse::call(cons.cdr, fusion::make_cons(cons.car, state)); + } + }; + + template + struct reverse_cons + { + typedef State type; + + static State const &call(nil const &, State const &state = State()) + { + return state; + } + }; + + //////////////////////////////////////////////////////////////////////////// + // tags + struct full_view {}; + struct left_view {}; + struct right_view {}; + struct center_view {}; + + template + struct segmented_view_tag; + + //////////////////////////////////////////////////////////////////////////// + // a segmented view of that includes all elements either to the + // right or the left of a segmented iterator. + template + struct segmented_view + : sequence_base > + { + typedef segmented_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + typedef forward_traversal_tag category; + + explicit segmented_view(Cons1 const &cons) + : cons(cons) + {} + + typedef Cons1 cons_type; + cons_type const &cons; + }; + + // a segmented view that contains all the elements in between + // two segmented iterators + template + struct segmented_view + : sequence_base > + { + typedef segmented_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + typedef forward_traversal_tag category; + + segmented_view(Cons1 const &lcons, Cons2 const &rcons) + : left_cons(lcons) + , right_cons(rcons) + {} + + typedef Cons1 left_cons_type; + typedef Cons2 right_cons_type; + + left_cons_type const &left_cons; + right_cons_type const &right_cons; + }; + + //////////////////////////////////////////////////////////////////////////// + // Used to transform a sequence of segments. The first segment is + // bounded by RightCons, and the last segment is bounded by LeftCons + // and all the others are passed through unchanged. + template + struct segments_transform + { + explicit segments_transform(RightCons const &cons_) + : right_cons(cons_) + , left_cons(cons_) + {} + + segments_transform(RightCons const &right_cons_, LeftCons const &left_cons_) + : right_cons(right_cons_) + , left_cons(left_cons_) + {} + + template + struct result; + + template + struct result + { + typedef segmented_view type; + }; + + template + struct result + { + typedef segmented_view type; + }; + + template + struct result + { + typedef Second type; + }; + + template + segmented_view operator ()(right_view, Second &second) const + { + return segmented_view(this->right_cons); + } + + template + segmented_view operator ()(left_view, Second &second) const + { + return segmented_view(this->left_cons); + } + + template + Second &operator ()(full_view, Second &second) const + { + return second; + } + + private: + RightCons const &right_cons; + LeftCons const &left_cons; + }; + + } // namespace detail + + namespace extension + { + //////////////////////////////////////////////////////////////////////////// + template + struct is_segmented_impl > + { + template + struct apply + : mpl::true_ + {}; + }; + + //////////////////////////////////////////////////////////////////////////// + template<> + struct segments_impl > + { + template< + typename Sequence + , typename Cdr = typename Sequence::cons_type::cdr_type + > + struct apply + { + typedef typename Sequence::cons_type::car_type segmented_range; + typedef typename result_of::size::type size; + typedef typename mpl::prior::type size_minus_1; + typedef detail::segments_transform tfx; + typedef joint_view< + single_view const + , multiple_view const + > mask; + typedef transform_view type; + + static type call(Sequence &seq) + { + return type( + mask( + make_single_view(detail::right_view()) + , make_multiple_view(detail::full_view()) + ) + , seq.cons.car + , tfx(seq.cons.cdr) + ); + } + }; + + template + struct apply + { + typedef typename Sequence::cons_type::car_type segmented_range; + typedef typename segmented_range::iterator_type begin; + typedef typename segmented_range::sequence_non_ref_type sequence_type; + typedef typename result_of::end::type end; + typedef iterator_range range; + typedef single_view type; + + static type call(Sequence &seq) + { + return type(range(seq.cons.car.where, fusion::end(seq.cons.car.sequence))); + } + }; + }; + + //////////////////////////////////////////////////////////////////////////// + template<> + struct segments_impl > + { + template< + typename Sequence + , typename Cdr = typename Sequence::cons_type::cdr_type + > + struct apply + { + typedef typename Sequence::cons_type::car_type right_segmented_range; + typedef typename right_segmented_range::sequence_type sequence_type; + typedef typename right_segmented_range::iterator_type iterator_type; + + typedef iterator_range< + typename result_of::begin::type + , typename result_of::next::type + > segmented_range; + + typedef detail::segments_transform tfx; + typedef typename result_of::size::type size; + typedef typename mpl::prior::type size_minus_1; + typedef joint_view< + multiple_view const + , single_view const + > mask; + typedef transform_view type; + + static type call(Sequence &seq) + { + return type( + mask( + make_multiple_view(detail::full_view()) + , make_single_view(detail::left_view()) + ) + , segmented_range(fusion::begin(seq.cons.car.sequence), fusion::next(seq.cons.car.where)) + , tfx(seq.cons.cdr) + ); + } + }; + + template + struct apply + { + typedef typename Sequence::cons_type::car_type segmented_range; + typedef typename segmented_range::sequence_non_ref_type sequence_type; + typedef typename result_of::begin::type begin; + typedef typename segmented_range::iterator_type end; + typedef iterator_range range; + typedef single_view type; + + static type call(Sequence &seq) + { + return type(range(fusion::begin(seq.cons.car.sequence), seq.cons.car.where)); + } + }; + }; + + //////////////////////////////////////////////////////////////////////////// + template<> + struct segments_impl > + { + template + struct apply + { + typedef typename Sequence::right_cons_type right_cons_type; + typedef typename Sequence::left_cons_type left_cons_type; + typedef typename right_cons_type::car_type right_segmented_range; + typedef typename left_cons_type::car_type left_segmented_range; + + typedef iterator_range< + typename result_of::begin::type + , typename result_of::next::type>::type + > segmented_range; + + typedef typename mpl::minus< + typename result_of::size::type + , mpl::int_<2> + >::type size_minus_2; + + BOOST_MPL_ASSERT_RELATION(0, <=, size_minus_2::value); + + typedef detail::segments_transform< + typename left_cons_type::cdr_type + , typename right_cons_type::cdr_type + > tfx; + + typedef joint_view< + multiple_view const + , single_view const + > left_mask; + + typedef joint_view< + single_view const + , left_mask const + > mask; + + typedef transform_view type; + + static type call(Sequence &seq) + { + left_mask lmask( + make_multiple_view(detail::full_view()) + , make_single_view(detail::left_view()) + ); + return type( + mask(make_single_view(detail::right_view()), lmask) + , segmented_range(fusion::begin(seq.left_cons.car), fusion::next(fusion::begin(seq.right_cons.car))) + , tfx(seq.left_cons.cdr, seq.right_cons.cdr) + ); + } + }; + }; + } + + // specialize iterator_range for use with segmented iterators, so that + // it presents a segmented view of the range. + template + struct iterator_range; + + template + struct iterator_range, segmented_iterator > + : sequence_base, segmented_iterator > > + { + typedef typename convert_iterator >::type begin_type; + typedef typename convert_iterator >::type end_type; + typedef typename detail::reverse_cons::type begin_cons_type; + typedef typename detail::reverse_cons::type end_cons_type; + typedef iterator_range_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef typename traits::category_of::type category; + typedef typename result_of::distance::type size; + typedef mpl::true_ is_view; + + iterator_range(segmented_iterator const& first_, segmented_iterator const& last_) + : first(convert_iterator >::call(first_)) + , last(convert_iterator >::call(last_)) + , first_cons(detail::reverse_cons::call(first_.cons())) + , last_cons(detail::reverse_cons::call(last_.cons())) + {} + + begin_type first; + end_type last; + + begin_cons_type first_cons; + end_cons_type last_cons; + }; + + namespace detail + { + + template + struct same_segment + : mpl::false_ + {}; + + template + struct same_segment, cons > + : mpl::and_< + traits::is_segmented + , is_same + > + {}; + + //////////////////////////////////////////////////////////////////////////// + template + struct segments_gen; + + //////////////////////////////////////////////////////////////////////////// + template + struct segments_gen2 + { + typedef segments_gen gen; + typedef typename gen::type type; + + static type call(Cons1 const &cons1, Cons2 const &cons2) + { + return gen::call(cons1.cdr, cons2.cdr); + } + }; + + template + struct segments_gen2 + { + typedef segmented_view view; + typedef typename result_of::segments::type type; + + static type call(Cons1 const &cons1, Cons2 const &cons2) + { + view v(cons1, cons2); + return fusion::segments(v); + } + }; + + template + struct segments_gen2, cons, false> + { + typedef iterator_range< + typename Car1::iterator_type + , typename Car2::iterator_type + > range; + + typedef single_view type; + + static type call(cons const &cons1, cons const &cons2) + { + return type(range(cons1.car.where, cons2.car.where)); + } + }; + + //////////////////////////////////////////////////////////////////////////// + template + struct segments_gen + : segments_gen2::value> + {}; + + template + struct segments_gen, nil> + { + typedef segmented_view > view; + typedef typename result_of::segments::type type; + + static type call(cons const &cons, nil const &) + { + view v(cons); + return fusion::segments(v); + } + }; + + template<> + struct segments_gen + { + typedef nil type; + + static type call(nil const &, nil const &) + { + return nil(); + } + }; + } // namespace detail + + namespace extension + { + template + struct is_segmented_impl; + + // An iterator_range of segmented_iterators is segmented + template<> + struct is_segmented_impl + { + template + struct is_segmented_iterator : mpl::false_ {}; + + template + struct is_segmented_iterator > : mpl::true_ {}; + + template + struct apply + : mpl::and_< + is_segmented_iterator + , is_segmented_iterator + > + {}; + }; + + template + struct segments_impl; + + template<> + struct segments_impl + { + template + struct apply + { + typedef typename Sequence::begin_cons_type begin_cons; + typedef typename Sequence::end_cons_type end_cons; + + typedef detail::segments_gen gen; + typedef typename gen::type type; + + static type call(Sequence &sequence) + { + return gen::call(sequence.first_cons, sequence.last_cons); + } + }; + }; + } + +}} + +#endif diff --git a/include/boost/fusion/view/filter_view.hpp b/include/boost/fusion/view/filter_view.hpp new file mode 100644 index 00000000..c649407f --- /dev/null +++ b/include/boost/fusion/view/filter_view.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_VIEW_FILTER_VIEW_10022005_0608) +#define FUSION_SEQUENCE_VIEW_FILTER_VIEW_10022005_0608 + +#include +#include + +#endif diff --git a/include/boost/fusion/view/filter_view/detail/begin_impl.hpp b/include/boost/fusion/view/filter_view/detail/begin_impl.hpp new file mode 100644 index 00000000..2ffe7bd0 --- /dev/null +++ b/include/boost/fusion/view/filter_view/detail/begin_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_05062005_0903) +#define FUSION_BEGIN_IMPL_05062005_0903 + +namespace boost { namespace fusion +{ + struct filter_view_tag; + + template + struct filter_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::first_type first_type; + typedef typename Sequence::last_type last_type; + typedef typename Sequence::pred_type pred_type; + typedef filter_iterator type; + + static type + call(Sequence& s) + { + return type(s.first()); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/filter_view/detail/deref_impl.hpp b/include/boost/fusion/view/filter_view/detail/deref_impl.hpp new file mode 100644 index 00000000..3e6447c5 --- /dev/null +++ b/include/boost/fusion/view/filter_view/detail/deref_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_IMPL_05062005_0905) +#define FUSION_DEREF_IMPL_05062005_0905 + +#include + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + : detail::adapt_deref_traits {}; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/filter_view/detail/end_impl.hpp b/include/boost/fusion/view/filter_view/detail/end_impl.hpp new file mode 100644 index 00000000..677004d4 --- /dev/null +++ b/include/boost/fusion/view/filter_view/detail/end_impl.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_05062005_0906) +#define FUSION_END_IMPL_05062005_0906 + +namespace boost { namespace fusion +{ + struct filter_view_tag; + + template + struct filter_iterator; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::last_type last_type; + typedef typename Sequence::pred_type pred_type; + typedef filter_iterator type; + + static type + call(Sequence& s) + { + return type(s.last()); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/filter_view/detail/equal_to_impl.hpp b/include/boost/fusion/view/filter_view/detail/equal_to_impl.hpp new file mode 100644 index 00000000..5d7b2932 --- /dev/null +++ b/include/boost/fusion/view/filter_view/detail/equal_to_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_EQUAL_TO_IMPL_02012005_2133) +#define BOOST_FUSION_EQUAL_TO_IMPL_02012005_2133 + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template + struct equal_to; + + template + struct equal_to_impl; + + template<> + struct equal_to_impl + { + template + struct apply + : result_of::equal_to + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/filter_view/detail/next_impl.hpp b/include/boost/fusion/view/filter_view/detail/next_impl.hpp new file mode 100644 index 00000000..8423dfe1 --- /dev/null +++ b/include/boost/fusion/view/filter_view/detail/next_impl.hpp @@ -0,0 +1,64 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_IMPL_06052005_0900) +#define FUSION_NEXT_IMPL_06052005_0900 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + + template + struct filter_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename Iterator::last_type last_type; + typedef typename Iterator::pred_type pred_type; + + typedef typename + mpl::eval_if< + result_of::equal_to + , mpl::identity + , result_of::next + >::type + next_type; + + typedef typename detail::static_find_if< + next_type, last_type, pred_type> + filter; + + typedef filter_iterator< + typename filter::type, last_type, pred_type> + type; + + static type + call(Iterator const& i) + { + return type(filter::call(i.first)); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/filter_view/detail/size_impl.hpp b/include/boost/fusion/view/filter_view/detail/size_impl.hpp new file mode 100644 index 00000000..1c5a0aca --- /dev/null +++ b/include/boost/fusion/view/filter_view/detail/size_impl.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SIZE_IMPL_09232005_1058) +#define FUSION_SIZE_IMPL_09232005_1058 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct filter_view_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply + : result_of::distance< + typename result_of::begin::type + , typename result_of::end::type> + {}; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/filter_view/detail/value_of_impl.hpp b/include/boost/fusion/view/filter_view/detail/value_of_impl.hpp new file mode 100644 index 00000000..f9188f6f --- /dev/null +++ b/include/boost/fusion/view/filter_view/detail/value_of_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_OF_IMPL_05062005_0857) +#define FUSION_VALUE_OF_IMPL_05062005_0857 + +#include + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + : detail::adapt_value_traits {}; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/filter_view/filter_view.hpp b/include/boost/fusion/view/filter_view/filter_view.hpp new file mode 100644 index 00000000..a34747e6 --- /dev/null +++ b/include/boost/fusion/view/filter_view/filter_view.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_FILTER_VIEW_HPP) +#define FUSION_SEQUENCE_FILTER_VIEW_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct filter_view_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template + struct filter_view : sequence_base > + { + typedef filter_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef forward_traversal_tag category; + typedef mpl::true_ is_view; + + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + typedef Pred pred_type; + + filter_view(Sequence& seq) + : seq(seq) + {} + + first_type first() const { return fusion::begin(seq); } + last_type last() const { return fusion::end(seq); } + typename mpl::if_, Sequence, Sequence&>::type seq; + }; +}} + +#endif + + diff --git a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp new file mode 100644 index 00000000..be93c657 --- /dev/null +++ b/include/boost/fusion/view/filter_view/filter_view_iterator.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_FILTER_VIEW_ITERATOR_05062005_0849) +#define FUSION_FILTER_VIEW_ITERATOR_05062005_0849 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct filter_view_iterator_tag; + struct forward_traversal_tag; + + template + struct filter_iterator : iterator_base > + { + typedef convert_iterator first_converter; + typedef typename first_converter::type first_iter; + typedef convert_iterator last_converter; + typedef typename last_converter::type last_iter; + + typedef filter_view_iterator_tag fusion_tag; + typedef forward_traversal_tag category; + typedef detail::static_find_if filter; + typedef typename filter::type first_type; + typedef last_iter last_type; + typedef Pred pred_type; + + filter_iterator(First const& first) + : first(filter::call(first_converter::call(first))) {} + + first_type first; + }; +}} + +#endif + + diff --git a/include/boost/fusion/view/iterator_range.hpp b/include/boost/fusion/view/iterator_range.hpp new file mode 100644 index 00000000..f8d30221 --- /dev/null +++ b/include/boost/fusion/view/iterator_range.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_VIEW_ITERATOR_RANGE_10022005_0610) +#define FUSION_SEQUENCE_VIEW_ITERATOR_RANGE_10022005_0610 + +#include + +#endif diff --git a/include/boost/fusion/view/iterator_range/detail/at_impl.hpp b/include/boost/fusion/view/iterator_range/detail/at_impl.hpp new file mode 100644 index 00000000..5f882aaa --- /dev/null +++ b/include/boost/fusion/view/iterator_range/detail/at_impl.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_ITERATOR_RANGE_AT_IMPL_HPP_INCLUDED + +#include +#include + +namespace boost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef typename Seq::begin_type begin_type; + typedef typename result_of::advance::type pos; + typedef typename result_of::deref::type type; + + static type + call(Seq& s) + { + return * advance(s.first); + } + }; + }; + } +}} + +#endif + diff --git a/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp b/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp new file mode 100644 index 00000000..32341369 --- /dev/null +++ b/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_05062005_1226) +#define FUSION_BEGIN_IMPL_05062005_1226 + +namespace boost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::begin_type type; + + static type + call(Sequence& s) + { + return s.first; + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/iterator_range/detail/end_impl.hpp b/include/boost/fusion/view/iterator_range/detail/end_impl.hpp new file mode 100644 index 00000000..dacbe191 --- /dev/null +++ b/include/boost/fusion/view/iterator_range/detail/end_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_05062005_1226) +#define FUSION_END_IMPL_05062005_1226 + +namespace boost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::end_type type; + + static type + call(Sequence& s) + { + return s.last; + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/iterator_range/detail/value_at_impl.hpp b/include/boost/fusion/view/iterator_range/detail/value_at_impl.hpp new file mode 100644 index 00000000..b6fe8881 --- /dev/null +++ b/include/boost/fusion/view/iterator_range/detail/value_at_impl.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_ITERATOR_RANGE_VALUE_AT_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_ITERATOR_RANGE_VALUE_AT_IMPL_HPP_INCLUDED + +#include +#include + +namespace boost { namespace fusion +{ + struct iterator_range_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename Seq::begin_type begin_type; + typedef typename result_of::advance::type pos; + typedef typename result_of::value_of::type type; + }; + }; + } +}} + +#endif + diff --git a/include/boost/fusion/view/iterator_range/iterator_range.hpp b/include/boost/fusion/view/iterator_range/iterator_range.hpp new file mode 100644 index 00000000..0036f0ae --- /dev/null +++ b/include/boost/fusion/view/iterator_range/iterator_range.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ITERATOR_RANGE_05062005_1224) +#define FUSION_ITERATOR_RANGE_05062005_1224 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct iterator_range_tag; + struct fusion_sequence_tag; + + template + struct iterator_range : sequence_base > + { + typedef typename convert_iterator::type begin_type; + typedef typename convert_iterator::type end_type; + typedef iterator_range_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef typename result_of::distance::type size; + typedef mpl::true_ is_view; + + typedef typename traits::category_of::type category; + + iterator_range(First const& first, Last const& last) + : first(convert_iterator::call(first)) + , last(convert_iterator::call(last)) {} + + begin_type first; + end_type last; + }; +}} + +#endif + + diff --git a/include/boost/fusion/view/joint_view.hpp b/include/boost/fusion/view/joint_view.hpp new file mode 100644 index 00000000..cd1b8571 --- /dev/null +++ b/include/boost/fusion/view/joint_view.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_VIEW_JOINT_VIEW_10022005_0610) +#define FUSION_SEQUENCE_VIEW_JOINT_VIEW_10022005_0610 + +#include +#include + +#endif diff --git a/include/boost/fusion/view/joint_view/detail/begin_impl.hpp b/include/boost/fusion/view/joint_view/detail/begin_impl.hpp new file mode 100644 index 00000000..e2b0281e --- /dev/null +++ b/include/boost/fusion/view/joint_view/detail/begin_impl.hpp @@ -0,0 +1,66 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_07162005_0115) +#define FUSION_BEGIN_IMPL_07162005_0115 + +#include +#include + +namespace boost { namespace fusion +{ + struct joint_view_tag; + + template + struct joint_view_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::first_type first_type; + typedef typename Sequence::last_type last_type; + typedef typename Sequence::concat_type concat_type; + typedef result_of::equal_to equal_to; + + typedef typename + mpl::if_< + equal_to + , concat_type + , joint_view_iterator + >::type + type; + + static type + call(Sequence& s, mpl::true_) + { + return s.concat(); + } + + static type + call(Sequence& s, mpl::false_) + { + return type(s.first(), s.concat()); + } + + static type + call(Sequence& s) + { + return call(s, equal_to()); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/joint_view/detail/deref_impl.hpp b/include/boost/fusion/view/joint_view/detail/deref_impl.hpp new file mode 100644 index 00000000..7eb47184 --- /dev/null +++ b/include/boost/fusion/view/joint_view/detail/deref_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_IMPL_07162005_0137) +#define FUSION_DEREF_IMPL_07162005_0137 + +#include + +namespace boost { namespace fusion +{ + struct joint_view_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + : detail::adapt_deref_traits {}; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/joint_view/detail/end_impl.hpp b/include/boost/fusion/view/joint_view/detail/end_impl.hpp new file mode 100644 index 00000000..5bdeb02e --- /dev/null +++ b/include/boost/fusion/view/joint_view/detail/end_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_07162005_0128) +#define FUSION_END_IMPL_07162005_0128 + +#include +#include + +namespace boost { namespace fusion +{ + struct joint_view_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::concat_last_type type; + + static type + call(Sequence& s) + { + return s.concat_last(); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/joint_view/detail/next_impl.hpp b/include/boost/fusion/view/joint_view/detail/next_impl.hpp new file mode 100644 index 00000000..80d3580d --- /dev/null +++ b/include/boost/fusion/view/joint_view/detail/next_impl.hpp @@ -0,0 +1,70 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_IMPL_07162005_0136) +#define FUSION_NEXT_IMPL_07162005_0136 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct joint_view_iterator_tag; + + template + struct joint_view_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename Iterator::last_type last_type; + typedef typename Iterator::concat_type concat_type; + typedef typename result_of::next::type next_type; + typedef result_of::equal_to equal_to; + + typedef typename + mpl::if_< + equal_to + , concat_type + , joint_view_iterator + >::type + type; + + static type + call(Iterator const& i, mpl::true_) + { + return i.concat; + } + + static type + call(Iterator const& i, mpl::false_) + { + return type(fusion::next(i.first), i.concat); + } + + static type + call(Iterator const& i) + { + return call(i, equal_to()); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/joint_view/detail/value_of_impl.hpp b/include/boost/fusion/view/joint_view/detail/value_of_impl.hpp new file mode 100644 index 00000000..53afe1c9 --- /dev/null +++ b/include/boost/fusion/view/joint_view/detail/value_of_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_IMPL_07162005_0132) +#define FUSION_VALUE_IMPL_07162005_0132 + +#include + +namespace boost { namespace fusion +{ + struct joint_view_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + : detail::adapt_value_traits {}; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/joint_view/joint_view.hpp b/include/boost/fusion/view/joint_view/joint_view.hpp new file mode 100644 index 00000000..9cc798d3 --- /dev/null +++ b/include/boost/fusion/view/joint_view/joint_view.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_JOINT_VIEW_07162005_0140) +#define FUSION_JOINT_VIEW_07162005_0140 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct joint_view_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template + struct joint_view : sequence_base > + { + typedef joint_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef forward_traversal_tag category; + typedef mpl::true_ is_view; + + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + typedef typename result_of::begin::type concat_type; + typedef typename result_of::end::type concat_last_type; + typedef typename mpl::plus, result_of::size >::type size; + + joint_view(Sequence1& seq1, Sequence2& seq2) + : seq1(seq1) + , seq2(seq2) + {} + + first_type first() const { return fusion::begin(seq1); } + concat_type concat() const { return fusion::begin(seq2); } + concat_last_type concat_last() const { return fusion::end(seq2); } + + private: + + typename mpl::if_, Sequence1, Sequence1&>::type seq1; + typename mpl::if_, Sequence2, Sequence2&>::type seq2; + }; +}} + +#endif + + diff --git a/include/boost/fusion/view/joint_view/joint_view_iterator.hpp b/include/boost/fusion/view/joint_view/joint_view_iterator.hpp new file mode 100644 index 00000000..18696d7e --- /dev/null +++ b/include/boost/fusion/view/joint_view/joint_view_iterator.hpp @@ -0,0 +1,52 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_JOINT_VIEW_ITERATOR_07162005_0140) +#define FUSION_JOINT_VIEW_ITERATOR_07162005_0140 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct joint_view_iterator_tag; + struct forward_traversal_tag; + + template + struct joint_view_iterator + : iterator_base > + { + typedef convert_iterator first_converter; + typedef convert_iterator last_converter; + typedef convert_iterator concat_converter; + + typedef typename first_converter::type first_type; + typedef typename last_converter::type last_type; + typedef typename concat_converter::type concat_type; + + typedef joint_view_iterator_tag fusion_tag; + typedef forward_traversal_tag category; + BOOST_STATIC_ASSERT((!result_of::equal_to::value)); + + joint_view_iterator(First const& first, Concat const& concat) + : first(first_converter::call(first)) + , concat(concat_converter::call(concat)) + {} + + first_type first; + concat_type concat; + }; +}} + +#endif + + diff --git a/include/boost/fusion/view/repetitive_view.hpp b/include/boost/fusion/view/repetitive_view.hpp new file mode 100644 index 00000000..fef1462f --- /dev/null +++ b/include/boost/fusion/view/repetitive_view.hpp @@ -0,0 +1,15 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_VIEW_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_HPP_INCLUDED + +#include +#include + +#endif + diff --git a/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp new file mode 100644 index 00000000..321d7b8d --- /dev/null +++ b/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_VIEW_BEGIN_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_BEGIN_IMPL_HPP_INCLUDED + +#include +#include + +namespace boost { namespace fusion +{ + struct repetitive_view_tag; + + template + struct repetitive_view_iterator; + + namespace extension + { + template + struct begin_impl; + + template<> + struct begin_impl + { + template + struct apply + { + typedef typename View::sequence_type sequence_type; + + typedef repetitive_view_iterator::type > type; + + static type call(View const& v) + { + return type(v.seq); + } + }; + }; + + } + +}} + +#endif + diff --git a/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp new file mode 100644 index 00000000..2c0caf80 --- /dev/null +++ b/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_VIEW_DEREF_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_DEREF_IMPL_HPP_INCLUDED + +#include + +namespace boost { namespace fusion +{ + struct repetitive_view_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template<> + struct deref_impl + { + template + struct apply + { + typedef typename + result_of::deref::type + type; + + static type call(Iterator const& i) + { + return *i.pos; + } + }; + }; + + } + +}} + +#endif + diff --git a/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp new file mode 100644 index 00000000..52e36da5 --- /dev/null +++ b/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_VIEW_END_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_END_IMPL_HPP_INCLUDED + +#include +#include + +namespace boost { namespace fusion +{ + struct repetitive_view_tag; + + template + struct repetitive_view_iterator; + + namespace extension + { + template + struct end_impl; + + template<> + struct end_impl + { + template + struct apply + { + typedef typename View::sequence_type sequence_type; + + typedef repetitive_view_iterator::type > type; + + static type call(View const& v) + { + return type(v.seq,end(v.seq)); + } + }; + }; + + } + +}} + +#endif + diff --git a/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp new file mode 100644 index 00000000..b629cb01 --- /dev/null +++ b/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp @@ -0,0 +1,90 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_VIEW_NEXT_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_NEXT_IMPL_HPP_INCLUDED + +#include +#include + +namespace boost { namespace fusion +{ + struct repetitive_view_iterator_tag; + + template + struct repetitive_view_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template::type>::value > + struct apply_nonempty // + { + // advanvce to next position + + typedef repetitive_view_iterator< + typename Iterator::sequence_type, + typename result_of::next::type + > + type; + + static type call(Iterator const& i) + { + return type(i.seq, next(i.pos)); + } + }; + template + struct apply_nonempty + { + // reset to beginning + + typedef repetitive_view_iterator< + typename Iterator::sequence_type, + typename Iterator::first_type + > + type; + + static type call(Iterator const& i) + { + return type(i.seq); + } + }; + + template ::value > + struct apply // + : apply_nonempty + { }; + + template + struct apply + { + // eps^n = eps + + typedef Iterator type; + + static type call(Iterator const& i) + { + return type(i); + } + }; + }; + } +}} + +#endif + diff --git a/include/boost/fusion/view/repetitive_view/detail/value_of_impl.hpp b/include/boost/fusion/view/repetitive_view/detail/value_of_impl.hpp new file mode 100644 index 00000000..bf5f2f06 --- /dev/null +++ b/include/boost/fusion/view/repetitive_view/detail/value_of_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_VIEW_VALUE_OF_IMPL_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_VALUE_OF_IMPL_HPP_INCLUDED + +#include + +namespace boost { namespace fusion +{ + struct repetitive_view_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template<> + struct value_of_impl + { + template + struct apply + : result_of::value_of + { }; + }; + } +}} + +#endif + diff --git a/include/boost/fusion/view/repetitive_view/repetitive_view.hpp b/include/boost/fusion/view/repetitive_view/repetitive_view.hpp new file mode 100644 index 00000000..050affb1 --- /dev/null +++ b/include/boost/fusion/view/repetitive_view/repetitive_view.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_REPETITIVE_VIEW_VIEW_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED + +#include +#include + +#include +#include + +#include +#include + + +namespace boost { namespace fusion +{ + struct repetitive_view_tag; + struct fusion_sequence_tag; + + template struct repetitive_view + : sequence_base< repetitive_view > + { + typedef repetitive_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + + typedef single_pass_traversal_tag category; + + typedef typename boost::remove_reference::type sequence_type; + typedef typename + mpl::if_, Sequence, sequence_type&>::type + stored_seq_type; + + repetitive_view(Sequence& seq) + : seq(seq) {} + + stored_seq_type seq; + }; + +}} + +#endif diff --git a/include/boost/fusion/view/repetitive_view/repetitive_view_fwd.hpp b/include/boost/fusion/view/repetitive_view/repetitive_view_fwd.hpp new file mode 100644 index 00000000..24e146c0 --- /dev/null +++ b/include/boost/fusion/view/repetitive_view/repetitive_view_fwd.hpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_VIEW_FWD_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_FWD_HPP_INCLUDED + +namespace boost { namespace fusion +{ + struct repetitive_view_tag; + + template struct repetitive_view; +}} + +#endif + diff --git a/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp b/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp new file mode 100644 index 00000000..9a7334de --- /dev/null +++ b/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#if !defined(BOOST_FUSION_REPETITIVE_VIEW_ITERATOR_HPP_INCLUDED) +#define BOOST_FUSION_REPETITIVE_VIEW_HPP_ITERATOR_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct repetitive_view_iterator_tag; + + template::type> + struct repetitive_view_iterator + : iterator_base< repetitive_view_iterator > + { + typedef repetitive_view_iterator_tag fusion_tag; + + typedef Sequence sequence_type; + typedef typename convert_iterator::type pos_type; + typedef typename convert_iterator::type>::type first_type; + typedef typename convert_iterator::type>::type end_type; + typedef single_pass_traversal_tag category; + + explicit repetitive_view_iterator(Sequence& seq) + : seq(seq), pos(begin(seq)) {} + + repetitive_view_iterator(Sequence& seq, pos_type const& pos) + : seq(seq), pos(pos) {} + + Sequence& seq; + pos_type pos; + + }; +}} + +#endif + diff --git a/include/boost/fusion/view/reverse_view.hpp b/include/boost/fusion/view/reverse_view.hpp new file mode 100644 index 00000000..634b398c --- /dev/null +++ b/include/boost/fusion/view/reverse_view.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_VIEW_REVERSE_VIEW_10022005_0612) +#define FUSION_SEQUENCE_VIEW_REVERSE_VIEW_10022005_0612 + +#include +#include + +#endif diff --git a/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp b/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp new file mode 100644 index 00000000..8785881e --- /dev/null +++ b/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ADVANCE_IMPL_14122005_2015) +#define FUSION_ADVANCE_IMPL_14122005_2015 + +#include +#include + +namespace boost { namespace fusion { + + struct reverse_view_iterator_tag; + + template + struct reverse_view_iterator; + + namespace extension + { + template + struct advance_impl; + + template<> + struct advance_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename mpl::negate::type negative_dist; + typedef typename result_of::advance::type advanced_type; + typedef reverse_view_iterator type; + + static type + call(Iterator const& i) + { + return type(boost::fusion::advance(i.first)); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp b/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp new file mode 100644 index 00000000..b7968f56 --- /dev/null +++ b/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_07202005_0849) +#define FUSION_BEGIN_IMPL_07202005_0849 + +namespace boost { namespace fusion +{ + struct reverse_view_tag; + + template + struct reverse_view_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef reverse_view_iterator type; + + static type + call(Sequence const& s) + { + return type(s.last()); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp b/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp new file mode 100644 index 00000000..97cb8915 --- /dev/null +++ b/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_IMPL_07202005_0851) +#define FUSION_DEREF_IMPL_07202005_0851 + +#include +#include + +namespace boost { namespace fusion +{ + struct reverse_view_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename + result_of::deref< + typename result_of::prior< + typename Iterator::first_type + >::type + >::type + type; + + static type + call(Iterator const& i) + { + return *fusion::prior(i.first); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp b/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp new file mode 100644 index 00000000..5edc7499 --- /dev/null +++ b/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DISTANCE_IMPL_14122005_2104) +#define FUSION_DISTANCE_IMPL_14122005_2104 + +#include + +namespace boost { namespace fusion { + + struct reverse_view_iterator_tag; + + template + struct reverse_view_iterator; + + namespace extension + { + template + struct distance_impl; + + template<> + struct distance_impl + { + template + struct apply + { + typedef typename First::first_type first_type; + typedef typename Last::first_type last_type; + typedef typename result_of::distance::type type; + + static type + call(First const& first, Last const& last) + { + return boost::fusion::distance(last.first, first.first); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/reverse_view/detail/end_impl.hpp b/include/boost/fusion/view/reverse_view/detail/end_impl.hpp new file mode 100644 index 00000000..916e49d0 --- /dev/null +++ b/include/boost/fusion/view/reverse_view/detail/end_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_07202005_0851) +#define FUSION_END_IMPL_07202005_0851 + +namespace boost { namespace fusion +{ + struct reverse_view_tag; + + template + struct reverse_view_iterator; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef reverse_view_iterator type; + + static type + call(Sequence const& s) + { + return type(s.first()); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/reverse_view/detail/next_impl.hpp b/include/boost/fusion/view/reverse_view/detail/next_impl.hpp new file mode 100644 index 00000000..c036510c --- /dev/null +++ b/include/boost/fusion/view/reverse_view/detail/next_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_IMPL_07202005_0856) +#define FUSION_NEXT_IMPL_07202005_0856 + +#include +#include + +namespace boost { namespace fusion +{ + struct reverse_view_iterator_tag; + + template + struct reverse_view_iterator; + + namespace extension + { + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename prior_impl:: + template apply + wrapped; + + typedef reverse_view_iterator type; + + static type + call(Iterator const& i) + { + return type(wrapped::call(i.first)); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp b/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp new file mode 100644 index 00000000..317054fc --- /dev/null +++ b/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PRIOR_IMPL_07202005_0857) +#define FUSION_PRIOR_IMPL_07202005_0857 + +#include +#include + +namespace boost { namespace fusion +{ + struct reverse_view_iterator_tag; + + template + struct reverse_view_iterator; + + namespace extension + { + template <> + struct prior_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename next_impl:: + template apply + wrapped; + + typedef reverse_view_iterator type; + + static type + call(Iterator const& i) + { + return type(wrapped::call(i.first)); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/reverse_view/detail/value_of_impl.hpp b/include/boost/fusion/view/reverse_view/detail/value_of_impl.hpp new file mode 100644 index 00000000..bf9b2ade --- /dev/null +++ b/include/boost/fusion/view/reverse_view/detail/value_of_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_OF_IMPL_07202005_0900) +#define FUSION_VALUE_OF_IMPL_07202005_0900 + +#include +#include + +namespace boost { namespace fusion +{ + struct reverse_view_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename + result_of::value_of< + typename result_of::prior< + typename Iterator::first_type + >::type + >::type + type; + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/reverse_view/reverse_view.hpp b/include/boost/fusion/view/reverse_view/reverse_view.hpp new file mode 100644 index 00000000..c939f7ce --- /dev/null +++ b/include/boost/fusion/view/reverse_view/reverse_view.hpp @@ -0,0 +1,58 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REVERSE_VIEW_07202005_0836) +#define FUSION_REVERSE_VIEW_07202005_0836 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct reverse_view_tag; + struct fusion_sequence_tag; + + template + struct reverse_view : sequence_base > + { + typedef reverse_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + + typedef typename traits::category_of::type category; + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + typedef typename result_of::size::type size; + + BOOST_STATIC_ASSERT(( + is_base_of< + bidirectional_traversal_tag + , typename traits::category_of::type>::value)); + + reverse_view(Sequence& seq) + : seq(seq) + {} + + first_type first() const { return fusion::begin(seq); } + last_type last() const { return fusion::end(seq); } + typename mpl::if_, Sequence, Sequence&>::type seq; + }; +}} + +#endif + + diff --git a/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp b/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp new file mode 100644 index 00000000..0a890437 --- /dev/null +++ b/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_REVERSE_VIEW_ITERATOR_07202005_0835) +#define FUSION_REVERSE_VIEW_ITERATOR_07202005_0835 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct reverse_view_iterator_tag; + + template + struct reverse_view_iterator + : iterator_base > + { + typedef convert_iterator converter; + typedef typename converter::type first_type; + typedef reverse_view_iterator_tag fusion_tag; + typedef typename traits::category_of::type category; + + BOOST_STATIC_ASSERT(( + is_base_of< + bidirectional_traversal_tag + , category>::value)); + + reverse_view_iterator(First const& first) + : first(converter::call(first)) {} + + first_type first; + }; +}} + +#endif + diff --git a/include/boost/fusion/view/single_view.hpp b/include/boost/fusion/view/single_view.hpp new file mode 100644 index 00000000..3640fae8 --- /dev/null +++ b/include/boost/fusion/view/single_view.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SINGLE_VIEW_03192006_2216) +#define FUSION_SINGLE_VIEW_03192006_2216 + +#include +#include + +#endif diff --git a/include/boost/fusion/view/single_view/detail/begin_impl.hpp b/include/boost/fusion/view/single_view/detail/begin_impl.hpp new file mode 100644 index 00000000..395992be --- /dev/null +++ b/include/boost/fusion/view/single_view/detail/begin_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_05052005_0305) +#define FUSION_BEGIN_IMPL_05052005_0305 + +namespace boost { namespace fusion +{ + struct single_view_tag; + + template + struct single_view_iterator; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef single_view_iterator type; + + static type + call(Sequence& s) + { + return type(s); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/single_view/detail/deref_impl.hpp b/include/boost/fusion/view/single_view/detail/deref_impl.hpp new file mode 100644 index 00000000..355cf6ac --- /dev/null +++ b/include/boost/fusion/view/single_view/detail/deref_impl.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_IMPL_05052005_0258) +#define FUSION_DEREF_IMPL_05052005_0258 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct single_view_iterator_tag; + + namespace extension + { + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename Iterator::value_type type; + + static type + call(Iterator const& i) + { + return i.val; + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/single_view/detail/end_impl.hpp b/include/boost/fusion/view/single_view/detail/end_impl.hpp new file mode 100644 index 00000000..d239c242 --- /dev/null +++ b/include/boost/fusion/view/single_view/detail/end_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_05052005_0332) +#define FUSION_END_IMPL_05052005_0332 + +namespace boost { namespace fusion +{ + struct single_view_tag; + + template + struct single_view_iterator_end; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef single_view_iterator_end type; + + static type + call(Sequence&) + { + return type(); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/single_view/detail/next_impl.hpp b/include/boost/fusion/view/single_view/detail/next_impl.hpp new file mode 100644 index 00000000..c9cdafdf --- /dev/null +++ b/include/boost/fusion/view/single_view/detail/next_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_IMPL_05052005_0331) +#define FUSION_NEXT_IMPL_05052005_0331 + +namespace boost { namespace fusion +{ + struct single_view_iterator_tag; + + template + struct single_view_iterator_end; + + template + struct single_view_iterator; + + namespace extension + { + template + struct next_impl; + + template <> + struct next_impl + { + template + struct apply + { + typedef single_view_iterator_end< + typename Iterator::single_view_type> + type; + + static type + call(Iterator) + { + return type(); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/single_view/detail/value_of_impl.hpp b/include/boost/fusion/view/single_view/detail/value_of_impl.hpp new file mode 100644 index 00000000..f975eb14 --- /dev/null +++ b/include/boost/fusion/view/single_view/detail/value_of_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_IMPL_05052005_0324) +#define FUSION_VALUE_IMPL_05052005_0324 + +namespace boost { namespace fusion +{ + struct single_view_iterator_tag; + + namespace extension + { + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename Iterator::single_view_type single_view_type; + typedef typename single_view_type::value_type type; + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/single_view/single_view.hpp b/include/boost/fusion/view/single_view/single_view.hpp new file mode 100644 index 00000000..7c10afe6 --- /dev/null +++ b/include/boost/fusion/view/single_view/single_view.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SINGLE_VIEW_05052005_0335) +#define FUSION_SINGLE_VIEW_05052005_0335 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct single_view_tag; + struct forward_traversal_tag; + struct fusion_sequence_tag; + + template + struct single_view : sequence_base > + { + typedef single_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef forward_traversal_tag category; + typedef mpl::true_ is_view; + typedef mpl::int_<1> size; + typedef T value_type; + + single_view() + : val() {} + + explicit single_view(typename detail::call_param::type val) + : val(val) {} + + value_type val; + }; + + template + inline single_view::type> + make_single_view(T const& v) + { + return single_view::type>(v); + } +}} + +#endif + + diff --git a/include/boost/fusion/view/single_view/single_view_iterator.hpp b/include/boost/fusion/view/single_view/single_view_iterator.hpp new file mode 100644 index 00000000..1a44bb15 --- /dev/null +++ b/include/boost/fusion/view/single_view/single_view_iterator.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SINGLE_VIEW_ITERATOR_05052005_0340) +#define FUSION_SINGLE_VIEW_ITERATOR_05052005_0340 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct single_view_iterator_tag; + struct forward_traversal_tag; + + template + struct single_view_iterator_end + : iterator_base > + { + typedef single_view_iterator_tag fusion_tag; + typedef forward_traversal_tag category; + }; + + template + struct single_view_iterator + : iterator_base > + { + typedef single_view_iterator_tag fusion_tag; + typedef forward_traversal_tag category; + typedef typename SingleView::value_type value_type; + typedef SingleView single_view_type; + + explicit single_view_iterator(single_view_type const& view) + : val(view.val) {} + + value_type val; + }; +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view.hpp b/include/boost/fusion/view/transform_view.hpp new file mode 100644 index 00000000..744d063c --- /dev/null +++ b/include/boost/fusion/view/transform_view.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_VIEW_TRANSFORM_VIEW_10022005_0612) +#define FUSION_SEQUENCE_VIEW_TRANSFORM_VIEW_10022005_0612 + +#include +#include + +#endif diff --git a/include/boost/fusion/view/transform_view/detail/advance_impl.hpp b/include/boost/fusion/view/transform_view/detail/advance_impl.hpp new file mode 100644 index 00000000..6b323484 --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/advance_impl.hpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ADVANCE_IMPL_13122005_1906) +#define FUSION_ADVANCE_IMPL_13122005_1906 + +#include + +namespace boost { namespace fusion +{ + struct transform_view_iterator_tag; + struct transform_view_iterator2_tag; + + template + struct transform_view_iterator; + + template + struct transform_view_iterator2; + + namespace extension + { + template + struct advance_impl; + + // Unary Version + template<> + struct advance_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename result_of::advance::type advanced_type; + typedef typename Iterator::transform_type transform_type; + typedef transform_view_iterator type; + + static type + call(Iterator const& i) + { + return type(boost::fusion::advance(i.first), i.f); + } + }; + }; + + // Binary Version + template<> + struct advance_impl + { + template + struct apply + { + typedef typename Iterator::first1_type first1_type; + typedef typename Iterator::first2_type first2_type; + typedef typename result_of::advance::type advanced1_type; + typedef typename result_of::advance::type advanced2_type; + typedef typename Iterator::transform_type transform_type; + typedef transform_view_iterator2 type; + + static type + call(Iterator const& i) + { + return type( + boost::fusion::advance(i.first1) + , boost::fusion::advance(i.first2), i.f); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/transform_view/detail/apply_transform_result.hpp b/include/boost/fusion/view/transform_view/detail/apply_transform_result.hpp new file mode 100644 index 00000000..73be3045 --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/apply_transform_result.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_APPLY_TRANSFORM_RESULT_02092006_1936) +#define BOOST_FUSION_APPLY_TRANSFORM_RESULT_02092006_1936 + +#include + +namespace boost { namespace fusion +{ + struct void_; + + namespace detail + { + template + struct apply_transform_result + { + template + struct apply + : boost::result_of + {}; + + template + struct apply + : boost::result_of + {}; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view/detail/at_impl.hpp b/include/boost/fusion/view/transform_view/detail/at_impl.hpp new file mode 100644 index 00000000..620d96fe --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/at_impl.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_IMPL_20061029_1946) +#define BOOST_FUSION_AT_IMPL_20061029_1946 + +#include +#include +#include + +namespace boost { namespace fusion { + struct transform_view_tag; + struct transform_view2_tag; + + namespace extension + { + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply + { + typedef typename Seq::transform_type F; + typedef detail::apply_transform_result transform_type; + typedef typename boost::fusion::result_of::at::type value_type; + typedef typename mpl::apply::type type; + + static type call(Seq& seq) + { + return seq.f(boost::fusion::at(seq.seq)); + } + }; + }; + + template<> + struct at_impl + { + template + struct apply + { + typedef typename Seq::transform_type F; + typedef detail::apply_transform_result transform_type; + typedef typename boost::fusion::result_of::at::type value1_type; + typedef typename boost::fusion::result_of::at::type value2_type; + typedef typename mpl::apply::type type; + + static type call(Seq& seq) + { + return seq.f(boost::fusion::at(seq.seq1), boost::fusion::at(seq.seq2)); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/transform_view/detail/begin_impl.hpp b/include/boost/fusion/view/transform_view/detail/begin_impl.hpp new file mode 100644 index 00000000..75b04382 --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/begin_impl.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_07162005_1031) +#define FUSION_BEGIN_IMPL_07162005_1031 + +#include + +namespace boost { namespace fusion +{ + template + struct transform_view_iterator; + + template + struct transform_view_iterator2; + + namespace extension + { + template + struct begin_impl; + + // Unary Version + template <> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::first_type first_type; + typedef typename Sequence::transform_type transform_type; + typedef transform_view_iterator type; + + static type + call(Sequence& s) + { + return type(s.first(), s.f); + } + }; + }; + + // Binary Version + template <> + struct begin_impl + { + template + struct apply + { + typedef typename Sequence::first1_type first1_type; + typedef typename Sequence::first2_type first2_type; + typedef typename Sequence::transform_type transform_type; + typedef transform_view_iterator2 type; + + static type + call(Sequence& s) + { + return type(s.first1(), s.first2(), s.f); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view/detail/deref_impl.hpp b/include/boost/fusion/view/transform_view/detail/deref_impl.hpp new file mode 100644 index 00000000..3849f80a --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/deref_impl.hpp @@ -0,0 +1,76 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_IMPL_07162005_1026) +#define FUSION_DEREF_IMPL_07162005_1026 + +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct transform_view_iterator_tag; + struct transform_view_iterator2_tag; + + namespace extension + { + template + struct deref_impl; + + // Unary Version + template <> + struct deref_impl + { + template + struct apply + { + typedef typename + result_of::deref::type + value_type; + + typedef detail::apply_transform_result transform_type; + typedef typename mpl::apply::type type; + + static type + call(Iterator const& i) + { + return i.f(*i.first); + } + }; + }; + + // Binary Version + template <> + struct deref_impl + { + template + struct apply + { + typedef typename + result_of::deref::type + value1_type; + typedef typename + result_of::deref::type + value2_type; + + typedef detail::apply_transform_result transform_type; + typedef typename mpl::apply::type type; + + static type + call(Iterator const& i) + { + return i.f(*i.first1, *i.first2); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view/detail/distance_impl.hpp b/include/boost/fusion/view/transform_view/detail/distance_impl.hpp new file mode 100644 index 00000000..d5ae0adc --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/distance_impl.hpp @@ -0,0 +1,59 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DISTANCE_IMPL_13122005_2139) +#define FUSION_DISTANCE_IMPL_13122005_2139 + +#include + +namespace boost { namespace fusion { + + struct transform_view_iterator_tag; + struct transform_view_iterator2_tag; + + namespace extension + { + template + struct distance_impl; + + // Unary Version + template<> + struct distance_impl + { + template + struct apply + : result_of::distance + { + static + typename result_of::distance::type + call(First const& first, Last const& last) + { + return boost::fusion::distance(first.first, last.first); + } + }; + }; + + // Binary Version + template<> + struct distance_impl + { + template + struct apply + : result_of::distance + { + static + typename result_of::distance::type + call(First const& first, Last const& last) + { + return boost::fusion::distance(first.first1, last.first1); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/transform_view/detail/end_impl.hpp b/include/boost/fusion/view/transform_view/detail/end_impl.hpp new file mode 100644 index 00000000..465a2cbe --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/end_impl.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_07162005_1028) +#define FUSION_END_IMPL_07162005_1028 + +#include + +namespace boost { namespace fusion +{ + template + struct transform_view_iterator; + + template + struct transform_view_iterator2; + + namespace extension + { + template + struct end_impl; + + // Unary Version + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::last_type last_type; + typedef typename Sequence::transform_type transform_type; + typedef transform_view_iterator type; + + static type + call(Sequence& s) + { + return type(s.last(), s.f); + } + }; + }; + + // Binary Version + template <> + struct end_impl + { + template + struct apply + { + typedef typename Sequence::last1_type last1_type; + typedef typename Sequence::last2_type last2_type; + typedef typename Sequence::transform_type transform_type; + typedef transform_view_iterator2 type; + + static type + call(Sequence& s) + { + return type(s.last1(), s.last2(), s.f); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view/detail/equal_to_impl.hpp b/include/boost/fusion/view/transform_view/detail/equal_to_impl.hpp new file mode 100644 index 00000000..063a00ed --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/equal_to_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_TRANSFORM_VIEW_ITERATOR_20070127_0957) +#define BOOST_FUSION_TRANSFORM_VIEW_ITERATOR_20070127_0957 + +#include + +namespace boost { namespace fusion { + + struct transform_view_iterator_tag; + struct transform_view_iterator2_tag; + + namespace extension + { + template + struct equal_to_impl; + + template<> + struct equal_to_impl + { + template + struct apply + : result_of::equal_to + {}; + }; + + template<> + struct equal_to_impl + { + template + struct apply + : result_of::equal_to + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/transform_view/detail/next_impl.hpp b/include/boost/fusion/view/transform_view/detail/next_impl.hpp new file mode 100644 index 00000000..4d6ec743 --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/next_impl.hpp @@ -0,0 +1,74 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_IMPL_07162005_1029) +#define FUSION_NEXT_IMPL_07162005_1029 + +#include + +namespace boost { namespace fusion +{ + struct transform_view_iterator_tag; + struct transform_view_iterator2_tag; + + template + struct transform_view_iterator; + + template + struct transform_view_iterator2; + + namespace extension + { + template + struct next_impl; + + // Unary Version + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename result_of::next::type next_type; + typedef typename Iterator::transform_type transform_type; + typedef transform_view_iterator type; + + static type + call(Iterator const& i) + { + return type(fusion::next(i.first), i.f); + } + }; + }; + + // Binary Version + template <> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::first1_type first1_type; + typedef typename Iterator::first2_type first2_type; + typedef typename result_of::next::type next1_type; + typedef typename result_of::next::type next2_type; + typedef typename Iterator::transform_type transform_type; + typedef transform_view_iterator2 type; + + static type + call(Iterator const& i) + { + return type(fusion::next(i.first1), fusion::next(i.first2), i.f); + } + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view/detail/prior_impl.hpp b/include/boost/fusion/view/transform_view/detail/prior_impl.hpp new file mode 100644 index 00000000..f7d49966 --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/prior_impl.hpp @@ -0,0 +1,73 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PREV_IMPL_13122005_2110) +#define FUSION_PREV_IMPL_13122005_2110 + +#include + +namespace boost { namespace fusion +{ + struct transform_view_iterator_tag; + struct transform_view_iterator2_tag; + + template + struct transform_view_iterator; + + template + struct transform_view_iterator2; + + namespace extension + { + template + struct prior_impl; + + // Unary Version + template<> + struct prior_impl + { + template + struct apply + { + typedef typename Iterator::first_type first_type; + typedef typename result_of::prior::type prior_type; + typedef typename Iterator::transform_type transform_type; + typedef transform_view_iterator type; + + static type + call(Iterator const& i) + { + return type(fusion::prior(i.first), i.f); + } + }; + }; + + // Binary Version + template<> + struct prior_impl + { + template + struct apply + { + typedef typename Iterator::first1_type first1_type; + typedef typename Iterator::first2_type first2_type; + typedef typename result_of::prior::type prior1_type; + typedef typename result_of::prior::type prior2_type; + typedef typename Iterator::transform_type transform_type; + typedef transform_view_iterator2 type; + + static type + call(Iterator const& i) + { + return type(fusion::prior(i.first1), fusion::prior(i.first2), i.f); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/transform_view/detail/value_at_impl.hpp b/include/boost/fusion/view/transform_view/detail/value_at_impl.hpp new file mode 100644 index 00000000..cb581583 --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/value_at_impl.hpp @@ -0,0 +1,53 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_IMPL_20061101_0745) +#define BOOST_FUSION_VALUE_AT_IMPL_20061101_0745 + +#include +#include +#include + +namespace boost { namespace fusion { + struct transform_view_tag; + struct transform_view2_tag; + + namespace extension + { + template + struct value_at_impl; + + template<> + struct value_at_impl + { + template + struct apply + { + typedef typename Seq::transform_type F; + typedef detail::apply_transform_result transform_type; + typedef typename boost::fusion::result_of::at::type value_type; + typedef typename mpl::apply::type type; + }; + }; + + template<> + struct value_at_impl + { + template + struct apply + { + typedef typename Seq::transform_type F; + typedef detail::apply_transform_result transform_type; + typedef typename boost::fusion::result_of::at::type value1_type; + typedef typename boost::fusion::result_of::at::type value2_type; + typedef typename mpl::apply::type type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/transform_view/detail/value_of_impl.hpp b/include/boost/fusion/view/transform_view/detail/value_of_impl.hpp new file mode 100644 index 00000000..08bbf209 --- /dev/null +++ b/include/boost/fusion/view/transform_view/detail/value_of_impl.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_OF_IMPL_07162005_1030) +#define FUSION_VALUE_OF_IMPL_07162005_1030 + +#include +#include +#include + +namespace boost { namespace fusion +{ + struct transform_view_iterator_tag; + struct transform_view_iterator2_tag; + + namespace extension + { + template + struct value_of_impl; + + // Unary Version + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename + result_of::value_of::type + value_type; + + typedef detail::apply_transform_result transform_type; + typedef typename mpl::apply::type type; + }; + }; + + // Binary Version + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename + result_of::value_of::type + value1_type; + typedef typename + result_of::value_of::type + value2_type; + + typedef detail::apply_transform_result transform_type; + typedef typename mpl::apply::type type; + }; + }; + } +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view/transform_view.hpp b/include/boost/fusion/view/transform_view/transform_view.hpp new file mode 100644 index 00000000..27ddc273 --- /dev/null +++ b/include/boost/fusion/view/transform_view/transform_view.hpp @@ -0,0 +1,99 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_TRANSFORM_VIEW_07162005_1037) +#define FUSION_TRANSFORM_VIEW_07162005_1037 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct void_; + struct transform_view_tag; + struct transform_view2_tag; + struct fusion_sequence_tag; + + // Binary Version + template + struct transform_view : sequence_base > + { + BOOST_STATIC_ASSERT(result_of::size::value == result_of::size::value); + typedef transform_view2_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + + typedef typename traits::category_of::type category1; + typedef typename traits::category_of::type category2; + typedef typename result_of::begin::type first1_type; + typedef typename result_of::begin::type first2_type; + typedef typename result_of::end::type last1_type; + typedef typename result_of::end::type last2_type; + typedef typename result_of::size::type size; + typedef Sequence1 sequence1_type; + typedef Sequence2 sequence2_type; + typedef F transform_type; + + transform_view(Sequence1& seq1, Sequence2& seq2, F const& binop) + : f(binop) + , seq1(seq1) + , seq2(seq2) + {} + + first1_type first1() const { return fusion::begin(seq1); } + first2_type first2() const { return fusion::begin(seq2); } + last1_type last1() const { return fusion::end(seq1); } + last2_type last2() const { return fusion::end(seq2); } + + transform_type f; + typename mpl::if_, Sequence1, Sequence1&>::type seq1; + typename mpl::if_, Sequence2, Sequence2&>::type seq2; + }; + + // Unary Version + template + struct transform_view : sequence_base > + { + typedef transform_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + + typedef typename traits::category_of::type category; + typedef typename result_of::begin::type first_type; + typedef typename result_of::end::type last_type; + typedef typename result_of::size::type size; + typedef Sequence sequence_type; + typedef F transform_type; + + transform_view(Sequence& seq, F const& f) + : seq(seq) + , f(f) + {} + + first_type first() const { return fusion::begin(seq); } + last_type last() const { return fusion::end(seq); } + typename mpl::if_, Sequence, Sequence&>::type seq; + transform_type f; + }; +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view/transform_view_fwd.hpp b/include/boost/fusion/view/transform_view/transform_view_fwd.hpp new file mode 100644 index 00000000..7dca304a --- /dev/null +++ b/include/boost/fusion/view/transform_view/transform_view_fwd.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_TRANSFORM_VIEW_FORWARD_01052006_1839) +#define FUSION_TRANSFORM_VIEW_FORWARD_01052006_1839 + +namespace boost { namespace fusion +{ + struct void_; + struct transform_view_tag; + struct transform_view2_tag; + + template + struct transform_view; +}} + +#endif + + diff --git a/include/boost/fusion/view/transform_view/transform_view_iterator.hpp b/include/boost/fusion/view/transform_view/transform_view_iterator.hpp new file mode 100644 index 00000000..bb4b6afd --- /dev/null +++ b/include/boost/fusion/view/transform_view/transform_view_iterator.hpp @@ -0,0 +1,69 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_TRANSFORM_VIEW_ITERATOR_07162005_1033) +#define FUSION_TRANSFORM_VIEW_ITERATOR_07162005_1033 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + // Unary Version + struct transform_view_iterator_tag; + + template + struct transform_view_iterator + : iterator_base > + { + typedef transform_view_iterator_tag fusion_tag; + typedef convert_iterator converter; + typedef typename converter::type first_type; + typedef typename traits::category_of::type category; + typedef F transform_type; + + transform_view_iterator(First const& first, F const& f) + : first(converter::call(first)), f(f) {} + + first_type first; + transform_type f; + }; + + // Binary Version + struct transform_view_iterator2_tag; + + template + struct transform_view_iterator2 + : iterator_base > + { + typedef transform_view_iterator2_tag fusion_tag; + typedef convert_iterator converter1; + typedef convert_iterator converter2; + typedef typename converter1::type first1_type; + typedef typename converter2::type first2_type; + typedef typename traits::category_of::type category; + typedef F transform_type; + + transform_view_iterator2(First1 const& first1, First2 const& first2, F const& f) + : first1(converter1::call(first1)), first2(converter2::call(first2)), f(f) {} + + first1_type first1; + first2_type first2; + transform_type f; + }; +}} + +#endif + diff --git a/include/boost/fusion/view/zip_view.hpp b/include/boost/fusion/view/zip_view.hpp new file mode 100644 index 00000000..f7a16ea0 --- /dev/null +++ b/include/boost/fusion/view/zip_view.hpp @@ -0,0 +1,14 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ZIP_VIEW_23012006_0811) +#define FUSION_ZIP_VIEW_23012006_0811 + +#include +#include + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/advance_impl.hpp b/include/boost/fusion/view/zip_view/detail/advance_impl.hpp new file mode 100644 index 00000000..9aa00deb --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/advance_impl.hpp @@ -0,0 +1,69 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ADVANCE_IMPL_20061024_2021) +#define FUSION_ADVANCE_IMPL_20061024_2021 + +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct zip_view_iterator_tag; + + namespace detail + { + template + struct poly_advance + { + template + struct result; + + template + struct result(It)> + { + typedef typename remove_reference::type it; + typedef typename result_of::advance::type type; + }; + + template + typename result::type + operator()(const It& it) const + { + return fusion::advance(it); + } + }; + } + + namespace extension + { + template + struct advance_impl; + + template<> + struct advance_impl + { + template + struct apply + { + typedef zip_view_iterator< + typename result_of::transform >::type> type; + + static type + call(It const& it) + { + return type( + fusion::transform(it.iterators_, detail::poly_advance())); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/at_impl.hpp b/include/boost/fusion/view/zip_view/detail/at_impl.hpp new file mode 100644 index 00000000..b01b8cfa --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/at_impl.hpp @@ -0,0 +1,92 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_AT_IMPL_20060124_1933) +#define FUSION_AT_IMPL_20060124_1933 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace boost { namespace fusion +{ + struct zip_view_tag; + + namespace detail + { + template + struct poly_at + { + template + struct result; + + template + struct result(SeqRef)> + : mpl::eval_if, + mpl::identity, + result_of::at::type, N> > + { + BOOST_MPL_ASSERT((is_reference)); + }; + + template + typename result::type + operator()(Seq& seq) const + { + return fusion::at(seq); + } + + template + typename result::type + operator()(Seq const& seq) const + { + return fusion::at(seq); + } + + unused_type operator()(unused_type const&) const + { + return unused_type(); + } + }; + } + + namespace extension + { + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply + { + typedef typename result_of::as_vector< + typename result_of::transform< + typename Seq::sequences, detail::poly_at >::type>::type type; + + static type + call(Seq& seq) + { + return type( + fusion::transform(seq.sequences_, detail::poly_at())); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/begin_impl.hpp b/include/boost/fusion/view/zip_view/detail/begin_impl.hpp new file mode 100644 index 00000000..674dea38 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/begin_impl.hpp @@ -0,0 +1,92 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_BEGIN_IMPL_20060123_2147) +#define FUSION_BEGIN_IMPL_20060123_2147 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct zip_view_tag; + + namespace detail + { + struct poly_begin + { + template + struct result; + + template + struct result + : mpl::eval_if, + mpl::identity, + result_of::begin::type> > + { + BOOST_MPL_ASSERT((is_reference)); + }; + + template + typename result::type + operator()(Seq& seq) const + { + return fusion::begin(seq); + } + + template + typename result::type + operator()(Seq const& seq) const + { + return fusion::begin(seq); + } + + unused_type operator()(unused_type const&) const + { + return unused_type(); + } + }; + } + + namespace extension + { + template + struct begin_impl; + + template<> + struct begin_impl + { + template + struct apply + { + typedef zip_view_iterator< + typename result_of::transform::type, + typename Sequence::category> type; + + static type + call(Sequence& sequence) + { + return type( + fusion::transform(sequence.sequences_, detail::poly_begin())); + } + }; + + + + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/deref_impl.hpp b/include/boost/fusion/view/zip_view/detail/deref_impl.hpp new file mode 100644 index 00000000..69cc8825 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/deref_impl.hpp @@ -0,0 +1,83 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DEREF_IMPL_20061024_1959) +#define FUSION_DEREF_IMPL_20061024_1959 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct zip_view_iterator_tag; + + namespace detail + { + struct poly_deref + { + template + struct result; + + template + struct result + { + typedef typename remove_const< + typename remove_reference::type>::type it; + + typedef typename mpl::eval_if, + mpl::identity, + result_of::deref >::type type; + }; + + template + typename result::type + operator()(const It& it) const + { + return fusion::deref(it); + } + + unused_type operator()(unused_type const&) const + { + return unused_type(); + } + }; + } + + namespace extension + { + template + struct deref_impl; + + template<> + struct deref_impl + { + template + struct apply + { + typedef typename result_of::as_vector< + typename result_of::transform::type>::type type; + + static type + call(It const& it) + { + return type( + fusion::transform(it.iterators_, detail::poly_deref())); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/distance_impl.hpp b/include/boost/fusion/view/zip_view/detail/distance_impl.hpp new file mode 100644 index 00000000..61447278 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/distance_impl.hpp @@ -0,0 +1,82 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_DISTANCE_IMPL_20060124_2033) +#define FUSION_DISTANCE_IMPL_20060124_2033 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct zip_view_iterator_tag; + + struct random_access_iterator_tag; + + namespace detail + { + template + struct best_distance + { + typedef typename result_of::find_if< + typename SearchIt::iterators, is_same, random_access_iterator_tag> > finder; + + BOOST_MPL_ASSERT_NOT((is_same >)); + + typedef typename result_of::distance::type type; + }; + + template + struct default_distance + : result_of::distance< + typename result_of::value_at_c::type, + typename result_of::value_at_c::type> + {}; + + template + struct zip_view_iterator_distance + { + typedef typename result_of::find_if< + typename It1::iterators, is_same, random_access_iterator_tag> > finder; + + typedef typename mpl::eval_if< + is_same::type>, + detail::default_distance , + detail::best_distance >::type type; + }; + } + + namespace extension + { + template + struct distance_impl; + + template<> + struct distance_impl + { + template + struct apply + : detail::zip_view_iterator_distance::type + { + static typename detail::zip_view_iterator_distance::type + call(It1 const& it1, It2 const& it2) + { + return typename detail::zip_view_iterator_distance::type(); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/end_impl.hpp b/include/boost/fusion/view/zip_view/detail/end_impl.hpp new file mode 100644 index 00000000..fa9c31db --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/end_impl.hpp @@ -0,0 +1,103 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_END_IMPL_20060123_2208) +#define FUSION_END_IMPL_20060123_2208 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace boost { namespace fusion { + + struct zip_view_tag; + + namespace detail + { + template + struct get_endpoint + { + typedef typename remove_reference::type Seq; + typedef typename result_of::begin::type begin; + typedef typename result_of::advance::type type; + }; + + template + struct endpoints + { + template + struct result; + + template + struct result(SeqRef)> + : mpl::eval_if, + mpl::identity, + get_endpoint > + { + BOOST_MPL_ASSERT((is_reference)); + }; + + template + typename result::type + operator()(Seq& seq) const + { + return fusion::advance(fusion::begin(seq)); + } + + template + typename result::type + operator()(Seq const& seq) + { + return fusion::advance(fusion::begin(seq)); + } + + unused_type operator()(unused_type const&) const + { + return unused_type(); + } + }; + } + + namespace extension + { + template + struct end_impl; + + template<> + struct end_impl + { + template + struct apply + { + typedef zip_view_iterator< + typename result_of::transform >::type, + typename Sequence::category> type; + + static type + call(Sequence& sequence) + { + return type( + fusion::transform(sequence.sequences_, detail::endpoints())); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/equal_to_impl.hpp b/include/boost/fusion/view/zip_view/detail/equal_to_impl.hpp new file mode 100644 index 00000000..c3962a63 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/equal_to_impl.hpp @@ -0,0 +1,62 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_EQUAL_TO_IMPL_20060128_1423) +#define FUSION_EQUAL_TO_IMPL_20060128_1423 + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +namespace boost { namespace fusion { + + struct zip_view_iterator_tag; + + namespace detail + { + template + struct zip_iterators_equal + { + typedef mpl::zip_view > zipped; + typedef mpl::transform_view > > transformed; + + typedef typename mpl::find_if >::type found; + + typedef typename is_same::type, found>::type type; + }; + } + + namespace extension + { + template + struct equal_to_impl; + + template<> + struct equal_to_impl + { + template + struct apply + : detail::zip_iterators_equal::type + {}; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/next_impl.hpp b/include/boost/fusion/view/zip_view/detail/next_impl.hpp new file mode 100644 index 00000000..1c9c0245 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/next_impl.hpp @@ -0,0 +1,83 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_NEXT_IMPL_20060124_2006) +#define FUSION_NEXT_IMPL_20060124_2006 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct zip_view_iterator_tag; + + namespace detail + { + struct poly_next + { + template + struct result; + + template + struct result + { + typedef typename remove_const< + typename remove_reference::type>::type it; + + typedef typename mpl::eval_if, + mpl::identity, + result_of::next >::type type; + }; + + template + typename result::type + operator()(const It& it) const + { + return fusion::next(it); + } + + unused_type operator()(unused_type const&) const + { + return unused_type(); + } + }; + } + + namespace extension + { + template + struct next_impl; + + template<> + struct next_impl + { + template + struct apply + { + typedef fusion::zip_view_iterator< + typename result_of::transform::type, + typename Iterator::category> type; + + static type + call(Iterator const& it) + { + return type( + fusion::transform(it.iterators_, detail::poly_next())); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/prior_impl.hpp b/include/boost/fusion/view/zip_view/detail/prior_impl.hpp new file mode 100644 index 00000000..49b99397 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/prior_impl.hpp @@ -0,0 +1,83 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_PRIOR_IMPL_20060124_2006) +#define FUSION_PRIOR_IMPL_20060124_2006 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct zip_view_iterator_tag; + + namespace detail + { + struct poly_prior + { + template + struct result; + + template + struct result + { + typedef typename remove_const< + typename remove_reference::type>::type it; + typedef typename mpl::eval_if, + mpl::identity, + result_of::prior >::type type; + }; + + template + typename result::type + operator()(const It& it) const + { + return fusion::prior(it); + } + + unused_type operator()(unused_type const&) const + { + return unused_type(); + } + }; + } + + namespace extension + { + template + struct prior_impl; + + template<> + struct prior_impl + { + template + struct apply + { + typedef zip_view_iterator< + typename result_of::transform::type, + typename Iterator::category> type; + + static type + call(Iterator const& it) + + { + return type( + fusion::transform(it.iterators_, detail::poly_prior())); + } + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/size_impl.hpp b/include/boost/fusion/view/zip_view/detail/size_impl.hpp new file mode 100644 index 00000000..70798d28 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/size_impl.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SIZE_IMPL_20060124_0800) +#define FUSION_SIZE_IMPL_20060124_0800 + +namespace boost { namespace fusion { + + struct zip_view_tag; + + namespace extension + { + template + struct size; + + template + struct size_impl; + + template<> + struct size_impl + { + template + struct apply + { + typedef typename Sequence::size type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/strictest_traversal.hpp b/include/boost/fusion/view/zip_view/detail/strictest_traversal.hpp new file mode 100644 index 00000000..e74ffbfc --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/strictest_traversal.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_STRICTEST_TRAVERSAL_20060123_2101) +#define FUSION_STRICTEST_TRAVERSAL_20060123_2101 + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct forward_traversal_tag; + struct bidirectional_traversal_tag; + struct random_access_traversal_tag; + + namespace detail + { + template::value> + struct stricter_traversal + { + typedef Tag1 type; + }; + + template + struct stricter_traversal + { + typedef Tag2 type; + }; + + struct strictest_traversal_impl + { + template + struct result; + + template + struct result + { + typedef typename remove_reference::type next_value; + typedef typename remove_reference::type strictest_so_far; + + typedef strictest_so_far tag1; + typedef typename traits::category_of::type tag2; + + typedef typename stricter_traversal::type type; + }; + }; + + template + struct strictest_traversal + : result_of::fold< + Sequence, fusion::random_access_traversal_tag, + strictest_traversal_impl> + {}; + + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/value_at_impl.hpp b/include/boost/fusion/view/zip_view/detail/value_at_impl.hpp new file mode 100644 index 00000000..7905b063 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/value_at_impl.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_AT_IMPL_20060124_2129) +#define FUSION_VALUE_AT_IMPL_20060124_2129 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { + + struct zip_view_tag; + + namespace detail + { + template + struct poly_value_at + { + template + struct result; + + template + struct result(Seq)> + : mpl::eval_if, + mpl::identity, + result_of::value_at::type, N> > + {}; + }; + } + + namespace extension + { + template + struct value_at_impl; + + template<> + struct value_at_impl + { + template + struct apply + { + typedef typename result_of::transform< + typename Sequence::sequences, + detail::poly_value_at >::type values; + typedef typename result_of::as_vector::type type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/detail/value_of_impl.hpp b/include/boost/fusion/view/zip_view/detail/value_of_impl.hpp new file mode 100644 index 00000000..4ba4c3c5 --- /dev/null +++ b/include/boost/fusion/view/zip_view/detail/value_of_impl.hpp @@ -0,0 +1,61 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_VALUE_OF_IMPL_20060124_2147) +#define FUSION_VALUE_OF_IMPL_20060124_2147 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct zip_view_iterator_tag; + + namespace detail + { + struct poly_value_of + { + template + struct result; + + template + struct result + : mpl::eval_if, + mpl::identity, + result_of::value_of > + {}; + }; + } + + namespace extension + { + template + struct value_of_impl; + + template<> + struct value_of_impl + { + template + struct apply + { + typedef typename result_of::transform< + typename Iterator::iterators, + detail::poly_value_of>::type values; + + typedef typename result_of::as_vector::type type; + }; + }; + } +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/zip_view.hpp b/include/boost/fusion/view/zip_view/zip_view.hpp new file mode 100644 index 00000000..5f152eb0 --- /dev/null +++ b/include/boost/fusion/view/zip_view/zip_view.hpp @@ -0,0 +1,115 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ZIP_VIEW_23012006_0813) +#define FUSION_ZIP_VIEW_23012006_0813 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace boost { namespace fusion { + + namespace detail + { + template + struct all_references + : fusion::result_of::equal_to > >::type, typename fusion::result_of::end::type> + {}; + + struct seq_ref_size + { + template + struct result; + + template + struct result + { + static int const high_int = static_cast( + (static_cast(~0) >> 1) - 1); + + typedef typename remove_reference::type SeqClass; + + typedef typename mpl::eval_if< + traits::is_forward, + result_of::size, + mpl::int_ >::type type; + }; + }; + + struct poly_min + { + template + struct result; + + template + struct result + { + typedef typename remove_reference::type lhs; + typedef typename remove_reference::type rhs; + typedef typename mpl::min::type type; + }; + }; + + template + struct min_size + { + typedef typename result_of::transform::type sizes; + typedef typename result_of::fold::type, detail::poly_min>::type type; + }; + } + + struct zip_view_tag; + struct fusion_sequence_tag; + + template + struct zip_view : sequence_base< zip_view > + { + typedef typename result_of::remove::type real_sequences; + BOOST_MPL_ASSERT((detail::all_references)); + typedef typename detail::strictest_traversal::type category; + typedef zip_view_tag fusion_tag; + typedef fusion_sequence_tag tag; // this gets picked up by MPL + typedef mpl::true_ is_view; + typedef typename fusion::result_of::as_vector::type sequences; + typedef typename detail::min_size::type size; + + zip_view( + const Sequences& seqs) + : sequences_(seqs) + {}; + + sequences sequences_; + }; +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/zip_view_iterator.hpp b/include/boost/fusion/view/zip_view/zip_view_iterator.hpp new file mode 100644 index 00000000..66b514dc --- /dev/null +++ b/include/boost/fusion/view/zip_view/zip_view_iterator.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ZIP_VIEW_ITERATOR_23012006_0814) +#define FUSION_ZIP_VIEW_ITERATOR_23012006_0814 + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace boost { namespace fusion { + + struct zip_view_iterator_tag; + + template< + typename IteratorSequence, + typename Traversal> + struct zip_view_iterator + : iterator_base > + { + typedef zip_view_iterator_tag fusion_tag; + typedef Traversal category; + + template + zip_view_iterator( + const InitSeq& iterator_seq) + : iterators_(iterator_seq) + {} + + typedef typename result_of::as_vector::type iterators; + iterators iterators_; + }; +}} + +#endif diff --git a/include/boost/fusion/view/zip_view/zip_view_iterator_fwd.hpp b/include/boost/fusion/view/zip_view/zip_view_iterator_fwd.hpp new file mode 100644 index 00000000..6edf4d68 --- /dev/null +++ b/include/boost/fusion/view/zip_view/zip_view_iterator_fwd.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_ZIP_VIEW_ITERATOR_FWD) +#define FUSION_ZIP_VIEW_ITERATOR_FWD + +#include + +namespace boost { namespace fusion { + + template< + typename IteratorSequence, + typename Traversal = typename detail::strictest_traversal::type> + struct zip_view_iterator; + +}} + +#endif