From 5f024c18caf2516ff4d41d519a1d5fa2df4acae9 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sat, 20 Oct 2007 23:43:20 +0000 Subject: [PATCH 01/14] Created folder remotely [SVN r40225] --- .gitattributes | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..3e84d7c7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,96 @@ +* text=auto !eol svneol=native#text/plain +*.gitattributes text svneol=native#text/plain + +# Scriptish formats +*.bat text svneol=native#text/plain +*.bsh text svneol=native#text/x-beanshell +*.cgi text svneol=native#text/plain +*.cmd text svneol=native#text/plain +*.js text svneol=native#text/javascript +*.php text svneol=native#text/x-php +*.pl text svneol=native#text/x-perl +*.pm text svneol=native#text/x-perl +*.py text svneol=native#text/x-python +*.sh eol=lf svneol=LF#text/x-sh +configure eol=lf svneol=LF#text/x-sh + +# Image formats +*.bmp binary svneol=unset#image/bmp +*.gif binary svneol=unset#image/gif +*.ico binary svneol=unset#image/ico +*.jpeg binary svneol=unset#image/jpeg +*.jpg binary svneol=unset#image/jpeg +*.png binary svneol=unset#image/png +*.tif binary svneol=unset#image/tiff +*.tiff binary svneol=unset#image/tiff +*.svg text svneol=native#image/svg%2Bxml + +# Data formats +*.pdf binary svneol=unset#application/pdf +*.avi binary svneol=unset#video/avi +*.doc binary svneol=unset#application/msword +*.dsp text svneol=crlf#text/plain +*.dsw text svneol=crlf#text/plain +*.eps binary svneol=unset#application/postscript +*.gz binary svneol=unset#application/gzip +*.mov binary svneol=unset#video/quicktime +*.mp3 binary svneol=unset#audio/mpeg +*.ppt binary svneol=unset#application/vnd.ms-powerpoint +*.ps binary svneol=unset#application/postscript +*.psd binary svneol=unset#application/photoshop +*.rdf binary svneol=unset#text/rdf +*.rss text svneol=unset#text/xml +*.rtf binary svneol=unset#text/rtf +*.sln text svneol=native#text/plain +*.swf binary svneol=unset#application/x-shockwave-flash +*.tgz binary svneol=unset#application/gzip +*.vcproj text svneol=native#text/xml +*.vcxproj text svneol=native#text/xml +*.vsprops text svneol=native#text/xml +*.wav binary svneol=unset#audio/wav +*.xls binary svneol=unset#application/vnd.ms-excel +*.zip binary svneol=unset#application/zip + +# Text formats +.htaccess text svneol=native#text/plain +*.bbk text svneol=native#text/xml +*.cmake text svneol=native#text/plain +*.css text svneol=native#text/css +*.dtd text svneol=native#text/xml +*.htm text svneol=native#text/html +*.html text svneol=native#text/html +*.ini text svneol=native#text/plain +*.log text svneol=native#text/plain +*.mak text svneol=native#text/plain +*.qbk text svneol=native#text/plain +*.rst text svneol=native#text/plain +*.sql text svneol=native#text/x-sql +*.txt text svneol=native#text/plain +*.xhtml text svneol=native#text/xhtml%2Bxml +*.xml text svneol=native#text/xml +*.xsd text svneol=native#text/xml +*.xsl text svneol=native#text/xml +*.xslt text svneol=native#text/xml +*.xul text svneol=native#text/xul +*.yml text svneol=native#text/plain +boost-no-inspect text svneol=native#text/plain +CHANGES text svneol=native#text/plain +COPYING text svneol=native#text/plain +INSTALL text svneol=native#text/plain +Jamfile text svneol=native#text/plain +Jamroot text svneol=native#text/plain +Jamfile.v2 text svneol=native#text/plain +Jamrules text svneol=native#text/plain +Makefile* text svneol=native#text/plain +README text svneol=native#text/plain +TODO text svneol=native#text/plain + +# Code formats +*.c text svneol=native#text/plain +*.cpp text svneol=native#text/plain +*.h text svneol=native#text/plain +*.hpp text svneol=native#text/plain +*.ipp text svneol=native#text/plain +*.tpp text svneol=native#text/plain +*.jam text svneol=native#text/plain +*.java text svneol=native#text/plain From 13b01b0bfe58728ed1b5f0713235df91b0406d09 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sat, 20 Oct 2007 23:49:46 +0000 Subject: [PATCH 02/14] Removed file/folder [SVN r40230] --- 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 | 107 ---- .../algorithm/transformation/erase_key.hpp | 37 -- .../algorithm/transformation/filter.hpp | 34 -- .../algorithm/transformation/filter_if.hpp | 32 -- .../algorithm/transformation/insert.hpp | 62 --- .../algorithm/transformation/insert_range.hpp | 54 -- .../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/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 | 56 -- .../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 | 15 - include/boost/fusion/sequence.hpp | 20 - include/boost/fusion/sequence/adapted.hpp | 17 - .../boost/fusion/sequence/adapted/array.hpp | 22 - .../sequence/adapted/array/array_iterator.hpp | 107 ---- .../sequence/adapted/array/detail/at_impl.hpp | 45 -- .../adapted/array/detail/begin_impl.hpp | 40 -- .../adapted/array/detail/category_of_impl.hpp | 35 -- .../adapted/array/detail/end_impl.hpp | 40 -- .../adapted/array/detail/is_sequence_impl.hpp | 31 -- .../adapted/array/detail/is_view_impl.hpp | 32 -- .../adapted/array/detail/size_impl.hpp | 29 - .../adapted/array/detail/value_at_impl.hpp | 32 -- .../fusion/sequence/adapted/array/tag_of.hpp | 35 -- .../fusion/sequence/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 - .../sequence/adapted/boost_tuple/tag_of.hpp | 55 -- include/boost/fusion/sequence/adapted/mpl.hpp | 21 - .../sequence/adapted/mpl/detail/at_impl.hpp | 40 -- .../adapted/mpl/detail/begin_impl.hpp | 45 -- .../adapted/mpl/detail/category_of_impl.hpp | 54 -- .../adapted/mpl/detail/empty_impl.hpp | 28 - .../sequence/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 -- .../sequence/adapted/mpl/detail/size_impl.hpp | 31 -- .../adapted/mpl/detail/value_at_impl.hpp | 31 -- .../sequence/adapted/mpl/mpl_iterator.hpp | 113 ---- .../fusion/sequence/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 ----- .../sequence/adapted/std_pair/tag_of.hpp | 29 - .../boost/fusion/sequence/adapted/struct.hpp | 23 - .../adapted/struct/adapt_assoc_struct.hpp | 94 ---- .../sequence/adapted/struct/adapt_struct.hpp | 75 --- .../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 -- .../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 -- .../sequence/adapted/struct/extension.hpp | 68 --- .../adapted/struct/struct_iterator.hpp | 103 ---- .../boost/fusion/sequence/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 -- .../sequence/adapted/variant/tag_of.hpp | 28 - .../adapted/variant/variant_iterator.hpp | 117 ---- 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/container.hpp | 16 - .../boost/fusion/sequence/container/deque.hpp | 14 - .../container/deque/back_extended_deque.hpp | 37 -- .../fusion/sequence/container/deque/deque.hpp | 93 ---- .../sequence/container/deque/deque_fwd.hpp | 24 - .../container/deque/deque_iterator.hpp | 106 ---- .../container/deque/detail/at_impl.hpp | 59 -- .../container/deque/detail/begin_impl.hpp | 46 -- .../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 -- .../sequence/container/deque/limits.hpp | 15 - .../fusion/sequence/container/ext_/tree.hpp | 130 ----- .../boost/fusion/sequence/container/list.hpp | 16 - .../fusion/sequence/container/list/cons.hpp | 143 ----- .../sequence/container/list/cons_iterator.hpp | 85 --- .../container/list/detail/at_impl.hpp | 79 --- .../container/list/detail/begin_impl.hpp | 49 -- .../container/list/detail/deref_impl.hpp | 52 -- .../container/list/detail/empty_impl.hpp | 37 -- .../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 -- .../fusion/sequence/container/list/limits.hpp | 19 - .../fusion/sequence/container/list/list.hpp | 68 --- .../sequence/container/list/list_fwd.hpp | 24 - .../boost/fusion/sequence/container/map.hpp | 14 - .../container/map/detail/at_key_impl.hpp | 49 -- .../container/map/detail/begin_impl.hpp | 56 -- .../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 | 129 ----- .../map/detail/value_at_key_impl.hpp | 33 -- .../fusion/sequence/container/map/limits.hpp | 25 - .../fusion/sequence/container/map/map.hpp | 71 --- .../fusion/sequence/container/map/map_fwd.hpp | 24 - .../boost/fusion/sequence/container/set.hpp | 14 - .../container/set/detail/at_key_impl.hpp | 49 -- .../container/set/detail/begin_impl.hpp | 56 -- .../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 | 129 ----- .../set/detail/value_at_key_impl.hpp | 35 -- .../fusion/sequence/container/set/limits.hpp | 25 - .../fusion/sequence/container/set/set.hpp | 71 --- .../fusion/sequence/container/set/set_fwd.hpp | 24 - .../fusion/sequence/container/vector.hpp | 20 - .../container/vector/detail/advance_impl.hpp | 42 -- .../container/vector/detail/at_impl.hpp | 49 -- .../container/vector/detail/begin_impl.hpp | 39 -- .../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 ---- .../sequence/container/vector/limits.hpp | 19 - .../sequence/container/vector/vector.hpp | 152 ----- .../sequence/container/vector/vector10.hpp | 66 --- .../sequence/container/vector/vector20.hpp | 50 -- .../sequence/container/vector/vector30.hpp | 50 -- .../sequence/container/vector/vector40.hpp | 50 -- .../sequence/container/vector/vector50.hpp | 50 -- .../sequence/container/vector/vector_fwd.hpp | 25 - .../container/vector/vector_iterator.hpp | 46 -- include/boost/fusion/sequence/conversion.hpp | 16 - .../fusion/sequence/conversion/as_deque.hpp | 47 -- .../fusion/sequence/conversion/as_list.hpp | 55 -- .../fusion/sequence/conversion/as_map.hpp | 46 -- .../fusion/sequence/conversion/as_set.hpp | 46 -- .../fusion/sequence/conversion/as_vector.hpp | 46 -- .../sequence/conversion/detail/as_deque.hpp | 102 ---- .../sequence/conversion/detail/as_map.hpp | 101 ---- .../sequence/conversion/detail/as_set.hpp | 101 ---- .../sequence/conversion/detail/as_vector.hpp | 101 ---- .../sequence/conversion/detail/build_cons.hpp | 57 -- 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 | 23 - .../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/mpl.hpp | 28 - .../fusion/sequence/intrinsic/mpl/at.hpp | 33 -- .../fusion/sequence/intrinsic/mpl/back.hpp | 32 -- .../fusion/sequence/intrinsic/mpl/begin.hpp | 31 -- .../fusion/sequence/intrinsic/mpl/clear.hpp | 33 -- .../sequence/intrinsic/mpl/detail/as.hpp | 80 --- .../sequence/intrinsic/mpl/detail/clear.hpp | 46 -- .../fusion/sequence/intrinsic/mpl/empty.hpp | 26 - .../fusion/sequence/intrinsic/mpl/end.hpp | 31 -- .../fusion/sequence/intrinsic/mpl/erase.hpp | 38 -- .../sequence/intrinsic/mpl/erase_key.hpp | 38 -- .../fusion/sequence/intrinsic/mpl/front.hpp | 28 - .../fusion/sequence/intrinsic/mpl/has_key.hpp | 27 - .../fusion/sequence/intrinsic/mpl/insert.hpp | 38 -- .../sequence/intrinsic/mpl/insert_range.hpp | 38 -- .../sequence/intrinsic/mpl/pop_back.hpp | 38 -- .../sequence/intrinsic/mpl/pop_front.hpp | 38 -- .../sequence/intrinsic/mpl/push_back.hpp | 38 -- .../sequence/intrinsic/mpl/push_front.hpp | 38 -- .../fusion/sequence/intrinsic/mpl/size.hpp | 26 - .../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/sequence/view.hpp | 17 - .../sequence/view/ext_/multiple_view.hpp | 178 ------ .../sequence/view/ext_/segmented_iterator.hpp | 425 -------------- .../view/ext_/segmented_iterator_range.hpp | 522 ------------------ .../fusion/sequence/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 - .../sequence/view/filter_view/filter_view.hpp | 51 -- .../view/filter_view/filter_view_iterator.hpp | 47 -- .../fusion/sequence/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 | 49 -- .../boost/fusion/sequence/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 - .../sequence/view/joint_view/joint_view.hpp | 61 -- .../view/joint_view/joint_view_iterator.hpp | 51 -- .../fusion/sequence/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 | 50 -- .../fusion/sequence/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 -- .../view/reverse_view/reverse_view.hpp | 58 -- .../reverse_view/reverse_view_iterator.hpp | 48 -- .../fusion/sequence/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 -- .../sequence/view/single_view/single_view.hpp | 54 -- .../view/single_view/single_view_iterator.hpp | 47 -- .../fusion/sequence/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 | 68 --- .../boost/fusion/sequence/view/zip_view.hpp | 14 - .../view/zip_view/detail/advance_impl.hpp | 69 --- .../sequence/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 --- .../view/zip_view/detail/end_impl.hpp | 103 ---- .../view/zip_view/detail/equal_to_impl.hpp | 62 --- .../view/zip_view/detail/next_impl.hpp | 83 --- .../view/zip_view/detail/prior_impl.hpp | 83 --- .../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 -- .../sequence/view/zip_view/zip_view.hpp | 115 ---- .../view/zip_view/zip_view_iterator.hpp | 47 -- .../view/zip_view/zip_view_iterator_fwd.hpp | 22 - 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/compiler_config.hpp | 17 - .../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 | 33 -- include/boost/fusion/support/pair.hpp | 103 ---- .../boost/fusion/support/sequence_base.hpp | 46 -- 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 | 8 - 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 -- 474 files changed, 25526 deletions(-) delete mode 100644 include/boost/fusion/algorithm.hpp delete mode 100644 include/boost/fusion/algorithm/iteration.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/accumulate.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/detail/fold.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/detail/for_each.hpp delete mode 100755 include/boost/fusion/algorithm/iteration/ext_/for_each_s.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/fold.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/for_each.hpp delete mode 100644 include/boost/fusion/algorithm/query.hpp delete mode 100644 include/boost/fusion/algorithm/query/all.hpp delete mode 100644 include/boost/fusion/algorithm/query/any.hpp delete mode 100644 include/boost/fusion/algorithm/query/count.hpp delete mode 100644 include/boost/fusion/algorithm/query/count_if.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/all.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/any.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/assoc_find.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/count.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/count_if.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/find_if.hpp delete mode 100755 include/boost/fusion/algorithm/query/ext_/find_if_s.hpp delete mode 100644 include/boost/fusion/algorithm/query/find.hpp delete mode 100644 include/boost/fusion/algorithm/query/find_if.hpp delete mode 100644 include/boost/fusion/algorithm/query/none.hpp delete mode 100644 include/boost/fusion/algorithm/transformation.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/clear.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/detail/replace.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/detail/replace_if.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/erase.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/erase_key.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/filter.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/filter_if.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/insert.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/insert_range.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/join.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/pop_back.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/pop_front.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/push_back.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/push_front.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/remove.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/remove_if.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/replace.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/replace_if.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/reverse.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/transform.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/zip.hpp delete mode 100644 include/boost/fusion/functional.hpp delete mode 100644 include/boost/fusion/functional/adapter.hpp delete mode 100644 include/boost/fusion/functional/adapter/detail/access.hpp delete mode 100644 include/boost/fusion/functional/adapter/detail/pow2_explode.hpp delete mode 100644 include/boost/fusion/functional/adapter/detail/pt_def.hpp delete mode 100644 include/boost/fusion/functional/adapter/detail/pt_undef.hpp delete mode 100644 include/boost/fusion/functional/adapter/fused.hpp delete mode 100644 include/boost/fusion/functional/adapter/fused_function_object.hpp delete mode 100644 include/boost/fusion/functional/adapter/fused_procedure.hpp delete mode 100644 include/boost/fusion/functional/adapter/limits.hpp delete mode 100644 include/boost/fusion/functional/adapter/unfused_generic.hpp delete mode 100644 include/boost/fusion/functional/adapter/unfused_lvalue_args.hpp delete mode 100644 include/boost/fusion/functional/adapter/unfused_rvalue_args.hpp delete mode 100644 include/boost/fusion/functional/adapter/unfused_typed.hpp delete mode 100644 include/boost/fusion/functional/generation.hpp delete mode 100644 include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp delete mode 100644 include/boost/fusion/functional/generation/make_fused.hpp delete mode 100644 include/boost/fusion/functional/generation/make_fused_function_object.hpp delete mode 100644 include/boost/fusion/functional/generation/make_fused_procedure.hpp delete mode 100644 include/boost/fusion/functional/generation/make_unfused_generic.hpp delete mode 100644 include/boost/fusion/functional/generation/make_unfused_lvalue_args.hpp delete mode 100644 include/boost/fusion/functional/generation/make_unfused_rvalue_args.hpp delete mode 100644 include/boost/fusion/functional/invocation.hpp delete mode 100644 include/boost/fusion/functional/invocation/detail/that_ptr.hpp delete mode 100644 include/boost/fusion/functional/invocation/invoke.hpp delete mode 100644 include/boost/fusion/functional/invocation/invoke_function_object.hpp delete mode 100644 include/boost/fusion/functional/invocation/invoke_procedure.hpp delete mode 100644 include/boost/fusion/functional/invocation/limits.hpp delete mode 100644 include/boost/fusion/include/adapt_struct.hpp delete mode 100644 include/boost/fusion/include/any.hpp delete mode 100644 include/boost/fusion/include/as_vector.hpp delete mode 100644 include/boost/fusion/include/at.hpp delete mode 100644 include/boost/fusion/include/begin.hpp delete mode 100644 include/boost/fusion/include/deref.hpp delete mode 100644 include/boost/fusion/include/end.hpp delete mode 100644 include/boost/fusion/include/equal_to.hpp delete mode 100644 include/boost/fusion/include/filter_if.hpp delete mode 100644 include/boost/fusion/include/for_each.hpp delete mode 100644 include/boost/fusion/include/io.hpp delete mode 100644 include/boost/fusion/include/is_sequence.hpp delete mode 100644 include/boost/fusion/include/join.hpp delete mode 100644 include/boost/fusion/include/joint_view.hpp delete mode 100644 include/boost/fusion/include/list.hpp delete mode 100644 include/boost/fusion/include/make_cons.hpp delete mode 100644 include/boost/fusion/include/make_vector.hpp delete mode 100644 include/boost/fusion/include/mpl.hpp delete mode 100644 include/boost/fusion/include/next.hpp delete mode 100644 include/boost/fusion/include/push_front.hpp delete mode 100644 include/boost/fusion/include/single_view.hpp delete mode 100644 include/boost/fusion/include/std_pair.hpp delete mode 100644 include/boost/fusion/include/swap.hpp delete mode 100644 include/boost/fusion/include/transform.hpp delete mode 100644 include/boost/fusion/include/transform_view.hpp delete mode 100644 include/boost/fusion/include/value_at.hpp delete mode 100644 include/boost/fusion/include/value_of.hpp delete mode 100644 include/boost/fusion/include/variant.hpp delete mode 100644 include/boost/fusion/include/vector.hpp delete mode 100644 include/boost/fusion/include/vector_tie.hpp delete mode 100644 include/boost/fusion/iterator.hpp delete mode 100644 include/boost/fusion/iterator/advance.hpp delete mode 100644 include/boost/fusion/iterator/deref.hpp delete mode 100644 include/boost/fusion/iterator/detail/adapt_deref_traits.hpp delete mode 100644 include/boost/fusion/iterator/detail/adapt_value_traits.hpp delete mode 100644 include/boost/fusion/iterator/detail/advance.hpp delete mode 100644 include/boost/fusion/iterator/detail/distance.hpp delete mode 100644 include/boost/fusion/iterator/distance.hpp delete mode 100644 include/boost/fusion/iterator/equal_to.hpp delete mode 100644 include/boost/fusion/iterator/iterator_facade.hpp delete mode 100644 include/boost/fusion/iterator/mpl.hpp delete mode 100644 include/boost/fusion/iterator/mpl/convert_iterator.hpp delete mode 100644 include/boost/fusion/iterator/mpl/fusion_iterator.hpp delete mode 100644 include/boost/fusion/iterator/next.hpp delete mode 100644 include/boost/fusion/iterator/prior.hpp delete mode 100644 include/boost/fusion/iterator/value_of.hpp delete mode 100644 include/boost/fusion/mpl.hpp delete mode 100644 include/boost/fusion/sequence.hpp delete mode 100644 include/boost/fusion/sequence/adapted.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/array_iterator.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/detail/size_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/array/tag_of.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/boost_tuple_iterator.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/detail/size_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/boost_tuple/tag_of.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/empty_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/has_key_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/size_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/mpl/mpl_iterator.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/detail/size_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/std_pair_iterator.hpp delete mode 100644 include/boost/fusion/sequence/adapted/std_pair/tag_of.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/adapt_assoc_struct.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/adapt_struct.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/at_key_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/has_key_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/size_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/detail/value_at_key_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/extension.hpp delete mode 100644 include/boost/fusion/sequence/adapted/struct/struct_iterator.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant/detail/size_impl.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant/tag_of.hpp delete mode 100644 include/boost/fusion/sequence/adapted/variant/variant_iterator.hpp delete mode 100644 include/boost/fusion/sequence/comparison.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/enable_comparison.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/equal_to.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/greater.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/greater_equal.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/less.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/less_equal.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp delete mode 100644 include/boost/fusion/sequence/comparison/equal_to.hpp delete mode 100644 include/boost/fusion/sequence/comparison/greater.hpp delete mode 100644 include/boost/fusion/sequence/comparison/greater_equal.hpp delete mode 100644 include/boost/fusion/sequence/comparison/less.hpp delete mode 100644 include/boost/fusion/sequence/comparison/less_equal.hpp delete mode 100644 include/boost/fusion/sequence/comparison/not_equal_to.hpp delete mode 100644 include/boost/fusion/sequence/container.hpp delete mode 100644 include/boost/fusion/sequence/container/deque.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/back_extended_deque.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/deque.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/deque_fwd.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/deque_iterator.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/deque_forward_ctor.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/deque_initial_size.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/deque_keyed_values.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/deque_keyed_values_call.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/keyed_element.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/front_extended_deque.hpp delete mode 100644 include/boost/fusion/sequence/container/deque/limits.hpp delete mode 100755 include/boost/fusion/sequence/container/ext_/tree.hpp delete mode 100644 include/boost/fusion/sequence/container/list.hpp delete mode 100644 include/boost/fusion/sequence/container/list/cons.hpp delete mode 100644 include/boost/fusion/sequence/container/list/cons_iterator.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/empty_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/list_forward_ctor.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/list_to_cons.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/list_to_cons_call.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/list/limits.hpp delete mode 100644 include/boost/fusion/sequence/container/list/list.hpp delete mode 100644 include/boost/fusion/sequence/container/list/list_fwd.hpp delete mode 100644 include/boost/fusion/sequence/container/map.hpp delete mode 100644 include/boost/fusion/sequence/container/map/detail/at_key_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/map/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/map/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/map/detail/lookup_key.hpp delete mode 100644 include/boost/fusion/sequence/container/map/detail/map_forward_ctor.hpp delete mode 100644 include/boost/fusion/sequence/container/map/detail/map_lookup.hpp delete mode 100644 include/boost/fusion/sequence/container/map/detail/value_at_key_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/map/limits.hpp delete mode 100644 include/boost/fusion/sequence/container/map/map.hpp delete mode 100644 include/boost/fusion/sequence/container/map/map_fwd.hpp delete mode 100644 include/boost/fusion/sequence/container/set.hpp delete mode 100644 include/boost/fusion/sequence/container/set/detail/at_key_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/set/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/set/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/set/detail/lookup_key.hpp delete mode 100644 include/boost/fusion/sequence/container/set/detail/set_forward_ctor.hpp delete mode 100644 include/boost/fusion/sequence/container/set/detail/set_lookup.hpp delete mode 100644 include/boost/fusion/sequence/container/set/detail/value_at_key_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/set/limits.hpp delete mode 100644 include/boost/fusion/sequence/container/set/set.hpp delete mode 100644 include/boost/fusion/sequence/container/set/set_fwd.hpp delete mode 100644 include/boost/fusion/sequence/container/vector.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/advance_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/distance_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/prior_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/vector_forward_ctor.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/vector_n.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/detail/vector_n_chooser.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/limits.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/vector.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/vector10.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/vector20.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/vector30.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/vector40.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/vector50.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/vector_fwd.hpp delete mode 100644 include/boost/fusion/sequence/container/vector/vector_iterator.hpp delete mode 100644 include/boost/fusion/sequence/conversion.hpp delete mode 100644 include/boost/fusion/sequence/conversion/as_deque.hpp delete mode 100644 include/boost/fusion/sequence/conversion/as_list.hpp delete mode 100644 include/boost/fusion/sequence/conversion/as_map.hpp delete mode 100644 include/boost/fusion/sequence/conversion/as_set.hpp delete mode 100644 include/boost/fusion/sequence/conversion/as_vector.hpp delete mode 100644 include/boost/fusion/sequence/conversion/detail/as_deque.hpp delete mode 100644 include/boost/fusion/sequence/conversion/detail/as_map.hpp delete mode 100644 include/boost/fusion/sequence/conversion/detail/as_set.hpp delete mode 100644 include/boost/fusion/sequence/conversion/detail/as_vector.hpp delete mode 100644 include/boost/fusion/sequence/conversion/detail/build_cons.hpp delete mode 100644 include/boost/fusion/sequence/generation.hpp delete mode 100644 include/boost/fusion/sequence/generation/cons_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/deque_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/ignore.hpp delete mode 100644 include/boost/fusion/sequence/generation/list_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_cons.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_deque.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_list.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_map.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_set.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_vector.hpp delete mode 100644 include/boost/fusion/sequence/generation/map_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/pair_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/vector_tie.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/at.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/at_key.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/back.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/begin.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/empty.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/end.hpp delete mode 100755 include/boost/fusion/sequence/intrinsic/ext_/segments.hpp delete mode 100755 include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/front.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/has_key.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/at.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/back.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/begin.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/clear.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/detail/as.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/detail/clear.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/empty.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/end.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/erase.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/erase_key.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/front.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/has_key.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/insert.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/insert_range.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/pop_back.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/pop_front.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/push_back.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/push_front.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/mpl/size.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/size.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/swap.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/value_at.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/value_at_key.hpp delete mode 100644 include/boost/fusion/sequence/io.hpp delete mode 100644 include/boost/fusion/sequence/io/detail/in.hpp delete mode 100644 include/boost/fusion/sequence/io/detail/manip.hpp delete mode 100644 include/boost/fusion/sequence/io/detail/out.hpp delete mode 100644 include/boost/fusion/sequence/io/in.hpp delete mode 100644 include/boost/fusion/sequence/io/out.hpp delete mode 100644 include/boost/fusion/sequence/sequence_facade.hpp delete mode 100644 include/boost/fusion/sequence/utility.hpp delete mode 100644 include/boost/fusion/sequence/view.hpp delete mode 100755 include/boost/fusion/sequence/view/ext_/multiple_view.hpp delete mode 100755 include/boost/fusion/sequence/view/ext_/segmented_iterator.hpp delete mode 100755 include/boost/fusion/sequence/view/ext_/segmented_iterator_range.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/detail/size_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/filter_view.hpp delete mode 100644 include/boost/fusion/sequence/view/filter_view/filter_view_iterator.hpp delete mode 100644 include/boost/fusion/sequence/view/iterator_range.hpp delete mode 100644 include/boost/fusion/sequence/view/iterator_range/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/iterator_range/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/iterator_range/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/iterator_range/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/iterator_range/iterator_range.hpp delete mode 100644 include/boost/fusion/sequence/view/joint_view.hpp delete mode 100644 include/boost/fusion/sequence/view/joint_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/joint_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/joint_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/joint_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/joint_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/joint_view/joint_view.hpp delete mode 100644 include/boost/fusion/sequence/view/joint_view/joint_view_iterator.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view/repetitive_view.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view/repetitive_view_fwd.hpp delete mode 100644 include/boost/fusion/sequence/view/repetitive_view/repetitive_view_iterator.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/detail/advance_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/detail/distance_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/detail/prior_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/reverse_view.hpp delete mode 100644 include/boost/fusion/sequence/view/reverse_view/reverse_view_iterator.hpp delete mode 100644 include/boost/fusion/sequence/view/single_view.hpp delete mode 100644 include/boost/fusion/sequence/view/single_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/single_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/single_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/single_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/single_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/single_view/single_view.hpp delete mode 100644 include/boost/fusion/sequence/view/single_view/single_view_iterator.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/advance_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/apply_transform_result.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/distance_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/prior_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/transform_view.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/transform_view_fwd.hpp delete mode 100644 include/boost/fusion/sequence/view/transform_view/transform_view_iterator.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/advance_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/at_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/distance_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/prior_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/size_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/strictest_traversal.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/zip_view.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/zip_view_iterator.hpp delete mode 100644 include/boost/fusion/sequence/view/zip_view/zip_view_iterator_fwd.hpp delete mode 100644 include/boost/fusion/support.hpp delete mode 100644 include/boost/fusion/support/category_of.hpp delete mode 100644 include/boost/fusion/support/deduce.hpp delete mode 100644 include/boost/fusion/support/deduce_sequence.hpp delete mode 100644 include/boost/fusion/support/detail/access.hpp delete mode 100644 include/boost/fusion/support/detail/as_fusion_element.hpp delete mode 100644 include/boost/fusion/support/detail/category_of.hpp delete mode 100644 include/boost/fusion/support/detail/compiler_config.hpp delete mode 100644 include/boost/fusion/support/detail/is_mpl_sequence.hpp delete mode 100644 include/boost/fusion/support/detail/is_view.hpp delete mode 100644 include/boost/fusion/support/detail/mpl_iterator_category.hpp delete mode 100644 include/boost/fusion/support/detail/unknown_key.hpp delete mode 100755 include/boost/fusion/support/ext_/is_segmented.hpp delete mode 100644 include/boost/fusion/support/is_iterator.hpp delete mode 100644 include/boost/fusion/support/is_sequence.hpp delete mode 100644 include/boost/fusion/support/is_view.hpp delete mode 100644 include/boost/fusion/support/iterator_base.hpp delete mode 100644 include/boost/fusion/support/pair.hpp delete mode 100644 include/boost/fusion/support/sequence_base.hpp delete mode 100644 include/boost/fusion/support/tag_of.hpp delete mode 100644 include/boost/fusion/support/tag_of_fwd.hpp delete mode 100644 include/boost/fusion/support/unused.hpp delete mode 100644 include/boost/fusion/support/void.hpp delete mode 100644 include/boost/fusion/tuple.hpp delete mode 100644 include/boost/fusion/tuple/detail/tuple_forward_ctor.hpp delete mode 100644 include/boost/fusion/tuple/make_tuple.hpp delete mode 100644 include/boost/fusion/tuple/tuple.hpp delete mode 100644 include/boost/fusion/tuple/tuple_fwd.hpp delete mode 100644 include/boost/fusion/tuple/tuple_tie.hpp diff --git a/include/boost/fusion/algorithm.hpp b/include/boost/fusion/algorithm.hpp deleted file mode 100644 index 74e52723..00000000 --- a/include/boost/fusion/algorithm.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5d0fefa0..00000000 --- a/include/boost/fusion/algorithm/iteration.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3d0685f7..00000000 --- a/include/boost/fusion/algorithm/iteration/accumulate.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 542a8114..00000000 --- a/include/boost/fusion/algorithm/iteration/detail/fold.hpp +++ /dev/null @@ -1,271 +0,0 @@ -#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 deleted file mode 100644 index a23517c8..00000000 --- a/include/boost/fusion/algorithm/iteration/detail/for_each.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 9e571d0f..00000000 --- a/include/boost/fusion/algorithm/iteration/ext_/for_each_s.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 75c63b8f..00000000 --- a/include/boost/fusion/algorithm/iteration/fold.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index fffb0f00..00000000 --- a/include/boost/fusion/algorithm/iteration/for_each.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 488a62a8..00000000 --- a/include/boost/fusion/algorithm/query.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9d78867c..00000000 --- a/include/boost/fusion/algorithm/query/all.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index be4ef099..00000000 --- a/include/boost/fusion/algorithm/query/any.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 27e3370e..00000000 --- a/include/boost/fusion/algorithm/query/count.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a080b3b2..00000000 --- a/include/boost/fusion/algorithm/query/count_if.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 979cfb11..00000000 --- a/include/boost/fusion/algorithm/query/detail/all.hpp +++ /dev/null @@ -1,127 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 31bbaa58..00000000 --- a/include/boost/fusion/algorithm/query/detail/any.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7591405f..00000000 --- a/include/boost/fusion/algorithm/query/detail/assoc_find.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ff17adbd..00000000 --- a/include/boost/fusion/algorithm/query/detail/count.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d270b591..00000000 --- a/include/boost/fusion/algorithm/query/detail/count_if.hpp +++ /dev/null @@ -1,170 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cf0cc6b7..00000000 --- a/include/boost/fusion/algorithm/query/detail/find_if.hpp +++ /dev/null @@ -1,252 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 2534ba4e..00000000 --- a/include/boost/fusion/algorithm/query/ext_/find_if_s.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ece8cdd6..00000000 --- a/include/boost/fusion/algorithm/query/find.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4340d688..00000000 --- a/include/boost/fusion/algorithm/query/find_if.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f31f4c9c..00000000 --- a/include/boost/fusion/algorithm/query/none.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0757b5ee..00000000 --- a/include/boost/fusion/algorithm/transformation.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 31e4269d..00000000 --- a/include/boost/fusion/algorithm/transformation/clear.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9e20f79f..00000000 --- a/include/boost/fusion/algorithm/transformation/detail/replace.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index db0434c6..00000000 --- a/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9e78da27..00000000 --- a/include/boost/fusion/algorithm/transformation/erase.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/*============================================================================= - 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 - -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 deleted file mode 100644 index dcdc6f09..00000000 --- a/include/boost/fusion/algorithm/transformation/erase_key.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 16244649..00000000 --- a/include/boost/fusion/algorithm/transformation/filter.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4f362882..00000000 --- a/include/boost/fusion/algorithm/transformation/filter_if.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ebe06f14..00000000 --- a/include/boost/fusion/algorithm/transformation/insert.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*============================================================================= - 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 - -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 deleted file mode 100644 index 4db840aa..00000000 --- a/include/boost/fusion/algorithm/transformation/insert_range.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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 - -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 deleted file mode 100644 index 10a5eecc..00000000 --- a/include/boost/fusion/algorithm/transformation/join.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c83d5904..00000000 --- a/include/boost/fusion/algorithm/transformation/pop_back.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d01e3754..00000000 --- a/include/boost/fusion/algorithm/transformation/pop_front.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 98f63702..00000000 --- a/include/boost/fusion/algorithm/transformation/push_back.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 526e28f1..00000000 --- a/include/boost/fusion/algorithm/transformation/push_front.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1eb4bfb3..00000000 --- a/include/boost/fusion/algorithm/transformation/remove.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c2140d17..00000000 --- a/include/boost/fusion/algorithm/transformation/remove_if.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 43657f99..00000000 --- a/include/boost/fusion/algorithm/transformation/replace.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 07abbdca..00000000 --- a/include/boost/fusion/algorithm/transformation/replace_if.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index faf78114..00000000 --- a/include/boost/fusion/algorithm/transformation/reverse.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0315a8d0..00000000 --- a/include/boost/fusion/algorithm/transformation/transform.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 33b7d25b..00000000 --- a/include/boost/fusion/algorithm/transformation/zip.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/*============================================================================= - 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/functional.hpp b/include/boost/fusion/functional.hpp deleted file mode 100644 index 12662d97..00000000 --- a/include/boost/fusion/functional.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 734dac39..00000000 --- a/include/boost/fusion/functional/adapter.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ee03ffd0..00000000 --- a/include/boost/fusion/functional/adapter/detail/access.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2d14ad70..00000000 --- a/include/boost/fusion/functional/adapter/detail/pow2_explode.hpp +++ /dev/null @@ -1,118 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8f85cf44..00000000 --- a/include/boost/fusion/functional/adapter/detail/pt_def.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dca50043..00000000 --- a/include/boost/fusion/functional/adapter/detail/pt_undef.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 08e8897a..00000000 --- a/include/boost/fusion/functional/adapter/fused.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 12cd1e27..00000000 --- a/include/boost/fusion/functional/adapter/fused_function_object.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 78034b97..00000000 --- a/include/boost/fusion/functional/adapter/fused_procedure.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 476fe021..00000000 --- a/include/boost/fusion/functional/adapter/limits.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 69191ef3..00000000 --- a/include/boost/fusion/functional/adapter/unfused_generic.hpp +++ /dev/null @@ -1,175 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7b801cf7..00000000 --- a/include/boost/fusion/functional/adapter/unfused_lvalue_args.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index eea0fec9..00000000 --- a/include/boost/fusion/functional/adapter/unfused_rvalue_args.hpp +++ /dev/null @@ -1,137 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 94385a35..00000000 --- a/include/boost/fusion/functional/adapter/unfused_typed.hpp +++ /dev/null @@ -1,155 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3dabd3ee..00000000 --- a/include/boost/fusion/functional/generation.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1c2c3e95..00000000 --- a/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 12365824..00000000 --- a/include/boost/fusion/functional/generation/make_fused.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4146ddd6..00000000 --- a/include/boost/fusion/functional/generation/make_fused_function_object.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0687577c..00000000 --- a/include/boost/fusion/functional/generation/make_fused_procedure.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 87a99c59..00000000 --- a/include/boost/fusion/functional/generation/make_unfused_generic.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f3c49e45..00000000 --- a/include/boost/fusion/functional/generation/make_unfused_lvalue_args.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9322e1e0..00000000 --- a/include/boost/fusion/functional/generation/make_unfused_rvalue_args.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3ca68c34..00000000 --- a/include/boost/fusion/functional/invocation.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a92c436b..00000000 --- a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bac695cc..00000000 --- a/include/boost/fusion/functional/invocation/invoke.hpp +++ /dev/null @@ -1,306 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ad742265..00000000 --- a/include/boost/fusion/functional/invocation/invoke_function_object.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 31822ade..00000000 --- a/include/boost/fusion/functional/invocation/invoke_procedure.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9cb5a04a..00000000 --- a/include/boost/fusion/functional/invocation/limits.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2fab5de7..00000000 --- a/include/boost/fusion/include/adapt_struct.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e5c73060..00000000 --- a/include/boost/fusion/include/any.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2136b492..00000000 --- a/include/boost/fusion/include/as_vector.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index eacd7bbb..00000000 --- a/include/boost/fusion/include/at.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 53361fb2..00000000 --- a/include/boost/fusion/include/begin.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9c831f79..00000000 --- a/include/boost/fusion/include/deref.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 60be1a98..00000000 --- a/include/boost/fusion/include/end.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5607b8e2..00000000 --- a/include/boost/fusion/include/equal_to.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 31fdec5d..00000000 --- a/include/boost/fusion/include/filter_if.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b20578e5..00000000 --- a/include/boost/fusion/include/for_each.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d84fdf35..00000000 --- a/include/boost/fusion/include/io.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a7f2b4d8..00000000 --- a/include/boost/fusion/include/is_sequence.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f701ad3..00000000 --- a/include/boost/fusion/include/join.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c60e34e5..00000000 --- a/include/boost/fusion/include/joint_view.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index fb5c0b42..00000000 --- a/include/boost/fusion/include/list.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a0181953..00000000 --- a/include/boost/fusion/include/make_cons.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d2a90cb4..00000000 --- a/include/boost/fusion/include/make_vector.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5e3f906d..00000000 --- a/include/boost/fusion/include/mpl.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6188c65a..00000000 --- a/include/boost/fusion/include/next.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5a9cfa5e..00000000 --- a/include/boost/fusion/include/push_front.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ae60d867..00000000 --- a/include/boost/fusion/include/single_view.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bb4d5952..00000000 --- a/include/boost/fusion/include/std_pair.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1f428aa1..00000000 --- a/include/boost/fusion/include/swap.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2b66c4f7..00000000 --- a/include/boost/fusion/include/transform.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7564c6ab..00000000 --- a/include/boost/fusion/include/transform_view.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index da5745d9..00000000 --- a/include/boost/fusion/include/value_at.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4f2bef95..00000000 --- a/include/boost/fusion/include/value_of.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 824b8a6a..00000000 --- a/include/boost/fusion/include/variant.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e49568e2..00000000 --- a/include/boost/fusion/include/vector.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 35f4abed..00000000 --- a/include/boost/fusion/include/vector_tie.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c7f8e1eb..00000000 --- a/include/boost/fusion/iterator.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2cbafede..00000000 --- a/include/boost/fusion/iterator/advance.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0e6f54d2..00000000 --- a/include/boost/fusion/iterator/deref.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d683c289..00000000 --- a/include/boost/fusion/iterator/detail/adapt_deref_traits.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a7d72f53..00000000 --- a/include/boost/fusion/iterator/detail/adapt_value_traits.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 900608fa..00000000 --- a/include/boost/fusion/iterator/detail/advance.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e4c0a5e7..00000000 --- a/include/boost/fusion/iterator/detail/distance.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 44fc4292..00000000 --- a/include/boost/fusion/iterator/distance.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2db27675..00000000 --- a/include/boost/fusion/iterator/equal_to.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f1720bdb..00000000 --- a/include/boost/fusion/iterator/iterator_facade.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2709bd29..00000000 --- a/include/boost/fusion/iterator/mpl.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index fc2efacf..00000000 --- a/include/boost/fusion/iterator/mpl/convert_iterator.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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 -#include - -namespace boost { namespace fusion -{ - // 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 deleted file mode 100644 index 150db549..00000000 --- a/include/boost/fusion/iterator/mpl/fusion_iterator.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9070a9e2..00000000 --- a/include/boost/fusion/iterator/next.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9a261039..00000000 --- a/include/boost/fusion/iterator/prior.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 808c6593..00000000 --- a/include/boost/fusion/iterator/value_of.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6eb2538b..00000000 --- a/include/boost/fusion/mpl.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 - -#endif diff --git a/include/boost/fusion/sequence.hpp b/include/boost/fusion/sequence.hpp deleted file mode 100644 index 9a794c2e..00000000 --- a/include/boost/fusion/sequence.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 -#include -#include -#include - -#endif diff --git a/include/boost/fusion/sequence/adapted.hpp b/include/boost/fusion/sequence/adapted.hpp deleted file mode 100644 index ea951f19..00000000 --- a/include/boost/fusion/sequence/adapted.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array.hpp b/include/boost/fusion/sequence/adapted/array.hpp deleted file mode 100644 index 0e1537f8..00000000 --- a/include/boost/fusion/sequence/adapted/array.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/array_iterator.hpp b/include/boost/fusion/sequence/adapted/array/array_iterator.hpp deleted file mode 100644 index dbad7763..00000000 --- a/include/boost/fusion/sequence/adapted/array/array_iterator.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/detail/at_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/at_impl.hpp deleted file mode 100644 index 3c427059..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/at_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/detail/begin_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/begin_impl.hpp deleted file mode 100644 index fc4fb6a3..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/begin_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/detail/category_of_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/category_of_impl.hpp deleted file mode 100644 index 4c6b040e..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/category_of_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/detail/end_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/end_impl.hpp deleted file mode 100644 index a3ffbed4..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/detail/is_sequence_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/is_sequence_impl.hpp deleted file mode 100644 index a248c314..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/detail/is_view_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/is_view_impl.hpp deleted file mode 100644 index bc821fa6..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/is_view_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/detail/size_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/size_impl.hpp deleted file mode 100644 index 63661573..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/size_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/detail/value_at_impl.hpp b/include/boost/fusion/sequence/adapted/array/detail/value_at_impl.hpp deleted file mode 100644 index f465b1d6..00000000 --- a/include/boost/fusion/sequence/adapted/array/detail/value_at_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/array/tag_of.hpp b/include/boost/fusion/sequence/adapted/array/tag_of.hpp deleted file mode 100644 index 96f6d35c..00000000 --- a/include/boost/fusion/sequence/adapted/array/tag_of.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple.hpp b/include/boost/fusion/sequence/adapted/boost_tuple.hpp deleted file mode 100644 index 14288087..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/boost_tuple_iterator.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/boost_tuple_iterator.hpp deleted file mode 100644 index fca135e5..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/boost_tuple_iterator.hpp +++ /dev/null @@ -1,149 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/detail/at_impl.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/detail/at_impl.hpp deleted file mode 100644 index b594dfd8..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/detail/at_impl.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/detail/begin_impl.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/detail/begin_impl.hpp deleted file mode 100644 index aaa6a670..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/detail/begin_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/detail/category_of_impl.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/detail/category_of_impl.hpp deleted file mode 100644 index 34f48b1e..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/detail/category_of_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/detail/end_impl.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/detail/end_impl.hpp deleted file mode 100644 index 016bca3f..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/detail/end_impl.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/detail/is_sequence_impl.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/detail/is_sequence_impl.hpp deleted file mode 100644 index 43d73115..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/detail/is_view_impl.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/detail/is_view_impl.hpp deleted file mode 100644 index 2927df7b..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/detail/is_view_impl.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/detail/size_impl.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/detail/size_impl.hpp deleted file mode 100644 index 167a5035..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/detail/size_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/detail/value_at_impl.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/detail/value_at_impl.hpp deleted file mode 100644 index d46d51e5..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/detail/value_at_impl.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/boost_tuple/tag_of.hpp b/include/boost/fusion/sequence/adapted/boost_tuple/tag_of.hpp deleted file mode 100644 index a1a27aa7..00000000 --- a/include/boost/fusion/sequence/adapted/boost_tuple/tag_of.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl.hpp b/include/boost/fusion/sequence/adapted/mpl.hpp deleted file mode 100644 index 94f4967a..00000000 --- a/include/boost/fusion/sequence/adapted/mpl.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/at_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/at_impl.hpp deleted file mode 100644 index 6f3be1c6..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/at_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/begin_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/begin_impl.hpp deleted file mode 100644 index 04e09e44..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/begin_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/category_of_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/category_of_impl.hpp deleted file mode 100644 index ad68fcc9..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/category_of_impl.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/empty_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/empty_impl.hpp deleted file mode 100644 index 14e8dfa2..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/empty_impl.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/end_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/end_impl.hpp deleted file mode 100644 index 6b3d7933..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/end_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/has_key_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/has_key_impl.hpp deleted file mode 100644 index bfecbc73..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/has_key_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/is_sequence_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/is_sequence_impl.hpp deleted file mode 100644 index bf9b349c..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/is_view_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/is_view_impl.hpp deleted file mode 100644 index 5ae48c90..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/is_view_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/size_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/size_impl.hpp deleted file mode 100644 index 62893517..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/size_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/detail/value_at_impl.hpp b/include/boost/fusion/sequence/adapted/mpl/detail/value_at_impl.hpp deleted file mode 100644 index 5f39e4eb..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/detail/value_at_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/mpl/mpl_iterator.hpp b/include/boost/fusion/sequence/adapted/mpl/mpl_iterator.hpp deleted file mode 100644 index c99b5804..00000000 --- a/include/boost/fusion/sequence/adapted/mpl/mpl_iterator.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair.hpp b/include/boost/fusion/sequence/adapted/std_pair.hpp deleted file mode 100644 index 0b755a0b..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/detail/at_impl.hpp b/include/boost/fusion/sequence/adapted/std_pair/detail/at_impl.hpp deleted file mode 100644 index 2f26fa68..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/detail/at_impl.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/detail/begin_impl.hpp b/include/boost/fusion/sequence/adapted/std_pair/detail/begin_impl.hpp deleted file mode 100644 index 1b77b7a7..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/detail/begin_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/detail/category_of_impl.hpp b/include/boost/fusion/sequence/adapted/std_pair/detail/category_of_impl.hpp deleted file mode 100644 index f207c1c7..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/detail/category_of_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/detail/end_impl.hpp b/include/boost/fusion/sequence/adapted/std_pair/detail/end_impl.hpp deleted file mode 100644 index 9aab76c5..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/detail/is_sequence_impl.hpp b/include/boost/fusion/sequence/adapted/std_pair/detail/is_sequence_impl.hpp deleted file mode 100644 index 1c669a68..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/detail/is_view_impl.hpp b/include/boost/fusion/sequence/adapted/std_pair/detail/is_view_impl.hpp deleted file mode 100644 index 94842bc0..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/detail/is_view_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/detail/size_impl.hpp b/include/boost/fusion/sequence/adapted/std_pair/detail/size_impl.hpp deleted file mode 100644 index 5f35bffd..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/detail/size_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/detail/value_at_impl.hpp b/include/boost/fusion/sequence/adapted/std_pair/detail/value_at_impl.hpp deleted file mode 100644 index 16047ec9..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/detail/value_at_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/std_pair_iterator.hpp b/include/boost/fusion/sequence/adapted/std_pair/std_pair_iterator.hpp deleted file mode 100644 index 4aa2daa2..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/std_pair_iterator.hpp +++ /dev/null @@ -1,127 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/std_pair/tag_of.hpp b/include/boost/fusion/sequence/adapted/std_pair/tag_of.hpp deleted file mode 100644 index 3211efad..00000000 --- a/include/boost/fusion/sequence/adapted/std_pair/tag_of.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct.hpp b/include/boost/fusion/sequence/adapted/struct.hpp deleted file mode 100644 index f4aed34e..00000000 --- a/include/boost/fusion/sequence/adapted/struct.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/adapt_assoc_struct.hpp b/include/boost/fusion/sequence/adapted/struct/adapt_assoc_struct.hpp deleted file mode 100644 index 44357c00..00000000 --- a/include/boost/fusion/sequence/adapted/struct/adapt_assoc_struct.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/adapt_struct.hpp b/include/boost/fusion/sequence/adapted/struct/adapt_struct.hpp deleted file mode 100644 index 38d03edb..00000000 --- a/include/boost/fusion/sequence/adapted/struct/adapt_struct.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/at_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/at_impl.hpp deleted file mode 100644 index 809902ae..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/at_impl.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/at_key_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/at_key_impl.hpp deleted file mode 100644 index 4ce0fce9..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/at_key_impl.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/begin_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/begin_impl.hpp deleted file mode 100644 index 14817726..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/begin_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/category_of_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/category_of_impl.hpp deleted file mode 100644 index 9e7f9df4..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/category_of_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/end_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/end_impl.hpp deleted file mode 100644 index 91830cea..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/has_key_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/has_key_impl.hpp deleted file mode 100644 index 8972f5df..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/has_key_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/is_sequence_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/is_sequence_impl.hpp deleted file mode 100644 index f81e9fb6..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/is_view_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/is_view_impl.hpp deleted file mode 100644 index da6f380b..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/is_view_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/size_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/size_impl.hpp deleted file mode 100644 index 12ec14ba..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/size_impl.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/value_at_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/value_at_impl.hpp deleted file mode 100644 index 8f5d97a0..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/value_at_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/detail/value_at_key_impl.hpp b/include/boost/fusion/sequence/adapted/struct/detail/value_at_key_impl.hpp deleted file mode 100644 index b1b3dcfb..00000000 --- a/include/boost/fusion/sequence/adapted/struct/detail/value_at_key_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/extension.hpp b/include/boost/fusion/sequence/adapted/struct/extension.hpp deleted file mode 100644 index da084498..00000000 --- a/include/boost/fusion/sequence/adapted/struct/extension.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/struct/struct_iterator.hpp b/include/boost/fusion/sequence/adapted/struct/struct_iterator.hpp deleted file mode 100644 index b00251bb..00000000 --- a/include/boost/fusion/sequence/adapted/struct/struct_iterator.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant.hpp b/include/boost/fusion/sequence/adapted/variant.hpp deleted file mode 100644 index 2443312d..00000000 --- a/include/boost/fusion/sequence/adapted/variant.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant/detail/begin_impl.hpp b/include/boost/fusion/sequence/adapted/variant/detail/begin_impl.hpp deleted file mode 100644 index dc9e2e7f..00000000 --- a/include/boost/fusion/sequence/adapted/variant/detail/begin_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant/detail/category_of_impl.hpp b/include/boost/fusion/sequence/adapted/variant/detail/category_of_impl.hpp deleted file mode 100644 index d81d9b3b..00000000 --- a/include/boost/fusion/sequence/adapted/variant/detail/category_of_impl.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant/detail/end_impl.hpp b/include/boost/fusion/sequence/adapted/variant/detail/end_impl.hpp deleted file mode 100644 index 622df47f..00000000 --- a/include/boost/fusion/sequence/adapted/variant/detail/end_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant/detail/is_sequence_impl.hpp b/include/boost/fusion/sequence/adapted/variant/detail/is_sequence_impl.hpp deleted file mode 100644 index 132f88a1..00000000 --- a/include/boost/fusion/sequence/adapted/variant/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant/detail/is_view_impl.hpp b/include/boost/fusion/sequence/adapted/variant/detail/is_view_impl.hpp deleted file mode 100644 index d58dbd3c..00000000 --- a/include/boost/fusion/sequence/adapted/variant/detail/is_view_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant/detail/size_impl.hpp b/include/boost/fusion/sequence/adapted/variant/detail/size_impl.hpp deleted file mode 100644 index 379bac32..00000000 --- a/include/boost/fusion/sequence/adapted/variant/detail/size_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant/tag_of.hpp b/include/boost/fusion/sequence/adapted/variant/tag_of.hpp deleted file mode 100644 index 3ec31460..00000000 --- a/include/boost/fusion/sequence/adapted/variant/tag_of.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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/sequence/adapted/variant/variant_iterator.hpp b/include/boost/fusion/sequence/adapted/variant/variant_iterator.hpp deleted file mode 100644 index 9372002c..00000000 --- a/include/boost/fusion/sequence/adapted/variant/variant_iterator.hpp +++ /dev/null @@ -1,117 +0,0 @@ -/*============================================================================= - 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/sequence/comparison.hpp b/include/boost/fusion/sequence/comparison.hpp deleted file mode 100644 index 50e72cb3..00000000 --- a/include/boost/fusion/sequence/comparison.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3e79277e..00000000 --- a/include/boost/fusion/sequence/comparison/detail/enable_comparison.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c4f91238..00000000 --- a/include/boost/fusion/sequence/comparison/detail/equal_to.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 34cf1448..00000000 --- a/include/boost/fusion/sequence/comparison/detail/greater.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0cf4c388..00000000 --- a/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3fc6429f..00000000 --- a/include/boost/fusion/sequence/comparison/detail/less.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3d48ae5c..00000000 --- a/include/boost/fusion/sequence/comparison/detail/less_equal.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 87911b6d..00000000 --- a/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cea3c9c1..00000000 --- a/include/boost/fusion/sequence/comparison/equal_to.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3ef215a1..00000000 --- a/include/boost/fusion/sequence/comparison/greater.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index df365c3a..00000000 --- a/include/boost/fusion/sequence/comparison/greater_equal.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4d3c086c..00000000 --- a/include/boost/fusion/sequence/comparison/less.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0f5a953c..00000000 --- a/include/boost/fusion/sequence/comparison/less_equal.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 34d2cab6..00000000 --- a/include/boost/fusion/sequence/comparison/not_equal_to.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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/container.hpp b/include/boost/fusion/sequence/container.hpp deleted file mode 100644 index 6a1047cc..00000000 --- a/include/boost/fusion/sequence/container.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque.hpp b/include/boost/fusion/sequence/container/deque.hpp deleted file mode 100644 index 0c9614a9..00000000 --- a/include/boost/fusion/sequence/container/deque.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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 - -#endif - diff --git a/include/boost/fusion/sequence/container/deque/back_extended_deque.hpp b/include/boost/fusion/sequence/container/deque/back_extended_deque.hpp deleted file mode 100644 index 6310bb59..00000000 --- a/include/boost/fusion/sequence/container/deque/back_extended_deque.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/deque.hpp b/include/boost/fusion/sequence/container/deque/deque.hpp deleted file mode 100644 index 884899f8..00000000 --- a/include/boost/fusion/sequence/container/deque/deque.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/deque_fwd.hpp b/include/boost/fusion/sequence/container/deque/deque_fwd.hpp deleted file mode 100644 index ce47bf62..00000000 --- a/include/boost/fusion/sequence/container/deque/deque_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/deque_iterator.hpp b/include/boost/fusion/sequence/container/deque/deque_iterator.hpp deleted file mode 100644 index 8fb6f009..00000000 --- a/include/boost/fusion/sequence/container/deque/deque_iterator.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/at_impl.hpp b/include/boost/fusion/sequence/container/deque/detail/at_impl.hpp deleted file mode 100644 index 7edf37f1..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/at_impl.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/begin_impl.hpp b/include/boost/fusion/sequence/container/deque/detail/begin_impl.hpp deleted file mode 100644 index 867cab8e..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/begin_impl.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/deque_forward_ctor.hpp b/include/boost/fusion/sequence/container/deque/detail/deque_forward_ctor.hpp deleted file mode 100644 index f79a02e5..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/deque_forward_ctor.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/deque_initial_size.hpp b/include/boost/fusion/sequence/container/deque/detail/deque_initial_size.hpp deleted file mode 100644 index 8fa56292..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/deque_initial_size.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/deque_keyed_values.hpp b/include/boost/fusion/sequence/container/deque/detail/deque_keyed_values.hpp deleted file mode 100644 index 26a76512..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/deque_keyed_values.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/deque_keyed_values_call.hpp b/include/boost/fusion/sequence/container/deque/detail/deque_keyed_values_call.hpp deleted file mode 100644 index ab31c43c..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/deque_keyed_values_call.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/end_impl.hpp b/include/boost/fusion/sequence/container/deque/detail/end_impl.hpp deleted file mode 100644 index 505dfdac..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/end_impl.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/keyed_element.hpp b/include/boost/fusion/sequence/container/deque/detail/keyed_element.hpp deleted file mode 100644 index 177f68ac..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/keyed_element.hpp +++ /dev/null @@ -1,111 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/detail/value_at_impl.hpp b/include/boost/fusion/sequence/container/deque/detail/value_at_impl.hpp deleted file mode 100644 index 6c08231d..00000000 --- a/include/boost/fusion/sequence/container/deque/detail/value_at_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/front_extended_deque.hpp b/include/boost/fusion/sequence/container/deque/front_extended_deque.hpp deleted file mode 100644 index b52508e7..00000000 --- a/include/boost/fusion/sequence/container/deque/front_extended_deque.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/container/deque/limits.hpp b/include/boost/fusion/sequence/container/deque/limits.hpp deleted file mode 100644 index 2262f17c..00000000 --- a/include/boost/fusion/sequence/container/deque/limits.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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/sequence/container/ext_/tree.hpp b/include/boost/fusion/sequence/container/ext_/tree.hpp deleted file mode 100755 index c6edc28c..00000000 --- a/include/boost/fusion/sequence/container/ext_/tree.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/*============================================================================= - 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/sequence/container/list.hpp b/include/boost/fusion/sequence/container/list.hpp deleted file mode 100644 index 47024b9c..00000000 --- a/include/boost/fusion/sequence/container/list.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================= - 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 - -#endif diff --git a/include/boost/fusion/sequence/container/list/cons.hpp b/include/boost/fusion/sequence/container/list/cons.hpp deleted file mode 100644 index 877f2982..00000000 --- a/include/boost/fusion/sequence/container/list/cons.hpp +++ /dev/null @@ -1,143 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/cons_iterator.hpp b/include/boost/fusion/sequence/container/list/cons_iterator.hpp deleted file mode 100644 index 6455f04f..00000000 --- a/include/boost/fusion/sequence/container/list/cons_iterator.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/at_impl.hpp b/include/boost/fusion/sequence/container/list/detail/at_impl.hpp deleted file mode 100644 index 54ba6bb8..00000000 --- a/include/boost/fusion/sequence/container/list/detail/at_impl.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/begin_impl.hpp b/include/boost/fusion/sequence/container/list/detail/begin_impl.hpp deleted file mode 100644 index a22c9a3d..00000000 --- a/include/boost/fusion/sequence/container/list/detail/begin_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/deref_impl.hpp b/include/boost/fusion/sequence/container/list/detail/deref_impl.hpp deleted file mode 100644 index 5292dced..00000000 --- a/include/boost/fusion/sequence/container/list/detail/deref_impl.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/empty_impl.hpp b/include/boost/fusion/sequence/container/list/detail/empty_impl.hpp deleted file mode 100644 index 5c92c733..00000000 --- a/include/boost/fusion/sequence/container/list/detail/empty_impl.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/end_impl.hpp b/include/boost/fusion/sequence/container/list/detail/end_impl.hpp deleted file mode 100644 index 49dca855..00000000 --- a/include/boost/fusion/sequence/container/list/detail/end_impl.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/equal_to_impl.hpp b/include/boost/fusion/sequence/container/list/detail/equal_to_impl.hpp deleted file mode 100644 index 11925880..00000000 --- a/include/boost/fusion/sequence/container/list/detail/equal_to_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/list_forward_ctor.hpp b/include/boost/fusion/sequence/container/list/detail/list_forward_ctor.hpp deleted file mode 100644 index 7922f382..00000000 --- a/include/boost/fusion/sequence/container/list/detail/list_forward_ctor.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/list_to_cons.hpp b/include/boost/fusion/sequence/container/list/detail/list_to_cons.hpp deleted file mode 100644 index fa5c7bb9..00000000 --- a/include/boost/fusion/sequence/container/list/detail/list_to_cons.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/list_to_cons_call.hpp b/include/boost/fusion/sequence/container/list/detail/list_to_cons_call.hpp deleted file mode 100644 index c8e63e95..00000000 --- a/include/boost/fusion/sequence/container/list/detail/list_to_cons_call.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/next_impl.hpp b/include/boost/fusion/sequence/container/list/detail/next_impl.hpp deleted file mode 100644 index dafa83cc..00000000 --- a/include/boost/fusion/sequence/container/list/detail/next_impl.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/value_at_impl.hpp b/include/boost/fusion/sequence/container/list/detail/value_at_impl.hpp deleted file mode 100644 index 5f0ff166..00000000 --- a/include/boost/fusion/sequence/container/list/detail/value_at_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/detail/value_of_impl.hpp b/include/boost/fusion/sequence/container/list/detail/value_of_impl.hpp deleted file mode 100644 index f8175c6d..00000000 --- a/include/boost/fusion/sequence/container/list/detail/value_of_impl.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/limits.hpp b/include/boost/fusion/sequence/container/list/limits.hpp deleted file mode 100644 index 20ff6dd2..00000000 --- a/include/boost/fusion/sequence/container/list/limits.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/list.hpp b/include/boost/fusion/sequence/container/list/list.hpp deleted file mode 100644 index e34e648f..00000000 --- a/include/boost/fusion/sequence/container/list/list.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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/sequence/container/list/list_fwd.hpp b/include/boost/fusion/sequence/container/list/list_fwd.hpp deleted file mode 100644 index cfd4e370..00000000 --- a/include/boost/fusion/sequence/container/list/list_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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/sequence/container/map.hpp b/include/boost/fusion/sequence/container/map.hpp deleted file mode 100644 index 100905cf..00000000 --- a/include/boost/fusion/sequence/container/map.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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 - -#endif diff --git a/include/boost/fusion/sequence/container/map/detail/at_key_impl.hpp b/include/boost/fusion/sequence/container/map/detail/at_key_impl.hpp deleted file mode 100644 index 8b0d70aa..00000000 --- a/include/boost/fusion/sequence/container/map/detail/at_key_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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/sequence/container/map/detail/begin_impl.hpp b/include/boost/fusion/sequence/container/map/detail/begin_impl.hpp deleted file mode 100644 index 5fe25caf..00000000 --- a/include/boost/fusion/sequence/container/map/detail/begin_impl.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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/sequence/container/map/detail/end_impl.hpp b/include/boost/fusion/sequence/container/map/detail/end_impl.hpp deleted file mode 100644 index 0cafc92c..00000000 --- a/include/boost/fusion/sequence/container/map/detail/end_impl.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - 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/sequence/container/map/detail/lookup_key.hpp b/include/boost/fusion/sequence/container/map/detail/lookup_key.hpp deleted file mode 100644 index 17774362..00000000 --- a/include/boost/fusion/sequence/container/map/detail/lookup_key.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - 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/sequence/container/map/detail/map_forward_ctor.hpp b/include/boost/fusion/sequence/container/map/detail/map_forward_ctor.hpp deleted file mode 100644 index 34b81830..00000000 --- a/include/boost/fusion/sequence/container/map/detail/map_forward_ctor.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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/sequence/container/map/detail/map_lookup.hpp b/include/boost/fusion/sequence/container/map/detail/map_lookup.hpp deleted file mode 100644 index aef42c62..00000000 --- a/include/boost/fusion/sequence/container/map/detail/map_lookup.hpp +++ /dev/null @@ -1,129 +0,0 @@ -/*============================================================================= - 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() - -#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 - -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1310) -#pragma warning (pop) -#endif - -#endif // defined(BOOST_PP_IS_ITERATING) - diff --git a/include/boost/fusion/sequence/container/map/detail/value_at_key_impl.hpp b/include/boost/fusion/sequence/container/map/detail/value_at_key_impl.hpp deleted file mode 100644 index 6c516462..00000000 --- a/include/boost/fusion/sequence/container/map/detail/value_at_key_impl.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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/sequence/container/map/limits.hpp b/include/boost/fusion/sequence/container/map/limits.hpp deleted file mode 100644 index 33cbc832..00000000 --- a/include/boost/fusion/sequence/container/map/limits.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/*============================================================================= - 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/sequence/container/map/map.hpp b/include/boost/fusion/sequence/container/map/map.hpp deleted file mode 100644 index bf6a0fa8..00000000 --- a/include/boost/fusion/sequence/container/map/map.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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/sequence/container/map/map_fwd.hpp b/include/boost/fusion/sequence/container/map/map_fwd.hpp deleted file mode 100644 index 311dce5a..00000000 --- a/include/boost/fusion/sequence/container/map/map_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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/sequence/container/set.hpp b/include/boost/fusion/sequence/container/set.hpp deleted file mode 100644 index 24ec2c67..00000000 --- a/include/boost/fusion/sequence/container/set.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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 - -#endif diff --git a/include/boost/fusion/sequence/container/set/detail/at_key_impl.hpp b/include/boost/fusion/sequence/container/set/detail/at_key_impl.hpp deleted file mode 100644 index d0c1de00..00000000 --- a/include/boost/fusion/sequence/container/set/detail/at_key_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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/sequence/container/set/detail/begin_impl.hpp b/include/boost/fusion/sequence/container/set/detail/begin_impl.hpp deleted file mode 100644 index 9b42df72..00000000 --- a/include/boost/fusion/sequence/container/set/detail/begin_impl.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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/sequence/container/set/detail/end_impl.hpp b/include/boost/fusion/sequence/container/set/detail/end_impl.hpp deleted file mode 100644 index 4df78a3f..00000000 --- a/include/boost/fusion/sequence/container/set/detail/end_impl.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - 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/sequence/container/set/detail/lookup_key.hpp b/include/boost/fusion/sequence/container/set/detail/lookup_key.hpp deleted file mode 100644 index a1b9e8b9..00000000 --- a/include/boost/fusion/sequence/container/set/detail/lookup_key.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/*============================================================================= - 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/sequence/container/set/detail/set_forward_ctor.hpp b/include/boost/fusion/sequence/container/set/detail/set_forward_ctor.hpp deleted file mode 100644 index 6eddd650..00000000 --- a/include/boost/fusion/sequence/container/set/detail/set_forward_ctor.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/container/set/detail/set_lookup.hpp b/include/boost/fusion/sequence/container/set/detail/set_lookup.hpp deleted file mode 100644 index fd300457..00000000 --- a/include/boost/fusion/sequence/container/set/detail/set_lookup.hpp +++ /dev/null @@ -1,129 +0,0 @@ -/*============================================================================= - 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() - -#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 - -#if defined(BOOST_MSVC) && (BOOST_MSVC == 1310) -#pragma warning (pop) -#endif - -#endif // defined(BOOST_PP_IS_ITERATING) - diff --git a/include/boost/fusion/sequence/container/set/detail/value_at_key_impl.hpp b/include/boost/fusion/sequence/container/set/detail/value_at_key_impl.hpp deleted file mode 100644 index 40f68ba0..00000000 --- a/include/boost/fusion/sequence/container/set/detail/value_at_key_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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/sequence/container/set/limits.hpp b/include/boost/fusion/sequence/container/set/limits.hpp deleted file mode 100644 index 0b03b4dc..00000000 --- a/include/boost/fusion/sequence/container/set/limits.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/*============================================================================= - 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/sequence/container/set/set.hpp b/include/boost/fusion/sequence/container/set/set.hpp deleted file mode 100644 index f5e7f152..00000000 --- a/include/boost/fusion/sequence/container/set/set.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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/sequence/container/set/set_fwd.hpp b/include/boost/fusion/sequence/container/set/set_fwd.hpp deleted file mode 100644 index 38ca9d22..00000000 --- a/include/boost/fusion/sequence/container/set/set_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector.hpp b/include/boost/fusion/sequence/container/vector.hpp deleted file mode 100644 index dd7f4333..00000000 --- a/include/boost/fusion/sequence/container/vector.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 - -#endif diff --git a/include/boost/fusion/sequence/container/vector/detail/advance_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/advance_impl.hpp deleted file mode 100644 index c2c97b18..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/advance_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/at_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/at_impl.hpp deleted file mode 100644 index 1a00f428..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/at_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/begin_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/begin_impl.hpp deleted file mode 100644 index 31d5643c..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/begin_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/deref_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/deref_impl.hpp deleted file mode 100644 index bd9f3d06..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/deref_impl.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/distance_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/distance_impl.hpp deleted file mode 100644 index 9664d5c2..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/distance_impl.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/end_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/end_impl.hpp deleted file mode 100644 index 795cabaa..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/equal_to_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/equal_to_impl.hpp deleted file mode 100644 index 5ff81c61..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/equal_to_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/next_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/next_impl.hpp deleted file mode 100644 index 1bbe16f1..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/next_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/prior_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/prior_impl.hpp deleted file mode 100644 index 3caaa590..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/prior_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/value_at_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/value_at_impl.hpp deleted file mode 100644 index 0178054b..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/value_at_impl.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/value_of_impl.hpp b/include/boost/fusion/sequence/container/vector/detail/value_of_impl.hpp deleted file mode 100644 index 3a775fbb..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/value_of_impl.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/vector_forward_ctor.hpp b/include/boost/fusion/sequence/container/vector/detail/vector_forward_ctor.hpp deleted file mode 100644 index 0dadc05d..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/vector_forward_ctor.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/vector_n.hpp b/include/boost/fusion/sequence/container/vector/detail/vector_n.hpp deleted file mode 100644 index 01981ab3..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/vector_n.hpp +++ /dev/null @@ -1,150 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/detail/vector_n_chooser.hpp b/include/boost/fusion/sequence/container/vector/detail/vector_n_chooser.hpp deleted file mode 100644 index 8f372b9b..00000000 --- a/include/boost/fusion/sequence/container/vector/detail/vector_n_chooser.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/limits.hpp b/include/boost/fusion/sequence/container/vector/limits.hpp deleted file mode 100644 index 0e7e3a03..00000000 --- a/include/boost/fusion/sequence/container/vector/limits.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/vector.hpp b/include/boost/fusion/sequence/container/vector/vector.hpp deleted file mode 100644 index a2fa9bc4..00000000 --- a/include/boost/fusion/sequence/container/vector/vector.hpp +++ /dev/null @@ -1,152 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/vector10.hpp b/include/boost/fusion/sequence/container/vector/vector10.hpp deleted file mode 100644 index 6ff80a0c..00000000 --- a/include/boost/fusion/sequence/container/vector/vector10.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/vector20.hpp b/include/boost/fusion/sequence/container/vector/vector20.hpp deleted file mode 100644 index 63809dfb..00000000 --- a/include/boost/fusion/sequence/container/vector/vector20.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/vector30.hpp b/include/boost/fusion/sequence/container/vector/vector30.hpp deleted file mode 100644 index 0c094ebd..00000000 --- a/include/boost/fusion/sequence/container/vector/vector30.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/vector40.hpp b/include/boost/fusion/sequence/container/vector/vector40.hpp deleted file mode 100644 index ecb13b71..00000000 --- a/include/boost/fusion/sequence/container/vector/vector40.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/vector50.hpp b/include/boost/fusion/sequence/container/vector/vector50.hpp deleted file mode 100644 index f5109448..00000000 --- a/include/boost/fusion/sequence/container/vector/vector50.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/vector_fwd.hpp b/include/boost/fusion/sequence/container/vector/vector_fwd.hpp deleted file mode 100644 index 8d1e23d6..00000000 --- a/include/boost/fusion/sequence/container/vector/vector_fwd.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/*============================================================================= - 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/sequence/container/vector/vector_iterator.hpp b/include/boost/fusion/sequence/container/vector/vector_iterator.hpp deleted file mode 100644 index fee4f6b0..00000000 --- a/include/boost/fusion/sequence/container/vector/vector_iterator.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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/sequence/conversion.hpp b/include/boost/fusion/sequence/conversion.hpp deleted file mode 100644 index e70cc88a..00000000 --- a/include/boost/fusion/sequence/conversion.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================= - 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_CONVERSION_10022005_0622) -#define FUSION_SEQUENCE_CONVERSION_10022005_0622 - -#include -#include -#include -#include -#include - -#endif diff --git a/include/boost/fusion/sequence/conversion/as_deque.hpp b/include/boost/fusion/sequence/conversion/as_deque.hpp deleted file mode 100644 index 78ae1273..00000000 --- a/include/boost/fusion/sequence/conversion/as_deque.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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_AS_DEQUE_20061213_2207) -#define FUSION_AS_DEQUE_20061213_2207 - -#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/sequence/conversion/as_list.hpp b/include/boost/fusion/sequence/conversion/as_list.hpp deleted file mode 100644 index 21b70bee..00000000 --- a/include/boost/fusion/sequence/conversion/as_list.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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_LIST_09232005_1215) -#define FUSION_AS_LIST_09232005_1215 - -#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/sequence/conversion/as_map.hpp b/include/boost/fusion/sequence/conversion/as_map.hpp deleted file mode 100644 index 4195dc25..00000000 --- a/include/boost/fusion/sequence/conversion/as_map.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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_MAP_09232005_1340) -#define FUSION_AS_MAP_09232005_1340 - -#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/sequence/conversion/as_set.hpp b/include/boost/fusion/sequence/conversion/as_set.hpp deleted file mode 100644 index 9d9c02df..00000000 --- a/include/boost/fusion/sequence/conversion/as_set.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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_SET_09232005_1341) -#define FUSION_AS_SET_09232005_1341 - -#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/sequence/conversion/as_vector.hpp b/include/boost/fusion/sequence/conversion/as_vector.hpp deleted file mode 100644 index 3e8cfab1..00000000 --- a/include/boost/fusion/sequence/conversion/as_vector.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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_VECTOR_09222005_1104) -#define FUSION_AS_VECTOR_09222005_1104 - -#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/sequence/conversion/detail/as_deque.hpp b/include/boost/fusion/sequence/conversion/detail/as_deque.hpp deleted file mode 100644 index 04e2a559..00000000 --- a/include/boost/fusion/sequence/conversion/detail/as_deque.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/*============================================================================= - 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/sequence/conversion/detail/as_map.hpp b/include/boost/fusion/sequence/conversion/detail/as_map.hpp deleted file mode 100644 index d163311c..00000000 --- a/include/boost/fusion/sequence/conversion/detail/as_map.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - 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/sequence/conversion/detail/as_set.hpp b/include/boost/fusion/sequence/conversion/detail/as_set.hpp deleted file mode 100644 index bd21f3c0..00000000 --- a/include/boost/fusion/sequence/conversion/detail/as_set.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - 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/sequence/conversion/detail/as_vector.hpp b/include/boost/fusion/sequence/conversion/detail/as_vector.hpp deleted file mode 100644 index ffd79df0..00000000 --- a/include/boost/fusion/sequence/conversion/detail/as_vector.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - 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/sequence/conversion/detail/build_cons.hpp b/include/boost/fusion/sequence/conversion/detail/build_cons.hpp deleted file mode 100644 index 4b08447f..00000000 --- a/include/boost/fusion/sequence/conversion/detail/build_cons.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - 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/sequence/generation.hpp b/include/boost/fusion/sequence/generation.hpp deleted file mode 100644 index 2afad632..00000000 --- a/include/boost/fusion/sequence/generation.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2b695d25..00000000 --- a/include/boost/fusion/sequence/generation/cons_tie.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 77478c03..00000000 --- a/include/boost/fusion/sequence/generation/deque_tie.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c363a203..00000000 --- a/include/boost/fusion/sequence/generation/ignore.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 56fb6823..00000000 --- a/include/boost/fusion/sequence/generation/list_tie.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 704b35e2..00000000 --- a/include/boost/fusion/sequence/generation/make_cons.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4c8544c2..00000000 --- a/include/boost/fusion/sequence/generation/make_deque.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a37a2367..00000000 --- a/include/boost/fusion/sequence/generation/make_list.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 885cea2b..00000000 --- a/include/boost/fusion/sequence/generation/make_map.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7f56159c..00000000 --- a/include/boost/fusion/sequence/generation/make_set.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2dc292fd..00000000 --- a/include/boost/fusion/sequence/generation/make_vector.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 523a22d4..00000000 --- a/include/boost/fusion/sequence/generation/map_tie.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 09437a26..00000000 --- a/include/boost/fusion/sequence/generation/pair_tie.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b8cfe527..00000000 --- a/include/boost/fusion/sequence/generation/vector_tie.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 59aaf9ff..00000000 --- a/include/boost/fusion/sequence/intrinsic.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - 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 -#include - -#endif diff --git a/include/boost/fusion/sequence/intrinsic/at.hpp b/include/boost/fusion/sequence/intrinsic/at.hpp deleted file mode 100644 index 4524ace5..00000000 --- a/include/boost/fusion/sequence/intrinsic/at.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 849ff294..00000000 --- a/include/boost/fusion/sequence/intrinsic/at_key.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1f3567f9..00000000 --- a/include/boost/fusion/sequence/intrinsic/back.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 715ef9e1..00000000 --- a/include/boost/fusion/sequence/intrinsic/begin.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2390a49b..00000000 --- a/include/boost/fusion/sequence/intrinsic/empty.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 04232f12..00000000 --- a/include/boost/fusion/sequence/intrinsic/end.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 58f148f2..00000000 --- a/include/boost/fusion/sequence/intrinsic/ext_/segments.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index d3c31ccc..00000000 --- a/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bb79cfa9..00000000 --- a/include/boost/fusion/sequence/intrinsic/front.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4c6a3e07..00000000 --- a/include/boost/fusion/sequence/intrinsic/has_key.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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/mpl.hpp b/include/boost/fusion/sequence/intrinsic/mpl.hpp deleted file mode 100644 index 9d5bb609..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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_MPL_10022005_1641) -#define FUSION_SEQUENCE_INTRINSIC_MPL_10022005_1641 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/include/boost/fusion/sequence/intrinsic/mpl/at.hpp b/include/boost/fusion/sequence/intrinsic/mpl/at.hpp deleted file mode 100644 index a164bb32..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/at.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/back.hpp b/include/boost/fusion/sequence/intrinsic/mpl/back.hpp deleted file mode 100644 index 1f5197e2..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/back.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/begin.hpp b/include/boost/fusion/sequence/intrinsic/mpl/begin.hpp deleted file mode 100644 index 6d344d75..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/begin.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/clear.hpp b/include/boost/fusion/sequence/intrinsic/mpl/clear.hpp deleted file mode 100644 index 0f2d492b..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/clear.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/detail/as.hpp b/include/boost/fusion/sequence/intrinsic/mpl/detail/as.hpp deleted file mode 100644 index 1537e549..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/detail/as.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/*============================================================================= - 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_10022005_1442) -#define FUSION_AS_10022005_1442 - -namespace boost { namespace fusion -{ - namespace result_of - { - template - struct as_list; - - template - struct as_map; - - template - struct as_set; - - template - struct as_vector; - - template - struct as_deque; - } - - namespace detail - { - template - struct as_impl; - - template <> - struct as_impl - { - template - struct apply : result_of::as_list {}; - }; - - template <> - struct as_impl - { - template - struct apply : result_of::as_map {}; - }; - - template <> - struct as_impl - { - template - struct apply : result_of::as_set {}; - }; - - template <> - struct as_impl - { - template - struct apply : result_of::as_vector {}; - }; - - template<> - struct as_impl - { - template - struct apply : result_of::as_deque {}; - }; - - template - struct as - { - typedef typename - as_impl::template apply::type - type; - }; - } -}} - -#endif diff --git a/include/boost/fusion/sequence/intrinsic/mpl/detail/clear.hpp b/include/boost/fusion/sequence/intrinsic/mpl/detail/clear.hpp deleted file mode 100644 index 28807cc7..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/detail/clear.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/empty.hpp b/include/boost/fusion/sequence/intrinsic/mpl/empty.hpp deleted file mode 100644 index a0e27d66..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/empty.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/end.hpp b/include/boost/fusion/sequence/intrinsic/mpl/end.hpp deleted file mode 100644 index 7d84a81b..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/end.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/erase.hpp b/include/boost/fusion/sequence/intrinsic/mpl/erase.hpp deleted file mode 100644 index 0ee650e0..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/erase.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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::detail::as::type, result>::type - type; - }; - }; -}} - -#endif - diff --git a/include/boost/fusion/sequence/intrinsic/mpl/erase_key.hpp b/include/boost/fusion/sequence/intrinsic/mpl/erase_key.hpp deleted file mode 100644 index 6c8ba6cf..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/erase_key.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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::detail::as::type, result>::type - type; - }; - }; -}} - -#endif - diff --git a/include/boost/fusion/sequence/intrinsic/mpl/front.hpp b/include/boost/fusion/sequence/intrinsic/mpl/front.hpp deleted file mode 100644 index 97a26f73..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/front.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/has_key.hpp b/include/boost/fusion/sequence/intrinsic/mpl/has_key.hpp deleted file mode 100644 index beac7c64..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/has_key.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/*============================================================================= - 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/sequence/intrinsic/mpl/insert.hpp b/include/boost/fusion/sequence/intrinsic/mpl/insert.hpp deleted file mode 100644 index 7df943a5..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/insert.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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::detail::as::type, result>::type - type; - }; - }; -}} - -#endif - diff --git a/include/boost/fusion/sequence/intrinsic/mpl/insert_range.hpp b/include/boost/fusion/sequence/intrinsic/mpl/insert_range.hpp deleted file mode 100644 index 1c7abc89..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/insert_range.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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::detail::as::type, result>::type - type; - }; - }; -}} - -#endif - diff --git a/include/boost/fusion/sequence/intrinsic/mpl/pop_back.hpp b/include/boost/fusion/sequence/intrinsic/mpl/pop_back.hpp deleted file mode 100644 index 94dbba3a..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/pop_back.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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::detail::as::type, result>::type - type; - }; - }; -}} - -#endif - diff --git a/include/boost/fusion/sequence/intrinsic/mpl/pop_front.hpp b/include/boost/fusion/sequence/intrinsic/mpl/pop_front.hpp deleted file mode 100644 index 957a673e..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/pop_front.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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::detail::as::type, result>::type - type; - }; - }; -}} - -#endif - diff --git a/include/boost/fusion/sequence/intrinsic/mpl/push_back.hpp b/include/boost/fusion/sequence/intrinsic/mpl/push_back.hpp deleted file mode 100644 index e828af9e..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/push_back.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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::detail::as::type, result>::type - type; - }; - }; -}} - -#endif - diff --git a/include/boost/fusion/sequence/intrinsic/mpl/push_front.hpp b/include/boost/fusion/sequence/intrinsic/mpl/push_front.hpp deleted file mode 100644 index 00431af2..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/push_front.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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::detail::as::type, result>::type - type; - }; - }; -}} - -#endif - diff --git a/include/boost/fusion/sequence/intrinsic/mpl/size.hpp b/include/boost/fusion/sequence/intrinsic/mpl/size.hpp deleted file mode 100644 index 2c724281..00000000 --- a/include/boost/fusion/sequence/intrinsic/mpl/size.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/*============================================================================= - 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/intrinsic/size.hpp b/include/boost/fusion/sequence/intrinsic/size.hpp deleted file mode 100644 index 74e3f53a..00000000 --- a/include/boost/fusion/sequence/intrinsic/size.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 90570c1f..00000000 --- a/include/boost/fusion/sequence/intrinsic/swap.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d0868155..00000000 --- a/include/boost/fusion/sequence/intrinsic/value_at.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dbef3e89..00000000 --- a/include/boost/fusion/sequence/intrinsic/value_at_key.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 080bae38..00000000 --- a/include/boost/fusion/sequence/io.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 93d63791..00000000 --- a/include/boost/fusion/sequence/io/detail/in.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 382eb32f..00000000 --- a/include/boost/fusion/sequence/io/detail/manip.hpp +++ /dev/null @@ -1,316 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bd74e20a..00000000 --- a/include/boost/fusion/sequence/io/detail/out.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 039190eb..00000000 --- a/include/boost/fusion/sequence/io/in.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 48098e57..00000000 --- a/include/boost/fusion/sequence/io/out.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index af6faf56..00000000 --- a/include/boost/fusion/sequence/sequence_facade.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 35a17af9..00000000 --- a/include/boost/fusion/sequence/utility.hpp +++ /dev/null @@ -1,14 +0,0 @@ -// -// 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/sequence/view.hpp b/include/boost/fusion/sequence/view.hpp deleted file mode 100644 index 712a9ac5..00000000 --- a/include/boost/fusion/sequence/view.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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/sequence/view/ext_/multiple_view.hpp b/include/boost/fusion/sequence/view/ext_/multiple_view.hpp deleted file mode 100755 index e34b1d62..00000000 --- a/include/boost/fusion/sequence/view/ext_/multiple_view.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/*============================================================================= - 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/sequence/view/ext_/segmented_iterator.hpp b/include/boost/fusion/sequence/view/ext_/segmented_iterator.hpp deleted file mode 100755 index 2f6c1f74..00000000 --- a/include/boost/fusion/sequence/view/ext_/segmented_iterator.hpp +++ /dev/null @@ -1,425 +0,0 @@ -/*============================================================================= - 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/sequence/view/ext_/segmented_iterator_range.hpp b/include/boost/fusion/sequence/view/ext_/segmented_iterator_range.hpp deleted file mode 100755 index 7bab8789..00000000 --- a/include/boost/fusion/sequence/view/ext_/segmented_iterator_range.hpp +++ /dev/null @@ -1,522 +0,0 @@ -/*============================================================================= - 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 - -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/sequence/view/filter_view.hpp b/include/boost/fusion/sequence/view/filter_view.hpp deleted file mode 100644 index d8fb4936..00000000 --- a/include/boost/fusion/sequence/view/filter_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/detail/begin_impl.hpp b/include/boost/fusion/sequence/view/filter_view/detail/begin_impl.hpp deleted file mode 100644 index 2ffe7bd0..00000000 --- a/include/boost/fusion/sequence/view/filter_view/detail/begin_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/detail/deref_impl.hpp b/include/boost/fusion/sequence/view/filter_view/detail/deref_impl.hpp deleted file mode 100644 index 3e6447c5..00000000 --- a/include/boost/fusion/sequence/view/filter_view/detail/deref_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/detail/end_impl.hpp b/include/boost/fusion/sequence/view/filter_view/detail/end_impl.hpp deleted file mode 100644 index 677004d4..00000000 --- a/include/boost/fusion/sequence/view/filter_view/detail/end_impl.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/detail/equal_to_impl.hpp b/include/boost/fusion/sequence/view/filter_view/detail/equal_to_impl.hpp deleted file mode 100644 index 5d7b2932..00000000 --- a/include/boost/fusion/sequence/view/filter_view/detail/equal_to_impl.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/detail/next_impl.hpp b/include/boost/fusion/sequence/view/filter_view/detail/next_impl.hpp deleted file mode 100644 index 8423dfe1..00000000 --- a/include/boost/fusion/sequence/view/filter_view/detail/next_impl.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/detail/size_impl.hpp b/include/boost/fusion/sequence/view/filter_view/detail/size_impl.hpp deleted file mode 100644 index 1c5a0aca..00000000 --- a/include/boost/fusion/sequence/view/filter_view/detail/size_impl.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/detail/value_of_impl.hpp b/include/boost/fusion/sequence/view/filter_view/detail/value_of_impl.hpp deleted file mode 100644 index f9188f6f..00000000 --- a/include/boost/fusion/sequence/view/filter_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/filter_view.hpp b/include/boost/fusion/sequence/view/filter_view/filter_view.hpp deleted file mode 100644 index e09ec97f..00000000 --- a/include/boost/fusion/sequence/view/filter_view/filter_view.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - 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/sequence/view/filter_view/filter_view_iterator.hpp b/include/boost/fusion/sequence/view/filter_view/filter_view_iterator.hpp deleted file mode 100644 index aaf1d6e0..00000000 --- a/include/boost/fusion/sequence/view/filter_view/filter_view_iterator.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 - -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/sequence/view/iterator_range.hpp b/include/boost/fusion/sequence/view/iterator_range.hpp deleted file mode 100644 index 16485eb4..00000000 --- a/include/boost/fusion/sequence/view/iterator_range.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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/sequence/view/iterator_range/detail/at_impl.hpp b/include/boost/fusion/sequence/view/iterator_range/detail/at_impl.hpp deleted file mode 100644 index 5f882aaa..00000000 --- a/include/boost/fusion/sequence/view/iterator_range/detail/at_impl.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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/sequence/view/iterator_range/detail/begin_impl.hpp b/include/boost/fusion/sequence/view/iterator_range/detail/begin_impl.hpp deleted file mode 100644 index 32341369..00000000 --- a/include/boost/fusion/sequence/view/iterator_range/detail/begin_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/view/iterator_range/detail/end_impl.hpp b/include/boost/fusion/sequence/view/iterator_range/detail/end_impl.hpp deleted file mode 100644 index dacbe191..00000000 --- a/include/boost/fusion/sequence/view/iterator_range/detail/end_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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/sequence/view/iterator_range/detail/value_at_impl.hpp b/include/boost/fusion/sequence/view/iterator_range/detail/value_at_impl.hpp deleted file mode 100644 index b6fe8881..00000000 --- a/include/boost/fusion/sequence/view/iterator_range/detail/value_at_impl.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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/sequence/view/iterator_range/iterator_range.hpp b/include/boost/fusion/sequence/view/iterator_range/iterator_range.hpp deleted file mode 100644 index dee6c00a..00000000 --- a/include/boost/fusion/sequence/view/iterator_range/iterator_range.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 - -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/sequence/view/joint_view.hpp b/include/boost/fusion/sequence/view/joint_view.hpp deleted file mode 100644 index 6d9209a8..00000000 --- a/include/boost/fusion/sequence/view/joint_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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/sequence/view/joint_view/detail/begin_impl.hpp b/include/boost/fusion/sequence/view/joint_view/detail/begin_impl.hpp deleted file mode 100644 index e2b0281e..00000000 --- a/include/boost/fusion/sequence/view/joint_view/detail/begin_impl.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - 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/sequence/view/joint_view/detail/deref_impl.hpp b/include/boost/fusion/sequence/view/joint_view/detail/deref_impl.hpp deleted file mode 100644 index 7eb47184..00000000 --- a/include/boost/fusion/sequence/view/joint_view/detail/deref_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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/sequence/view/joint_view/detail/end_impl.hpp b/include/boost/fusion/sequence/view/joint_view/detail/end_impl.hpp deleted file mode 100644 index 5bdeb02e..00000000 --- a/include/boost/fusion/sequence/view/joint_view/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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/sequence/view/joint_view/detail/next_impl.hpp b/include/boost/fusion/sequence/view/joint_view/detail/next_impl.hpp deleted file mode 100644 index 80d3580d..00000000 --- a/include/boost/fusion/sequence/view/joint_view/detail/next_impl.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/*============================================================================= - 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/sequence/view/joint_view/detail/value_of_impl.hpp b/include/boost/fusion/sequence/view/joint_view/detail/value_of_impl.hpp deleted file mode 100644 index 53afe1c9..00000000 --- a/include/boost/fusion/sequence/view/joint_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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/sequence/view/joint_view/joint_view.hpp b/include/boost/fusion/sequence/view/joint_view/joint_view.hpp deleted file mode 100644 index d0c48200..00000000 --- a/include/boost/fusion/sequence/view/joint_view/joint_view.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - 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/sequence/view/joint_view/joint_view_iterator.hpp b/include/boost/fusion/sequence/view/joint_view/joint_view_iterator.hpp deleted file mode 100644 index 0bdfae07..00000000 --- a/include/boost/fusion/sequence/view/joint_view/joint_view_iterator.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - 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 - -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/sequence/view/repetitive_view.hpp b/include/boost/fusion/sequence/view/repetitive_view.hpp deleted file mode 100644 index 8940174b..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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/sequence/view/repetitive_view/detail/begin_impl.hpp b/include/boost/fusion/sequence/view/repetitive_view/detail/begin_impl.hpp deleted file mode 100644 index b5c4c29a..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view/detail/begin_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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/sequence/view/repetitive_view/detail/deref_impl.hpp b/include/boost/fusion/sequence/view/repetitive_view/detail/deref_impl.hpp deleted file mode 100644 index 2c0caf80..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view/detail/deref_impl.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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/sequence/view/repetitive_view/detail/end_impl.hpp b/include/boost/fusion/sequence/view/repetitive_view/detail/end_impl.hpp deleted file mode 100644 index 00ac0874..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view/detail/end_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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/sequence/view/repetitive_view/detail/next_impl.hpp b/include/boost/fusion/sequence/view/repetitive_view/detail/next_impl.hpp deleted file mode 100644 index b629cb01..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view/detail/next_impl.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/*============================================================================= - 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/sequence/view/repetitive_view/detail/value_of_impl.hpp b/include/boost/fusion/sequence/view/repetitive_view/detail/value_of_impl.hpp deleted file mode 100644 index bf5f2f06..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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/sequence/view/repetitive_view/repetitive_view.hpp b/include/boost/fusion/sequence/view/repetitive_view/repetitive_view.hpp deleted file mode 100644 index 2e06fd80..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view/repetitive_view.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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/sequence/view/repetitive_view/repetitive_view_fwd.hpp b/include/boost/fusion/sequence/view/repetitive_view/repetitive_view_fwd.hpp deleted file mode 100644 index 24e146c0..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view/repetitive_view_fwd.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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/sequence/view/repetitive_view/repetitive_view_iterator.hpp b/include/boost/fusion/sequence/view/repetitive_view/repetitive_view_iterator.hpp deleted file mode 100644 index 6b2a9a5e..00000000 --- a/include/boost/fusion/sequence/view/repetitive_view/repetitive_view_iterator.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 - -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/sequence/view/reverse_view.hpp b/include/boost/fusion/sequence/view/reverse_view.hpp deleted file mode 100644 index 6aa499e3..00000000 --- a/include/boost/fusion/sequence/view/reverse_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/detail/advance_impl.hpp b/include/boost/fusion/sequence/view/reverse_view/detail/advance_impl.hpp deleted file mode 100644 index 8785881e..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/detail/advance_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/detail/begin_impl.hpp b/include/boost/fusion/sequence/view/reverse_view/detail/begin_impl.hpp deleted file mode 100644 index b7968f56..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/detail/begin_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/detail/deref_impl.hpp b/include/boost/fusion/sequence/view/reverse_view/detail/deref_impl.hpp deleted file mode 100644 index 97cb8915..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/detail/deref_impl.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/detail/distance_impl.hpp b/include/boost/fusion/sequence/view/reverse_view/detail/distance_impl.hpp deleted file mode 100644 index 5edc7499..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/detail/distance_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/detail/end_impl.hpp b/include/boost/fusion/sequence/view/reverse_view/detail/end_impl.hpp deleted file mode 100644 index 916e49d0..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/detail/end_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/detail/next_impl.hpp b/include/boost/fusion/sequence/view/reverse_view/detail/next_impl.hpp deleted file mode 100644 index c036510c..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/detail/next_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/detail/prior_impl.hpp b/include/boost/fusion/sequence/view/reverse_view/detail/prior_impl.hpp deleted file mode 100644 index 317054fc..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/detail/prior_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/detail/value_of_impl.hpp b/include/boost/fusion/sequence/view/reverse_view/detail/value_of_impl.hpp deleted file mode 100644 index bf9b2ade..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/reverse_view.hpp b/include/boost/fusion/sequence/view/reverse_view/reverse_view.hpp deleted file mode 100644 index 6e6f4c09..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/reverse_view.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/*============================================================================= - 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/sequence/view/reverse_view/reverse_view_iterator.hpp b/include/boost/fusion/sequence/view/reverse_view/reverse_view_iterator.hpp deleted file mode 100644 index 5f44b8b5..00000000 --- a/include/boost/fusion/sequence/view/reverse_view/reverse_view_iterator.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 - -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/sequence/view/single_view.hpp b/include/boost/fusion/sequence/view/single_view.hpp deleted file mode 100644 index e4a59476..00000000 --- a/include/boost/fusion/sequence/view/single_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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/sequence/view/single_view/detail/begin_impl.hpp b/include/boost/fusion/sequence/view/single_view/detail/begin_impl.hpp deleted file mode 100644 index 395992be..00000000 --- a/include/boost/fusion/sequence/view/single_view/detail/begin_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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/sequence/view/single_view/detail/deref_impl.hpp b/include/boost/fusion/sequence/view/single_view/detail/deref_impl.hpp deleted file mode 100644 index 355cf6ac..00000000 --- a/include/boost/fusion/sequence/view/single_view/detail/deref_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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/sequence/view/single_view/detail/end_impl.hpp b/include/boost/fusion/sequence/view/single_view/detail/end_impl.hpp deleted file mode 100644 index d239c242..00000000 --- a/include/boost/fusion/sequence/view/single_view/detail/end_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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/sequence/view/single_view/detail/next_impl.hpp b/include/boost/fusion/sequence/view/single_view/detail/next_impl.hpp deleted file mode 100644 index c9cdafdf..00000000 --- a/include/boost/fusion/sequence/view/single_view/detail/next_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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/sequence/view/single_view/detail/value_of_impl.hpp b/include/boost/fusion/sequence/view/single_view/detail/value_of_impl.hpp deleted file mode 100644 index f975eb14..00000000 --- a/include/boost/fusion/sequence/view/single_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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/sequence/view/single_view/single_view.hpp b/include/boost/fusion/sequence/view/single_view/single_view.hpp deleted file mode 100644 index 31b68e20..00000000 --- a/include/boost/fusion/sequence/view/single_view/single_view.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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/sequence/view/single_view/single_view_iterator.hpp b/include/boost/fusion/sequence/view/single_view/single_view_iterator.hpp deleted file mode 100644 index 68155d37..00000000 --- a/include/boost/fusion/sequence/view/single_view/single_view_iterator.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view.hpp b/include/boost/fusion/sequence/view/transform_view.hpp deleted file mode 100644 index 714f8784..00000000 --- a/include/boost/fusion/sequence/view/transform_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/advance_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/advance_impl.hpp deleted file mode 100644 index 6b323484..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/advance_impl.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/apply_transform_result.hpp b/include/boost/fusion/sequence/view/transform_view/detail/apply_transform_result.hpp deleted file mode 100644 index 73be3045..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/apply_transform_result.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/at_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/at_impl.hpp deleted file mode 100644 index eb48cfa0..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/at_impl.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/begin_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/begin_impl.hpp deleted file mode 100644 index b5f4bc29..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/begin_impl.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/deref_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/deref_impl.hpp deleted file mode 100644 index d466cfd3..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/deref_impl.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/distance_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/distance_impl.hpp deleted file mode 100644 index d5ae0adc..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/distance_impl.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/end_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/end_impl.hpp deleted file mode 100644 index a689d933..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/end_impl.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/equal_to_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/equal_to_impl.hpp deleted file mode 100644 index 063a00ed..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/equal_to_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/next_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/next_impl.hpp deleted file mode 100644 index 4d6ec743..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/next_impl.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/prior_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/prior_impl.hpp deleted file mode 100644 index f7d49966..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/prior_impl.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/value_at_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/value_at_impl.hpp deleted file mode 100644 index cc5bbf46..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/value_at_impl.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/detail/value_of_impl.hpp b/include/boost/fusion/sequence/view/transform_view/detail/value_of_impl.hpp deleted file mode 100644 index 28e9942c..00000000 --- a/include/boost/fusion/sequence/view/transform_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/transform_view.hpp b/include/boost/fusion/sequence/view/transform_view/transform_view.hpp deleted file mode 100644 index 853bdf61..00000000 --- a/include/boost/fusion/sequence/view/transform_view/transform_view.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/transform_view_fwd.hpp b/include/boost/fusion/sequence/view/transform_view/transform_view_fwd.hpp deleted file mode 100644 index 7dca304a..00000000 --- a/include/boost/fusion/sequence/view/transform_view/transform_view_fwd.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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/sequence/view/transform_view/transform_view_iterator.hpp b/include/boost/fusion/sequence/view/transform_view/transform_view_iterator.hpp deleted file mode 100644 index 4d63f7e0..00000000 --- a/include/boost/fusion/sequence/view/transform_view/transform_view_iterator.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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 - -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/sequence/view/zip_view.hpp b/include/boost/fusion/sequence/view/zip_view.hpp deleted file mode 100644 index 74f71421..00000000 --- a/include/boost/fusion/sequence/view/zip_view.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/advance_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/advance_impl.hpp deleted file mode 100644 index 36da0444..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/advance_impl.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/at_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/at_impl.hpp deleted file mode 100644 index d90b5d05..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/at_impl.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/begin_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/begin_impl.hpp deleted file mode 100644 index c98eb7fc..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/begin_impl.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/deref_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/deref_impl.hpp deleted file mode 100644 index 70b95d55..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/deref_impl.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/distance_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/distance_impl.hpp deleted file mode 100644 index 61447278..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/distance_impl.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/end_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/end_impl.hpp deleted file mode 100644 index a19b5c1f..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/end_impl.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/equal_to_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/equal_to_impl.hpp deleted file mode 100644 index 7def2030..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/equal_to_impl.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/next_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/next_impl.hpp deleted file mode 100644 index cae95eec..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/next_impl.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/prior_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/prior_impl.hpp deleted file mode 100644 index 787eb4f9..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/prior_impl.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/size_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/size_impl.hpp deleted file mode 100644 index 70798d28..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/size_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/strictest_traversal.hpp b/include/boost/fusion/sequence/view/zip_view/detail/strictest_traversal.hpp deleted file mode 100644 index 60abb57c..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/strictest_traversal.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/value_at_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/value_at_impl.hpp deleted file mode 100644 index ed5475ba..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/value_at_impl.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/detail/value_of_impl.hpp b/include/boost/fusion/sequence/view/zip_view/detail/value_of_impl.hpp deleted file mode 100644 index 9ea84a17..00000000 --- a/include/boost/fusion/sequence/view/zip_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/zip_view.hpp b/include/boost/fusion/sequence/view/zip_view/zip_view.hpp deleted file mode 100644 index 563d853f..00000000 --- a/include/boost/fusion/sequence/view/zip_view/zip_view.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/zip_view_iterator.hpp b/include/boost/fusion/sequence/view/zip_view/zip_view_iterator.hpp deleted file mode 100644 index d4ebcc58..00000000 --- a/include/boost/fusion/sequence/view/zip_view/zip_view_iterator.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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/sequence/view/zip_view/zip_view_iterator_fwd.hpp b/include/boost/fusion/sequence/view/zip_view/zip_view_iterator_fwd.hpp deleted file mode 100644 index 6e8bf3f2..00000000 --- a/include/boost/fusion/sequence/view/zip_view/zip_view_iterator_fwd.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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 diff --git a/include/boost/fusion/support.hpp b/include/boost/fusion/support.hpp deleted file mode 100644 index 012ee107..00000000 --- a/include/boost/fusion/support.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4d38fb64..00000000 --- a/include/boost/fusion/support/category_of.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 846fbc4d..00000000 --- a/include/boost/fusion/support/deduce.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 41ecbd1b..00000000 --- a/include/boost/fusion/support/deduce_sequence.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 looses 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 deleted file mode 100644 index 0508e50f..00000000 --- a/include/boost/fusion/support/detail/access.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 78e4b631..00000000 --- a/include/boost/fusion/support/detail/as_fusion_element.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 04102cfd..00000000 --- a/include/boost/fusion/support/detail/category_of.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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/compiler_config.hpp b/include/boost/fusion/support/detail/compiler_config.hpp deleted file mode 100644 index 3859ef78..00000000 --- a/include/boost/fusion/support/detail/compiler_config.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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_COMPILER_CONFIG_01052006_1200) -#define FUSION_COMPILER_CONFIG_01052006_1200 - -#include -#include - -#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) -#pragma warning(disable : 4512 4244 4100 4305) -#endif - -#endif diff --git a/include/boost/fusion/support/detail/is_mpl_sequence.hpp b/include/boost/fusion/support/detail/is_mpl_sequence.hpp deleted file mode 100644 index eeb8f916..00000000 --- a/include/boost/fusion/support/detail/is_mpl_sequence.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5fa2f241..00000000 --- a/include/boost/fusion/support/detail/is_view.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 37a7fe94..00000000 --- a/include/boost/fusion/support/detail/mpl_iterator_category.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 48ffcc2b..00000000 --- a/include/boost/fusion/support/detail/unknown_key.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 38def075..00000000 --- a/include/boost/fusion/support/ext_/is_segmented.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9e775f4e..00000000 --- a/include/boost/fusion/support/is_iterator.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 84dc2ec1..00000000 --- a/include/boost/fusion/support/is_sequence.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a89291d1..00000000 --- a/include/boost/fusion/support/is_view.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 39d05c40..00000000 --- a/include/boost/fusion/support/iterator_base.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 - -#include - -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 deleted file mode 100644 index 67758071..00000000 --- a/include/boost/fusion/support/pair.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/*============================================================================= - 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 -#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 deleted file mode 100644 index 1a82848d..00000000 --- a/include/boost/fusion/support/sequence_base.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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 -#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 deleted file mode 100644 index a1ccf12d..00000000 --- a/include/boost/fusion/support/tag_of.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 053cacaf..00000000 --- a/include/boost/fusion/support/tag_of_fwd.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dc2014ec..00000000 --- a/include/boost/fusion/support/unused.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 63275b11..00000000 --- a/include/boost/fusion/support/void.hpp +++ /dev/null @@ -1,8 +0,0 @@ -#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 deleted file mode 100644 index c4b56b9e..00000000 --- a/include/boost/fusion/tuple.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2ff20a2a..00000000 --- a/include/boost/fusion/tuple/detail/tuple_forward_ctor.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 32fd912e..00000000 --- a/include/boost/fusion/tuple/make_tuple.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a32e6b3e..00000000 --- a/include/boost/fusion/tuple/tuple.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f3e660e5..00000000 --- a/include/boost/fusion/tuple/tuple_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b6c21eff..00000000 --- a/include/boost/fusion/tuple/tuple_tie.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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) - From c3fec7efe69cdfbe4cd8c6c27fdd12eb3b767f16 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sat, 20 Oct 2007 23:52:36 +0000 Subject: [PATCH 03/14] creating branch for fusion 2.1 [SVN r40231] --- doc/Jamfile | 17 + doc/acknowledgements.qbk | 16 + doc/algorithms.qbk | 2402 ++++++++++ doc/changelog.qbk | 9 + doc/extension.qbk | 377 ++ doc/functional.qbk | 1694 +++++++ doc/fusion.qbk | 309 ++ doc/html/boostbook.css | 511 +++ doc/html/fusion/acknowledgements.html | 53 + doc/html/fusion/algorithms.html | 110 + doc/html/fusion/algorithms/concepts.html | 41 + doc/html/fusion/algorithms/concepts/poly.html | 96 + doc/html/fusion/algorithms/iteration.html | 54 + .../algorithms/iteration/functions.html | 44 + .../iteration/functions/accumulate.html | 198 + .../algorithms/iteration/functions/fold.html | 198 + .../iteration/functions/for_each.html | 174 + .../algorithms/iteration/metafunctions.html | 44 + .../iteration/metafunctions/accumulate.html | 176 + .../iteration/metafunctions/fold.html | 176 + .../iteration/metafunctions/for_each.html | 158 + doc/html/fusion/algorithms/query.html | 53 + .../fusion/algorithms/query/functions.html | 48 + .../algorithms/query/functions/all.html | 177 + .../algorithms/query/functions/any.html | 177 + .../algorithms/query/functions/count.html | 164 + .../algorithms/query/functions/count_if.html | 163 + .../algorithms/query/functions/find.html | 169 + .../algorithms/query/functions/find_if.html | 173 + .../algorithms/query/functions/none.html | 177 + .../algorithms/query/metafunctions.html | 48 + .../algorithms/query/metafunctions/all.html | 161 + .../algorithms/query/metafunctions/any.html | 161 + .../algorithms/query/metafunctions/count.html | 156 + .../query/metafunctions/count_if.html | 156 + .../algorithms/query/metafunctions/find.html | 157 + .../query/metafunctions/find_if.html | 159 + .../algorithms/query/metafunctions/none.html | 161 + .../fusion/algorithms/transformation.html | 66 + .../algorithms/transformation/functions.html | 60 + .../transformation/functions/clear.html | 140 + .../transformation/functions/erase.html | 208 + .../transformation/functions/erase_key.html | 167 + .../transformation/functions/filter.html | 164 + .../transformation/functions/filter_if.html | 167 + .../transformation/functions/insert.html | 185 + .../functions/insert_range.html | 188 + .../transformation/functions/join.html | 166 + .../transformation/functions/pop_back.html | 142 + .../transformation/functions/pop_front.html | 142 + .../transformation/functions/push_back.html | 163 + .../transformation/functions/push_front.html | 164 + .../transformation/functions/remove.html | 164 + .../transformation/functions/remove_if.html | 166 + .../transformation/functions/replace.html | 185 + .../transformation/functions/replace_if.html | 194 + .../transformation/functions/reverse.html | 141 + .../transformation/functions/transform.html | 292 ++ .../transformation/functions/zip.html | 153 + .../transformation/metafunctions.html | 60 + .../transformation/metafunctions/clear.html | 134 + .../transformation/metafunctions/erase.html | 191 + .../metafunctions/erase_key.html | 158 + .../transformation/metafunctions/filter.html | 160 + .../metafunctions/filter_if.html | 161 + .../transformation/metafunctions/insert.html | 179 + .../metafunctions/insert_range.html | 181 + .../transformation/metafunctions/join.html | 93 + .../metafunctions/pop_back.html | 138 + .../metafunctions/pop_front.html | 138 + .../metafunctions/push_back.html | 159 + .../metafunctions/push_front.html | 159 + .../transformation/metafunctions/remove.html | 160 + .../metafunctions/remove_if.html | 161 + .../transformation/metafunctions/replace.html | 157 + .../metafunctions/replace_if.html | 178 + .../transformation/metafunctions/reverse.html | 137 + .../metafunctions/transform.html | 292 ++ .../transformation/metafunctions/zip.html | 100 + doc/html/fusion/change_log.html | 55 + doc/html/fusion/extension.html | 536 +++ doc/html/fusion/functional.html | 165 + doc/html/fusion/functional/adapters.html | 52 + .../fusion/functional/adapters/fused.html | 249 + .../adapters/fused_function_object.html | 272 ++ .../functional/adapters/fused_procedure.html | 269 ++ .../functional/adapters/unfused_generic.html | 298 ++ .../adapters/unfused_lvalue_args.html | 266 ++ .../adapters/unfused_rvalue_args.html | 266 ++ .../functional/adapters/unfused_typed.html | 347 ++ doc/html/fusion/functional/concepts.html | 48 + .../fusion/functional/concepts/callable.html | 64 + .../functional/concepts/def_callable.html | 146 + doc/html/fusion/functional/concepts/poly.html | 160 + .../functional/concepts/reg_callable.html | 141 + doc/html/fusion/functional/generation.html | 43 + .../functional/generation/functions.html | 54 + .../generation/functions/mk_fused.html | 158 + .../generation/functions/mk_fused_fobj.html | 174 + .../generation/functions/mk_fused_proc.html | 154 + .../functions/mk_unfused_genrc.html | 181 + .../functions/mk_unfused_lvargs.html | 172 + .../functions/mk_unfused_rvargs.html | 170 + .../functional/generation/metafunctions.html | 55 + .../generation/metafunctions/mk_fused.html | 79 + .../metafunctions/mk_fused_fobj.html | 80 + .../metafunctions/mk_fused_proc.html | 80 + .../metafunctions/mk_unfused_genrc.html | 80 + .../metafunctions/mk_unfused_lvargs.html | 80 + .../metafunctions/mk_unfused_rvargs.html | 79 + doc/html/fusion/functional/invocation.html | 44 + .../functional/invocation/functions.html | 46 + .../invocation/functions/invoke.html | 192 + .../invocation/functions/invoke_fobj.html | 209 + .../invocation/functions/invoke_proc.html | 201 + .../functional/invocation/metafunctions.html | 47 + .../invocation/metafunctions/invoke.html | 73 + .../invocation/metafunctions/invoke_fobj.html | 78 + .../invocation/metafunctions/invoke_proc.html | 78 + doc/html/fusion/introduction.html | 141 + doc/html/fusion/iterators.html | 94 + doc/html/fusion/iterators/concepts.html | 61 + .../concepts/bidirectional_iterator.html | 320 ++ .../iterators/concepts/forward_iterator.html | 577 +++ .../concepts/random_access_iterator.html | 297 ++ doc/html/fusion/iterators/functions.html | 53 + .../fusion/iterators/functions/advance.html | 161 + .../fusion/iterators/functions/advance_c.html | 160 + .../fusion/iterators/functions/deref.html | 137 + .../fusion/iterators/functions/distance.html | 135 + doc/html/fusion/iterators/functions/next.html | 137 + .../fusion/iterators/functions/prior.html | 136 + doc/html/fusion/iterators/metafunctions.html | 50 + .../iterators/metafunctions/advance.html | 165 + .../iterators/metafunctions/advance_c.html | 164 + .../fusion/iterators/metafunctions/deref.html | 143 + .../iterators/metafunctions/distance.html | 143 + .../iterators/metafunctions/equal_to.html | 141 + .../fusion/iterators/metafunctions/next.html | 138 + .../fusion/iterators/metafunctions/prior.html | 141 + .../iterators/metafunctions/value_of.html | 141 + doc/html/fusion/iterators/operators.html | 52 + .../operators/operator_equality.html | 129 + .../operators/operator_inequality.html | 125 + .../operators/operator_unary_star.html | 141 + doc/html/fusion/notes.html | 257 ++ doc/html/fusion/organization.html | 205 + doc/html/fusion/preface.html | 226 + doc/html/fusion/quick_start.html | 261 ++ doc/html/fusion/references.html | 68 + doc/html/fusion/sequences.html | 115 + doc/html/fusion/sequences/adapted.html | 73 + .../sequences/adapted/boost__array.html | 80 + .../sequences/adapted/boost__tuple.html | 76 + .../sequences/adapted/boost__variant.html | 80 + .../sequences/adapted/mpl_sequence.html | 96 + .../fusion/sequences/adapted/std__pair.html | 79 + doc/html/fusion/sequences/concepts.html | 81 + .../concepts/associative_sequence.html | 328 ++ .../concepts/bidirectional_sequence.html | 344 ++ .../sequences/concepts/forward_sequence.html | 471 ++ .../concepts/random_access_sequence.html | 373 ++ doc/html/fusion/sequences/containers.html | 59 + .../fusion/sequences/containers/cons.html | 321 ++ .../fusion/sequences/containers/list.html | 289 ++ doc/html/fusion/sequences/containers/map.html | 278 ++ doc/html/fusion/sequences/containers/set.html | 270 ++ .../fusion/sequences/containers/vector.html | 300 ++ doc/html/fusion/sequences/conversion.html | 54 + .../sequences/conversion/functions.html | 45 + .../conversion/functions/as_list.html | 133 + .../conversion/functions/as_map.html | 140 + .../conversion/functions/as_set.html | 137 + .../conversion/functions/as_vector.html | 133 + .../sequences/conversion/metafunctions.html | 45 + .../conversion/metafunctions/as_list.html | 129 + .../conversion/metafunctions/as_map.html | 136 + .../conversion/metafunctions/as_set.html | 133 + .../conversion/metafunctions/as_vector.html | 129 + doc/html/fusion/sequences/generation.html | 53 + .../sequences/generation/functions.html | 50 + .../generation/functions/list_tie.html | 144 + .../generation/functions/make_cons.html | 163 + .../generation/functions/make_list.html | 149 + .../generation/functions/make_map.html | 191 + .../generation/functions/make_set.html | 161 + .../generation/functions/make_vector.html | 149 + .../generation/functions/map_tie.html | 170 + .../sequences/generation/functions/tiers.html | 101 + .../generation/functions/vector_tie.html | 144 + .../sequences/generation/metafunctions.html | 49 + .../generation/metafunctions/list_tie.html | 141 + .../generation/metafunctions/make_cons.html | 150 + .../generation/metafunctions/make_list.html | 142 + .../generation/metafunctions/make_map.html | 185 + .../generation/metafunctions/make_set.html | 154 + .../generation/metafunctions/make_vector.html | 142 + .../generation/metafunctions/map_tie.html | 166 + .../generation/metafunctions/vector_tie.html | 141 + doc/html/fusion/sequences/intrinsics.html | 67 + .../sequences/intrinsics/functions.html | 52 + .../sequences/intrinsics/functions/at.html | 169 + .../sequences/intrinsics/functions/at_c.html | 169 + .../intrinsics/functions/at_key.html | 164 + .../sequences/intrinsics/functions/back.html | 145 + .../sequences/intrinsics/functions/begin.html | 151 + .../sequences/intrinsics/functions/empty.html | 134 + .../sequences/intrinsics/functions/end.html | 151 + .../sequences/intrinsics/functions/front.html | 145 + .../intrinsics/functions/has_key.html | 154 + .../sequences/intrinsics/functions/size.html | 133 + .../sequences/intrinsics/functions/swap.html | 135 + .../sequences/intrinsics/metafunctions.html | 55 + .../intrinsics/metafunctions/at.html | 166 + .../intrinsics/metafunctions/at_c.html | 165 + .../intrinsics/metafunctions/at_key.html | 167 + .../intrinsics/metafunctions/back.html | 133 + .../intrinsics/metafunctions/begin.html | 135 + .../intrinsics/metafunctions/empty.html | 138 + .../intrinsics/metafunctions/end.html | 135 + .../intrinsics/metafunctions/front.html | 134 + .../intrinsics/metafunctions/has_key.html | 158 + .../intrinsics/metafunctions/size.html | 135 + .../intrinsics/metafunctions/swap.html | 124 + .../intrinsics/metafunctions/value_at.html | 155 + .../intrinsics/metafunctions/value_at_c.html | 154 + .../metafunctions/value_at_key.html | 155 + doc/html/fusion/sequences/operators.html | 48 + .../sequences/operators/comparison.html | 68 + .../sequences/operators/comparison/equal.html | 154 + .../operators/comparison/greater_than.html | 148 + .../comparison/greater_than_equal.html | 147 + .../operators/comparison/less_than.html | 150 + .../operators/comparison/less_than_equal.html | 148 + .../operators/comparison/not_equal.html | 150 + doc/html/fusion/sequences/operators/i_o.html | 135 + .../fusion/sequences/operators/i_o/in.html | 151 + .../fusion/sequences/operators/i_o/out.html | 150 + doc/html/fusion/sequences/views.html | 64 + .../fusion/sequences/views/filter_view.html | 244 + .../sequences/views/iterator_range.html | 258 ++ .../fusion/sequences/views/joint_view.html | 245 + .../fusion/sequences/views/reverse_view.html | 216 + .../fusion/sequences/views/single_view.html | 208 + .../sequences/views/transform_view.html | 383 ++ doc/html/fusion/sequences/views/zip_view.html | 230 + doc/html/fusion/support.html | 51 + doc/html/fusion/support/category_of.html | 192 + doc/html/fusion/support/deduce.html | 99 + doc/html/fusion/support/deduce_sequence.html | 101 + doc/html/fusion/support/is_sequence.html | 146 + doc/html/fusion/support/is_view.html | 150 + doc/html/fusion/support/pair.html | 337 ++ doc/html/fusion/support/tag_of.html | 146 + doc/html/fusion/tuples.html | 65 + .../fusion/tuples/class_template_tuple.html | 80 + .../class_template_tuple/construction.html | 130 + .../class_template_tuple/element_access.html | 95 + .../relational_operators.html | 207 + .../tuple_creation_functions.html | 80 + .../tuple_helper_classes.html | 87 + doc/html/fusion/tuples/pairs.html | 108 + doc/html/images/alert.png | Bin 0 -> 603 bytes doc/html/images/caution.png | Bin 0 -> 1250 bytes doc/html/images/fusion_org.png | Bin 0 -> 1849 bytes doc/html/images/home.png | Bin 0 -> 358 bytes doc/html/images/important.png | Bin 0 -> 722 bytes doc/html/images/next.png | Bin 0 -> 336 bytes doc/html/images/note.png | Bin 0 -> 658 bytes doc/html/images/prev.png | Bin 0 -> 334 bytes doc/html/images/smiley.png | Bin 0 -> 867 bytes doc/html/images/tip.png | Bin 0 -> 640 bytes doc/html/images/up.png | Bin 0 -> 370 bytes doc/html/images/warning.png | Bin 0 -> 1241 bytes doc/html/index.html | 234 + doc/introduction.qbk | 81 + doc/iterators.qbk | 855 ++++ doc/notes.qbk | 146 + doc/organization.qbk | 68 + doc/preface.qbk | 68 + doc/quick_start.qbk | 159 + doc/references.qbk | 19 + doc/sequences.qbk | 4036 +++++++++++++++++ doc/support.qbk | 427 ++ doc/tuples.qbk | 264 ++ example/cookbook/do_the_bind.cpp | 237 + example/cookbook/fill_em_up.cpp | 105 + example/extension/Jamfile | 18 + example/extension/detail/advance_impl.hpp | 47 + example/extension/detail/at_impl.hpp | 67 + example/extension/detail/at_key_impl.hpp | 72 + example/extension/detail/begin_impl.hpp | 43 + example/extension/detail/category_of_impl.hpp | 34 + example/extension/detail/deref_impl.hpp | 67 + example/extension/detail/distance_impl.hpp | 44 + example/extension/detail/end_impl.hpp | 43 + example/extension/detail/equal_to_impl.hpp | 38 + example/extension/detail/has_key_impl.hpp | 45 + example/extension/detail/is_sequence_impl.hpp | 34 + example/extension/detail/is_view_impl.hpp | 32 + example/extension/detail/next_impl.hpp | 46 + example/extension/detail/prior_impl.hpp | 46 + example/extension/detail/size_impl.hpp | 36 + example/extension/detail/value_at_impl.hpp | 44 + .../extension/detail/value_at_key_impl.hpp | 50 + example/extension/detail/value_of_impl.hpp | 49 + example/extension/example_struct.hpp | 25 + example/extension/example_struct_iterator.hpp | 64 + example/extension/example_struct_type.hpp | 27 + example/extension/tag_of.hpp | 30 + example/extension/test_example.cpp | 62 + example/performance/Jamfile | 20 + example/performance/accumulate.cpp | 352 ++ example/performance/functional.cpp | 318 ++ example/performance/inner_product.cpp | 178 + example/performance/inner_product2.cpp | 198 + example/performance/measure.hpp | 85 + example/performance/sequence_efficiency.cpp | 244 + example/performance/timings.txt | 49 + example/performance/zip_efficiency.cpp | 155 + index.html | 15 + test/Jamfile | 147 + test/algorithm/all.cpp | 58 + test/algorithm/any.cpp | 57 + test/algorithm/clear.cpp | 45 + test/algorithm/count.cpp | 41 + test/algorithm/count_if.cpp | 38 + test/algorithm/erase.cpp | 63 + test/algorithm/erase_key.cpp | 74 + test/algorithm/ext_/find_if_s.cpp | 109 + test/algorithm/ext_/for_each_s.cpp | 82 + test/algorithm/filter.cpp | 43 + test/algorithm/filter_if.cpp | 77 + test/algorithm/find.cpp | 79 + test/algorithm/find_if.cpp | 69 + test/algorithm/fold.cpp | 222 + test/algorithm/for_each.cpp | 61 + test/algorithm/insert.cpp | 67 + test/algorithm/insert_range.cpp | 71 + test/algorithm/join.cpp | 28 + test/algorithm/none.cpp | 58 + test/algorithm/pop_back.cpp | 46 + test/algorithm/pop_front.cpp | 46 + test/algorithm/push_back.cpp | 72 + test/algorithm/push_front.cpp | 55 + test/algorithm/remove.cpp | 80 + test/algorithm/remove_if.cpp | 78 + test/algorithm/replace.cpp | 49 + test/algorithm/replace_if.cpp | 52 + test/algorithm/reverse.cpp | 49 + test/algorithm/transform.cpp | 157 + test/algorithm/zip.cpp | 30 + test/algorithm/zip2.cpp | 30 + test/algorithm/zip_ignore.cpp | 28 + test/functional/fused.cpp | 97 + test/functional/fused_function_object.cpp | 83 + test/functional/fused_procedure.cpp | 82 + test/functional/invoke.cpp | 394 ++ test/functional/invoke_function_object.cpp | 234 + test/functional/invoke_procedure.cpp | 284 ++ test/functional/make_fused.cpp | 85 + .../functional/make_fused_function_object.cpp | 95 + test/functional/make_fused_procedure.cpp | 91 + test/functional/make_unfused_generic.cpp | 124 + test/functional/make_unfused_lvalue_args.cpp | 126 + test/functional/make_unfused_rvalue_args.cpp | 110 + test/functional/unfused_generic.cpp | 126 + test/functional/unfused_lvalue_args.cpp | 119 + test/functional/unfused_rvalue_args.cpp | 102 + test/functional/unfused_typed.cpp | 166 + test/sequence/adapt_assoc_struct.cpp | 131 + test/sequence/adapt_struct.cpp | 106 + test/sequence/array.cpp | 41 + test/sequence/as_list.cpp | 53 + test/sequence/as_map.cpp | 61 + test/sequence/as_set.cpp | 64 + test/sequence/as_vector.cpp | 54 + test/sequence/back_extended_deque.cpp | 75 + test/sequence/boost_tuple.cpp | 90 + test/sequence/comparison.hpp | 57 + test/sequence/cons.cpp | 87 + test/sequence/construction.hpp | 117 + test/sequence/copy.hpp | 98 + test/sequence/deduce_sequence.cpp | 80 + test/sequence/deque_comparison.cpp | 20 + test/sequence/deque_construction.cpp | 19 + test/sequence/deque_copy.cpp | 22 + test/sequence/deque_iterator.cpp | 19 + test/sequence/deque_make.cpp | 20 + test/sequence/deque_misc.cpp | 22 + test/sequence/deque_mutate.cpp | 20 + test/sequence/deque_tie.cpp | 23 + test/sequence/deque_value_at.cpp | 20 + test/sequence/ext_/iterator_range_s.cpp | 146 + test/sequence/filter_view.cpp | 118 + test/sequence/front_extended_deque.cpp | 75 + test/sequence/io.cpp | 116 + test/sequence/iterator.hpp | 197 + test/sequence/iterator_range.cpp | 81 + test/sequence/joint_view.cpp | 144 + test/sequence/list_comparison.cpp | 19 + test/sequence/list_construction.cpp | 18 + test/sequence/list_copy.cpp | 21 + test/sequence/list_iterator.cpp | 22 + test/sequence/list_make.cpp | 20 + test/sequence/list_misc.cpp | 21 + test/sequence/list_mutate.cpp | 19 + test/sequence/list_tie.cpp | 22 + test/sequence/list_value_at.cpp | 19 + test/sequence/make.hpp | 88 + test/sequence/make_list.cpp | 20 + test/sequence/make_vector.cpp | 20 + test/sequence/map.cpp | 72 + test/sequence/map_tie.cpp | 35 + test/sequence/misc.hpp | 189 + test/sequence/mutate.hpp | 52 + test/sequence/repetitive_view.cpp | 53 + test/sequence/reverse_view.cpp | 64 + test/sequence/set.cpp | 67 + test/sequence/single_view.cpp | 57 + test/sequence/std_pair.cpp | 91 + test/sequence/swap.cpp | 35 + test/sequence/tie.hpp | 85 + test/sequence/transform_view.cpp | 115 + test/sequence/tuple_comparison.cpp | 20 + test/sequence/tuple_construction.cpp | 20 + test/sequence/tuple_copy.cpp | 22 + test/sequence/tuple_element.cpp | 21 + test/sequence/tuple_make.cpp | 21 + test/sequence/tuple_misc.cpp | 23 + test/sequence/tuple_mutate.cpp | 20 + test/sequence/tuple_tie.cpp | 22 + test/sequence/value_at.hpp | 87 + test/sequence/variant.cpp | 56 + test/sequence/vector_comparison.cpp | 19 + test/sequence/vector_construction.cpp | 18 + test/sequence/vector_copy.cpp | 21 + test/sequence/vector_iterator.cpp | 22 + test/sequence/vector_make.cpp | 20 + test/sequence/vector_misc.cpp | 21 + test/sequence/vector_mutate.cpp | 19 + test/sequence/vector_n.cpp | 232 + test/sequence/vector_tie.cpp | 22 + test/sequence/vector_value_at.cpp | 19 + test/sequence/zip_view.cpp | 87 + test/sequence/zip_view2.cpp | 64 + test/sequence/zip_view_ignore.cpp | 58 + todo.txt | 161 + 448 files changed, 62241 insertions(+) create mode 100644 doc/Jamfile create mode 100644 doc/acknowledgements.qbk create mode 100644 doc/algorithms.qbk create mode 100644 doc/changelog.qbk create mode 100644 doc/extension.qbk create mode 100644 doc/functional.qbk create mode 100644 doc/fusion.qbk create mode 100755 doc/html/boostbook.css create mode 100644 doc/html/fusion/acknowledgements.html create mode 100644 doc/html/fusion/algorithms.html create mode 100644 doc/html/fusion/algorithms/concepts.html create mode 100644 doc/html/fusion/algorithms/concepts/poly.html create mode 100644 doc/html/fusion/algorithms/iteration.html create mode 100644 doc/html/fusion/algorithms/iteration/functions.html create mode 100644 doc/html/fusion/algorithms/iteration/functions/accumulate.html create mode 100644 doc/html/fusion/algorithms/iteration/functions/fold.html create mode 100644 doc/html/fusion/algorithms/iteration/functions/for_each.html create mode 100644 doc/html/fusion/algorithms/iteration/metafunctions.html create mode 100644 doc/html/fusion/algorithms/iteration/metafunctions/accumulate.html create mode 100644 doc/html/fusion/algorithms/iteration/metafunctions/fold.html create mode 100644 doc/html/fusion/algorithms/iteration/metafunctions/for_each.html create mode 100644 doc/html/fusion/algorithms/query.html create mode 100644 doc/html/fusion/algorithms/query/functions.html create mode 100644 doc/html/fusion/algorithms/query/functions/all.html create mode 100644 doc/html/fusion/algorithms/query/functions/any.html create mode 100644 doc/html/fusion/algorithms/query/functions/count.html create mode 100644 doc/html/fusion/algorithms/query/functions/count_if.html create mode 100644 doc/html/fusion/algorithms/query/functions/find.html create mode 100644 doc/html/fusion/algorithms/query/functions/find_if.html create mode 100644 doc/html/fusion/algorithms/query/functions/none.html create mode 100644 doc/html/fusion/algorithms/query/metafunctions.html create mode 100644 doc/html/fusion/algorithms/query/metafunctions/all.html create mode 100644 doc/html/fusion/algorithms/query/metafunctions/any.html create mode 100644 doc/html/fusion/algorithms/query/metafunctions/count.html create mode 100644 doc/html/fusion/algorithms/query/metafunctions/count_if.html create mode 100644 doc/html/fusion/algorithms/query/metafunctions/find.html create mode 100644 doc/html/fusion/algorithms/query/metafunctions/find_if.html create mode 100644 doc/html/fusion/algorithms/query/metafunctions/none.html create mode 100644 doc/html/fusion/algorithms/transformation.html create mode 100644 doc/html/fusion/algorithms/transformation/functions.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/clear.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/erase.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/erase_key.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/filter.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/filter_if.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/insert.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/insert_range.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/join.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/pop_back.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/pop_front.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/push_back.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/push_front.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/remove.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/remove_if.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/replace.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/replace_if.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/reverse.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/transform.html create mode 100644 doc/html/fusion/algorithms/transformation/functions/zip.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/clear.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/erase.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/erase_key.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/filter.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/filter_if.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/insert.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/insert_range.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/join.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/pop_back.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/pop_front.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/push_back.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/push_front.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/remove.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/remove_if.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/replace.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/replace_if.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/reverse.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/transform.html create mode 100644 doc/html/fusion/algorithms/transformation/metafunctions/zip.html create mode 100644 doc/html/fusion/change_log.html create mode 100644 doc/html/fusion/extension.html create mode 100644 doc/html/fusion/functional.html create mode 100644 doc/html/fusion/functional/adapters.html create mode 100644 doc/html/fusion/functional/adapters/fused.html create mode 100644 doc/html/fusion/functional/adapters/fused_function_object.html create mode 100644 doc/html/fusion/functional/adapters/fused_procedure.html create mode 100644 doc/html/fusion/functional/adapters/unfused_generic.html create mode 100644 doc/html/fusion/functional/adapters/unfused_lvalue_args.html create mode 100644 doc/html/fusion/functional/adapters/unfused_rvalue_args.html create mode 100644 doc/html/fusion/functional/adapters/unfused_typed.html create mode 100644 doc/html/fusion/functional/concepts.html create mode 100644 doc/html/fusion/functional/concepts/callable.html create mode 100644 doc/html/fusion/functional/concepts/def_callable.html create mode 100644 doc/html/fusion/functional/concepts/poly.html create mode 100644 doc/html/fusion/functional/concepts/reg_callable.html create mode 100644 doc/html/fusion/functional/generation.html create mode 100644 doc/html/fusion/functional/generation/functions.html create mode 100644 doc/html/fusion/functional/generation/functions/mk_fused.html create mode 100644 doc/html/fusion/functional/generation/functions/mk_fused_fobj.html create mode 100644 doc/html/fusion/functional/generation/functions/mk_fused_proc.html create mode 100644 doc/html/fusion/functional/generation/functions/mk_unfused_genrc.html create mode 100644 doc/html/fusion/functional/generation/functions/mk_unfused_lvargs.html create mode 100644 doc/html/fusion/functional/generation/functions/mk_unfused_rvargs.html create mode 100644 doc/html/fusion/functional/generation/metafunctions.html create mode 100644 doc/html/fusion/functional/generation/metafunctions/mk_fused.html create mode 100644 doc/html/fusion/functional/generation/metafunctions/mk_fused_fobj.html create mode 100644 doc/html/fusion/functional/generation/metafunctions/mk_fused_proc.html create mode 100644 doc/html/fusion/functional/generation/metafunctions/mk_unfused_genrc.html create mode 100644 doc/html/fusion/functional/generation/metafunctions/mk_unfused_lvargs.html create mode 100644 doc/html/fusion/functional/generation/metafunctions/mk_unfused_rvargs.html create mode 100644 doc/html/fusion/functional/invocation.html create mode 100644 doc/html/fusion/functional/invocation/functions.html create mode 100644 doc/html/fusion/functional/invocation/functions/invoke.html create mode 100644 doc/html/fusion/functional/invocation/functions/invoke_fobj.html create mode 100644 doc/html/fusion/functional/invocation/functions/invoke_proc.html create mode 100644 doc/html/fusion/functional/invocation/metafunctions.html create mode 100644 doc/html/fusion/functional/invocation/metafunctions/invoke.html create mode 100644 doc/html/fusion/functional/invocation/metafunctions/invoke_fobj.html create mode 100644 doc/html/fusion/functional/invocation/metafunctions/invoke_proc.html create mode 100644 doc/html/fusion/introduction.html create mode 100644 doc/html/fusion/iterators.html create mode 100644 doc/html/fusion/iterators/concepts.html create mode 100644 doc/html/fusion/iterators/concepts/bidirectional_iterator.html create mode 100644 doc/html/fusion/iterators/concepts/forward_iterator.html create mode 100644 doc/html/fusion/iterators/concepts/random_access_iterator.html create mode 100644 doc/html/fusion/iterators/functions.html create mode 100644 doc/html/fusion/iterators/functions/advance.html create mode 100644 doc/html/fusion/iterators/functions/advance_c.html create mode 100644 doc/html/fusion/iterators/functions/deref.html create mode 100644 doc/html/fusion/iterators/functions/distance.html create mode 100644 doc/html/fusion/iterators/functions/next.html create mode 100644 doc/html/fusion/iterators/functions/prior.html create mode 100644 doc/html/fusion/iterators/metafunctions.html create mode 100644 doc/html/fusion/iterators/metafunctions/advance.html create mode 100644 doc/html/fusion/iterators/metafunctions/advance_c.html create mode 100644 doc/html/fusion/iterators/metafunctions/deref.html create mode 100644 doc/html/fusion/iterators/metafunctions/distance.html create mode 100644 doc/html/fusion/iterators/metafunctions/equal_to.html create mode 100644 doc/html/fusion/iterators/metafunctions/next.html create mode 100644 doc/html/fusion/iterators/metafunctions/prior.html create mode 100644 doc/html/fusion/iterators/metafunctions/value_of.html create mode 100644 doc/html/fusion/iterators/operators.html create mode 100644 doc/html/fusion/iterators/operators/operator_equality.html create mode 100644 doc/html/fusion/iterators/operators/operator_inequality.html create mode 100644 doc/html/fusion/iterators/operators/operator_unary_star.html create mode 100644 doc/html/fusion/notes.html create mode 100644 doc/html/fusion/organization.html create mode 100644 doc/html/fusion/preface.html create mode 100644 doc/html/fusion/quick_start.html create mode 100644 doc/html/fusion/references.html create mode 100644 doc/html/fusion/sequences.html create mode 100644 doc/html/fusion/sequences/adapted.html create mode 100644 doc/html/fusion/sequences/adapted/boost__array.html create mode 100644 doc/html/fusion/sequences/adapted/boost__tuple.html create mode 100644 doc/html/fusion/sequences/adapted/boost__variant.html create mode 100644 doc/html/fusion/sequences/adapted/mpl_sequence.html create mode 100644 doc/html/fusion/sequences/adapted/std__pair.html create mode 100644 doc/html/fusion/sequences/concepts.html create mode 100644 doc/html/fusion/sequences/concepts/associative_sequence.html create mode 100644 doc/html/fusion/sequences/concepts/bidirectional_sequence.html create mode 100644 doc/html/fusion/sequences/concepts/forward_sequence.html create mode 100644 doc/html/fusion/sequences/concepts/random_access_sequence.html create mode 100644 doc/html/fusion/sequences/containers.html create mode 100644 doc/html/fusion/sequences/containers/cons.html create mode 100644 doc/html/fusion/sequences/containers/list.html create mode 100644 doc/html/fusion/sequences/containers/map.html create mode 100644 doc/html/fusion/sequences/containers/set.html create mode 100644 doc/html/fusion/sequences/containers/vector.html create mode 100644 doc/html/fusion/sequences/conversion.html create mode 100644 doc/html/fusion/sequences/conversion/functions.html create mode 100644 doc/html/fusion/sequences/conversion/functions/as_list.html create mode 100644 doc/html/fusion/sequences/conversion/functions/as_map.html create mode 100644 doc/html/fusion/sequences/conversion/functions/as_set.html create mode 100644 doc/html/fusion/sequences/conversion/functions/as_vector.html create mode 100644 doc/html/fusion/sequences/conversion/metafunctions.html create mode 100644 doc/html/fusion/sequences/conversion/metafunctions/as_list.html create mode 100644 doc/html/fusion/sequences/conversion/metafunctions/as_map.html create mode 100644 doc/html/fusion/sequences/conversion/metafunctions/as_set.html create mode 100644 doc/html/fusion/sequences/conversion/metafunctions/as_vector.html create mode 100644 doc/html/fusion/sequences/generation.html create mode 100644 doc/html/fusion/sequences/generation/functions.html create mode 100644 doc/html/fusion/sequences/generation/functions/list_tie.html create mode 100644 doc/html/fusion/sequences/generation/functions/make_cons.html create mode 100644 doc/html/fusion/sequences/generation/functions/make_list.html create mode 100644 doc/html/fusion/sequences/generation/functions/make_map.html create mode 100644 doc/html/fusion/sequences/generation/functions/make_set.html create mode 100644 doc/html/fusion/sequences/generation/functions/make_vector.html create mode 100644 doc/html/fusion/sequences/generation/functions/map_tie.html create mode 100644 doc/html/fusion/sequences/generation/functions/tiers.html create mode 100644 doc/html/fusion/sequences/generation/functions/vector_tie.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions/list_tie.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions/make_cons.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions/make_list.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions/make_map.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions/make_set.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions/make_vector.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions/map_tie.html create mode 100644 doc/html/fusion/sequences/generation/metafunctions/vector_tie.html create mode 100644 doc/html/fusion/sequences/intrinsics.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/at.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/at_c.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/at_key.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/back.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/begin.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/empty.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/end.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/front.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/has_key.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/size.html create mode 100644 doc/html/fusion/sequences/intrinsics/functions/swap.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/at.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/at_c.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/at_key.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/back.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/begin.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/empty.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/end.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/front.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/has_key.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/size.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/swap.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/value_at.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/value_at_c.html create mode 100644 doc/html/fusion/sequences/intrinsics/metafunctions/value_at_key.html create mode 100644 doc/html/fusion/sequences/operators.html create mode 100644 doc/html/fusion/sequences/operators/comparison.html create mode 100644 doc/html/fusion/sequences/operators/comparison/equal.html create mode 100644 doc/html/fusion/sequences/operators/comparison/greater_than.html create mode 100644 doc/html/fusion/sequences/operators/comparison/greater_than_equal.html create mode 100644 doc/html/fusion/sequences/operators/comparison/less_than.html create mode 100644 doc/html/fusion/sequences/operators/comparison/less_than_equal.html create mode 100644 doc/html/fusion/sequences/operators/comparison/not_equal.html create mode 100644 doc/html/fusion/sequences/operators/i_o.html create mode 100644 doc/html/fusion/sequences/operators/i_o/in.html create mode 100644 doc/html/fusion/sequences/operators/i_o/out.html create mode 100644 doc/html/fusion/sequences/views.html create mode 100644 doc/html/fusion/sequences/views/filter_view.html create mode 100644 doc/html/fusion/sequences/views/iterator_range.html create mode 100644 doc/html/fusion/sequences/views/joint_view.html create mode 100644 doc/html/fusion/sequences/views/reverse_view.html create mode 100644 doc/html/fusion/sequences/views/single_view.html create mode 100644 doc/html/fusion/sequences/views/transform_view.html create mode 100644 doc/html/fusion/sequences/views/zip_view.html create mode 100644 doc/html/fusion/support.html create mode 100644 doc/html/fusion/support/category_of.html create mode 100644 doc/html/fusion/support/deduce.html create mode 100644 doc/html/fusion/support/deduce_sequence.html create mode 100644 doc/html/fusion/support/is_sequence.html create mode 100644 doc/html/fusion/support/is_view.html create mode 100644 doc/html/fusion/support/pair.html create mode 100644 doc/html/fusion/support/tag_of.html create mode 100644 doc/html/fusion/tuples.html create mode 100644 doc/html/fusion/tuples/class_template_tuple.html create mode 100644 doc/html/fusion/tuples/class_template_tuple/construction.html create mode 100644 doc/html/fusion/tuples/class_template_tuple/element_access.html create mode 100644 doc/html/fusion/tuples/class_template_tuple/relational_operators.html create mode 100644 doc/html/fusion/tuples/class_template_tuple/tuple_creation_functions.html create mode 100644 doc/html/fusion/tuples/class_template_tuple/tuple_helper_classes.html create mode 100644 doc/html/fusion/tuples/pairs.html create mode 100755 doc/html/images/alert.png create mode 100644 doc/html/images/caution.png create mode 100644 doc/html/images/fusion_org.png create mode 100755 doc/html/images/home.png create mode 100644 doc/html/images/important.png create mode 100755 doc/html/images/next.png create mode 100755 doc/html/images/note.png create mode 100755 doc/html/images/prev.png create mode 100755 doc/html/images/smiley.png create mode 100755 doc/html/images/tip.png create mode 100755 doc/html/images/up.png create mode 100644 doc/html/images/warning.png create mode 100644 doc/html/index.html create mode 100644 doc/introduction.qbk create mode 100644 doc/iterators.qbk create mode 100644 doc/notes.qbk create mode 100644 doc/organization.qbk create mode 100644 doc/preface.qbk create mode 100644 doc/quick_start.qbk create mode 100644 doc/references.qbk create mode 100644 doc/sequences.qbk create mode 100644 doc/support.qbk create mode 100644 doc/tuples.qbk create mode 100644 example/cookbook/do_the_bind.cpp create mode 100644 example/cookbook/fill_em_up.cpp create mode 100644 example/extension/Jamfile create mode 100644 example/extension/detail/advance_impl.hpp create mode 100644 example/extension/detail/at_impl.hpp create mode 100644 example/extension/detail/at_key_impl.hpp create mode 100644 example/extension/detail/begin_impl.hpp create mode 100644 example/extension/detail/category_of_impl.hpp create mode 100644 example/extension/detail/deref_impl.hpp create mode 100644 example/extension/detail/distance_impl.hpp create mode 100644 example/extension/detail/end_impl.hpp create mode 100644 example/extension/detail/equal_to_impl.hpp create mode 100644 example/extension/detail/has_key_impl.hpp create mode 100644 example/extension/detail/is_sequence_impl.hpp create mode 100644 example/extension/detail/is_view_impl.hpp create mode 100644 example/extension/detail/next_impl.hpp create mode 100644 example/extension/detail/prior_impl.hpp create mode 100644 example/extension/detail/size_impl.hpp create mode 100644 example/extension/detail/value_at_impl.hpp create mode 100644 example/extension/detail/value_at_key_impl.hpp create mode 100644 example/extension/detail/value_of_impl.hpp create mode 100644 example/extension/example_struct.hpp create mode 100644 example/extension/example_struct_iterator.hpp create mode 100644 example/extension/example_struct_type.hpp create mode 100644 example/extension/tag_of.hpp create mode 100644 example/extension/test_example.cpp create mode 100644 example/performance/Jamfile create mode 100644 example/performance/accumulate.cpp create mode 100644 example/performance/functional.cpp create mode 100644 example/performance/inner_product.cpp create mode 100644 example/performance/inner_product2.cpp create mode 100644 example/performance/measure.hpp create mode 100644 example/performance/sequence_efficiency.cpp create mode 100644 example/performance/timings.txt create mode 100644 example/performance/zip_efficiency.cpp create mode 100644 index.html create mode 100644 test/Jamfile create mode 100644 test/algorithm/all.cpp create mode 100644 test/algorithm/any.cpp create mode 100644 test/algorithm/clear.cpp create mode 100644 test/algorithm/count.cpp create mode 100644 test/algorithm/count_if.cpp create mode 100644 test/algorithm/erase.cpp create mode 100644 test/algorithm/erase_key.cpp create mode 100755 test/algorithm/ext_/find_if_s.cpp create mode 100755 test/algorithm/ext_/for_each_s.cpp create mode 100644 test/algorithm/filter.cpp create mode 100644 test/algorithm/filter_if.cpp create mode 100644 test/algorithm/find.cpp create mode 100644 test/algorithm/find_if.cpp create mode 100644 test/algorithm/fold.cpp create mode 100644 test/algorithm/for_each.cpp create mode 100644 test/algorithm/insert.cpp create mode 100644 test/algorithm/insert_range.cpp create mode 100644 test/algorithm/join.cpp create mode 100644 test/algorithm/none.cpp create mode 100644 test/algorithm/pop_back.cpp create mode 100644 test/algorithm/pop_front.cpp create mode 100644 test/algorithm/push_back.cpp create mode 100644 test/algorithm/push_front.cpp create mode 100644 test/algorithm/remove.cpp create mode 100644 test/algorithm/remove_if.cpp create mode 100644 test/algorithm/replace.cpp create mode 100644 test/algorithm/replace_if.cpp create mode 100644 test/algorithm/reverse.cpp create mode 100644 test/algorithm/transform.cpp create mode 100644 test/algorithm/zip.cpp create mode 100644 test/algorithm/zip2.cpp create mode 100644 test/algorithm/zip_ignore.cpp create mode 100644 test/functional/fused.cpp create mode 100644 test/functional/fused_function_object.cpp create mode 100644 test/functional/fused_procedure.cpp create mode 100644 test/functional/invoke.cpp create mode 100644 test/functional/invoke_function_object.cpp create mode 100644 test/functional/invoke_procedure.cpp create mode 100644 test/functional/make_fused.cpp create mode 100644 test/functional/make_fused_function_object.cpp create mode 100644 test/functional/make_fused_procedure.cpp create mode 100644 test/functional/make_unfused_generic.cpp create mode 100644 test/functional/make_unfused_lvalue_args.cpp create mode 100644 test/functional/make_unfused_rvalue_args.cpp create mode 100644 test/functional/unfused_generic.cpp create mode 100644 test/functional/unfused_lvalue_args.cpp create mode 100644 test/functional/unfused_rvalue_args.cpp create mode 100644 test/functional/unfused_typed.cpp create mode 100644 test/sequence/adapt_assoc_struct.cpp create mode 100644 test/sequence/adapt_struct.cpp create mode 100644 test/sequence/array.cpp create mode 100644 test/sequence/as_list.cpp create mode 100644 test/sequence/as_map.cpp create mode 100644 test/sequence/as_set.cpp create mode 100644 test/sequence/as_vector.cpp create mode 100644 test/sequence/back_extended_deque.cpp create mode 100644 test/sequence/boost_tuple.cpp create mode 100644 test/sequence/comparison.hpp create mode 100644 test/sequence/cons.cpp create mode 100644 test/sequence/construction.hpp create mode 100644 test/sequence/copy.hpp create mode 100644 test/sequence/deduce_sequence.cpp create mode 100644 test/sequence/deque_comparison.cpp create mode 100644 test/sequence/deque_construction.cpp create mode 100644 test/sequence/deque_copy.cpp create mode 100644 test/sequence/deque_iterator.cpp create mode 100644 test/sequence/deque_make.cpp create mode 100644 test/sequence/deque_misc.cpp create mode 100644 test/sequence/deque_mutate.cpp create mode 100644 test/sequence/deque_tie.cpp create mode 100644 test/sequence/deque_value_at.cpp create mode 100755 test/sequence/ext_/iterator_range_s.cpp create mode 100644 test/sequence/filter_view.cpp create mode 100644 test/sequence/front_extended_deque.cpp create mode 100644 test/sequence/io.cpp create mode 100644 test/sequence/iterator.hpp create mode 100644 test/sequence/iterator_range.cpp create mode 100644 test/sequence/joint_view.cpp create mode 100644 test/sequence/list_comparison.cpp create mode 100644 test/sequence/list_construction.cpp create mode 100644 test/sequence/list_copy.cpp create mode 100644 test/sequence/list_iterator.cpp create mode 100644 test/sequence/list_make.cpp create mode 100644 test/sequence/list_misc.cpp create mode 100644 test/sequence/list_mutate.cpp create mode 100644 test/sequence/list_tie.cpp create mode 100644 test/sequence/list_value_at.cpp create mode 100644 test/sequence/make.hpp create mode 100644 test/sequence/make_list.cpp create mode 100644 test/sequence/make_vector.cpp create mode 100644 test/sequence/map.cpp create mode 100644 test/sequence/map_tie.cpp create mode 100644 test/sequence/misc.hpp create mode 100644 test/sequence/mutate.hpp create mode 100644 test/sequence/repetitive_view.cpp create mode 100644 test/sequence/reverse_view.cpp create mode 100644 test/sequence/set.cpp create mode 100644 test/sequence/single_view.cpp create mode 100644 test/sequence/std_pair.cpp create mode 100644 test/sequence/swap.cpp create mode 100644 test/sequence/tie.hpp create mode 100644 test/sequence/transform_view.cpp create mode 100644 test/sequence/tuple_comparison.cpp create mode 100644 test/sequence/tuple_construction.cpp create mode 100644 test/sequence/tuple_copy.cpp create mode 100644 test/sequence/tuple_element.cpp create mode 100644 test/sequence/tuple_make.cpp create mode 100644 test/sequence/tuple_misc.cpp create mode 100644 test/sequence/tuple_mutate.cpp create mode 100644 test/sequence/tuple_tie.cpp create mode 100644 test/sequence/value_at.hpp create mode 100644 test/sequence/variant.cpp create mode 100644 test/sequence/vector_comparison.cpp create mode 100644 test/sequence/vector_construction.cpp create mode 100644 test/sequence/vector_copy.cpp create mode 100644 test/sequence/vector_iterator.cpp create mode 100644 test/sequence/vector_make.cpp create mode 100644 test/sequence/vector_misc.cpp create mode 100644 test/sequence/vector_mutate.cpp create mode 100644 test/sequence/vector_n.cpp create mode 100644 test/sequence/vector_tie.cpp create mode 100644 test/sequence/vector_value_at.cpp create mode 100644 test/sequence/zip_view.cpp create mode 100644 test/sequence/zip_view2.cpp create mode 100644 test/sequence/zip_view_ignore.cpp create mode 100644 todo.txt diff --git a/doc/Jamfile b/doc/Jamfile new file mode 100644 index 00000000..c47c6ccb --- /dev/null +++ b/doc/Jamfile @@ -0,0 +1,17 @@ +project boost/libs/fusion/doc ; +import boostbook : boostbook ; +using quickbook ; + +boostbook quickbook + : + fusion.qbk + : + boost.root=../../../.. + boost.libraries=../../../libraries.htm + chunk.section.depth=4 + chunk.first.sections=1 + toc.section.depth=3 + toc.max.depth=3 + generate.section.toc.level=4 + ; + diff --git a/doc/acknowledgements.qbk b/doc/acknowledgements.qbk new file mode 100644 index 00000000..f0b628d4 --- /dev/null +++ b/doc/acknowledgements.qbk @@ -0,0 +1,16 @@ +[section Acknowledgements] + +Special thanks to David Abrahams, Douglas Gregor, Hartmut Kaiser, Aleksey +Gurtovoy, Peder Holt, Daniel Wallin, Jaakko Jarvi, Jeremiah Willcock, Dan +Marsden, Eric Niebler, Joao Abecasis and Andy Little. These people are +instrumental in the design and development of Fusion. + +Special thanks to Ronald Garcia, the review manager and to all the people in the +boost community who participated in the review: Andreas Pokorny, Andreas Huber, +Jeff Flinn, David Abrahams, Pedro Lamarao, Larry Evans, Ryan Gallagher, Andy +Little, Gennadiy Rozental, Tobias Schwinger, Joao Abecasis, Eric Niebler, Oleg +Abrosimov, Gary Powell, Eric Friedman, Darren Cook, Martin Bonner and Douglas +Gregor. + +[endsect] + diff --git a/doc/algorithms.qbk b/doc/algorithms.qbk new file mode 100644 index 00000000..44c46073 --- /dev/null +++ b/doc/algorithms.qbk @@ -0,0 +1,2402 @@ +[section Algorithms] +[heading Lazy Evaluation] + +Unlike __mpl__, Fusion algorithms are lazy and non sequence-type +preserving. What does that mean? It means that when you operate on a +sequence through a Fusion algorithm that returns a sequence, the sequence +returned may not be of the same class as the original. This is by design. +Runtime efficiency is given a high priority. Like __mpl__, and unlike +__stl__, fusion algorithms are functional in nature such that algorithms +are non mutating (no side effects). However, due to the high cost of +returning full sequences such as vectors and lists, /Views/ are returned +from Fusion algorithms instead. For example, the __transform__ algorithm +does not actually return a transformed version of the original sequence. +__transform__ returns a __transform_view__. This view holds a reference to +the original sequence plus the transform function. Iteration over the +__transform_view__ will apply the transform function over the sequence +elements on demand. This /lazy/ evaluation scheme allows us to chain as +many algorithms as we want without incurring a high runtime penalty. + +[heading Sequence Extension] + +The /lazy/ evaluation scheme where __algorithms__ return __views__ also +allows operations such as __push_back__ to be totally generic. In Fusion, +__push_back__ is actually a generic algorithm that works on all sequences. +Given an input sequence `s` and a value `x`, Fusion's __push_back__ +algorithm simply returns a __joint_view__: a view that holds a reference to +the original sequence `s` and the value `x`. Functions that were once +sequence specific and need to be implemented N times over N different +sequences are now implemented only once. That is to say that Fusion +sequences are cheaply extensible. However, an important caveat is that the +result of a sequence extending operation like __push_back__ does not retain +the properties of the original sequence such as associativity of __set__s. +To regain the original sequence, __conversion__ functions are provided. You +may use one of the __conversion__ functions to convert back to the original +sequence type. + +[heading Header] + #include + +[section Iteration] + +The iteration algorithms provide the fundamental algorithms for traversing +a sequence repeatedly applying an operation to its elements. + +[heading Header] + #include + +[section Functions] + +[section fold] + +[heading Description] +For a sequence `Seq`, initial state, and binary function object or function pointer `f`, fold repeatedly applies binary `f` to each element of `Seq` and the previous state. + +[heading Synopsis] + template< + typename Sequence, + typename State, + typename F + > + typename __result_of_fold__::type fold( + Sequence& seq, State const& initial_state, F const& f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__,`f(e,s)` must be a valid expression for each element `e` in `seq`, and current state `s`][Operation's argument]] + [[`initial_state`][Any type][Initial state]] + [[`f`][`__boost_result_of_call__::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`][Operation's argument]] +] + +[heading Expression Semantics] + fold(seq, initial_state, f); + +[*Return type]: Any type + +[*Semantics]: Equivalent to `f(eN ....f(e2,f(e1,initial_state)))` where `e1 ...eN` are the elements of `seq`. + +[heading Complexity] +Linear, exactly `__result_of_size__::value` applications of `f`. + +[heading Header] + #include + +[heading Example] + struct make_string + { + typedef std::string result_type; + + template + std::string operator()(const T& t, const std::string& str) const + { + return str + boost::lexical_cast(t); + } + }; + ... + const __vector__ vec(1,2); + assert(__fold__(vec,std::string(""), make_string()) == "12"); + +[endsect] + +[section accumulate] + +[heading Description] +For a sequence `Seq`, initial state, and binary function object or function pointer `f`, accumulate repeatedly applies binary `f` to each element of `Seq` and the previous state. + +[heading Synopsis] + template< + typename Sequence, + typename State, + typename F + > + typename __result_of_accumulate__::type accumulate( + Sequence& seq, State const& initial_state, F const& f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__, `f(eN ....f(e2,f(e1,initial_state)))` must be a valid expression for each element `e1` to `eN` in `seq`][Operation's argument]] + [[`initial_state`][Any type][Initial state]] + [[`f`][`__boost_result_of_call__::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`][Operation's argument]] +] + +[heading Expression Semantics] + accumulate(seq, initial_state, f); + +[*Return type]: Any type + +[*Semantics]: Equivalent to `f(eN ....f(e2,f(e1,initial_state)))` where `e1 ...eN` are the elements of `seq`. + +[heading Complexity] +Linear, exactly `__result_of_size__::value` applications of `f`. + +[heading Header] + #include + +[heading Example] + struct make_string + { + typedef std::string result_type; + + template + std::string operator()(const T& t, const std::string& str) const + { + return str + boost::lexical_cast(t); + } + }; + ... + const __vector__ vec(1,2); + assert(__accumulate__(vec,std::string(""), make_string()) == "12"); + +[endsect] + +[section for_each] + +[heading Description] +Applies a unary function object to each element of a sequence. + +[heading Synopsis] + template< + typename Sequence, + typename F + > + typename __result_of_for_each__::type for_each( + Sequence& seq, F const& f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__, `f(e)` must be a valid expression for each element `e` in `seq`][Operation's argument]] + [[`f`][A unary __reg_callable_obj__][Operation's argument]] +] + +[heading Expression Semantics] + __for_each__(seq, f); + +[*Return type]: `void` + +[*Semantics]: Calls `f(e)` for each element `e` in `seq`. + +[heading Complexity] +Linear, exactly `__result_of_size__::value` applications of `f`. + +[heading Header] + #include + +[heading Example] + struct increment + { + template + void operator()(T& t) const + { + ++t; + } + }; + ... + __vector__ vec(1,2); + __for_each__(vec, increment()); + assert(vec == __make_vector__(2,3)); + +[endsect] + +[endsect] + +[section Metafunctions] + +[section fold] + +[heading Description] +Returns the result type of __fold__. + +[heading Synopsis] + template< + typename Sequence, + typename State, + typename F> + struct fold + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A model of __forward_sequence__] [The sequence to iterate]] + [[`State`] [Any type] [The initial state for the first application of `F`]] + [[`F`] [`__boost_result_of_call__::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`] [The operation to be applied on forward traversal]] +] + +[heading Expression Semantics] + __result_of_fold__::type + +[*Return type]: Any type + +[*Semantics]: Returns the result of applying `fold` to a sequence of type `Sequence`, with an initial state of +type `State` and binary function object or function pointer of type `F`. + +[heading Complexity] +Linear, exactly `__result_of_size__::value` applications of `F`. + +[heading Header] + #include + +[endsect] + +[section accumulate] + +[heading Description] +Returns the result type of __accumulate__. + +[heading Synopsis] + template< + typename Sequence, + typename State, + typename F> + struct accumulate + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A model of __forward_sequence__] [The sequence to iterate]] + [[`State`] [Any type] [The initial state for the first application of `F`]] + [[`F`] [`__boost_result_of_call__::type` is the return type of `f(e,s)` for each element `e` of type `E` in `seq`, and current state `s` of type `S`] [The operation to be applied on forward traversal]] +] + +[heading Expression Semantics] + __result_of_accumulate__::type + +[*Return type]: Any type + +[*Semantics]: Returns the result of applying `accumulate` to a sequence of type `Sequence`, with an initial state of +type `State` and binary function object or function pointer of type `F`. + +[heading Complexity] +Linear, exactly `__result_of_size__::value` applications of `F`. + +[heading Header] + #include + +[endsect] + +[section for_each] +A metafunction returning the result type of applying __for_each__ to a sequence. The +return type of __for_each__ is always `void`. + +[heading Description] + +[heading Synopsis] + template< + typename Sequence, + typename F + > + struct for_each + { + typedef void type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A model of __forward_sequence__] [Operation's argument]] + [[`F`] [Any type] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_for_each__::type + +[*Return type]: `void`. + +[*Semantics]: Returns the return type of __for_each__ for a sequence of type `Sequence` and a unary function object `F`. +The return type is always `void`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[endsect] + +[endsect] + +[section Query] +The query algorithms provide support for searching and analyzing sequences. + +[heading Header] + #include + +[section Functions] + +[section any] + +[heading Description] +For a sequence `seq` and unary function object `f`, `any` returns true if `f` returns true for at least one element of `seq`. + +[heading Synopsis] + template< + typename Sequence, + typename F + > + typename __result_of_any__::type any( + Sequence const& seq, F f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__, `f(e)` must be a valid expression, convertible to `bool`, for each element `e` in `seq`][The sequence to search]] + [[`f`][A unary function object][The search predicate]] +] + +[heading Expression semantics] + __any__(seq, f); + +[*Return type]: `bool` + +[*Semantics]: Returns true if and only if `f(e)` evaluates to `true` for some element `e` in `seq`. + +[heading Complexity] +Linear. At most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[heading Example] + struct odd + { + template + bool operator()(T t) const + { + return t % 2; + } + }; + ... + assert(__any__(__make_vector__(1,2), odd())); + assert(!__any__(__make_vector__(2,4), odd())); + +[endsect] + +[section all] + +[heading Description] +For a sequence `seq` and unary function object `f`, `all` returns true if `f` returns true for every element of `seq`. + +[heading Synopsis] + template< + typename Sequence, + typename F + > + typename __result_of_all__::type all( + Sequence const& seq, F f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__, `f(e)` is a valid expression, convertible to `bool`, for every element `e` in `seq`][The sequence to search]] + [[`f`][A unary function object][The search predicate]] +] + +[heading Expression Semantics] + __all__(seq, f); + +[*Return type]: `bool` + +[*Semantics]: Returns true if and only if `f(e)` evaluates to `true` for every element `e` in `seq`. + +[heading Complexity] +Linear. At most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[heading Example] + struct odd + { + template + bool operator()(T t) const + { + return t % 2; + } + }; + ... + assert(__all__(__make_vector__(1,3), odd())); + assert(!__all__(__make_vector__(1,2), odd())); + +[endsect] + +[section none] + +[heading Description] +For a sequence `seq` and unary function object `f`, `none` returns true if `f` returns false for every element of `seq`. + +[heading Synopsis] + template< + typename Sequence, + typename F + > + typename __result_of_none__::type none( + Sequence const& seq, F f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__, `f(e)` is a valid expression, convertible to `bool`, for every element `e` in `seq`][The sequence to search]] + [[`f`][A unary function object][The search predicate]] +] + +[heading Expression Semantics] + __none__(seq, f); + +[*Return type]: `bool` + +[*Semantics]: Returns true if and only if `f(e)` evaluates to `false` for every element `e` in `seq`. Result equivalent to `!any(seq, f)`. + +[heading Complexity] +Linear. At most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[heading Example] + struct odd + { + template + bool operator()(T t) const + { + return t % 2; + } + }; + ... + assert(__none__(__make_vector__(2,4), odd())); + assert(!__none__(__make_vector__(1,2), odd())); + +[endsect] + +[section find] + +[heading Description] +Finds the first element of a given type within a sequence. + +[heading Synopsis] + template< + typename T, + typename Sequence + > + __unspecified__ find(Sequence const& seq); + + template< + typename T, + typename Sequence + > + __unspecified__ find(Sequence& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][The sequence to search]] + [[`T`][Any type][The type to search for]] +] + +[heading Expression Semantics] + __find__(seq) + +[*Return type]: A model of the same iterator category as the iterators of `seq`. + +[*Semantics]: Returns an iterator to the first element of `seq` of type `T`, or `__end__(seq)` if there is no such element. +Equivalent to `__find_if__ >(seq)` + +[heading Complexity] +Linear. At most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[heading Example] + const __vector__ vec('a','0'); + assert(*__find__(vec) == '0'); + assert(__find__(vec) == __end__(vec)); + +[endsect] + +[section find_if] +Finds the first element within a sequence with a type for which a given __mpl_lambda_expression__ evaluates to +`boost::mpl::true_`. + +[heading Description] + +[heading Synopsis] + template< + typename F, + typename Sequence + > + __unspecified__ find_if(Sequence const& seq); + + template< + typename F, + typename Sequence + > + __unspecified__ find_if(Sequence& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][The sequence to search]] + [[`F`][A unary __mpl_lambda_expression__][The search predicate]] +] + +[heading Expression Semantics] + __find_if__(seq) + +[*Return type]: An iterator of the same iterator category as the iterators of `seq`. + +[*Semantics]: Returns the first element of `seq` for which __mpl_lambda_expression__ `F` evaluates to `boost::mpl::true_`, +or `__end__(seq)` if there is no such element. + +[heading Complexity] +Linear. At most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1.0,2); + assert(*__find_if__ >(vec) == 2); + assert(__find_if__ >(vec) == __end__(vec)); + +[endsect] + +[section count] + +[heading Description] +Returns the number of elements of a given type within a sequence. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + typename __result_of_count__::type count( + Sequence const& seq, T const& t); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__, `e == t` must be a valid expression, convertible to `bool`, for each element `e` in `seq`][The sequence to search]] + [[`T`][Any type][The type to count]] +] + +[heading Expression Semantics] + __count__(seq, t); + +[*Return type]: `int` + +[*Semantics]: Returns the number of elements of type `T` and equal to `t` in `seq`. + +[heading Complexity] +Linear. At most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1.0,2,3); + assert(__count__(vec,2) == 1); + +[endsect] + +[section count_if] + +[heading Description] +Returns the number of elements within a sequence with a type for which a given unary function object evaluates to +`true`. + +[heading Synopsis] + template< + typename Sequence, + typename F + > + typename __result_of_count_if__::type count_if( + Sequence const& seq, F f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__, `f(e)` is a valid expression, convertible to `bool`, for each element `e` in `seq`][The sequence to search]] + [[`f`][A unary function object][The search predicate]] +] + +[heading Expression Semantics] + __count_if__(seq, f) + +[*Return type]: `int` + +[*Semantics]: Returns the number of elements in `seq` where `f` evaluates to `true`. + +[heading Complexity] +Linear. At most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1,2,3); + assert(__count_if__(vec,odd()) == 2); + +[endsect] + +[endsect] + +[section Metafunctions] + +[section any] + +[heading Description] +A metafunction returning the result type of __any__. + +[heading Synopsis] + template< + typename Sequence, + typename F + > + struct any + { + typedef bool type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A model of __forward_sequence__] [Operation's argument]] + [[`F`] [A model of unary __poly_func_obj__] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_any__::type + +[*Return type]: `bool`. + +[*Semantics]: Returns the return type of __any__ given a sequence of type `Sequence` and a unary __poly_func_obj__ of type `F`. The return type is always `bool`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section all] + +[heading Description] +A metafunction returning the result type of __all__. + +[heading Synopsis] + template< + typename Sequence, + typename F + > + struct all + { + typedef bool type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A model of __forward_sequence__] [Operation's argument]] + [[`F`] [A model of unary __poly_func_obj__] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_all__::type + +[*Return type]: `bool`. + +[*Semantics]: Returns the return type of __all__ given a sequence of type `Sequence` and a unary __poly_func_obj__ of type `F`. The return type is always `bool`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section none] + +[heading Description] +A metafunction returning the result type of __none__. + +[heading Synopsis] + template< + typename Sequence, + typename F + > + struct none + { + typedef bool type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A model of __forward_sequence__] [Operation's argument]] + [[`F`] [A model of unary __poly_func_obj__] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_none__::type + +[*Return type]: `bool`. + +[*Semantics]: Returns the return type of __none__ given a sequence of type `Sequence` and a unary __poly_func_obj__ of type `F`. The return type is always `bool`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section find] + +[heading Description] +Returns the result type of `find`, given the sequence and search types. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + struct find + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [Model of __forward_sequence__] [Operation's argument]] + [[`T`] [Any type] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_find__::type + +[*Return type]: A model of the same iterator category as the iterators of `Sequence`. + +[*Semantics]: Returns an iterator to the first element of type `T` in `Sequence`, or `__result_of_end__::type` if there is no such element. + +[heading Complexity] +Linear, at most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[endsect] + +[section find_if] + +[heading Description] +Returns the result type of `find_if` given the sequence and predicate types. + +[heading Synopsis] + template< + typename Sequence, + typename Pred + > + struct find_if + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A model of __forward_sequence__] [Operation's argument]] + [[`Pred`] [A model of __mpl_lambda_expression__] [Operation's arguments]] +] + +[heading Expression Semantics] + __result_of_find_if__::type + +[*Return type]: A model of the same iterator category as the iterators of `Sequence`. + +[*Semantics]: Returns an iterator to the first element in `Sequence` for which `Pred` evaluates to true. Returns `__result_of_end__::type` if there is no such element. + +[heading Complexity] +Linear. At most `__result_of_size__::value` comparisons. + +[heading Header] + #include + +[endsect] + +[section count] + +[heading Description] +A metafunction that returns the result type of `count` given the sequence and search types. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + struct count + { + typedef int type; + }; + +[table Parameters + [[Parameter] [Requirement] [heading Description]] + [[`Sequence`] [A model of __forward_sequence__] [Operation's argument]] + [[`T`] [Any type] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_count__::type + +[*Return type]: `int`. + +[*Semantics]: Returns the return type of __count__. The return type is always `int`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section count_if] + +[heading Description] +A metafunction that returns the result type of `count_if` given the sequence and predicate types. + +[heading Synopsis] + template< + typename Sequence, + typename Pred + > + struct count_if + { + typedef int type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A model of __forward_sequence__] [Operation's argument]] + [[`Pred`] [A unary function object] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_count_if__::type + +[*Return type]: `int`. + +[*Semantics]: Returns the return type of __count_if__. The return type is always `int`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[endsect] + +[endsect] + +[section Transformation] +The transformation algorithms create new sequences out of existing sequences by performing some sort of transformation. In reality the new sequences are views onto the data in the original sequences. + +[note As the transformation algorithms return views onto their input arguments, +it is important that the lifetime of the input arguments is greater than the +period during which you wish to use the results.] + +[heading Header] + #include + +[section Functions] + +[section filter] + +[heading Description] +For a given sequence, filter returns a new sequences containing only the elements of a specified type. + +[heading Synopsis] + template< + typename T, + typename Sequence + > + typename __result_of_filter__::type filter(Sequence const& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`T`][Any type][The type to retain]] +] + +[heading Expression Semantics] + __filter__(seq); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing all the elements of `seq` of type `T`. +Equivalent to `__filter_if__ >(seq)`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1,2,3,4); + assert(__filter__(vec) == __make_vector__(1,2)); + +[endsect] + +[section filter_if] + +[heading Description] +For a given sequence, __filter_if__ returns a new sequences containing +only the elements with types for which a given __mpl_lambda_expression__ evaluates to `boost::mpl::true_`. + +[heading Synopsis] + template< + typename Pred, + typename Sequence + > + typename __result_of_filter_if__::type filter_if(Sequence const& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`Pred`][A unary __mpl_lambda_expression__][The predicate to filter by]] +] + +[heading Expression Semantics] + __filter_if__(seq); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing all the elements of `seq` with types for which `Pred` evaluates +to `boost::mpl::true_`. The order of the retained elements is the same as in the original sequence. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1,2,3.0,4.0); + assert(__filter_if__ >(vec) == __make_vector__(1,2)); + +[endsect] + +[section transform] + +[heading Description] +For a sequence `seq` and function object or function pointer `f`, `transform` returns a new sequence +with elements created by applying `f(e)` to each element of `e` of `seq`. + +[heading Unary version synopsis] + template< + typename Sequence, + typename F + > + typename __result_of_transform__::type transform( + Sequence const& seq, F f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`f`][`f(e)` is a valid expression for each element `e` of `seq`. `__boost_result_of_call__::type` is the return type of `f` when called with a value of each element type `E`.][Transformation function]] +] + +[heading Expression Semantics] + __transform__(seq, f); + +[*Return type]: A model of __forward_sequence__ + +[*Semantics]: Returns a new sequence, containing the return values of `f(e)` for each element `e` within `seq`. + +[heading Binary version synopsis] + template< + typename Sequence1, + typename Sequence2, + typename F + > + typename __result_of_transform__::type transform( + Sequence1 const& seq1, Sequence2 const& seq2, F f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq1`][A model of __forward_sequence__][Operation's argument]] + [[`seq2`][A model of __forward_sequence__][Operation's argument]] + [[`f`][`f(e1,e2)` is a valid expression for each pair of elements `e1` of `seq1` and `e2` of `seq2`. `__boost_result_of_call__::type` is the return type of `f` when called with elements of type `E1` and `E2`][Transformation function]] +] + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing the return values of `f(e1, e2)` for each pair of elements `e1` and `e2` within `seq1` and `seq2` respectively. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + struct triple + { + typedef int result_type; + + int operator()(int t) const + { + return t * 3; + }; + }; + ... + assert(__transform__(__make_vector__(1,2,3), triple()) == __make_vector__(3,6,9)); + +[endsect] + +[section replace] + +[heading Description] +Replaces each value within a sequence of a given type and value with a new value. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + typename __result_of_replace__::type replace( + Sequence const& seq, T const& old_value, T const& new_value); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__, `e == old_value` is a valid expression, convertible to `bool`, for each element `e` in `seq` with type convertible to `T`][Operation's argument]] + [[`old_value`][Any type][Value to replace]] + [[`new_value`][Any type][Replacement value]] +] + +[heading Expression Semantics] + __replace__(seq, old_value, new_value); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence with all the values of `seq` with `new_value` assigned to elements with the same type and equal to `old_value`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + assert(__replace__(__make_vector__(1,2), 2, 3) == __make_vector__(1,3)); + +[endsect] + +[section replace_if] + +[heading Description] +Replaces each element of a given sequence for which an unary function object evaluates to `true` replaced with +a new value. + +[heading Synopsis] + template< + typename Sequence, + typename F, + typename T> + typename __result_of_replace_if__::type replace_if( + Sequence const& seq, F f, T const& new_value); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`f`][A function object for which `f(e)` is a valid expression, convertible to `bool`, for each element `e` in `seq`][Operation's argument]] + [[`new_value`][Any type][Replacement value]] +] + +[heading Expression Semantics] + __replace_if__(seq, f, new_value); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence with all the elements of `seq`, +with `new_value` assigned to each element for which `f` evaluates to `true`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + struct odd + { + template + bool operator()(T t) const + { + return t % 2; + } + }; + ... + assert(__replace_if__(__make_vector__(1,2), odd(), 3) == __make_vector__(3,2)); + +[endsect] + +[section remove] + +[heading Description] +Returns a new sequence, with all the elements of the original sequence, except those of a given type. + +[heading Synopsis] + template< + typename T, + typename Sequence + > + typename __result_of_remove__::type replace(Sequence const& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`T`][Any type][Type to remove]] +] + +[heading Expression Semantics] + __remove__(seq); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing all the elements of `seq`, in their original order, except +those of type `T`. Equivalent to `__remove_if__ >(seq)`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1,2.0); + assert(__remove__(vec) == __make_vector__(1)); + +[endsect] + +[section remove_if] + +[heading Description] +Returns a new sequence, containing all the elements of the original except those where a given unary +function object evaluates to `true`. + +[heading Synopsis] + template< + typename Pred, + typename Sequence + > + typename __result_of_remove_if__::type remove_if(Sequence const& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`Pred`][A model of unary __mpl_lambda_expression__][Removal predicate]] +] + +[heading Expression Semantics] + __remove_if__(seq); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing all the elements of `seq`, in their original order, except +those elements with types for which `Pred` evaluates to `boost::mpl::true_`. +Equivalent to `__filter__ >(seq)`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1,2.0); + assert(__remove_if__ >(vec) == __make_vector__(1)); + +[endsect] + +[section reverse] + +[heading Description] +Returns a new sequence with the elements of the original in reverse order. + +[heading Synposis] + template< + typename Sequence + > + typename __result_of_reverse__::type reverse(Sequence const& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __bidirectional_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __reverse__(seq); + +[*Return type]: A model of __bidirectional_sequence__. + +[*Semantics]: Returns a new sequence containing all the elements of `seq` in reverse order. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + assert(__reverse__(__make_vector__(1,2,3)) == __make_vector__(3,2,1)); + +[endsect] + +[section clear] + +[heading Description] +__clear__ returns an empty sequence. + +[heading Synposis] + template< + typename Sequence + > + typename __result_of_clear__::type clear(Sequence const& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __clear__(seq); + +[*Return type]: A model of __forward_sequence__. + +[*Expression Semantics]: Returns a sequence with no elements. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[heading Example] + assert(__clear__(__make_vector__(1,2,3)) == __make_vector__()); + +[endsect] + +[section erase] + +[heading Description] +Returns a new sequence, containing all the elements of the original except those at a specified iterator, or +between two iterators. + +[heading Synposis] + template< + typename Sequence, + typename First + > + typename __result_of_erase__::type erase( + Sequence const& seq, First const& it1); + + template< + typename Sequence, + typename First, + typename Last + > + typename __result_of_erase__::type erase( + Sequence const& seq, First const& it1, Last const& it2); + +[table Parameters + [[Parameters][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`it1`][A model of __forward_iterator__][Iterator into `seq`]] + [[`it2`][A model of __forward_iterator__][Iterator into `seq` after `it1`]] +] + +[heading Expression Semantics] + __erase__(seq, pos); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing all the elements of `seq` except the element at `pos`. + + __erase__(seq, first, last); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, with all the elements of `seq`, in their original order, except those +in the range [`first`,`last`). + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1, 2.0, 'c'); + assert(__erase__(vec, __next__(__begin__(vec))) == __make_vector__(1, 'c')); + assert(__erase__(vec, __next__(__begin__(vec)), __end__(vec)) == __make_vector__(1)); + +[endsect] + +[section erase_key] + +[heading Description] +For an __associative_sequence__ `seq`, returns a __forward_sequence__ containing all the +elements of the original except those with a given key. + +[heading Synposis] + template< + typename Key, + typename Sequence + > + typename result_of::erase_key::type erase_key(Sequence const& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __associative_sequence__][Operation's argument]] + [[`Key`][Any type][Key to erase]] +] + +[heading Expression Semantics] + __erase_key__(seq); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing all the elements of `seq`, except those with key `Key`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + assert(__erase_key__(__make_map__('a', 'b')) == __make_map__('b')); + +[endsect] + +[section insert] + +[heading Description] +Returns a new sequence with all the elements of the original, an a new element inserted the +position described by a given iterator. + +[heading Synposis] + template< + typename Sequence, + typename Pos, + typename T + > + __unspecified__ insert(Sequence const& seq, Pos const& pos, T const& t); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`pos`][A model of __forward_iterator__][The position to insert at]] + [[`t`][Any type][The value to insert]] +] + +[heading Expression Semantics] + __insert__(seq, p, t); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing all the elements of `seq`, in their original order, and a new element with the +type and value of `t` inserted at iterator `pos`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1,2); + assert(__insert__(vec, __next__(__begin__(vec)), 3) == __make_vector__(1,3,2)); + +[endsect] + +[section insert_range] + +[heading Description] +Returns a new sequence with another sequence inserted at a specified iterator. + +[heading Synposis] + template< + typename Sequence, + typename Pos, + typename Range + > + typename __result_of_insert_range__::type insert_range( + Sequence const& seq, Pos const& pos, Range const& range); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`pos`][A model of __forward_iterator__][The position to insert at]] + [[`range`][A model of __forward_sequence__][Range to insert]] +] + +[heading Expression Semantics] + __insert__(seq, pos, range); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing all the elements of `seq`, and the elements of +`range` inserted at iterator `pos`. All elements retaining their ordering from the orignal sequences. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + const __vector__ vec(1,2); + assert(__insert_range__(vec, __next__(__begin__(vec)), __make_vector__(3,4)) == __make_vector__(1,3,4,2)); + +[endsect] + +[section join] + +[heading Description] +Takes 2 sequences and returns a sequence containing the elements of the first followed by the elements of the second. + +[heading Synopsis] + template< + typename LhSequence, + typename RhSequence> + typename __result_of_join__::type join(LhSequence const& lhs, RhSequence const& rhs); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`lhs`][A model of __forward_sequence__][Operation's argument]] + [[`rhs`][A model of __forward_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __join__(lhs, rhs); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing all the elements of `lhs` followed by all the elements of `rhs`. The order of th elements is preserved. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + __vector__ v1(1, 'a'); + __vector__ v2(2, 'b'); + assert(__join__(v1, v2) == __make_vector__(1,'a',2,'b')); + +[endsect] + +[section zip] + +[heading Description] +Zips sequences together to form a single sequence, whos members are tuples of the members of the component sequences. + +[heading Synopsis] + template< + typename Sequence1, + typename Sequence2, + ... + typename SequenceN + > + typename __result_of_zip__::type + zip(Sequence1 const& seq1, Sequence2 const& seq2, ... SequenceN const& seqN); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq1` to `seqN`][Each sequence is a model of __forward_sequence__.][Operation's argument]] +] + +[heading Expression Semantics] + __zip__(seq1, seq2, ... seqN); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing tuples of elements from sequences `seq1` to `seqN`. For example, applying zip to tuples `(1, 2, 3)` and `('a', 'b', 'c')` would return `((1, 'a'),(2, 'b'),(3, 'c'))` + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + __vector__ v1(1, 'a'); + __vector__ v2(2, 'b'); + assert(__zip__(v1, v2) == __make_vector__(__make_vector__(1, 2),__make_vector__('a', 'b')); + +[endsect] + +[section pop_back] + +[heading Description] +Returns a new sequence, with the last element of the original removed. + +[heading Synopsis] + template< + typename Sequence + > + typename __result_of_pop_back__::type pop_back(Sequence const& seq); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __pop_back__(seq); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence containing all the elements of `seq`, except the last element. The elements in the new sequence are in the same order as they were in `seq`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + assert(___pop_back__(__make_vector__(1,2,3)) == __make_vector__(1,2)); + +[endsect] + +[section pop_front] + +[heading Description] +Returns a new sequence, with the first element of the original removed. + +[heading Synopsis] + template< + typename Sequence + > + typename __result_of_pop_front__::type pop_front(Sequence const& seq); + + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __pop_front__(seq); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence containing all the elements of `seq`, except the first element. The elements in the new sequence are in the same order as they were in `seq`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + assert(__pop_front__(__make_vector__(1,2,3)) == __make_vector__(2,3)); + +[endsect] + +[section push_back] + +[heading Description] +Returns a new sequence with an element added at the end. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + typename __result_of_push_back__::type push_back( + Sequence const& seq, T const& t); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`t`][Any type][The value to add to the end]] +] + +[heading Expression Semantics] + __push_back__(seq, t); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing all the elements of `seq`, and new element `t` appended to the end. The elements are in the same order as they were in `seq`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + assert(__push_back__(__make_vector__(1,2,3),4) == __make_vector__(1,2,3,4)); + +[endsect] + +[section push_front] + +[heading Description] +Returns a new sequence with an element added at the beginning. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + typename __result_of_push_front__::type push_front( + Sequence const& seq, T const& t); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`t`][Any type][The value to add to the beginning]] +] + +[heading Expression Semantics] + __push_back__(seq, t); + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing all the elements of `seq`, and new element `t` appended to the beginning. The elements are in the same order as they were in `seq`. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + assert(__push_front__(__make_vector__(1,2,3),0) == __make_vector__(0,1,2,3)); + +[endsect] + +[endsect] + +[section Metafunctions] + +[section filter] + +[heading Description] +Returns the result type of __filter__ given the sequence type and type to retain. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + struct filter + { + typedef __unspecified__ type; + }; + +[table Parameter + [[Parameter] [Requirement] [Description]] + [[`Sequence`][A model of __forward_sequence__] [Operation's argument]] + [[`T`][Any type][Type to retain]] +] + +[heading Expression Semantics] + __result_of_filter__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing the elements of `Sequence` that are of type `T`. Equivalent to `__result_of_filter_if__ >::type`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section filter_if] + +[heading Description] +Returns the result type of __filter_if__ given the sequence and unary __mpl_lambda_expression__ predicate type. + +[heading Synopsis] + template< + typename Sequence, + typename Pred + > + struct filter_if + { + typedef __unspecified__ type; + }; + +[table Parameter + [[Parameter] [Requirement] [Description]] + [[`Sequence`][A model of __forward_sequence__] [Operation's argument]] + [[`Pred`][A unary __mpl_lambda_expression__][Type to retain]] +] + +[heading Expression Semantics] + __result_of_filter_if__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing the elements of `Sequence` for which `Pred` evaluates to `boost::mpl::true_`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section transform] + +[heading Description] +For a sequence `seq` and function object or function pointer `f`, `transform` returns a new sequence +with elements created by applying `f(e)` to each element of `e` of `seq`. + +[heading Unary version synopsis] + template< + typename Sequence, + typename F + > + typename __result_of_transform__::type transform( + Sequence const& seq, F f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq`][A model of __forward_sequence__][Operation's argument]] + [[`f`][`f(e)` is a valid expression for each element `e` of `seq`. `__boost_result_of_call__::type` is the return type of `f` when called with a value of each element type `E`.][Transformation function]] +] + +[heading Expression Semantics] + __transform__(seq, f); + +[*Return type]: A model of __forward_sequence__ + +[*Semantics]: Returns a new sequence, containing the return values of `f(e)` for each element `e` within `seq`. + +[heading Binary version synopsis] + template< + typename Sequence1, + typename Sequence2, + typename F + > + typename __result_of_transform__::type transform( + Sequence1 const& seq1, Sequence2 const& seq2, F f); + +[table Parameters + [[Parameter][Requirement][Description]] + [[`seq1`][A model of __forward_sequence__][Operation's argument]] + [[`seq2`][A model of __forward_sequence__][Operation's argument]] + [[`f`][`f(e1,e2)` is a valid expression for each pair of elements `e1` of `seq1` and `e2` of `seq2`. `__boost_result_of_call__::type` is the return type of `f` when called with elements of type `E1` and `E2`][Transformation function]] +] + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence, containing the return values of `f(e1, e2)` for each pair of elements `e1` and `e2` within `seq1` and `seq2` respectively. + +[heading Complexity] +Constant. Returns a view which is lazily evaluated. + +[heading Header] + #include + +[heading Example] + struct triple + { + typedef int result_type; + + int operator()(int t) const + { + return t * 3; + }; + }; + ... + assert(__transform__(__make_vector__(1,2,3), triple()) == __make_vector__(3,6,9)); + +[endsect] + +[section replace] + +[heading Description] +Returns the result type of __replace__, given the types of the input sequence and element to replace. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + struct replace + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`T`][Any type][The type of the search and replacement objects]] +] + +[heading Expression Semantics] + __result_of_replace__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns the return type of __replace__. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section replace_if] + +[heading Description] +Returns the result type of __replace_if__, given the types of the sequence, __poly_func_obj__ predicate and replacement object. + +[heading Synopsis] + template< + typename Sequence, + typename F, + typename T> + struct replace_if + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`F`][A model of unary __poly_func_obj__][Replacement predicate]] + [[`T`][Any type][The type of the replacement object]] +] + +[heading Expression Semantics] + __result_of_replace_if__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns the return type of __replace_if__. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section remove] + +[heading Description] +Returns the result type of __remove__, given the sequence and removal types. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + struct remove + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`T`][Any type][Remove elements of this type]] +] + +[heading Expression Semantics] + __result_of_remove__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing the elements of `Sequence` not of type `T`. Equivalent to `__result_of_replace_if__ >::type`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section remove_if] + +[heading Description] +Returns the result type of __remove_if__, given the input sequence and unary __mpl_lambda_expression__ predicate types. + +[heading Synopsis] + template< + typename Sequence, + typename Pred + > + struct remove_if + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`Pred`][A model of unary __mpl_lambda_expression__][Remove elements which evaluate to `boost::mpl::true_`]] +] + +[heading Expression Semantics] + __result_of_remove_if__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing the elements of `Sequence` for which `Pred` evaluates to `boost::mpl::false_`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section reverse] + +[heading Description] +Returns the result type of __reverse__, given the input sequence type. + +[heading Synopsis] + template< + typename Sequence + > + struct reverse + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __bidirectional_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_reverse__::type + +[*Return type]: A model of __bidirectional_sequence__. + +[*Semantics]: Returns a sequence with the elements in the reverse order to `Sequence`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section clear] + +[heading Description] +Returns the result type of __clear__, given the input sequence type. + +[heading Synopsis] + template< + typename Sequence + > + struct clear + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][Any type][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_clear__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns an empty sequence. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section erase] +Returns the result type of __erase__, given the input sequence and range delimiting iterator types. + +[heading Description] + +[heading Synopsis] + template< + typename Sequence, + typename It1, + typename It2 = __unspecified__> + struct erase + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`It1`][A model of __forward_iterator__][Operation's argument]] + [[`It2`][A model of __forward_iterator__][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_erase__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence with the element at `It1` removed. + + __result_of_erase__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a new sequence with the elements between `It1` and `It2` removed. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section erase_key] + +[heading Description] +Returns the result type of __erase_key__, given the sequence and key types. + +[heading Synopsis] + template< + typename Sequence, + typename Key + > + struct erase_key + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __associative_sequence__][Operation's argument]] + [[`Key`][Any type][Key type]] +] + +[heading Expression Semantics] + __result_of_erase_key__::type + +[*Return type]: A model of __associative_sequence__. + +[*Semantics]: Returns a sequence with the elements of `Sequence`, except those with key `Key`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section insert] + +[heading Description] +Returns the result type of __insert__, given the sequence, position iterator and insertion types. + +[heading Synopsis] + template< + typename Sequence, + typename Position, + typename T + > + struct insert + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`Position`][A model of __forward_iterator__][Operation's argument]] + [[`T`][Any type][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_insert__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence with an element of type `T` inserted at position `Position` in `Sequence`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section insert_range] + +[heading Description] +Returns the result type of __insert_range__, given the input sequence, position iterator and insertion range types. + +[heading Synopsis] + template< + typename Sequence, + typename Position, + typename Range + > + struct insert_range + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`Position`][A model of __forward_iterator__][Operation's argument]] + [[`Range`][A model of __forward_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_insert_range__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence with the elements of `Range` inserted at position `Position` into `Sequence`. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section join] + +[heading Description] +Returns the result of joining 2 sequences, given the sequence types. + +[heading Synopsis] + template< + typename LhSequence, + typename RhSequence + > + struct join + { + typedef __unspecified__ type; + }; + +[heading Expression Semantics] + __result_of_join__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence containing the elements of `LhSequence` followed by the elements of `RhSequence`. The order of the elements in the 2 sequences is preserved. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section zip] + +[heading Description] +Zips sequences together to form a single sequence, whos members are tuples of the members of the component sequences. + +[heading Synopsis] + template< + typename Sequence1, + typename Sequence2, + ... + typename SequenceN + > + struct zip + { + typedef __unspecified__ type; + }; + +[heading Expression Semantics] + __result_of_zip__::type + +[*Return type]: A model of the most restrictive traversal category of sequences `Sequence1` to `SequenceN`. + +[*Semantics]: Return a sequence containing tuples of elements from each sequence. For example, applying zip to tuples `(1, 2, 3)` and `('a', 'b', 'c')` would return `((1, 'a'),(2, 'b'),(3, 'c'))` + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section pop_back] + +[heading Description] +Returns the result type of __pop_back__, given the input sequence type. + +[heading Synopsis] + template< + typename Sequence + > + struct pop_back + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_pop_back__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence with all the elements of `Sequence` except the last element. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section pop_front] + +[heading Description] +Returns the result type of __pop_front__, given the input sequence type. + +[heading Synopsis] + template< + typename Sequence + > + struct pop_front + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_pop_front__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence with all the elements of `Sequence` except the first element. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section push_back] + +[heading Description] +Returns the result type of __push_back__, given the types of the input sequence and element to push. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + struct push_back + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`T`][Any type][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_push_back__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence with the elements of `Sequence` and an element of type `T` added to the end. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[section push_front] + +[heading Description] +Returns the result type of __push_front__, given the types of the input sequence and element to push. + +[heading Synopsis] + template< + typename Sequence, + typename T + > + struct push_front + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter][Requirement][Description]] + [[`Sequence`][A model of __forward_sequence__][Operation's argument]] + [[`T`][Any type][Operation's argument]] +] + +[heading Expression Semantics] + __result_of_push_front__::type + +[*Return type]: A model of __forward_sequence__. + +[*Semantics]: Returns a sequence with the elements of `Sequence` and an element of type `T` added to the beginning. + +[heading Complexity] +Constant. + +[heading Header] + #include + +[endsect] + +[endsect] + +[endsect] + +[endsect] diff --git a/doc/changelog.qbk b/doc/changelog.qbk new file mode 100644 index 00000000..23d17406 --- /dev/null +++ b/doc/changelog.qbk @@ -0,0 +1,9 @@ +[section Change log] + +This section summarizes significant changes to the Fusion library. + +* Sep 27, 2006: Added `boost::tuple` support. +* Nov 17, 2006: Added `boost::variant` support. +* Feb 15, 2007: Added functional module. + +[endsect] diff --git a/doc/extension.qbk b/doc/extension.qbk new file mode 100644 index 00000000..de6d183c --- /dev/null +++ b/doc/extension.qbk @@ -0,0 +1,377 @@ +[section Extension] + +The Fusion library is designed to be extensible, new sequences types can easily +be added. In fact, the library support for `std::pair`, `boost::array` and __mpl__ +sequences is entirely provided using the extension mechanism. + +The process for adding a new sequence type to Fusion is: + +# Enable the __tag_dispatching__ mechanism used by Fusion for your sequence type +# Design an iterator type for the sequence +# Provide specialized behaviour for the intrinsic operations of the new Fusion sequence + +[heading Our example] + +In order to illustrate enabling a new sequence type for use with Fusion, we +are going to use the type: + + namespace example + { + struct example_struct + { + std::string name; + int age; + example_struct( + const std::string& n, + int a) + : name(n), age(a) + {} + }; + } + +We are going to pretend that this type has been provided by a 3rd party +library, and therefore cannot be modified. We shall work through all the +necessary steps to enable `example_struct` to serve as an __associative_sequence__ +as described in the __quick_start__ guide. + +[heading Enabling Tag Dispatching] + +The Fusion extensibility mechanism uses __tag_dispatching__ to call the +correct code for a given sequence type. In order to exploit the tag +dispatching mechanism we must first declare a new tag type for the +mechanism to use. For example: + + namespace example { + struct example_sequence_tag; // Only definition needed + } + +Next we need to enable the `traits::tag_of` metafunction to return our newly chosen +tag type for operations involving our sequence. This is done by specializing +`traits::tag_of` for our sequence type. + + #include + + namespace boost { namespace fusion { namespace traits { + template<> + struct tag_of + { + typedef example::example_sequence_tag type; + }; + }}} + +`traits::tag_of` also has a second template argument, +that can be used in conjuction with `boost::enable_if` to provide tag +support for groups of related types. This feature is not necessary +for our sequence, but for an example see the code in: + + #include + +[heading Designing a suitable iterator] + +We need an iterator to describe positions, and provide access to +the data within our sequence. As it is straightforward to do, +we are going to provide a random access iterator in our example. + +We will use a simple design, in which the 2 members of +`example_struct` are given numbered indices, 0 for `name` and +1 for `age` respectively. + + template + struct example_struct_iterator + : boost::fusion::iterator_base > + { + BOOST_STATIC_ASSERT(Pos >=0 && Pos < 3); + typedef Struct struct_type; + typedef boost::mpl::int_ index; + typedef boost::fusion::random_access_traversal_tag category; + + example_struct_iterator(Struct& str) + : struct_(str) {} + + Struct& struct_; + }; + +A quick summary of the details of our iterator: + +# The iterator is parameterized by the type it is iterating over, and the index of the current element. +# The typedefs `struct_type` and `index` provide convenient access to information we will need later in + the implementation. +# The typedef `category` allows the `traits::__category_of__` metafunction to establish + the traversal category of the iterator. +# The constructor stores a reference to the `example_struct` being iterated over. + +We also need to enable __tag_dispatching__ for our iterator type, with another specialization of +`traits::tag_of`. + +In isolation, the iterator implementation is pretty dry. Things should become clearer as we +add features to our implementation. + +[heading A first couple of instructive features] + +To start with, we will get the __result_of_value_of__ metafunction working. To +do this, we provide a specialization of the `boost::fusion::extension::value_of_impl` template for +our iterator's tag type. + + template<> + struct value_of_impl + { + template + struct apply; + + template + struct apply > + { + typedef std::string type; + }; + + template + struct apply > + { + typedef int type; + }; + }; + +The implementation itself is pretty simple, it just uses 2 partial specializations to +provide the type of the 2 different members of `example_struct`, based on the index of the iterator. + +To understand how `value_of_impl` is used by the library we will look at the implementation of __value_of__: + + template + struct __value_of__ + : extension::value_of_impl::type>:: + template apply + {}; + +So __value_of__ uses __tag_dispatching__ to select an __mpl_metafunction_class__ +to provide its functionality. You will notice this pattern throughout the +implementation of Fusion. + +Ok, lets enable dereferencing of our iterator. In this case we must provide a suitable +specialization of `deref_impl`. + + template<> + struct deref_impl + { + template + struct apply; + + template + struct apply > + { + typedef typename mpl::if_< + is_const, std::string const&, std::string&>::type type; + + static type + call(example::example_struct_iterator const& it) + { + return it.struct_.name; + } + }; + + template + struct apply > + { + typedef typename mpl::if_< + is_const, int const&, int&>::type type; + + static type + call(example::example_struct_iterator const& it) + { + return it.struct_.age; + } + }; + }; + } + +The use of `deref_impl` is very similar to that of `value_of_impl`, but it also +provides some runtime functionality this time via the `call` static member function. +To see how `deref_impl` is used, lets have a look at the implementation of __deref__: + + 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); + } + +So again __result_of_deref__ uses __tag_dispatching__ in exactly the +same way as the __value_of__ implementation. The runtime functionality used +by __deref__ is provided by the `call` static function of the selected +__mpl_metafunction_class__. + +The actual implementation of `deref_impl` is slightly more complex than that of `value_of_impl`. +We also need to implement the `call` function, which returns a reference +to the appropriate member of the underlying sequence. We also require a little +bit of metaprogramming to return `const` references if the underlying sequence +is const. + +[note Although there is a fair amount of left to do to produce a fully fledged +Fusion sequence, __value_of__ and __deref__ illustrate all the signficant concepts +required. The remainder of the process is very repetitive, simply requiring +implementation of a suitable `xxxx_impl` for each feature `xxxx`. +] + +[heading Implementing the remaining iterator functionality] + +Ok, now we have seen the way __value_of__ and __deref__ work, everything else will work + in pretty much the same way. Lets start with forward iteration, +by providing a `next_impl`: + + template<> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::struct_type struct_type; + typedef typename Iterator::index index; + typedef example::example_struct_iterator type; + + static type + call(Iterator const& i) + { + return type(i.struct_); + } + }; + }; + +This should be very familiar from our `deref_impl` implementation, we will be +using this approach again and again now. Our design is simply to increment +the `index` counter to move on to the next element. The various other iterator +manipulations we need to perform will all just involve simple calculations +with the `index` variables. + +We also need to provide a suitable `equal_to_impl` so that iterators can be +correctly compared. A __bidirectional_iterator__ will also need an implementation of `prior_impl`. For a +__random_access_iterator__ `distance_impl` and `advance_impl` also need to be provided +in order to satisfy the necessary complexity guarantees. As our iterator is +a __random_access_iterator__ we will have to implement all of these functions. + +Full implementations of `prior_impl`, `advance_impl`, `distance_impl` and `equal_to_impl` are +provided in the example code. + +[heading Implementing the intrinsic functions of the sequence] + +In order that Fusion can correctly identify our sequence as a Fusion sequence, we +need to enable `is_sequence` for our sequence type. As usual we just create +an `impl` type specialized for our sequence tag: + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + +We've some similar formalities to complete, providing `category_of_impl` so Fusion +can correctly identify our sequence type, and `is_view_impl` so Fusion can correctly +identify our sequence as not being a __view__ type. Implementations are +provide in the example code. + +Now we've completed some formalities, on to more interesting features. Lets get +__begin__ working so that we can get an iterator to start accessing the data in +our sequence. + + template<> + struct begin_impl + { + template + struct apply + { + typedef example::example_struct_iterator type; + + static type + call(Sequence& seq) + { + return type(seq); + } + }; + }; + +The implementation uses the same ideas we have applied throughout, in this case +we are just creating one of the iterators we developed earlier, pointing to the +first element in the sequence. The implementation of __end__ is very similar, and +is provided in the example code. + +For our __random_access_sequence__ we will also need to implement `size_impl`, +`value_at_impl` and `at_impl`. + +[heading Enabling our type as an associative container] + +In order for `example_struct` to serve as an associative container, +we need to enable 3 lookup features, __at_key__, __value_at_key__ and __has_key__. +We also need to provide an implementation of the `is_associative` trait +so that our sequence can be correctly identified as an associative container. + +To implement `at_key_impl` we need to associate the `fields::age` and `fields::age` +types described in the __quick_start__ guide with the appropriate members of `example_struct`. +Our implementation is as follows: + + template<> + struct at_key_impl + { + template + struct apply; + + template + struct apply + { + typedef typename mpl::if_< + is_const, + std::string const&, + std::string&>::type type; + + static type + call(Sequence& seq) + { + return seq.name; + }; + }; + + template + struct apply + { + typedef typename mpl::if_< + is_const, + int const&, + int&>::type type; + + static type + call(Sequence& seq) + { + return seq.age; + }; + }; + }; + +Its all very similar to the implementations we've seen previously, +such as `deref_impl` and `value_of_impl`. Instead of identifying +the members by index or position, we are now selecting them using +the types `fields::name` and `fields::age`. The implementations of +`value_at_key_impl` and `has_key_impl` are equally straightforward, +and are provided in the example code, along with an implementation +of `is_associative_impl`. + +[heading Summary] + +We've now worked through the entire process for adding a new random +access sequence and we've also enabled our type to serve as an associative +container. The implementation was slightly longwinded, but followed +a simple repeating pattern. + +The support for `std::pair`, __mpl__ sequences, and `boost::array` all +use the same approach, and provide additional examples of the approach +for a variety of types. + +[endsect] + diff --git a/doc/functional.qbk b/doc/functional.qbk new file mode 100644 index 00000000..afacde35 --- /dev/null +++ b/doc/functional.qbk @@ -0,0 +1,1694 @@ +[section Functional] + +Components to call functions and function objects and to make Fusion code +callable through a function object interface. + +[heading Header] + #include + +[heading Fused and unfused forms] + +What is a function call? + + f (a,b,c) + +It is a name and a tuple written next to each other, left-to-right. + +Although the C++ syntax does not allow to replace [^(a,b,c)] with some Fusion +__sequence__, introducing yet another function provides a solution: + + invoke(f,my_sequence) + +Alternatively it is possible to apply a simple transformation to [^f] in order +to achieve the same effect: + + f tuple <=> ``f'`` (tuple) + +Now, [^f'] is an unary function that takes the arguments to `f` as a tuple; +[^f'] is the /fused/ form of `f`. +Reading the above equivalence right-to-left to get the inverse transformation, +`f` is the /unfused/ form of [^f']. + +[heading Calling functions and function objects] + +Having generic C++ code call back arbitrary functions provided by the client +used to be a heavily repetitive task, as different functions can differ in +arity, invocation syntax and other properties that might be part of the type. +Transporting arguments as Fusion sequences and factoring out the invocation +makes Fusion algorithms applicable to function arguments and also reduces +the problem to one invocation syntax and a fixed arity (instead of an arbitrary +number of arbitrary arguments times several syntactic variants times additional +properties). + +Transforming an unfused function into its fused counterpart allows n-ary +calls from an algorithm that invokes an unary __poly_func_obj__ with +__sequence__ arguments. + +The library provides several function templates to invoke different kinds of +functions and adapters to transform them into fused form, respectively. +Every variant has a corresponding generator function template that returns +an adapter instance for the given argument. + +[heading Making Fusion code callable through a function object interface] + +Transforming a fused function into its unfused counterpart allows to create +function objects to accept arbitrary calls. In other words, an unary function +object can be implemented instead of (maybe heavily overloaded) function +templates or function call operators. + +The library provides several adapter variants that implement this +transformation, ranging from strictly typed to fully generic. The latter +provides a reusable, approximate solution to __the_forwarding_problem__. +Every generic variant has a corresponding generator function template that +returns an adapter instance for the given argument. + +[/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ] + +[section Concepts] + + +[section:callable Callable Object] + +[heading Description] + +A pointer to a function, a pointer to member function, a pointer to member +data, or a class type whose objects can appear immediately to the left of a +function call operator. + +[heading Models] +* function pointer types +* member (function or data) pointer types +* all kinds of function objects + +[heading Examples] + + & a_free_function + & a_class::a_static_member_function + & a_class::a_nonstatic_data_member + & a_class::a_nonstatic_member_function + std::less() + // using namespace boost; + bind(std::less(), _1, 5) + lambda::_1 += lambda::_2; + fusion::__make_fused_function_object__(std::less()) + + +[endsect] + + +[section:reg_callable Regular Callable Object] + +[heading Description] + +A non-member-pointer __callable_obj__ type: A pointer to a function or a class +type whose objects can appear immediately to the left of a function call operator. + +[heading Refinement of] +* __callable_obj__ + +[variablelist Notation + [[`F`][A possibly const qualified Deferred Callable Object type]] + [[`f`][An object or reference to an object of type F]] + [[`A1 ...AN`][Argument types]] + [[`a1 ...aN`][Objects or references to objects with types `A1 ...AN`]] +] + +[heading Expression requirements] + +[table + [[Expression][Return Type][Runtime Complexity]] + [[`f(a1, ...aN)`][Unspecified][Unspecified]] +] + +[heading Models] +* function pointer types +* all kinds of function objects + +[heading Examples] + + & a_free_function + & a_class::a_static_member_function + std::less() + // using namespace boost; + bind(std::less(), _1, 5) + lambda::_1 += lambda::_2; + fusion::__make_fused_function_object__(std::less()) + +[endsect] + + +[section:def_callable Deferred Callable Object] + +[heading Description] + +__callable_obj__ types that work with __boost_result_of__ to determine the +result of a call. + +[heading Refinement of] +* __callable_obj__ + +[blurb note Once C++ supports the [^decltype] keyword, all models of +__callable_obj__ will also be models of __def_callable_obj__, because +function objects won't need client-side support for `result_of`. +] + +[variablelist Notation + [[`F`][A possibly const qualified Deferred Callable Object type]] + [[`A1 ...AN`][Argument types]] + [[`a1 ...aN`][Objects or references to objects with types `A1 ...AN`]] + [[`T1 ...TN`][`T`i is `A`i `&` if `a`i is an __lvalue__, same as `A`i, otherwise]] +] + +[heading Expression requirements] + +[table + [[Expression][Type]] + [[__boost_result_of_call__`< F(T1 ...TN) >::type`][Result of a call with `A1 ...AN`-typed arguments]] +] + +[heading Models] +* __poly_func_obj__ types +* member (function or data) pointer types + +[heading Examples] + + & a_free_function + & a_class::a_static_member_function + & a_class::a_nonstatic_data_member + & a_class::a_nonstatic_member_function + std::less() + // using namespace boost; + bind(std::less(), _1, 5) + // Note: Boost.Lambda expressions don't work with __boost_result_of__ + fusion::__make_fused_function_object__(std::less()) + +[endsect] + + +[section:poly Polymorphic Function Object] + +[heading Description] + +A non-member-pointer __def_callable_obj__ type. + +[heading Refinement of] +* __reg_callable_obj__ +* __def_callable_obj__ + +[variablelist Notation + [[`F`][A possibly const-qualified Polymorphic Function Object type]] + [[`f`][An object or reference to an object of type F]] + [[`A1 ...AN`][Argument types]] + [[`a1 ...aN`][Objects or references to objects with types `A1 ...AN`]] + [[`T1 ...TN`][`T`i is `A`i `&` if `a`i is an __lvalue__, same as `A`i, otherwise]] +] + +[heading Expression requirements] + +[table + [[Expression][Return Type][Runtime Complexity]] + [[`f(a1, ...aN)`][`result_of< F(T1, ...TN) >::type`][Unspecified]] +] + +[heading Models] +* function pointers +* function objects of the Standard Library +* all Fusion __functional_adapters__ + +[heading Examples] + + & a_free_function + & a_class::a_static_member_function + std::less() + // using namespace boost; + bind(std::less(), _1, 5) + // Note: Boost.Lambda expressions don't work with __boost_result_of__ + fusion::__make_fused_function_object__(std::less()) + +[endsect] + + +[endsect] + +[/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ] + +[section Invocation] + +[section Functions] + +[section invoke] + +[heading Description] + +Calls a __def_callable_obj__ with the arguments from a __sequence__. + +The first template parameter can be specialized explicitly to avoid copying +and/or to control the const qualification of a function object. + +If the target function is a pointer to a class members, the corresponding +object can be specified as a reference, pointer, or smart pointer. +In case of the latter, a freestanding [^get_pointer] function must be +defined (Boost provides this function for [^std::auto_ptr] and +__boost_shared_ptr_call__). + +[heading Synopsis] + template< + typename Function, + class Sequence + > + typename __result_of_invoke__::type + invoke(Function f, Sequence & s); + + template< + typename Function, + class Sequence + > + typename __result_of_invoke__::type + invoke(Function f, Sequence const & s); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [A __def_callable_obj__] [The function to call.]] + [[`s`] [A __forward_sequence__] [The arguments.]] +] + +[heading Expression Semantics] + + invoke(f,s); + +[*Return type]: Return type of `f` when invoked with the elements in `s` as its +arguments. + +[*Semantics]: Invokes `f` with the elements in `s` as arguments and returns +the result of the call expression. + +[heading Header] + #include + +[heading Example] + __std_plus_doc__ add; + assert(invoke(add,__make_vector__(1,1)) == 2); + +[heading See also] +* __invoke_procedure__ +* __invoke_function_object__ +* __result_of_invoke__ +* __fused__ + +[endsect] + +[section:invoke_proc invoke_procedure] + +[heading Description] + +Calls a __callable_obj__ with the arguments from a __sequence__. The result +of the call is ignored. + +The first template parameter can be specialized explicitly to avoid copying +and/or to control the const qualification of a function object. + +For pointers to class members corresponding object can be specified as +a reference, pointer, or smart pointer. In case of the latter, a freestanding +[^get_pointer] function must be defined (Boost provides this function for +[^std::auto_ptr] and __boost_shared_ptr_call__). + +The target function must not be a pointer to a member object (dereferencing +such a pointer without returning anything does not make sense, so it isn't +implemented). + +[heading Synopsis] + template< + typename Function, + class Sequence + > + typename __result_of_invoke_procedure__::type + invoke_procedure(Function f, Sequence & s); + + template< + typename Function, + class Sequence + > + typename __result_of_invoke_procedure__::type + invoke_procedure(Function f, Sequence const & s); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [Model of __callable_obj__] [The function to call.]] + [[`s`] [Model of __forward_sequence__] [The arguments.]] +] + +[heading Expression Semantics] + + invoke_procedure(f,s); + +[*Return type]: `void` + +[*Semantics]: Invokes `f` with the elements in `s` as arguments. + +[heading Header] + #include + +[heading Example] + __vector__ v(1,2); + using namespace boost::lambda; + invoke_procedure(_1 += _2, v); + assert(__front__(v) == 3); + +[heading See also] +* __invoke__ +* __invoke_function_object__ +* __result_of_invoke_procedure__ +* __fused_procedure__ + +[endsect] + +[section:invoke_fobj invoke_function_object] + +[heading Description] + +Calls a __poly_func_obj__ with the arguments from a __sequence__. + +The first template parameter can be specialized explicitly to avoid copying +and/or to control the const qualification of a function object. + +[heading Synopsis] + template< + typename Function, + class Sequence + > + typename __result_of_invoke_function_object__::type + invoke_function_object(Function f, Sequence & s); + + template< + typename Function, + class Sequence + > + typename __result_of_invoke_function_object__::type + invoke_function_object(Function f, Sequence const & s); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [Model of __poly_func_obj__] [The function object to call.]] + [[`s`] [Model of __forward_sequence__] [The arguments.]] +] + +[heading Expression Semantics] + + invoke_function_object(f,s); + +[*Return type]: Return type of `f` when invoked with the elements in `s` as its +arguments. + +[*Semantics]: Invokes `f` with the elements in `s` as arguments and returns the +result of the call expression. + +[heading Header] + #include + +[heading Example] + struct sub + { + template + struct result; + + template + struct result< Self(T,T) > + { typedef typename remove_reference::type type; }; + + template + T operator()(T lhs, T rhs) const + { + return lhs - rhs; + } + }; + + void try_it() + { + sub f; + assert(f(2,1) == invoke_function_object(f,__make_vector__(2,1))); + } + +[heading See also] +* __invoke__ +* __invoke_procedure__ +* __result_of_invoke_function_object__ +* __fused_function_object__ + +[endsect] + +[endsect] [/ Functions] + +[section Metafunctions] + +[section invoke] + +[heading Description] +Returns the result type of __invoke__. + +[heading Synopsis] + namespace result_of + { + template< + typename Function, + class Sequence + > + struct invoke + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __invoke__ +* __fused__ + +[endsect] + +[section:invoke_proc invoke_procedure] + +[heading Description] +Returns the result type of __invoke_procedure__. + +[heading Synopsis] + namespace result_of + { + template< + typename Function, + class Sequence + > + struct invoke_procedure + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __invoke_procedure__ +* __fused_procedure__ + +[endsect] + +[section:invoke_fobj invoke_function_object] + +[heading Description] +Returns the result type of __invoke_function_object__. + +[heading Synopsis] + namespace result_of + { + template< + class Function, + class Sequence + > + struct invoke_function_object + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __invoke_function_object__ +* __fused_function_object__ + +[endsect] + +[endsect] [/ Metafunctions ] + +[endsect] [/ Invocation ] + +[/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ] + +[section:adapters Adapters] + +Function object templates to transform a particular target function. + +[section fused] + +[heading Description] + +An unary __poly_func_obj__ adapter template for __def_callable_obj__ target +functions. It takes a __forward_sequence__ that contains the arguments for the +target function. + +The type of the target function is allowed to be const qualified or a +reference. Const qualification is preserved and propagated appropriately +(in other words, only const versions of [^operator()] can be used for a +target function object that is const or, if the target function object +is held by value, the adapter is const - these semantics have nothing to +do with the const qualification of a member function, which is referring +to the type of object pointed to by [^this] which is specified with the +first element in the sequence passed to the adapter). + +If the target function is a pointer to a class members, the corresponding +object can be specified as a reference, pointer, or smart pointer. +In case of the latter, a freestanding [^get_pointer] function must be +defined (Boost provides this function for [^std::auto_ptr] and +__boost_shared_ptr_call__). + +[heading Header] + #include + +[heading Synopsis] + template + class fused; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Function`] [A __def_callable_obj__] []] +] + +[heading Model of] + +* __poly_func_obj__ +* __def_callable_obj__ + +[variablelist Notation + [[`R`] [A possibly const qualified __def_callable_obj__ type or reference type thereof]] + [[`r`] [An object convertible to `R`]] + [[`s`] [A __sequence__ of arguments that are accepted by `r`]] + [[`f`] [An instance of `fused`]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`fused(r)`] [Creates a fused function as described above, initializes the target function with `r`.]] + [[`fused()`] [Creates a fused function as described above, attempts to use `R`'s default constructor.]] + [[`f(s)`] [Calls `r` with the elements in `s` as its arguments.]] +] + +[heading Example] + fused< __std_plus_doc__ > f; + assert(f(__make_vector__(1,2l)) == 3l); + +[heading See also] + +* __fused_procedure__ +* __fused_function_object__ +* __invoke__ +* __deduce__ + +[endsect] + +[section fused_procedure] + +[heading Description] + +An unary __poly_func_obj__ adapter template for __callable_obj__ target +functions. It takes a __forward_sequence__ that contains the arguments for +the target function. + +The result is discared and the adapter's return type is `void`. + +The type of the target function is allowed to be const qualified or a +reference. Const qualification is preserved and propagated appropriately +(in other words, only const versions of [^operator()] can be used for a +target function object that is const or, if the target function object +is held by value, the adapter is const - these semantics have nothing to +do with the const qualification of a member function, which is referring +to the type of object pointed to by [^this] which is specified with the +first element in the sequence passed to the adapter). + +If the target function is a pointer to a members function, the corresponding +object can be specified as a reference, pointer, or smart pointer. +In case of the latter, a freestanding [^get_pointer] function must be +defined (Boost provides this function for [^std::auto_ptr] and +__boost_shared_ptr_call__). + +The target function must not be a pointer to a member object (dereferencing +such a pointer without returning anything does not make sense, so this case +is not implemented). + +[heading Header] + #include + +[heading Synopsis] + template + class fused_procedure; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Function`] [__callable_obj__ type] []] +] + +[heading Model of] + +* __poly_func_obj__ +* __def_callable_obj__ + +[variablelist Notation + [[`R`] [A possibly const qualified __callable_obj__ type or reference type thereof]] + [[`r`] [An object convertible to `R`]] + [[`s`] [A __sequence__ of arguments that are accepted by `r`]] + [[`f`] [An instance of `fused`]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`fused_procedure(r)`] [Creates a fused function as described above, initializes the target function with `r`.]] + [[`fused_procedure()`] [Creates a fused function as described above, attempts to use `R`'s default constructor.]] + [[`f(s)`] [Calls `r` with the elements in `s` as its arguments.]] +] + +[heading Example] + template + void n_ary_for_each(SequenceOfSequences const & s, Func const & f) + { + __for_each__(__zip_view__(s), + fused_procedure(f)); + } + + void try_it() + { + __vector__ a(2,2.0f); + __vector__ b(1,1.5f); + using namespace boost::lambda; + n_ary_for_each(__vector_tie__(a,b), _1 -= _2); + assert(a == __make_vector__(1,0.5f)); + } + +[heading See also] + +* __fused__ +* __fused_function_object__ +* __invoke_procedure__ + +[endsect] + +[section fused_function_object] + +[heading Description] + +An unary __poly_func_obj__ adapter template for a __poly_func_obj__ target +function. It takes a __forward_sequence__ that contains the arguments for the +target function. + +The type of the target function is allowed to be const qualified or a +reference. Const qualification is preserved and propagated appropriately +(in other words, only const versions of [^operator()] can be used for an +target function object that is const or, if the target function object +is held by value, the adapter is const). + +[heading Header] + #include + +[heading Synopsis] + template + class fused_function_object; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Function`] [__poly_func_obj__ type] []] +] + +[heading Model of] + +* __poly_func_obj__ +* __def_callable_obj__ + +[variablelist Notation + [[`R`] [A possibly const qualified __poly_func_obj__ type or reference type thereof]] + [[`r`] [An object convertible to `R`]] + [[`s`] [A __sequence__ of arguments that are accepted by `r`]] + [[`f`] [An instance of `fused`]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`fused_function_object(r)`] [Creates a fused function as described above, initializes the target function with `r`.]] + [[`fused_function_object()`] [Creates a fused function as described above, attempts to use `R`'s default constructor.]] + [[`f(s)`] [Calls `r` with the elements in `s` as its arguments.]] +] + +[heading Example] + template + typename __result_of_transform__< zip_view const, + fused_function_object >::type + n_ary_transform(SeqOfSeqs const & s, Func const & f) + { + return __transform__(zip_view(s), + fused_function_object(f)); + } + + struct sub + { + template + struct result; + + template + struct result< Self(T,T) > + { typedef typename remove_reference::type type; }; + + template + T operator()(T lhs, T rhs) const + { + return lhs - rhs; + } + }; + + void try_it() + { + __vector__ a(2,2.0f); + __vector__ b(1,1.5f); + __vector__ c(1,0.5f); + assert(c == n_ary_transform(__vector_tie__(a,b), sub())); + } + +[heading See also] + +* __fused__ +* __fused_procedure__ +* __invoke_function_object__ +* __deduce__ + +[endsect] + + +[section unfused_generic] + +[heading Description] + +An n-ary __poly_func_obj__ adapter template for an unary __poly_func_obj__ +target function. When called, its arguments are bundled to a +__random_access_sequence__ of references that is passed to the target function. +Non-const __lvalue__ arguments are transported as references to non-const, otherwise +references to const are used. + +[blurb __tip__ Detecting mutable LValues on a per-argument basis is currently a +compile time expensive operation (see __the_forwarding_problem__ for +details). Therefore, there are two, lightweight and more restricted variants +of this class template, __unfused_lvalue_args__ and __unfused_rvalue_args__.] + +The type of the target function is allowed to be const qualified or a +reference. Const qualification is preserved and propagated appropriately +(in other words, only const versions of [^operator()] can be used if +the target function object is const - or, in case the target function +object is held by value, the adapter is const). + +[heading Header] + #include + +[heading Synopsis] + template + class unfused_generic; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Function`] [An unary __poly_func_obj__] []] +] + +[heading Model of] + +* __poly_func_obj__ +* __def_callable_obj__ + +[variablelist Notation + [[`F`] [A possibly const qualified, unary __poly_func_obj__ type or reference type thereof]] + [[`f`] [An object convertible to `F`]] + [[`UG`] [The type `unfused_generic`]] + [[`ug`] [An instance of `UG`, initialized with `f`]] + [[`a0`...`aN`] [Arguments to `ug`]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`UG(f)`] [Creates a fused function as described above, initializes the target function with `f`.]] + [[`UG()`] [Creates a fused function as described above, attempts to use `F`'s default constructor.]] + [[`ug(a0`...`aN)`] [Calls `f` with a __sequence__ that contains references to the arguments `a0`...`aN`.]] +] + +[heading Example] + template + class fused_bound_1st + { + typename traits::deduce::type fnc_deferred; + typename traits::deduce::type xxx_bound; + public: + + fused_bound_1st(Function deferred, T bound) + : fnc_deferred(deferred), xxx_bound(bound) + { } + + template + struct result; + + template + struct result< Self(Seq) > + : result_of::invoke< Function, typename result_of::push_front< + typename remove_reference::type, T>::type > + { }; + + template + typename result< void(Seq) >::type operator()(Seq const & s) const + { + return invoke(fnc_deferred, push_front(s,xxx_bound)); + } + }; + + template + unfused_generic< fused_bound_1st > + bind_1st(Function f, T const & x) + { + return unfused_generic< fused_bound_1st >( + fused_bound_1st(f,x) ); + } + + int test_func(int a, int b, int c) + { + return a+b+c; + } + + void try_it() + { + assert(bind_1st(& test_func,3)(-2,-1) == 0); + assert(bind_1st(std::plus(), 1)(0.5f) == 1.5f); + } + +[heading See also] +* __unfused_lvalue_args__ +* __unfused_rvalue_args__ +* __unfused_typed__ +* __deduce__ +* __deduce_sequence__ + +[endsect] + + +[section unfused_lvalue_args] + +[heading Description] + +An n-ary __poly_func_obj__ adapter template for an unary __poly_func_obj__ +target function. When called, its arguments are bundled to a +__random_access_sequence__ of references that is passed to the target function +object. Only __lvalue__ arguments are accepted. + +The type of the target function is allowed to be const qualified or a +reference. Const qualification is preserved and propagated appropriately +(in other words, only const versions of [^operator()] can be used if +the target function object is const - or, in case the target function +object is held by value, the adapter is const). + +[heading Header] + #include + +[heading Synopsis] + template + class unfused_lvalue_args; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Function`] [A unary __poly_func_obj__] []] +] + +[heading Model of] + +* __poly_func_obj__ +* __def_callable_obj__ + +[variablelist Notation + [[`F`] [A possibly const qualified, unary __poly_func_obj__ type or reference type thereof]] + [[`f`] [An object convertible to `F`]] + [[`UL`] [The type `unfused_lvalue_args`]] + [[`ul`] [An instance of `UL`, initialized with `f`]] + [[`a0`...`aN`] [Arguments to `ul`]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`UL(f)`] [Creates a fused function as described above, initializes the target function with `f`.]] + [[`UL()`] [Creates a fused function as described above, attempts to use `F`'s default constructor.]] + [[`ul(a0`...`aN)`] [Calls `f` with a __sequence__ that contains references to the arguments `a0`...`aN`.]] +] + +[heading Example] + struct fused_incrementer + { + template + struct result + { + typedef void type; + }; + + template + void operator()(Seq const & s) const + { + __for_each__(s,++boost::lambda::_1); + } + }; + + void try_it() + { + unfused_lvalue_args increment; + int a = 2; char b = 'X'; + increment(a,b); + assert(a == 3 && b == 'Y'); + } + +[heading See also] +* __unfused_rvalue_args__ +* __unfused_generic__ +* __unfused_typed__ + +[endsect] + +[section unfused_rvalue_args] + +[heading Description] + +An n-ary __poly_func_obj__ adapter template for an unary __poly_func_obj__ +target function. When called, its arguments are bundled to a +__random_access_sequence__ of references that is passed to the target +function object. All referenced objects in the sequence are const qualified. + +The type of the target function is allowed to be const qualified or a +reference. Const qualification is preserved and propagated appropriately +(in other words, only const versions of [^operator()] can be used if +the target function object is const - or, in case the target function object +is held by value, the adapter is const). + +[heading Header] + #include + +[heading Synopsis] + template + class unfused_rvalue_args; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Function`] [A unary __poly_func_obj__] []] +] + +[heading Model of] + +* __poly_func_obj__ +* __def_callable_obj__ + +[variablelist Notation + [[`F`] [A possibly const qualified, unary __poly_func_obj__ type or reference type thereof]] + [[`f`] [An object convertible to `F`]] + [[`UR`] [The type `unfused_rvalue_args`]] + [[`ur`] [An instance of `UR`, initialized with `f`]] + [[`a0`...`aN`] [Arguments to `ur`]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`UR(f)`] [Creates a fused function as described above, initializes the target function with `f`.]] + [[`UR()`] [Creates a fused function as described above, attempts to use `F`'s default constructor.]] + [[`ur(a0`...`aN)`] [Calls `f` with a __sequence__ that contains references to the arguments `a0`...`aN`.]] +] + +[heading Example] + struct sequence_printer + { + template + struct result + { + typedef void type; + }; + + template + void operator()(Seq const & s) const + { + std::cout << s << std::endl; + } + }; + + void try_it() + { + unfused_rvalue_args print; + print(24,"bottles of beer in",'a',"box."); + } + +[heading See also] +* __unfused_lvalue_args__ +* __unfused_generic__ +* __unfused_typed__ +* __deduce__ +* __deduce_sequence__ + +[endsect] + +[section unfused_typed] + +[heading Description] + +An n-ary __poly_func_obj__ adapter template for an unary __poly_func_obj__ +target function. When called, its arguments are bundled to a +__random_access_sequence__ that is passed to the target function object. + +The call operators of esulting function objects are strictly typed +(in other words, non-templatized) with the types from a __sequence__. + +The type of the target function is allowed to be const qualified or a +reference. Const qualification is preserved and propagated appropriately +(in other words, only const versions of [^operator()] can be used if +the target function object is const - or, in case the target function object +is held by value, the adapter is const). + +[blurb __note__ For Microsoft Visual C++ 7.1 (Visual Studio 2003) the detection +of the Function Object's const qualification easily causes an internal error. +Therefore the adapter is always treated as if it was const. ] + +[blurb __tip__ If the type sequence passed to this template contains +non-reference elements, the element is copied only once - the call operator's +signature is optimized automatically to avoid by-value parameters.] + +[heading Header] + #include + +[heading Synopsis] + template + class unfused_typed; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Function`] [A unary __poly_func_obj__] []] + [[`Sequence`] [A __sequence__] []] +] + +[heading Model of] + +* __poly_func_obj__ +* __def_callable_obj__ + +[variablelist Notation + [[`F`] [A possibly const qualified, unary __poly_func_obj__ type or reference type thereof]] + [[`f`] [An object convertible to `F`]] + [[`S`] [A __sequence__ of parameter types]] + [[`UT`] [The type `unfused_typed`]] + [[`ut`] [An instance of `UT`, initialized with `f`]] + [[`a0`...`aN`] [Arguments to `ut`, convertible to the types in `S`]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`UT(f)`] [Creates a fused function as described above, initializes the target function with `f`.]] + [[`UT()`] [Creates a fused function as described above, attempts to use `F`'s default constructor.]] + [[`ut(a0`...`aN)`] [Calls `f` with an instance of `S` (or a subsequence of `S` starting at the first element, + if fewer arguments are given and the overload hasn't been disabled) initialized with + `a0`...`aN`.]] +] + +[heading Example] + struct add_assign // applies operator+= + { + typedef void result_type; // for simplicity + + template + void operator()(T & lhs, T const & rhs) const + { + lhs += rhs; + } + }; + + template + class fused_parallel_adder + { + Tie tie_dest; + public: + explicit fused_parallel_adder(Tie const & dest) + : tie_dest(dest) + { } + + typedef void result_type; + + template + void operator()(Seq const & s) const + { + for_each( zip(tie_dest,s), fused() ); + } + }; + + // accepts a tie and creates a typed function object from it + struct fused_parallel_adder_maker + { + template + struct result; + + template + struct result< Self(Seq) > + { + typedef typename remove_reference::type seq; + + typedef unfused_typed< fused_parallel_adder, + typename mpl::transform >::type > type; + }; + + template + typename result< void(Seq) >::type operator()(Seq const & tie) + { + return typename result< void(Seq) >::type( + fused_parallel_adder(tie) ); + } + }; + unfused_lvalue_args parallel_add; + + void try_it() + { + int a = 2; char b = 'X'; + // the second call is strictly typed with the types deduced from the + // first call + parallel_add(a,b)(3,2); + parallel_add(a,b)(3); + parallel_add(a,b)(); + assert(a == 8 && b == 'Z'); + } + +[heading See also] +* __unfused_generic__ +* __unfused_lvalue_args__ +* __unfused_rvalue_args__ +* __deduce__ +* __deduce_sequence__ + +[endsect] + +[endsect] [/ Adapters] + +[/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ] + +[section Generation] + +[section Functions] + +[section:mk_fused make_fused] + +[heading Description] +Creates a __fused__ adapter for a given __def_callable_obj__. The usual +__element_conversion__ is applied to the target function. + +[heading Synopsis] + template + inline typename __result_of_make_fused__::type + make_fused(F const & f); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [Model of __def_callable_obj__] [The function to transform.]] +] + +[heading Expression Semantics] + + make_fused(f); + +[*Return type]: A specialization of __fused__. + +[*Semantics]: Returns a __fused__ adapter for `f`. + +[heading Header] + + #include + +[heading Example] + float sub(float a, float b) { return a - b; } + + void try_it() + { + __vector__ a(2,2.0f); + __vector__ b(1,1.5f); + __vector__ c(1.0f,0.5f); + assert(c == __transform__(__zip__(a,b), make_fused(& sub))); + assert(c == __transform__(__zip__(a,b), make_fused(__std_minus_doc__()))); + } + +[heading See also] +* __fused__ +* __deduce__ +* __result_of_make_fused__ + +[endsect] + +[section:mk_fused_proc make_fused_procedure] + +[heading Description] +Creates a __fused_procedure__ adapter for a given __def_callable_obj__. +The usual __element_conversion__ applied to the target function. + +[heading Synopsis] + template + inline typename __result_of_make_fused_procedure__::type + make_fused_procedure(F const & f); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [Model of __callable_obj__] [The function to transform.]] +] + +[heading Expression Semantics] + + make_fused_procedure(f); + +[*Return type]: A specialization of __fused_procedure__. + +[*Semantics]: Returns a __fused_procedure__ adapter for `f`. + +[heading Header] + + #include + +[heading Example] + __vector__ v(1,2,3); + using namespace boost::lambda; + make_fused_procedure(_1 += _2 - _3)(v); + assert(__front__(v) == 0); + +[heading See also] +* __fused_procedure__ +* __deduce__ +* __result_of_make_fused_procedure__ + +[endsect] + +[section:mk_fused_fobj make_fused_function_object] + +[heading Description] +Creates a __fused_function_object__ adapter for a given __def_callable_obj__. +The usual __element_conversion__ is applied to the target function. + +[heading Synopsis] + template + inline typename __result_of_make_fused_function_object__::type + make_fused_function_object(F const & f); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [Model of __poly_func_obj__] [The function to transform.]] +] + +[heading Expression Semantics] + + make_fused_function_object(f); + +[*Return type]: A specialization of __fused_function_object__. + +[*Semantics]: Returns a __fused_function_object__ adapter for `f`. + +[heading Header] + + #include + +[heading Example] + struct sub + { + template + struct result; + + template + struct result< Self(T,T) > + { typedef typename remove_reference::type type; }; + + template + T operator()(T lhs, T rhs) const + { + return lhs - rhs; + } + }; + + void try_it() + { + __vector__ a(2,2.0f); + __vector__ b(1,1.5f); + __vector__ c(1,0.5f); + assert(c == __transform__(__zip__(a,b), make_fused_function_object(sub()))); + } + +[heading See also] +* __fused_function_object__ +* __deduce__ +* __result_of_make_fused_function_object__ + +[endsect] + +[section:mk_unfused_genrc make_unfused_generic] + +[heading Description] +Creates a __unfused_generic__ adapter for a given, unary __poly_func_obj__. +The usual __element_conversion__ is applied to the target function. + +[heading Synopsis] + template + inline typename __result_of_make_unfused_generic__::type + make_unfused_generic(F const & f); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [Model of __poly_func_obj__] [The function to transform.]] +] + +[heading Expression Semantics] + + make_unfused_generic(f); + +[*Return type]: A specialization of __unfused_generic__. + +[*Semantics]: Returns a __unfused_generic__ adapter for `f`. + +[heading Header] + + #include + +[heading Example] + struct bottles_song + { + typedef void result_type; + + template + void operator()(Seq & s) const + { + typename result_of::at_c::type n = at_c<0>(s); + typename result_of::at_c::type what = at_c<1>(s); + + std::cout + << n << " bottles of " << what << " on the wall.\n" + << n << " bottles of " << what << "!\n" + << "Take one down - pass it around.\n"; + + n -= 1; // glug glug... + + std::cout + << n << " bottles of " << what << " on the wall.\n" + << std::endl; + } + }; + + void try_it() + { + unsigned n_milk = 99; + for(int i = 0; i < 3; ++i) + make_unfused_generic(bottles_song())(n_milk,"milk"); + // 96 bottles left for me + } + +[heading See also] +* __unfused_generic__ +* __deduce__ +* __result_of_make_unfused_generic__ + +[endsect] + +[section:mk_unfused_lvargs make_unfused_lvalue_args] + +[heading Description] +Creates a __unfused_lvalue_args__ adapter for a given, unary __poly_func_obj__. +The usual __element_conversion__ is applied to the target function. + +[heading Synopsis] + template + inline typename __result_of_make_unfused_lvalue_args__::type + make_unfused_lvalue_args(F const & f); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [Model of __poly_func_obj__] [The function to transform.]] +] + +[heading Expression Semantics] + + make_unfused_lvalue_args(f); + +[*Return type]: A specialization of __unfused_lvalue_args__. + +[*Semantics]: Returns a __unfused_lvalue_args__ adapter for `f`. + +[heading Header] + + #include + +[heading Example] + struct fused_incrementer + { + template + struct result + { + typedef void type; + }; + + template + void operator()(Seq const & s) const + { + __for_each__(s,++boost::lambda::_1); + } + }; + + void try_it() + { + int a = 2; char b = 'X'; + make_unfused_lvalue_args(fused_incrementer())(a,b); + assert(a == 3 && b == 'Y'); + } + +[heading See also] +* __unfused_lvalue_args__ +* __deduce__ +* __result_of_make_unfused_lvalue_args__ + +[endsect] + +[section:mk_unfused_rvargs make_unfused_rvalue_args] + +[heading Description] +Creates a __unfused_rvalue_args__ adapter for a given, unary __poly_func_obj__. +The usual __element_conversion__ is applied to the target function. + +[heading Synopsis] + template + inline typename __result_of_make_unfused_rvalue_args__::type + make_unfused_rvalue_args(F const & f); + +[heading Parameters] +[table + [[Parameter] [Requirement] [Description]] + [[`f`] [Model of __poly_func_obj__] [The function to transform.]] +] + +[heading Expression Semantics] + + make_unfused_rvalue_args(f); + +[*Return type]: A specialization of __unfused_rvalue_args__. + +[*Semantics]: Returns a __unfused_rvalue_args__ adapter for `f`. + +[heading Header] + + #include + +[heading Example] + struct sequence_printer + { + template + struct result + { + typedef void type; + }; + + template + void operator()(Seq const & s) const + { + std::cout << s << std::endl; + } + }; + + void try_it() + { + make_unfused_rvalue_args(sequence_printer()) + (24,"bottles of beer in",'a',"box."); + } + +[heading See also] +* __unfused_rvalue_args__ +* __deduce__ +* __result_of_make_unfused_rvalue_args__ + +[endsect] + +[endsect] [/ Functions] + +[section Metafunctions] + +[section:mk_fused make_fused] + +[heading Description] +Returns the result type of __make_fused__. + +[heading Header] + + #include + +[heading Synopsis] + namespace result_of + { + template + struct make_fused + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __make_fused__ + +[endsect] + +[section:mk_fused_proc make_fused_procedure] + +[heading Description] +Returns the result type of __make_fused_procedure__. + +[heading Header] + + #include + +[heading Synopsis] + namespace result_of + { + template + struct make_fused_procedure + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __make_fused_procedure__ + +[endsect] + +[section:mk_fused_fobj make_fused_function_object] + +[heading Description] +Returns the result type of __make_fused_function_object__. + +[heading Header] + + #include + +[heading Synopsis] + namespace result_of + { + template + struct make_fused_function_object + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __make_fused_function_object__ + +[endsect] + +[section:mk_unfused_genrc make_unfused_generic] + +[heading Description] +Returns the result type of __make_unfused_generic__. + +[heading Header] + + #include + +[heading Synopsis] + namespace result_of + { + template + struct make_unfused_generic + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __make_unfused_generic__ + +[endsect] + +[section:mk_unfused_lvargs make_unfused_lvalue_args] + +[heading Description] +Returns the result type of __make_unfused_lvalue_args__. + +[heading Header] + + #include + +[heading Synopsis] + namespace result_of + { + template + struct make_unfused_lvalue_args + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __make_unfused_lvalue_args__ + +[endsect] + +[section:mk_unfused_rvargs make_unfused_rvalue_args] + +[heading Description] +Returns the result type of __make_unfused_rvalue_args__. + +[heading Header] + + #include + +[heading Synopsis] + namespace result_of + { + template + struct make_unfused_rvalue_args + { + typedef __unspecified__ type; + }; + } + +[heading See also] +* __make_unfused_rvalue_args__ + +[endsect] + +[endsect] [/ Metafunctions] + +[endsect] [/ Generation] + +[endsect] [/ Functional ] diff --git a/doc/fusion.qbk b/doc/fusion.qbk new file mode 100644 index 00000000..b53fee73 --- /dev/null +++ b/doc/fusion.qbk @@ -0,0 +1,309 @@ +[library Fusion + [quickbook 1.3] + [version 2.0] + [authors [de Guzman, Joel], [Marsden, Dan], [Schwinger, Tobias]] + [copyright 2001 2002 2003 2004 2005 2006 2007 Joel de Guzman, Dan Marsden, Tobias Schwinger] + [purpose Statically Typed Heterogeneous Data Structures and Algorithms] + [license + Distributed under the Boost Software License, Version 1.0. + (See accompanying file LICENSE_1_0.txt or copy at + [@http://www.boost.org/LICENSE_1_0.txt]) + ] +] + +[def __note__ [$images/note.png]] +[def __alert__ [$images/alert.png]] +[def __tip__ [$images/tip.png]] +[def __caution__ [$images/caution.png]] + +[def __spirit__ [@http://spirit.sourceforge.net Spirit]] +[def __phoenix__ [@http://boost.org/libs/spirit/phoenix/index.html Phoenix]] +[def __mpl__ [@http://www.boost.org/libs/mpl/index.html MPL]] +[def __stl__ [@http://en.wikipedia.org/wiki/Standard_Template_Library STL]] +[def __tuple__ [@http://www.boost.org/libs/tuple/doc/tuple_users_guide.html Boost.Tuple]] +[def __tr1__tuple__ [@http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1403.pdf TR1 Tuple]] +[def __boost_tools__ [@http://www.boost.org/tools/index.html Boost Tools]] +[def __spirit_list__ [@https://lists.sourceforge.net/lists/listinfo/spirit-general Spirit Mailing List]] +[def __spirit_general__ [@news://news.gmane.org/gmane.comp.spirit.general Spirit General NNTP news portal]] +[def __gmane__ [@http://www.gmane.org Gmane]] +[def __mlist_archive__ [@http://news.gmane.org/gmane.comp.parsers.spirit.general]] +[def __jaakko_jarvi__ [@http://www.boost.org/people/jaakko_jarvi.htm Jaakko Jarvi]] +[def __david_abrahams__ [@http://www.boost.org/people/dave_abrahams.htm David Abrahams]] +[def __the_forwarding_problem__ [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm The Forwarding Problem]] + +[def __boost_any__ [@http://boost.org/doc/html/any.html Boost.Any]] +[def __new_iterator_concepts__ [@http://boost.org/libs/iterator/doc/new-iter-concepts.html New Iterator Concepts]] +[def __boost_array_library__ [@http://www.boost.org/doc/html/array.html Boost.Array Library]] +[def __boost_variant_library__ [@http://www.boost.org/doc/html/variant.html Boost.Variant Library]] +[def __boost_tuple_library__ [@http://www.boost.org/libs/tuple/doc/tuple_users_guide.html Boost.Tuple Library]] +[def __boost_ref__ [@http://www.boost.org/doc/html/ref.html Boost.Ref]] +[def __boost_ref_call__ [@http://www.boost.org/doc/html/ref.html `ref`]] +[def __boost_result_of__ [@http://www.boost.org/libs/utility/utility.htm#result_of Boost.ResultOf]] +[def __boost_result_of_call__ [@http://www.boost.org/libs/utility/utility.htm#result_of `boost::result_of`]] +[def __boost_enable_if__ [@http://www.boost.org/libs/utility/enable_if.html Boost.EnableIf utility]] +[def __boost_shared_ptr_call__ [@http://www.boost.org/libs/smart_ptr/shared_ptr.htm `boost::shared_ptr`]] +[def __std_pair_doc__ [@http://www.sgi.com/tech/stl/pair.html `std::pair`]] +[def __std_plus_doc__ [@http://www.sgi.com/tech/stl/plus.html `std::plus`]] +[def __std_minus_doc__ [@http://www.sgi.com/tech/stl/minus.html `std::minus`]] + +[def __mpl_integral_constant__ [@http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html MPL Integral Constant]] +[def __mpl_boolean_constant__ [@http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html MPL Boolean Constant]] +[def __mpl_metafunction_class__ [@http://www.boost.org/libs/mpl/doc/refmanual/metafunction-class.html MPL Metafunction Class]] +[def __mpl_lambda_expression__ [@http://www.boost.org/libs/mpl/doc/refmanual/lambda-expression.html MPL Lambda Expression]] + +[def __lvalue__ LValue] +[def __unspecified__ /unspecified/] + +[def __support__ [link fusion.support Support]] +[def __is_sequence__ [link fusion.support.is_sequence `is_sequence`]] +[def __is_view__ [link fusion.support.is_view `is_view`]] +[def __tag_of__ [link fusion.support.tag_of `tag_of`]] +[def __category_of__ [link fusion.support.category_of `category_of`]] +[def __deduce__ [link fusion.support.deduce `deduce`]] +[def __deduce_sequence__ [link fusion.support.deduce_sequence `deduce_sequence`]] +[def __fusion_pair__ [link fusion.support.pair `fusion::pair`]] +[def __pair__ [link fusion.support.pair `pair`]] +[def __fusion_make_pair__ [link fusion.support.pair `make_pair`]] + +[def __iterator__ [link fusion.iterators Iterator]] +[def __iterator_concepts__ [link fusion.iterators.concepts Iterator Concepts]] +[def __forward_iterator__ [link fusion.iterators.concepts.forward_iterator Forward Iterator]] +[def __bidirectional_iterator__ [link fusion.iterators.concepts.bidirectional_iterator Bidirectional Iterator]] +[def __random_access_iterator__ [link fusion.iterators.concepts.random_access_iterator Random Access Iterator]] + +[def __next__ [link fusion.iterators.functions.next `next`]] +[def __prior__ [link fusion.iterators.functions.prior `prior`]] +[def __advance__ [link fusion.iterators.functions.advance `advance`]] +[def __advance_c__ [link fusion.iterators.functions.advance_c `advance_c`]] +[def __distance__ [link fusion.iterators.functions.distance `distance`]] +[def __deref__ [link fusion.iterators.functions.deref `deref`]] + +[def __result_of_next__ [link fusion.iterators.metafunctions.next `result_of::next`]] +[def __result_of_prior__ [link fusion.iterators.metafunctions.prior `result_of::prior`]] +[def __result_of_equal_to__ [link fusion.iterators.metafunctions.equal_to `result_of::equal_to`]] +[def __result_of_advance__ [link fusion.iterators.metafunctions.advance `result_of::advance`]] +[def __result_of_advance_c__ [link fusion.iterators.metafunctions.advance_c `result_of::advance_c`]] +[def __result_of_distance__ [link fusion.iterators.metafunctions.distance `result_of::distance`]] +[def __result_of_deref__ [link fusion.iterators.metafunctions.deref `result_of::deref`]] +[def __result_of_value_of__ [link fusion.iterators.metafunctions.value_of `result_of::value_of`]] +[def __value_of__ [link fusion.iterators.metafunctions.value_of `value_of`]] + +[def __sequence__ [link fusion.sequences Sequence]] +[def __sequence_concepts__ [link fusion.sequences.concepts Sequence Concepts]] +[def __traversal_concept__ [link fusion.sequences.concepts.traversal Sequence Traversal Concept]] +[def __associativity_concept__ [link fusion.sequences.concepts.associativity Sequence Associativity Concept]] +[def __forward_sequence__ [link fusion.sequences.concepts.forward_sequence Forward Sequence]] +[def __bidirectional_sequence__ [link fusion.sequences.concepts.bidirectional_sequence Bidirectional Sequence]] +[def __random_access_sequence__ [link fusion.sequences.concepts.random_access_sequence Random Access Sequence]] +[def __associative_sequence__ [link fusion.sequences.concepts.associative_sequence Associative Sequence]] + +[def __containers__ [link fusion.sequences.containers Containers]] +[def __vector__ [link fusion.sequences.containers.vector `vector`]] +[def __cons__ [link fusion.sequences.containers.cons `cons`]] +[def __list__ [link fusion.sequences.containers.list `list`]] +[def __set__ [link fusion.sequences.containers.set `set`]] +[def __map__ [link fusion.sequences.containers.map `map`]] + +[def __view__ [link fusion.sequences.views View]] +[def __views__ [link fusion.sequences.views Views]] +[def __single_view__ [link fusion.sequences.views.single_view `single_view`]] +[def __filter_view__ [link fusion.sequences.views.filter_view `filter_view`]] +[def __iterator_range__ [link fusion.sequences.views.iterator_range `iterator_range`]] +[def __joint_view__ [link fusion.sequences.views.joint_view `joint_view`]] +[def __transform_view__ [link fusion.sequences.views.transform_view `transform_view`]] +[def __reverse_view__ [link fusion.sequences.views.reverse_view `reverse_view`]] +[def __zip_view__ [link fusion.sequences.views.zip_view `zip_view`]] + +[def __std_pair__ [link fusion.sequences.adapted.std__pair `std::pair`]] +[def __boost_array__ [link fusion.sequences.adapted.boost__array `boost::array`]] +[def __mpl_sequence__ [link fusion.sequences.adapted.mpl_sequence mpl sequence]] + +[def __intrinsic__ [link fusion.sequences.intrinsics Intrinsic]] +[def __intrinsics__ [link fusion.sequences.intrinsics Intrinsics]] +[def __begin__ [link fusion.sequences.intrinsics.functions.begin `begin`]] +[def __result_of_begin__ [link fusion.sequences.intrinsics.metafunctions.begin `result_of::begin`]] +[def __end__ [link fusion.sequences.intrinsics.functions.end `end`]] +[def __result_of_end__ [link fusion.sequences.intrinsics.metafunctions.end `result_of::end`]] +[def __size__ [link fusion.sequences.intrinsics.functions.size `size`]] +[def __result_of_size__ [link fusion.sequences.intrinsics.metafunctions.size `result_of::size`]] +[def __empty__ [link fusion.sequences.intrinsics.functions.empty `empty`]] +[def __result_of_empty__ [link fusion.sequences.intrinsics.metafunctions.empty `result_of::empty`]] +[def __front__ [link fusion.sequences.intrinsics.functions.front `front`]] +[def __result_of_front__ [link fusion.sequences.intrinsics.metafunctions.front `result_of::front`]] +[def __back__ [link fusion.sequences.intrinsics.functions.back `back`]] +[def __result_of_back__ [link fusion.sequences.intrinsics.metafunctions.back `result_of::back`]] +[def __at__ [link fusion.sequences.intrinsics.functions.at `at`]] +[def __result_of_at__ [link fusion.sequences.intrinsics.metafunctions.at `result_of::at`]] +[def __at_c__ [link fusion.sequences.intrinsics.functions.at_c `at_c`]] +[def __result_of_at_c__ [link fusion.sequences.intrinsics.metafunctions.at_c `result_of::at_c`]] +[def __at_key__ [link fusion.sequences.intrinsics.functions.at_key `at_key`]] +[def __result_of_at_key__ [link fusion.sequences.intrinsics.metafunctions.at_key `result_of::at_key`]] +[def __has_key__ [link fusion.sequences.intrinsics.functions.has_key `has_key`]] +[def __result_of_has_key__ [link fusion.sequences.intrinsics.metafunctions.has_key `result_of::has_key`]] +[def __value_at_key__ [link fusion.sequences.intrinsics.metafunctions.value_at_key `value_at_key`]] +[def __result_of_value_at__ [link fusion.sequences.intrinsics.metafunctions.value_at `result_of::value_at`]] +[def __result_of_value_at_c__ [link fusion.sequences.intrinsics.metafunctions.value_at_c `result_of::value_at_c`]] +[def __result_of_value_at_key__ [link fusion.sequences.intrinsics.metafunctions.value_at_key `result_of::value_at_key`]] + +[def __conversion__ [link fusion.sequences.conversion.functions Conversion]] +[def __result_of_conversion__ [link fusion.sequences.conversion.metafunctions Conversion Metafunctions]] +[def __as_vector__ [link fusion.sequences.conversion.functions.as_vector `as_vector`]] +[def __result_of_as_vector__ [link fusion.sequences.conversion.metafunctions.as_vector `result_of::as_vector`]] +[def __as_list__ [link fusion.sequences.conversion.functions.as_list `as_list`]] +[def __result_of_as_list__ [link fusion.sequences.conversion.metafunctions.as_list `result_of::as_list`]] +[def __as_set__ [link fusion.sequences.conversion.functions.as_set `as_set`]] +[def __result_of_as_set__ [link fusion.sequences.conversion.metafunctions.as_set `result_of::as_set`]] +[def __as_map__ [link fusion.sequences.conversion.functions.as_map `as_map`]] +[def __result_of_as_map__ [link fusion.sequences.conversion.metafunctions.as_map `result_of::as_map`]] + +[def __generation__ [link fusion.sequences.generation.functions Generation]] +[def __result_of_generation__ [link fusion.sequences.generation.metafunctions Generation Metafunctions]] +[def __make_vector__ [link fusion.sequences.generation.functions.make_vector `make_vector`]] +[def __result_of_make_vector__ [link fusion.sequences.generation.metafunctions.make_vector `result_of::make_vector`]] +[def __vector_tie__ [link fusion.sequences.generation.functions.vector_tie `vector_tie`]] +[def __map_tie__ [link fusion.sequences.generation.functions.vector_tie `map_tie`]] +[def __result_of_vector_tie__ [link fusion.sequences.generation.metafunctions.vector_tie `result_of::vector_tie`]] +[def __make_vector__ [link fusion.sequences.generation.functions.make_vector `make_vector`]] +[def __result_of_make_vector__ [link fusion.sequences.generation.metafunctions.make_vector `result_of::make_vector`]] +[def __make_cons__ [link fusion.sequences.generation.functions.make_cons `make_cons`]] +[def __result_of_make_cons__ [link fusion.sequences.generation.metafunctions.make_cons `result_of::make_cons`]] +[def __make_list__ [link fusion.sequences.generation.functions.make_list `make_list`]] +[def __result_of_make_list__ [link fusion.sequences.generation.metafunctions.make_list `result_of::make_list`]] +[def __make_set__ [link fusion.sequences.generation.functions.make_set `make_set`]] +[def __result_of_make_set__ [link fusion.sequences.generation.metafunctions.make_set `result_of::make_set`]] +[def __make_map__ [link fusion.sequences.generation.functions.make_map `make_map`]] +[def __result_of_make_map__ [link fusion.sequences.generation.metafunctions.make_map `result_of::make_map`]] +[def __list_tie__ [link fusion.sequences.generation.functions.list_tie `list_tie`]] +[def __result_of_list_tie__ [link fusion.sequences.generation.metafunctions.list_tie `result_of::list_tie`]] + +[def __out__ [link fusion.sequences.operators.i_o.out out]] +[def __in__ [link fusion.sequences.operators.i_o.in in]] +[def __eq__ [link fusion.sequences.operators.comparison.equal equal]] +[def __neq__ [link fusion.sequences.operators.comparison.not_equal not equal]] +[def __lt__ [link fusion.sequences.operators.comparison.less_than less than]] +[def __lte__ [link fusion.sequences.operators.comparison.less_than_equal less than equal]] +[def __gt__ [link fusion.sequences.operators.comparison.greater_than greater than]] +[def __gte__ [link fusion.sequences.operators.comparison.greater_than_equal greater than equal]] + +[def __algorithm__ [link fusion.algorithms Algorithm]] +[def __algorithms__ [link fusion.algorithms Algorithms]] +[def __fold__ [link fusion.algorithms.iteration.functions.fold `fold`]] +[def __result_of_fold__ [link fusion.algorithms.iteration.metafunctions.fold `result_of::fold`]] +[def __accumulate__ [link fusion.algorithms.iteration.functions.accumulate `accumulate`]] +[def __result_of_accumulate__ [link fusion.algorithms.iteration.metafunctions.accumulate `result_of::accumulate`]] +[def __for_each__ [link fusion.algorithms.iteration.functions.for_each `for_each`]] +[def __result_of_for_each__ [link fusion.algorithms.iteration.metafunctions.for_each `result_of::for_each`]] +[def __any__ [link fusion.algorithms.query.functions.any `any`]] +[def __result_of_any__ [link fusion.algorithms.query.metafunctions.any `result_of::any`]] +[def __all__ [link fusion.algorithms.query.functions.all `all`]] +[def __result_of_all__ [link fusion.algorithms.query.metafunctions.all `result_of::all`]] +[def __none__ [link fusion.algorithms.query.functions.none `none`]] +[def __result_of_none__ [link fusion.algorithms.query.metafunctions.none `result_of::none`]] +[def __find__ [link fusion.algorithms.query.functions.find `find`]] +[def __result_of_find__ [link fusion.algorithms.query.metafunctions.find `result_of::find`]] +[def __find_if__ [link fusion.algorithms.query.functions.find_if `find_if`]] +[def __result_of_find_if__ [link fusion.algorithms.query.metafunctions.find_if `result_of::find_if`]] +[def __count__ [link fusion.algorithms.query.functions.count `count`]] +[def __result_of_count__ [link fusion.algorithms.query.metafunctions.count `result_of::count`]] +[def __count_if__ [link fusion.algorithms.query.functions.count_if `count_if`]] +[def __result_of_count_if__ [link fusion.algorithms.query.metafunctions.count_if `result_of::count_if`]] +[def __filter__ [link fusion.algorithms.transformation.functions.filter `filter`]] +[def __result_of_filter__ [link fusion.algorithms.transformation.metafunctions.filter `result_of::filter`]] +[def __filter_if__ [link fusion.algorithms.transformation.functions.filter_if `filter_if`]] +[def __result_of_filter_if__ [link fusion.algorithms.transformation.metafunctions.filter_if `result_of::filter_if`]] +[def __transform__ [link fusion.algorithms.transformation.functions.transform `transform`]] +[def __result_of_transform__ [link fusion.algorithms.transformation.metafunctions.transform `result_of::transform`]] +[def __replace__ [link fusion.algorithms.transformation.functions.replace `replace`]] +[def __result_of_replace__ [link fusion.algorithms.transformation.metafunctions.replace `result_of::replace`]] +[def __replace_if__ [link fusion.algorithms.transformation.functions.replace_if `replace_if`]] +[def __result_of_replace_if__ [link fusion.algorithms.transformation.metafunctions.replace_if `result_of::replace_if`]] +[def __remove__ [link fusion.algorithms.transformation.functions.remove `remove`]] +[def __result_of_remove__ [link fusion.algorithms.transformation.metafunctions.remove `result_of::remove`]] +[def __remove_if__ [link fusion.algorithms.transformation.functions.remove_if `remove_if`]] +[def __result_of_remove_if__ [link fusion.algorithms.transformation.metafunctions.remove_if `result_of::remove_if`]] +[def __reverse__ [link fusion.algorithms.transformation.functions.reverse `reverse`]] +[def __result_of_reverse__ [link fusion.algorithms.transformation.metafunctions.reverse `result_of::reverse`]] +[def __clear__ [link fusion.algorithms.transformation.functions.clear `clear`]] +[def __result_of_clear__ [link fusion.algorithms.transformation.metafunctions.clear `result_of::clear`]] +[def __erase__ [link fusion.algorithms.transformation.functions.erase `erase`]] +[def __result_of_erase__ [link fusion.algorithms.transformation.metafunctions.erase `result_of::erase`]] +[def __erase_key__ [link fusion.algorithms.transformation.functions.erase_key `erase_key`]] +[def __result_of_erase_key__ [link fusion.algorithms.transformation.metafunctions.erase_key `result_of::erase_key`]] +[def __insert__ [link fusion.algorithms.transformation.functions.insert `insert`]] +[def __result_of_insert__ [link fusion.algorithms.transformation.metafunctions.insert `result_of::insert`]] +[def __insert_range__ [link fusion.algorithms.transformation.functions.insert_range `insert_range`]] +[def __result_of_insert_range__ [link fusion.algorithms.transformation.metafunctions.insert_range `result_of::insert_range`]] +[def __join__ [link fusion.algorithms.transformation.functions.join `join`]] +[def __result_of_join__ [link fusion.algorithms.transformation.metafunctions.join `result_of::join`]] +[def __zip__ [link fusion.algorithms.transformation.functions.zip `zip`]] +[def __result_of_zip__ [link fusion.algorithms.transformation.metafunctions.zip `result_of::zip`]] +[def __pop_back__ [link fusion.algorithms.transformation.functions.pop_back `pop_back`]] +[def __result_of_pop_back__ [link fusion.algorithms.transformation.metafunctions.pop_back `result_of::pop_back`]] +[def __pop_front__ [link fusion.algorithms.transformation.functions.pop_front `pop_front`]] +[def __result_of_pop_front__ [link fusion.algorithms.transformation.metafunctions.pop_front `result_of::pop_front`]] +[def __push_back__ [link fusion.algorithms.transformation.functions.push_back `push_back`]] +[def __result_of_push_back__ [link fusion.algorithms.transformation.metafunctions.push_back `result_of::push_back`]] +[def __push_front__ [link fusion.algorithms.transformation.functions.push_front `push_front`]] +[def __result_of_push_front__ [link fusion.algorithms.transformation.metafunctions.push_front `result_of::push_front`]] + +[def __tr1_tuple_pair__ [link fusion.tuples.pairs `TR1 and std::pair`]] +[def __tuple_get__ [link fusion.tuples.class_template_tuple.element_access `get`]] + +[def __callable_obj__ [link fusion.functional.concepts.callable Callable Object]] +[def __def_callable_obj__ [link fusion.functional.concepts.def_callable Deferred Callable Object]] +[def __reg_callable_obj__ [link fusion.functional.concepts.reg_callable Regular Callable Object]] +[def __poly_func_obj__ [link fusion.functional.concepts.poly Polymorphic Function Object]] +[def __functional_adapters__ [link fusion.functional.adapters functional adapters]] +[def __fused__ [link fusion.functional.adapters.fused `fused`]] +[def __fused_procedure__ [link fusion.functional.adapters.fused_procedure `fused_procedure`]] +[def __fused_function_object__ [link fusion.functional.adapters.fused_function_object `fused_function_object`]] +[def __unfused_generic__ [link fusion.functional.adapters.unfused_generic `unfused_generic`]] +[def __unfused_lvalue_args__ [link fusion.functional.adapters.unfused_lvalue_args `unfused_lvalue_args`]] +[def __unfused_rvalue_args__ [link fusion.functional.adapters.unfused_rvalue_args `unfused_rvalue_args`]] +[def __unfused_typed__ [link fusion.functional.adapters.unfused_typed `unfused_typed`]] +[def __invoke__ [link fusion.functional.invocation.functions.invoke `invoke`]] +[def __invoke_procedure__ [link fusion.functional.invocation.functions.invoke_proc `invoke_procedure`]] +[def __invoke_function_object__ [link fusion.functional.invocation.functions.invoke_fobj `invoke_function_object`]] +[def __make_fused__ [link fusion.functional.generation.functions.mk_fused `make_fused`]] +[def __make_fused_procedure__ [link fusion.functional.generation.functions.mk_fused_proc `make_fused_procedure`]] +[def __make_fused_function_object__ [link fusion.functional.generation.functions.mk_fused_fobj `make_fused_function_object`]] +[def __make_unfused_generic__ [link fusion.functional.generation.functions.mk_unfused_genrc `make_unfused_generic`]] +[def __make_unfused_rvalue_args__ [link fusion.functional.generation.functions.mk_unfused_rvargs `make_unfused_rvalue_args`]] +[def __make_unfused_lvalue_args__ [link fusion.functional.generation.functions.mk_unfused_lvargs `make_unfused_lvalue_args`]] +[def __result_of_invoke__ [link fusion.functional.invocation.metafunctions.invoke `result_of::invoke`]] +[def __result_of_invoke_procedure__ [link fusion.functional.invocation.metafunctions.invoke_proc `result_of::invoke_procedure`]] +[def __result_of_invoke_function_object__ [link fusion.functional.invocation.metafunctions.invoke_fobj `result_of::invoke_function_object`]] +[def __result_of_make_fused__ [link fusion.functional.generation.metafunctions.mk_fused `make_fused`]] +[def __result_of_make_fused_procedure__ [link fusion.functional.generation.metafunctions.mk_fused_proc `make_fused_procedure`]] +[def __result_of_make_fused_function_object__ [link fusion.functional.generation.metafunctions.mk_fused_fobj `make_fused_function_object`]] +[def __result_of_make_unfused_generic__ [link fusion.functional.generation.metafunctions.mk_unfused_genrc `make_unfused_generic`]] +[def __result_of_make_unfused_rvalue_args__ [link fusion.functional.generation.metafunctions.mk_unfused_rvargs `make_unfused_rvalue_args`]] +[def __result_of_make_unfused_lvalue_args__ [link fusion.functional.generation.metafunctions.mk_unfused_lvargs `make_unfused_lvalue_args`]] + +[def __recursive_inline__ [link fusion.notes.recursive_inlined_functions Recursive Inlined Functions]] +[def __overloaded_functions__ [link fusion.notes.overloaded_functions Overloaded Functions]] +[def __tag_dispatching__ [link fusion.notes.tag_dispatching /tag dispatching/]] +[def __element_conversion__ [link fusion.notes.element_conversion /element conversion/]] +[def __see_element_conversion__ [link fusion.notes.element_conversion /see element conversion/]] +[def __note_boost_ref__ [link fusion.notes.boost__ref `boost::ref`]] + +[def __quick_start__ [link fusion.quick_start Quick Start]] +[def __organization__ [link fusion.organization Orgainization]] +[def __extension__ [link fusion.extension Extension]] + +[include preface.qbk] +[include introduction.qbk] +[include quick_start.qbk] +[include organization.qbk] +[include support.qbk] +[include iterators.qbk] +[include sequences.qbk] +[include algorithms.qbk] +[include tuples.qbk] +[include extension.qbk] +[include functional.qbk] +[include notes.qbk] +[include changelog.qbk] +[include acknowledgements.qbk] +[include references.qbk] + diff --git a/doc/html/boostbook.css b/doc/html/boostbook.css new file mode 100755 index 00000000..d84d5384 --- /dev/null +++ b/doc/html/boostbook.css @@ -0,0 +1,511 @@ +/*============================================================================= + Copyright (c) 2004 Joel de Guzman + http://spirit.sourceforge.net/ + + 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) +=============================================================================*/ + +/*============================================================================= + Body defaults +=============================================================================*/ + + body + { + margin: 1em; + font-family: sans-serif; + } + +/*============================================================================= + Paragraphs +=============================================================================*/ + + p + { + text-align: left; + font-size: 10pt; + line-height: 1.15; + } + +/*============================================================================= + Program listings +=============================================================================*/ + + /* Code on paragraphs */ + p tt.computeroutput + { + font-size: 9pt; + } + + pre.synopsis + { + font-size: 90%; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + .programlisting, + .screen + { + font-size: 9pt; + display: block; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + /* Program listings in tables don't get borders */ + td .programlisting, + td .screen + { + margin: 0pc 0pc 0pc 0pc; + padding: 0pc 0pc 0pc 0pc; + } + +/*============================================================================= + Headings +=============================================================================*/ + + h1, h2, h3, h4, h5, h6 + { + text-align: left; + margin: 1em 0em 0.5em 0em; + font-weight: bold; + } + + h1 { font: 140% } + h2 { font: bold 140% } + h3 { font: bold 130% } + h4 { font: bold 120% } + h5 { font: italic 110% } + h6 { font: italic 100% } + + /* Top page titles */ + title, + h1.title, + h2.title + h3.title, + h4.title, + h5.title, + h6.title, + .refentrytitle + { + font-weight: bold; + margin-bottom: 1pc; + } + + h1.title { font-size: 140% } + h2.title { font-size: 140% } + h3.title { font-size: 130% } + h4.title { font-size: 120% } + h5.title { font-size: 110% } + h6.title { font-size: 100% } + + .section h1 + { + margin: 0em 0em 0.5em 0em; + font-size: 140%; + } + + .section h2 { font-size: 140% } + .section h3 { font-size: 130% } + .section h4 { font-size: 120% } + .section h5 { font-size: 110% } + .section h6 { font-size: 100% } + + /* Code on titles */ + h1 tt.computeroutput { font-size: 140% } + h2 tt.computeroutput { font-size: 140% } + h3 tt.computeroutput { font-size: 130% } + h4 tt.computeroutput { font-size: 120% } + h5 tt.computeroutput { font-size: 110% } + h6 tt.computeroutput { font-size: 100% } + +/*============================================================================= + Author +=============================================================================*/ + + h3.author + { + font-size: 100% + } + +/*============================================================================= + Lists +=============================================================================*/ + + li + { + font-size: 10pt; + line-height: 1.3; + } + + /* Unordered lists */ + ul + { + text-align: left; + } + + /* Ordered lists */ + ol + { + text-align: left; + } + +/*============================================================================= + Links +=============================================================================*/ + + a + { + text-decoration: none; /* no underline */ + } + + a:hover + { + text-decoration: underline; + } + +/*============================================================================= + Spirit style navigation +=============================================================================*/ + + .spirit-nav + { + text-align: right; + } + + .spirit-nav a + { + color: white; + padding-left: 0.5em; + } + + .spirit-nav img + { + border-width: 0px; + } + +/*============================================================================= + Table of contents +=============================================================================*/ + + .toc + { + margin: 1pc 4% 0pc 4%; + padding: 0.1pc 1pc 0.1pc 1pc; + font-size: 80%; + line-height: 1.15; + } + + .boost-toc + { + float: right; + padding: 0.5pc; + } + +/*============================================================================= + Tables +=============================================================================*/ + + .table-title, + div.table p.title + { + margin-left: 4%; + padding-right: 0.5em; + padding-left: 0.5em; + } + + .informaltable table, + .table table + { + width: 92%; + margin-left: 4%; + margin-right: 4%; + } + + div.informaltable table, + div.table table + { + padding: 4px; + } + + /* Table Cells */ + div.informaltable table tr td, + div.table table tr td + { + padding: 0.5em; + text-align: left; + font-size: 9pt; + } + + div.informaltable table tr th, + div.table table tr th + { + padding: 0.5em 0.5em 0.5em 0.5em; + border: 1pt solid white; + font-size: 80%; + } + +/*============================================================================= + Blurbs +=============================================================================*/ + + div.note, + div.tip, + div.important, + div.caution, + div.warning, + p.blurb + { + font-size: 9pt; /* A little bit smaller than the main text */ + line-height: 1.2; + display: block; + margin: 1pc 4% 0pc 4%; + padding: 0.5pc 0.5pc 0.5pc 0.5pc; + } + + p.blurb img + { + padding: 1pt; + } + +/*============================================================================= + Variable Lists +=============================================================================*/ + + /* Make the terms in definition lists bold */ + div.variablelist dl dt, + span.term + { + font-weight: bold; + font-size: 10pt; + } + + div.variablelist table tbody tr td + { + text-align: left; + vertical-align: top; + padding: 0em 2em 0em 0em; + font-size: 10pt; + margin: 0em 0em 0.5em 0em; + line-height: 1; + } + + div.variablelist dl dt + { + margin-bottom: 0.2em; + } + + div.variablelist dl dd + { + margin: 0em 0em 0.5em 2em; + font-size: 10pt; + } + + div.variablelist table tbody tr td p, + div.variablelist dl dd p + { + margin: 0em 0em 0.5em 0em; + line-height: 1; + } + +/*============================================================================= + Misc +=============================================================================*/ + + /* Title of books and articles in bibliographies */ + span.title + { + font-style: italic; + } + + span.underline + { + text-decoration: underline; + } + + span.strikethrough + { + text-decoration: line-through; + } + + /* Copyright, Legal Notice */ + div div.legalnotice p + { + text-align: left + } + +/*============================================================================= + Colors +=============================================================================*/ + + @media screen + { + /* Links */ + a + { + color: #005a9c; + } + + a:visited + { + color: #9c5a9c; + } + + h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, + h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover, + h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited + { + text-decoration: none; /* no underline */ + color: #000000; + } + + /* Syntax Highlighting */ + .keyword { color: #0000AA; } + .identifier { color: #000000; } + .special { color: #707070; } + .preprocessor { color: #402080; } + .char { color: teal; } + .comment { color: #800000; } + .string { color: teal; } + .number { color: teal; } + .white_bkd { background-color: #FFFFFF; } + .dk_grey_bkd { background-color: #999999; } + + /* Copyright, Legal Notice */ + .copyright + { + color: #666666; + font-size: small; + } + + div div.legalnotice p + { + color: #666666; + } + + /* Program listing */ + pre.synopsis + { + border: 1px solid #DCDCDC; + } + + .programlisting, + .screen + { + border: 1px solid #DCDCDC; + } + + td .programlisting, + td .screen + { + border: 0px solid #DCDCDC; + } + + /* Blurbs */ + div.note, + div.tip, + div.important, + div.caution, + div.warning, + p.blurb + { + border: 1px solid #DCDCDC; + } + + /* Table of contents */ + .toc + { + border: 1px solid #DCDCDC; + } + + /* Tables */ + div.informaltable table tr td, + div.table table tr td + { + border: 1px solid #DCDCDC; + } + + div.informaltable table tr th, + div.table table tr th + { + background-color: #F0F0F0; + border: 1px solid #DCDCDC; + } + + /* Misc */ + span.highlight + { + color: #00A000; + } + } + + @media print + { + /* Links */ + a + { + color: black; + } + + a:visited + { + color: black; + } + + .spirit-nav + { + display: none; + } + + /* Program listing */ + pre.synopsis + { + border: 1px solid gray; + } + + .programlisting, + .screen + { + border: 1px solid gray; + } + + td .programlisting, + td .screen + { + border: 0px solid #DCDCDC; + } + + /* Table of contents */ + .toc + { + border: 1px solid gray; + } + + .informaltable table, + .table table + { + border: 1px solid gray; + border-collapse: collapse; + } + + /* Tables */ + div.informaltable table tr td, + div.table table tr td + { + border: 1px solid gray; + } + + div.informaltable table tr th, + div.table table tr th + { + border: 1px solid gray; + } + + /* Misc */ + span.highlight + { + font-weight: bold; + } + } diff --git a/doc/html/fusion/acknowledgements.html b/doc/html/fusion/acknowledgements.html new file mode 100644 index 00000000..b889a16a --- /dev/null +++ b/doc/html/fusion/acknowledgements.html @@ -0,0 +1,53 @@ + + + +Acknowledgements + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Special thanks to David Abrahams, Douglas Gregor, Hartmut Kaiser, Aleksey Gurtovoy, + Peder Holt, Daniel Wallin, Jaakko Jarvi, Jeremiah Willcock, Dan Marsden, Eric + Niebler, Joao Abecasis and Andy Little. These people are instrumental in the + design and development of Fusion. +

+

+ Special thanks to Ronald Garcia, the review manager and to all the people in + the boost community who participated in the review: Andreas Pokorny, Andreas + Huber, Jeff Flinn, David Abrahams, Pedro Lamarao, Larry Evans, Ryan Gallagher, + Andy Little, Gennadiy Rozental, Tobias Schwinger, Joao Abecasis, Eric Niebler, + Oleg Abrosimov, Gary Powell, Eric Friedman, Darren Cook, Martin Bonner and + Douglas Gregor. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms.html b/doc/html/fusion/algorithms.html new file mode 100644 index 00000000..5812bdf6 --- /dev/null +++ b/doc/html/fusion/algorithms.html @@ -0,0 +1,110 @@ + + + +Algorithms + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ + Lazy Evaluation +

+

+ Unlike MPL, Fusion + algorithms are lazy and non sequence-type preserving. What does that mean? + It means that when you operate on a sequence through a Fusion algorithm that + returns a sequence, the sequence returned may not be of the same class as the + original. This is by design. Runtime efficiency is given a high priority. Like + MPL, and unlike + STL, + fusion algorithms are functional in nature such that algorithms are non mutating + (no side effects). However, due to the high cost of returning full sequences + such as vectors and lists, Views are returned from Fusion + algorithms instead. For example, the transform algorithm does not actually + return a transformed version of the original sequence. transform returns a transform_view. This view holds a + reference to the original sequence plus the transform function. Iteration over + the transform_view + will apply the transform function over the sequence elements on demand. This + lazy evaluation scheme allows us to chain as many algorithms + as we want without incurring a high runtime penalty. +

+

+ + Sequence Extension +

+

+ The lazy evaluation scheme where Algorithms + return Views also allows operations + such as push_back to be totally generic. In + Fusion, push_back is actually a generic algorithm + that works on all sequences. Given an input sequence s + and a value x, Fusion's push_back algorithm simply returns + a joint_view: + a view that holds a reference to the original sequence s + and the value x. Functions + that were once sequence specific and need to be implemented N times over N + different sequences are now implemented only once. That is to say that Fusion + sequences are cheaply extensible. However, an important caveat is that the + result of a sequence extending operation like push_back does not retain the properties + of the original sequence such as associativity of _set_s. + To regain the original sequence, Conversion + functions are provided. You may use one of the Conversion + functions to convert back to the original sequence type. +

+

+ + Header +

+
+#include <boost/fusion/algorithm.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/concepts.html b/doc/html/fusion/algorithms/concepts.html new file mode 100644 index 00000000..492017fe --- /dev/null +++ b/doc/html/fusion/algorithms/concepts.html @@ -0,0 +1,41 @@ + + + +Concepts + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2005 Joel de Guzman, Dan Marsden
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/concepts/poly.html b/doc/html/fusion/algorithms/concepts/poly.html new file mode 100644 index 00000000..cdfddca7 --- /dev/null +++ b/doc/html/fusion/algorithms/concepts/poly.html @@ -0,0 +1,96 @@ + + + + Polymorphic Function + Object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A type of function object with a nested metafunction result. + result returns the result + type of calling the function object, given the argument types. +

+
+

Notation

+
+
F
+
+ A Polymorphic Function Object type +
+
f
+
+ A Polymorphic Function Object +
+
T1 + ...TN
+
+ Arbitrary types +
+
t1 + ...tN
+
+ Objects with types T1 ...TN +
+
+
+
+ + Expression + requirements +
+
+++++ + + + + + + + + + + +
ExpressionReturn TypeRuntime + Complexity
f(t1, ...tN)F::result<T1, ...TN>::typeUnspecified
+
+ + + +
Copyright © 2001-2005 Joel de Guzman, Dan Marsden
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration.html b/doc/html/fusion/algorithms/iteration.html new file mode 100644 index 00000000..2183865c --- /dev/null +++ b/doc/html/fusion/algorithms/iteration.html @@ -0,0 +1,54 @@ + + + +Iteration + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ The iteration algorithms provide the fundamental algorithms for traversing + a sequence repeatedly applying an operation to its elements. +

+

+ + Header +

+
+#include <boost/fusion/algorithm/iteration.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration/functions.html b/doc/html/fusion/algorithms/iteration/functions.html new file mode 100644 index 00000000..2efb8e1e --- /dev/null +++ b/doc/html/fusion/algorithms/iteration/functions.html @@ -0,0 +1,44 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration/functions/accumulate.html b/doc/html/fusion/algorithms/iteration/functions/accumulate.html new file mode 100644 index 00000000..424e78e1 --- /dev/null +++ b/doc/html/fusion/algorithms/iteration/functions/accumulate.html @@ -0,0 +1,198 @@ + + + +accumulate + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ For a sequence Seq, initial + state, and binary function object or function pointer f, + accumulate repeatedly applies binary f + to each element of Seq + and the previous state. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename State,
+    typename F
+    >
+typename result_of::accumulate<Sequence, State, F>::type accumulate(
+    Sequence& seq, State const& initial_state, F const& f);
+
+
+

Table 1.34. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence, f(eN + ....f(e2,f(e1,initial_state))) must be a valid expression for + each element e1 + to eN in seq +

+
+

+ Operation's argument +

+
+

+ initial_state +

+
+

+ Any type +

+
+

+ Initial state +

+
+

+ f +

+
+

+ boost::result_of<F(E,S)>::type is the return type of f(e,s) + for each element e + of type E in seq, and current state s of type S +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+accumulate(seq, initial_state, f);
+
+

+ Return type: Any type +

+

+ Semantics: Equivalent to f(eN ....f(e2,f(e1,initial_state))) + where e1 ...eN are the elements of seq. +

+
+ + Complexity +
+

+ Linear, exactly result_of::size<Sequence>::value applications of f. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/iteration/accumulate.hpp>
+
+
+ + Example +
+
+struct make_string
+{
+    typedef std::string result_type;
+
+    template<typename T>
+    std::string operator()(const T& t, const std::string& str) const
+    {
+        return str + boost::lexical_cast<std::string>(t);
+    }
+};
+...
+const vector<int,int> vec(1,2);
+assert(accumulate(vec,std::string(""), make_string()) == "12");
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration/functions/fold.html b/doc/html/fusion/algorithms/iteration/functions/fold.html new file mode 100644 index 00000000..e1e2f911 --- /dev/null +++ b/doc/html/fusion/algorithms/iteration/functions/fold.html @@ -0,0 +1,198 @@ + + + +fold + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ For a sequence Seq, initial + state, and binary function object or function pointer f, + fold repeatedly applies binary f + to each element of Seq + and the previous state. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename State,
+    typename F
+    >
+typename result_of::fold<Sequence, State, F>::type fold(
+    Sequence& seq, State const& initial_state, F const& f);
+
+
+

Table 1.33. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence,f(e,s) must be a valid expression for + each element e + in seq, and current + state s +

+
+

+ Operation's argument +

+
+

+ initial_state +

+
+

+ Any type +

+
+

+ Initial state +

+
+

+ f +

+
+

+ boost::result_of<F(E,S)>::type is the return type of f(e,s) + for each element e + of type E in seq, and current state s of type S +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+fold(seq, initial_state, f);
+
+

+ Return type: Any type +

+

+ Semantics: Equivalent to f(eN ....f(e2,f(e1,initial_state))) + where e1 ...eN are the elements of seq. +

+
+ + Complexity +
+

+ Linear, exactly result_of::size<Sequence>::value applications of f. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/iteration/fold.hpp>
+
+
+ + Example +
+
+struct make_string
+{
+    typedef std::string result_type;
+
+    template<typename T>
+    std::string operator()(const T& t, const std::string& str) const
+    {
+        return str + boost::lexical_cast<std::string>(t);
+    }
+};
+...
+const vector<int,int> vec(1,2);
+assert(fold(vec,std::string(""), make_string()) == "12");
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration/functions/for_each.html b/doc/html/fusion/algorithms/iteration/functions/for_each.html new file mode 100644 index 00000000..013ff685 --- /dev/null +++ b/doc/html/fusion/algorithms/iteration/functions/for_each.html @@ -0,0 +1,174 @@ + + + +for_each + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Applies a unary function object to each element of a sequence. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+typename result_of::for_each<Sequence, F>::type for_each(
+    Sequence& seq, F const& f);
+
+
+

Table 1.35. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence, f(e) must be a valid expression for + each element e + in seq +

+
+

+ Operation's argument +

+
+

+ f +

+
+

+ A unary Regular + Callable Object +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+for_each(seq, f);
+
+

+ Return type: void +

+

+ Semantics: Calls f(e) for each element e + in seq. +

+
+ + Complexity +
+

+ Linear, exactly result_of::size<Sequence>::value applications of f. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
+
+
+ + Example +
+
+struct increment
+{
+    template<typename T>
+    void operator()(T& t) const
+    {
+        ++t;
+    }
+};
+...
+vector<int,int> vec(1,2);
+for_each(vec, increment());
+assert(vec == make_vector(2,3));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration/metafunctions.html b/doc/html/fusion/algorithms/iteration/metafunctions.html new file mode 100644 index 00000000..fd27f8a8 --- /dev/null +++ b/doc/html/fusion/algorithms/iteration/metafunctions.html @@ -0,0 +1,44 @@ + + + +Metafunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration/metafunctions/accumulate.html b/doc/html/fusion/algorithms/iteration/metafunctions/accumulate.html new file mode 100644 index 00000000..b3a5db47 --- /dev/null +++ b/doc/html/fusion/algorithms/iteration/metafunctions/accumulate.html @@ -0,0 +1,176 @@ + + + +accumulate + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of accumulate. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename State,
+    typename F>
+struct accumulate
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.37. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ The sequence to iterate +

+
+

+ State +

+
+

+ Any type +

+
+

+ The initial state for the first application of F +

+
+

+ F +

+
+

+ boost::result_of<F(E,S)>::type is the return type of f(e,s) + for each element e + of type E in seq, and current state s of type S +

+
+

+ The operation to be applied on forward traversal +

+
+
+
+ + Expression + Semantics +
+
+result_of::accumulate<Sequence, State, F>::type
+
+

+ Return type: Any type +

+

+ Semantics: Returns the result of applying + accumulate to a sequence + of type Sequence, with + an initial state of type State + and binary function object or function pointer of type F. +

+
+ + Complexity +
+

+ Linear, exactly result_of::size<Sequence>::value applications of F. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/iteration/accumulate.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration/metafunctions/fold.html b/doc/html/fusion/algorithms/iteration/metafunctions/fold.html new file mode 100644 index 00000000..a319ac39 --- /dev/null +++ b/doc/html/fusion/algorithms/iteration/metafunctions/fold.html @@ -0,0 +1,176 @@ + + + +fold + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of fold. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename State,
+    typename F>
+struct fold
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.36. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ The sequence to iterate +

+
+

+ State +

+
+

+ Any type +

+
+

+ The initial state for the first application of F +

+
+

+ F +

+
+

+ boost::result_of<F(E,S)>::type is the return type of f(e,s) + for each element e + of type E in seq, and current state s of type S +

+
+

+ The operation to be applied on forward traversal +

+
+
+
+ + Expression + Semantics +
+
+result_of::fold<Sequence, State, F>::type
+
+

+ Return type: Any type +

+

+ Semantics: Returns the result of applying + fold to a sequence of + type Sequence, with an + initial state of type State + and binary function object or function pointer of type F. +

+
+ + Complexity +
+

+ Linear, exactly result_of::size<Sequence>::value applications of F. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/iteration/fold.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/iteration/metafunctions/for_each.html b/doc/html/fusion/algorithms/iteration/metafunctions/for_each.html new file mode 100644 index 00000000..09b24b77 --- /dev/null +++ b/doc/html/fusion/algorithms/iteration/metafunctions/for_each.html @@ -0,0 +1,158 @@ + + + +for_each + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ A metafunction returning the result type of applying for_each to a sequence. The + return type of for_each is always void. +

+
+ + Description +
+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+>
+struct for_each
+{
+    typedef void type;
+};
+
+
+

Table 1.38. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ F +

+
+

+ Any type +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::for_each<Sequence, F>::type
+
+

+ Return type: void. +

+

+ Semantics: Returns the return type of + for_each for a sequence of type + Sequence and a unary + function object F. The + return type is always void. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/iteration/for_each.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query.html b/doc/html/fusion/algorithms/query.html new file mode 100644 index 00000000..41aea719 --- /dev/null +++ b/doc/html/fusion/algorithms/query.html @@ -0,0 +1,53 @@ + + + +Query + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ The query algorithms provide support for searching and analyzing sequences. +

+

+ + Header +

+
+#include <boost/fusion/algorithm/query.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/functions.html b/doc/html/fusion/algorithms/query/functions.html new file mode 100644 index 00000000..b09e34a4 --- /dev/null +++ b/doc/html/fusion/algorithms/query/functions.html @@ -0,0 +1,48 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/functions/all.html b/doc/html/fusion/algorithms/query/functions/all.html new file mode 100644 index 00000000..52dbfb06 --- /dev/null +++ b/doc/html/fusion/algorithms/query/functions/all.html @@ -0,0 +1,177 @@ + + + +all + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+all
+
+ + Description +
+

+ For a sequence seq and + unary function object f, + all returns true if + f returns true for every + element of seq. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+typename result_of::all<Sequence,F>::type all(
+    Sequence const& seq, F f);
+
+
+

Table 1.40. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence, f(e) is a valid expression, convertible + to bool, for every + element e in seq +

+
+

+ The sequence to search +

+
+

+ f +

+
+

+ A unary function object +

+
+

+ The search predicate +

+
+
+
+ + Expression + Semantics +
+
+all(seq, f);
+
+

+ Return type: bool +

+

+ Semantics: Returns true if and only + if f(e) + evaluates to true for every + element e in seq. +

+
+ + Complexity +
+

+ Linear. At most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/all.hpp>
+
+
+ + Example +
+
+struct odd
+{
+    template<typename T>
+    bool operator()(T t) const
+    {
+        return t % 2;
+    }
+};
+...
+assert(all(make_vector(1,3), odd()));
+assert(!all(make_vector(1,2), odd()));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/functions/any.html b/doc/html/fusion/algorithms/query/functions/any.html new file mode 100644 index 00000000..4ab9512a --- /dev/null +++ b/doc/html/fusion/algorithms/query/functions/any.html @@ -0,0 +1,177 @@ + + + +any + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+any
+
+ + Description +
+

+ For a sequence seq and + unary function object f, + any returns true if + f returns true for at + least one element of seq. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+typename result_of::any<Sequence,F>::type any(
+    Sequence const& seq, F f);
+
+
+

Table 1.39. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence, f(e) must be a valid expression, convertible + to bool, for each + element e in seq +

+
+

+ The sequence to search +

+
+

+ f +

+
+

+ A unary function object +

+
+

+ The search predicate +

+
+
+
+ + Expression + semantics +
+
+any(seq, f);
+
+

+ Return type: bool +

+

+ Semantics: Returns true if and only + if f(e) + evaluates to true for some + element e in seq. +

+
+ + Complexity +
+

+ Linear. At most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/any.hpp>
+
+
+ + Example +
+
+struct odd
+{
+    template<typename T>
+    bool operator()(T t) const
+    {
+        return t % 2;
+    }
+};
+...
+assert(any(make_vector(1,2), odd()));
+assert(!any(make_vector(2,4), odd()));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/functions/count.html b/doc/html/fusion/algorithms/query/functions/count.html new file mode 100644 index 00000000..8d520d6d --- /dev/null +++ b/doc/html/fusion/algorithms/query/functions/count.html @@ -0,0 +1,164 @@ + + + +count + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the number of elements of a given type within a sequence. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+typename result_of::count<Sequence, T>::type count(
+    Sequence const& seq, T const& t);
+
+
+

Table 1.44. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence, e == t + must be a valid expression, convertible to bool, + for each element e + in seq +

+
+

+ The sequence to search +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type to count +

+
+
+
+ + Expression + Semantics +
+
+count(seq, t);
+
+

+ Return type: int +

+

+ Semantics: Returns the number of elements + of type T and equal to + t in seq. +

+
+ + Complexity +
+

+ Linear. At most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/count.hpp>
+
+
+ + Example +
+
+const vector<double,int,int> vec(1.0,2,3);
+assert(count(vec,2) == 1);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/functions/count_if.html b/doc/html/fusion/algorithms/query/functions/count_if.html new file mode 100644 index 00000000..e34b696f --- /dev/null +++ b/doc/html/fusion/algorithms/query/functions/count_if.html @@ -0,0 +1,163 @@ + + + +count_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the number of elements within a sequence with a type for which + a given unary function object evaluates to true. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+typename result_of::count_if<Sequence, F>::type count_if(
+    Sequence const& seq, F f);
+
+
+

Table 1.45. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence, f(e) is a valid expression, convertible + to bool, for each + element e in seq +

+
+

+ The sequence to search +

+
+

+ f +

+
+

+ A unary function object +

+
+

+ The search predicate +

+
+
+
+ + Expression + Semantics +
+
+count_if(seq, f)
+
+

+ Return type: int +

+

+ Semantics: Returns the number of elements + in seq where f evaluates to true. +

+
+ + Complexity +
+

+ Linear. At most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/count_if.hpp>
+
+
+ + Example +
+
+const vector<int,int,int> vec(1,2,3);
+assert(count_if(vec,odd()) == 2);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/functions/find.html b/doc/html/fusion/algorithms/query/functions/find.html new file mode 100644 index 00000000..ec889050 --- /dev/null +++ b/doc/html/fusion/algorithms/query/functions/find.html @@ -0,0 +1,169 @@ + + + +find + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Finds the first element of a given type within a sequence. +

+
+ + Synopsis +
+
+template<
+    typename T,
+    typename Sequence
+    >
+unspecified find(Sequence const& seq);
+
+template<
+    typename T,
+    typename Sequence
+    >
+unspecified find(Sequence& seq);
+
+
+

Table 1.42. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ The sequence to search +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type to search for +

+
+
+
+ + Expression + Semantics +
+
+find<T>(seq)
+
+

+ Return type: A model of the same iterator + category as the iterators of seq. +

+

+ Semantics: Returns an iterator to the + first element of seq + of type T, or end(seq) if there is no such element. Equivalent + to find_if<boost::is_same<_, T> >(seq) +

+
+ + Complexity +
+

+ Linear. At most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/find.hpp>
+
+
+ + Example +
+
+const vector<char,int> vec('a','0');
+assert(*find<int>(vec) == '0');
+assert(find<double>(vec) == end(vec));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/functions/find_if.html b/doc/html/fusion/algorithms/query/functions/find_if.html new file mode 100644 index 00000000..7c237c4e --- /dev/null +++ b/doc/html/fusion/algorithms/query/functions/find_if.html @@ -0,0 +1,173 @@ + + + +find_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Finds the first element within a sequence with a type for which a given + MPL + Lambda Expression evaluates to boost::mpl::true_. +

+
+ + Description +
+
+ + Synopsis +
+
+template<
+    typename F,
+    typename Sequence
+    >
+unspecified find_if(Sequence const& seq);
+
+template<
+    typename F,
+    typename Sequence
+    >
+unspecified find_if(Sequence& seq);
+
+
+

Table 1.43. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ The sequence to search +

+
+

+ F +

+
+

+ A unary MPL + Lambda Expression +

+
+

+ The search predicate +

+
+
+
+ + Expression + Semantics +
+
+find_if<F>(seq)
+
+

+ Return type: An iterator of the same + iterator category as the iterators of seq. +

+

+ Semantics: Returns the first element + of seq for which MPL + Lambda Expression F + evaluates to boost::mpl::true_, or end(seq) + if there is no such element. +

+
+ + Complexity +
+

+ Linear. At most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/find_if.hpp>
+
+
+ + Example +
+
+const vector<double,int> vec(1.0,2);
+assert(*find_if<is_integral<mpl::_> >(vec) == 2);
+assert(find_if<is_class<mpl::_> >(vec) == end(vec));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/functions/none.html b/doc/html/fusion/algorithms/query/functions/none.html new file mode 100644 index 00000000..c99c944a --- /dev/null +++ b/doc/html/fusion/algorithms/query/functions/none.html @@ -0,0 +1,177 @@ + + + +none + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ For a sequence seq and + unary function object f, + none returns true if + f returns false for every + element of seq. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+typename result_of::none<Sequence,F>::type none(
+    Sequence const& seq, F f);
+
+
+

Table 1.41. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence, f(e) is a valid expression, convertible + to bool, for every + element e in seq +

+
+

+ The sequence to search +

+
+

+ f +

+
+

+ A unary function object +

+
+

+ The search predicate +

+
+
+
+ + Expression + Semantics +
+
+none(seq, f);
+
+

+ Return type: bool +

+

+ Semantics: Returns true if and only + if f(e) + evaluates to false for every + element e in seq. Result equivalent to !any(seq, f). +

+
+ + Complexity +
+

+ Linear. At most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/none.hpp>
+
+
+ + Example +
+
+struct odd
+{
+    template<typename T>
+    bool operator()(T t) const
+    {
+        return t % 2;
+    }
+};
+...
+assert(none(make_vector(2,4), odd()));
+assert(!none(make_vector(1,2), odd()));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/metafunctions.html b/doc/html/fusion/algorithms/query/metafunctions.html new file mode 100644 index 00000000..be03b74c --- /dev/null +++ b/doc/html/fusion/algorithms/query/metafunctions.html @@ -0,0 +1,48 @@ + + + +Metafunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/metafunctions/all.html b/doc/html/fusion/algorithms/query/metafunctions/all.html new file mode 100644 index 00000000..394d74f6 --- /dev/null +++ b/doc/html/fusion/algorithms/query/metafunctions/all.html @@ -0,0 +1,161 @@ + + + +all + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+all
+
+ + Description +
+

+ A metafunction returning the result type of all. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+struct all
+{
+    typedef bool type;
+};
+
+
+

Table 1.47. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ F +

+
+

+ A model of unary Polymorphic + Function Object +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::all<Sequence, F>::type
+
+

+ Return type: bool. +

+

+ Semantics: Returns the return type of + all + given a sequence of type Sequence + and a unary Polymorphic + Function Object of type F. + The return type is always bool. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/all.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/metafunctions/any.html b/doc/html/fusion/algorithms/query/metafunctions/any.html new file mode 100644 index 00000000..79b3c1ab --- /dev/null +++ b/doc/html/fusion/algorithms/query/metafunctions/any.html @@ -0,0 +1,161 @@ + + + +any + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+any
+
+ + Description +
+

+ A metafunction returning the result type of any. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+struct any
+{
+    typedef bool type;
+};
+
+
+

Table 1.46. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ F +

+
+

+ A model of unary Polymorphic + Function Object +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::any<Sequence, F>::type
+
+

+ Return type: bool. +

+

+ Semantics: Returns the return type of + any + given a sequence of type Sequence + and a unary Polymorphic + Function Object of type F. + The return type is always bool. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/any.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/metafunctions/count.html b/doc/html/fusion/algorithms/query/metafunctions/count.html new file mode 100644 index 00000000..f5992e7c --- /dev/null +++ b/doc/html/fusion/algorithms/query/metafunctions/count.html @@ -0,0 +1,156 @@ + + + +count + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A metafunction that returns the result type of count + given the sequence and search types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+struct count
+{
+    typedef int type;
+};
+
+
+

Table 1.51. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ heading Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::count<T>::type
+
+

+ Return type: int. +

+

+ Semantics: Returns the return type of + count. The return type is always + int. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/count.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/metafunctions/count_if.html b/doc/html/fusion/algorithms/query/metafunctions/count_if.html new file mode 100644 index 00000000..35badef9 --- /dev/null +++ b/doc/html/fusion/algorithms/query/metafunctions/count_if.html @@ -0,0 +1,156 @@ + + + +count_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A metafunction that returns the result type of count_if + given the sequence and predicate types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename Pred
+    >
+struct count_if
+{
+    typedef int type;
+};
+
+
+

Table 1.52. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ Pred +

+
+

+ A unary function object +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::count_if<Sequence, Pred>::type
+
+

+ Return type: int. +

+

+ Semantics: Returns the return type of + count_if. The return type is + always int. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/count_if.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/metafunctions/find.html b/doc/html/fusion/algorithms/query/metafunctions/find.html new file mode 100644 index 00000000..da040e90 --- /dev/null +++ b/doc/html/fusion/algorithms/query/metafunctions/find.html @@ -0,0 +1,157 @@ + + + +find + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of find, + given the sequence and search types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+struct find
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.49. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ Model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::find<Sequence, T>::type
+
+

+ Return type: A model of the same iterator + category as the iterators of Sequence. +

+

+ Semantics: Returns an iterator to the + first element of type T + in Sequence, or result_of::end<Sequence>::type if there is no such element. +

+
+ + Complexity +
+

+ Linear, at most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/find.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/metafunctions/find_if.html b/doc/html/fusion/algorithms/query/metafunctions/find_if.html new file mode 100644 index 00000000..8e41a749 --- /dev/null +++ b/doc/html/fusion/algorithms/query/metafunctions/find_if.html @@ -0,0 +1,159 @@ + + + +find_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of find_if + given the sequence and predicate types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename Pred
+    >
+struct find_if
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.50. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ Pred +

+
+

+ A model of MPL + Lambda Expression +

+
+

+ Operation's arguments +

+
+
+
+ + Expression + Semantics +
+
+result_of::find_if<Sequence, Pred>::type
+
+

+ Return type: A model of the same iterator + category as the iterators of Sequence. +

+

+ Semantics: Returns an iterator to the + first element in Sequence + for which Pred evaluates + to true. Returns result_of::end<Sequence>::type if there is no such element. +

+
+ + Complexity +
+

+ Linear. At most result_of::size<Sequence>::value comparisons. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/find_if.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/query/metafunctions/none.html b/doc/html/fusion/algorithms/query/metafunctions/none.html new file mode 100644 index 00000000..9e8e0644 --- /dev/null +++ b/doc/html/fusion/algorithms/query/metafunctions/none.html @@ -0,0 +1,161 @@ + + + +none + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A metafunction returning the result type of none. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+struct none
+{
+    typedef bool type;
+};
+
+
+

Table 1.48. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ F +

+
+

+ A model of unary Polymorphic + Function Object +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::none<Sequence, F>::type
+
+

+ Return type: bool. +

+

+ Semantics: Returns the return type of + none given a sequence of type + Sequence and a unary + Polymorphic Function + Object of type F. + The return type is always bool. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/query/none.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation.html b/doc/html/fusion/algorithms/transformation.html new file mode 100644 index 00000000..c7da6318 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation.html @@ -0,0 +1,66 @@ + + + +Transformation + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ The transformation algorithms create new sequences out of existing sequences + by performing some sort of transformation. In reality the new sequences are + views onto the data in the original sequences. +

+
+ + + + + +
[Note]Note

+ As the transformation algorithms return views onto their input arguments, + it is important that the lifetime of the input arguments is greater than + the period during which you wish to use the results. +

+

+ + Header +

+
+#include <boost/fusion/algorithm/transformation.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions.html b/doc/html/fusion/algorithms/transformation/functions.html new file mode 100644 index 00000000..225bfb0b --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions.html @@ -0,0 +1,60 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/clear.html b/doc/html/fusion/algorithms/transformation/functions/clear.html new file mode 100644 index 00000000..8f351169 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/clear.html @@ -0,0 +1,140 @@ + + + +clear + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ clear returns an empty sequence. +

+
+ + Synposis +
+
+template<
+    typename Sequence
+    >
+typename result_of::clear<Sequence const>::type clear(Sequence const& seq);
+
+
+

Table 1.62. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+clear(seq);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Expression Semantics: Returns a sequence + with no elements. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/clear.hpp>
+
+
+ + Example +
+
+assert(clear(make_vector(1,2,3)) == make_vector());
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/erase.html b/doc/html/fusion/algorithms/transformation/functions/erase.html new file mode 100644 index 00000000..484fab77 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/erase.html @@ -0,0 +1,208 @@ + + + +erase + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence, containing all the elements of the original except + those at a specified iterator, or between two iterators. +

+
+ + Synposis +
+
+template<
+    typename Sequence,
+    typename First
+    >
+typename result_of::erase<Sequence const, First>::type erase(
+    Sequence const& seq, First const& it1);
+
+template<
+    typename Sequence,
+    typename First,
+    typename Last
+    >
+typename result_of::erase<Sequence const, First, Last>::type erase(
+    Sequence const& seq, First const& it1, Last const& it2);
+
+
+

Table 1.63. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameters +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ it1 +

+
+

+ A model of Forward + Iterator +

+
+

+ Iterator into seq +

+
+

+ it2 +

+
+

+ A model of Forward + Iterator +

+
+

+ Iterator into seq + after it1 +

+
+
+
+ + Expression + Semantics +
+
+erase(seq, pos);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + all the elements of seq + except the element at pos. +

+
+erase(seq, first, last);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, with + all the elements of seq, + in their original order, except those in the range [first,last). +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/erase.hpp>
+
+
+ + Example +
+
+const vector<int, double, char> vec(1, 2.0, 'c');
+assert(erase(vec, next(begin(vec))) == make_vector(1, 'c'));
+assert(erase(vec, next(begin(vec)), end(vec)) == make_vector(1));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/erase_key.html b/doc/html/fusion/algorithms/transformation/functions/erase_key.html new file mode 100644 index 00000000..b9ad0b0e --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/erase_key.html @@ -0,0 +1,167 @@ + + + +erase_key + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ For an Associative + Sequence seq, + returns a Forward + Sequence containing all the elements of the original except those + with a given key. +

+
+ + Synposis +
+
+template<
+    typename Key,
+    typename Sequence
+    >
+typename result_of::erase_key<Sequence const, Key>::type erase_key(Sequence const& seq);
+
+
+

Table 1.64. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Associative + Sequence +

+
+

+ Operation's argument +

+
+

+ Key +

+
+

+ Any type +

+
+

+ Key to erase +

+
+
+
+ + Expression + Semantics +
+
+erase_key<Key>(seq);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + all the elements of seq, + except those with key Key. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/erase_key.hpp>
+
+
+ + Example +
+
+assert(erase_key<int>(make_map<int, long>('a', 'b')) == make_map<long>('b'));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/filter.html b/doc/html/fusion/algorithms/transformation/functions/filter.html new file mode 100644 index 00000000..02bf4eae --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/filter.html @@ -0,0 +1,164 @@ + + + +filter + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ For a given sequence, filter returns a new sequences containing only + the elements of a specified type. +

+
+ + Synopsis +
+
+template<
+    typename T,
+    typename Sequence
+    >
+typename result_of::filter<Sequence const, T>::type filter(Sequence const& seq);
+
+
+

Table 1.53. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type to retain +

+
+
+
+ + Expression + Semantics +
+
+filter<T>(seq);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + all the elements of seq + of type T. Equivalent + to filter_if<boost::same_type<_, T> >(seq). +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/filter.hpp>
+
+
+ + Example +
+
+const vector<int,int,long,long> vec(1,2,3,4);
+assert(filter<int>(vec) == make_vector(1,2));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/filter_if.html b/doc/html/fusion/algorithms/transformation/functions/filter_if.html new file mode 100644 index 00000000..7142a8c3 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/filter_if.html @@ -0,0 +1,167 @@ + + + +filter_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ For a given sequence, filter_if returns a new sequences + containing only the elements with types for which a given MPL + Lambda Expression evaluates to boost::mpl::true_. +

+
+ + Synopsis +
+
+template<
+    typename Pred,
+    typename Sequence
+    >
+typename result_of::filter_if<Sequence const, Pred>::type filter_if(Sequence const& seq);
+
+
+

Table 1.54. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ Pred +

+
+

+ A unary MPL + Lambda Expression +

+
+

+ The predicate to filter by +

+
+
+
+ + Expression + Semantics +
+
+filter_if<Pred>(seq);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + all the elements of seq + with types for which Pred + evaluates to boost::mpl::true_. The order of the retained elements + is the same as in the original sequence. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/filter_if.hpp>
+
+
+ + Example +
+
+const vector<int,int,double,double> vec(1,2,3.0,4.0);
+assert(filter_if<is_integral<mpl::_> >(vec) == make_vector(1,2));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/insert.html b/doc/html/fusion/algorithms/transformation/functions/insert.html new file mode 100644 index 00000000..812ba362 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/insert.html @@ -0,0 +1,185 @@ + + + +insert + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence with all the elements of the original, an a new + element inserted the position described by a given iterator. +

+
+ + Synposis +
+
+template<
+    typename Sequence,
+    typename Pos,
+    typename T
+    >
+unspecified insert(Sequence const& seq, Pos const& pos, T const& t);
+
+
+

Table 1.65. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ pos +

+
+

+ A model of Forward + Iterator +

+
+

+ The position to insert at +

+
+

+ t +

+
+

+ Any type +

+
+

+ The value to insert +

+
+
+
+ + Expression + Semantics +
+
+insert(seq, p, t);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + all the elements of seq, + in their original order, and a new element with the type and value of + t inserted at iterator + pos. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/insert.hpp>
+
+
+ + Example +
+
+const vector<int,int> vec(1,2);
+assert(insert(vec, next(begin(vec)), 3) == make_vector(1,3,2));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/insert_range.html b/doc/html/fusion/algorithms/transformation/functions/insert_range.html new file mode 100644 index 00000000..b117a4c9 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/insert_range.html @@ -0,0 +1,188 @@ + + + +insert_range + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence with another sequence inserted at a specified + iterator. +

+
+ + Synposis +
+
+template<
+    typename Sequence,
+    typename Pos,
+    typename Range
+    >
+typename result_of::insert_range<Sequence const, Pos, Range>::type insert_range(
+    Sequence const& seq, Pos const& pos, Range const& range);
+
+
+

Table 1.66. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ pos +

+
+

+ A model of Forward + Iterator +

+
+

+ The position to insert at +

+
+

+ range +

+
+

+ A model of Forward + Sequence +

+
+

+ Range to insert +

+
+
+
+ + Expression + Semantics +
+
+insert(seq, pos, range);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + all the elements of seq, + and the elements of range + inserted at iterator pos. + All elements retaining their ordering from the orignal sequences. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/insert_range.hpp>
+
+
+ + Example +
+
+const vector<int,int> vec(1,2);
+assert(insert_range(vec, next(begin(vec)), make_vector(3,4)) == make_vector(1,3,4,2));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/join.html b/doc/html/fusion/algorithms/transformation/functions/join.html new file mode 100644 index 00000000..44bfe402 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/join.html @@ -0,0 +1,166 @@ + + + +join + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Takes 2 sequences and returns a sequence containing the elements of the + first followed by the elements of the second. +

+
+ + Synopsis +
+
+template<
+    typename LhSequence,
+    typename RhSequence>
+typename result_of::join<LhSequence, RhSequence>::type join(LhSequence const& lhs, RhSequence const& rhs);
+
+
+

Table 1.67. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ lhs +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ rhs +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+join(lhs, rhs);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + all the elements of lhs + followed by all the elements of rhs. + The order of th elements is preserved. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/join.hpp>
+
+
+ + Example +
+
+vector<int,char> v1(1, 'a');
+vector<int,char> v2(2, 'b');
+assert(join(v1, v2) == make_vector(1,'a',2,'b'));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/pop_back.html b/doc/html/fusion/algorithms/transformation/functions/pop_back.html new file mode 100644 index 00000000..58b34be5 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/pop_back.html @@ -0,0 +1,142 @@ + + + +pop_back + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence, with the last element of the original removed. +

+
+ + Synopsis +
+
+template<
+    typename Sequence
+    >
+typename result_of::pop_back<Sequence const>::type pop_back(Sequence const& seq);
+
+
+

Table 1.69. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+pop_back(seq);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence containing + all the elements of seq, + except the last element. The elements in the new sequence are in the + same order as they were in seq. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/pop_back.hpp>
+
+
+ + Example +
+
+assert(___pop_back__(make_vector(1,2,3)) == make_vector(1,2));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/pop_front.html b/doc/html/fusion/algorithms/transformation/functions/pop_front.html new file mode 100644 index 00000000..2177bbbf --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/pop_front.html @@ -0,0 +1,142 @@ + + + +pop_front + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence, with the first element of the original removed. +

+
+ + Synopsis +
+
+template<
+    typename Sequence
+    >
+typename result_of::pop_front<Sequence const>::type pop_front(Sequence const& seq);
+
+
+

Table 1.70. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+pop_front(seq);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence containing + all the elements of seq, + except the first element. The elements in the new sequence are in the + same order as they were in seq. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/pop_front.hpp>
+
+
+ + Example +
+
+assert(pop_front(make_vector(1,2,3)) == make_vector(2,3));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/push_back.html b/doc/html/fusion/algorithms/transformation/functions/push_back.html new file mode 100644 index 00000000..9d9af052 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/push_back.html @@ -0,0 +1,163 @@ + + + +push_back + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence with an element added at the end. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+typename result_of::push_back<Sequence, T>::type push_back(
+    Sequence const& seq, T const& t);
+
+
+

Table 1.71. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ t +

+
+

+ Any type +

+
+

+ The value to add to the end +

+
+
+
+ + Expression + Semantics +
+
+push_back(seq, t);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + all the elements of seq, + and new element t appended + to the end. The elements are in the same order as they were in seq. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/push_back.hpp>
+
+
+ + Example +
+
+assert(push_back(make_vector(1,2,3),4) == make_vector(1,2,3,4));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/push_front.html b/doc/html/fusion/algorithms/transformation/functions/push_front.html new file mode 100644 index 00000000..0a600437 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/push_front.html @@ -0,0 +1,164 @@ + + + +push_front + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence with an element added at the beginning. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+typename result_of::push_front<Sequence, T>::type push_front(
+    Sequence const& seq, T const& t);
+
+
+

Table 1.72. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ t +

+
+

+ Any type +

+
+

+ The value to add to the beginning +

+
+
+
+ + Expression + Semantics +
+
+push_back(seq, t);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + all the elements of seq, + and new element t appended + to the beginning. The elements are in the same order as they were in + seq. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/push_front.hpp>
+
+
+ + Example +
+
+assert(push_front(make_vector(1,2,3),0) == make_vector(0,1,2,3));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/remove.html b/doc/html/fusion/algorithms/transformation/functions/remove.html new file mode 100644 index 00000000..9f6577d2 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/remove.html @@ -0,0 +1,164 @@ + + + +remove + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence, with all the elements of the original sequence, + except those of a given type. +

+
+ + Synopsis +
+
+template<
+    typename T,
+    typename Sequence
+    >
+typename result_of::remove<Sequence const, T>::type replace(Sequence const& seq);
+
+
+

Table 1.59. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ Type to remove +

+
+
+
+ + Expression + Semantics +
+
+remove<T>(seq);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + all the elements of seq, + in their original order, except those of type T. + Equivalent to remove_if<boost::is_same<_,T> >(seq). +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/remove.hpp>
+
+
+ + Example +
+
+const vector<int,double> vec(1,2.0);
+assert(remove<double>(vec) == make_vector(1));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/remove_if.html b/doc/html/fusion/algorithms/transformation/functions/remove_if.html new file mode 100644 index 00000000..622500ca --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/remove_if.html @@ -0,0 +1,166 @@ + + + +remove_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence, containing all the elements of the original except + those where a given unary function object evaluates to true. +

+
+ + Synopsis +
+
+template<
+    typename Pred,
+    typename Sequence
+    >
+typename result_of::remove_if<Sequence const, Pred>::type remove_if(Sequence const& seq);
+
+
+

Table 1.60. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ Pred +

+
+

+ A model of unary MPL + Lambda Expression +

+
+

+ Removal predicate +

+
+
+
+ + Expression + Semantics +
+
+remove_if<Pred>(seq);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + all the elements of seq, + in their original order, except those elements with types for which + Pred evaluates to boost::mpl::true_. Equivalent to filter<boost::mpl::not_<Pred> + >(seq). +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/remove_if.hpp>
+
+
+ + Example +
+
+const vector<int,double> vec(1,2.0);
+assert(remove_if<is_floating_point<mpl::_> >(vec) == make_vector(1));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/replace.html b/doc/html/fusion/algorithms/transformation/functions/replace.html new file mode 100644 index 00000000..1d4e7b04 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/replace.html @@ -0,0 +1,185 @@ + + + +replace + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Replaces each value within a sequence of a given type and value with + a new value. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+typename result_of::replace<Sequence const, T>::type replace(
+    Sequence const& seq, T const& old_value, T const& new_value);
+
+
+

Table 1.57. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence, e == old_value + is a valid expression, convertible to bool, + for each element e + in seq with type + convertible to T +

+
+

+ Operation's argument +

+
+

+ old_value +

+
+

+ Any type +

+
+

+ Value to replace +

+
+

+ new_value +

+
+

+ Any type +

+
+

+ Replacement value +

+
+
+
+ + Expression + Semantics +
+
+replace(seq, old_value, new_value);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence with + all the values of seq + with new_value assigned + to elements with the same type and equal to old_value. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/replace.hpp>
+
+
+ + Example +
+
+assert(replace(make_vector(1,2), 2, 3) == make_vector(1,3));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/replace_if.html b/doc/html/fusion/algorithms/transformation/functions/replace_if.html new file mode 100644 index 00000000..e7462b27 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/replace_if.html @@ -0,0 +1,194 @@ + + + +replace_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Replaces each element of a given sequence for which an unary function + object evaluates to true + replaced with a new value. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F,
+    typename T>
+typename result_of::replace_if<Sequence const, F, T>::type replace_if(
+    Sequence const& seq, F f, T const& new_value);
+
+
+

Table 1.58. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ f +

+
+

+ A function object for which f(e) is a valid expression, convertible + to bool, for each + element e in seq +

+
+

+ Operation's argument +

+
+

+ new_value +

+
+

+ Any type +

+
+

+ Replacement value +

+
+
+
+ + Expression + Semantics +
+
+replace_if(seq, f, new_value);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence with + all the elements of seq, + with new_value assigned + to each element for which f + evaluates to true. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/replace_if.hpp>
+
+
+ + Example +
+
+struct odd
+{
+    template<typename T>
+    bool operator()(T t) const
+    {
+        return t % 2;
+    }
+};
+...
+assert(replace_if(make_vector(1,2), odd(), 3) == make_vector(3,2));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/reverse.html b/doc/html/fusion/algorithms/transformation/functions/reverse.html new file mode 100644 index 00000000..cbe0dcde --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/reverse.html @@ -0,0 +1,141 @@ + + + +reverse + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a new sequence with the elements of the original in reverse order. +

+
+ + Synposis +
+
+template<
+    typename Sequence
+    >
+typename result_of::reverse<Sequence const>::type reverse(Sequence const& seq);
+
+
+

Table 1.61. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Bidirectional + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+reverse(seq);
+
+

+ Return type: A model of Bidirectional + Sequence. +

+

+ Semantics: Returns a new sequence containing + all the elements of seq + in reverse order. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/reverse.hpp>
+
+
+ + Example +
+
+assert(reverse(make_vector(1,2,3)) == make_vector(3,2,1));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/transform.html b/doc/html/fusion/algorithms/transformation/functions/transform.html new file mode 100644 index 00000000..081723b7 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/transform.html @@ -0,0 +1,292 @@ + + + +transform + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ For a sequence seq and + function object or function pointer f, + transform returns a new + sequence with elements created by applying f(e) to each element of e + of seq. +

+
+ + Unary + version synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+typename result_of::transform<Sequence const, F>::type transform(
+    Sequence const& seq, F f);
+
+
+

Table 1.55. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ f +

+
+

+ f(e) + is a valid expression for each element e + of seq. boost::result_of<F(E)>::type is the return type of f when called with a value of + each element type E. +

+
+

+ Transformation function +

+
+
+
+ + Expression + Semantics +
+
+transform(seq, f);
+
+

+ Return type: A model of Forward + Sequence +

+

+ Semantics: Returns a new sequence, containing + the return values of f(e) for each element e + within seq. +

+
+ + Binary + version synopsis +
+
+template<
+    typename Sequence1,
+    typename Sequence2,
+    typename F
+    >
+typename result_of::transform<Sequence1 const, Sequence2 const, F>::type transform(
+    Sequence1 const& seq1, Sequence2 const& seq2, F f);
+
+
+

Table 1.56. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq1 +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ seq2 +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ f +

+
+

+ f(e1,e2) + is a valid expression for each pair of elements e1 + of seq1 and e2 of seq2. + boost::result_of<F(E1,E2)>::type is the return type of f when called with elements of + type E1 and E2 +

+
+

+ Transformation function +

+
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + the return values of f(e1, e2) for each pair of elements e1 and e2 + within seq1 and seq2 respectively. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/transform.hpp>
+
+
+ + Example +
+
+struct triple
+{
+    typedef int result_type;
+
+    int operator()(int t) const
+    {
+        return t * 3;
+    };
+};
+...
+assert(transform(make_vector(1,2,3), triple()) == make_vector(3,6,9));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/functions/zip.html b/doc/html/fusion/algorithms/transformation/functions/zip.html new file mode 100644 index 00000000..d4f8fa0f --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/functions/zip.html @@ -0,0 +1,153 @@ + + + +zip + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+zip
+
+ + Description +
+

+ Zips sequences together to form a single sequence, whos members are tuples + of the members of the component sequences. +

+
+ + Synopsis +
+
+template<
+    typename Sequence1,
+    typename Sequence2,
+    ...
+    typename SequenceN
+    >
+typename result_of::zip<Sequence1, Sequence2, ... SequenceN>::type 
+zip(Sequence1 const& seq1, Sequence2 const& seq2, ... SequenceN const& seqN);
+
+
+

Table 1.68. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq1 to seqN +

+
+

+ Each sequence is a model of Forward + Sequence. +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+zip(seq1, seq2, ... seqN);
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + tuples of elements from sequences seq1 + to seqN. For example, + applying zip to tuples (1, 2, 3) + and ('a', 'b', + 'c') + would return ((1, 'a'),(2, 'b'),(3, + 'c')) +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/zip.hpp>
+
+
+ + Example +
+
+vector<int,char> v1(1, 'a');
+vector<int,char> v2(2, 'b');
+assert(zip(v1, v2) == make_vector(make_vector(1, 2),make_vector('a', 'b'));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions.html b/doc/html/fusion/algorithms/transformation/metafunctions.html new file mode 100644 index 00000000..0f2ff997 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions.html @@ -0,0 +1,60 @@ + + + +Metafunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/clear.html b/doc/html/fusion/algorithms/transformation/metafunctions/clear.html new file mode 100644 index 00000000..848d0a47 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/clear.html @@ -0,0 +1,134 @@ + + + +clear + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of clear, given the input sequence + type. +

+
+ + Synopsis +
+
+template<
+    typename Sequence
+    >
+struct clear
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.82. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ Any type +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::clear<Sequence>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns an empty sequence. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/clear.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/erase.html b/doc/html/fusion/algorithms/transformation/metafunctions/erase.html new file mode 100644 index 00000000..31344d05 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/erase.html @@ -0,0 +1,191 @@ + + + +erase + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Returns the result type of erase, given the input sequence + and range delimiting iterator types. +

+
+ + Description +
+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename It1,
+    typename It2 = unspecified>
+struct erase
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.83. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ It1 +

+
+

+ A model of Forward + Iterator +

+
+

+ Operation's argument +

+
+

+ It2 +

+
+

+ A model of Forward + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::erase<Sequence, It1>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence with + the element at It1 removed. +

+
+result_of::erase<Sequence, It1, It2>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence with + the elements between It1 + and It2 removed. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/erase.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/erase_key.html b/doc/html/fusion/algorithms/transformation/metafunctions/erase_key.html new file mode 100644 index 00000000..dd6dd245 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/erase_key.html @@ -0,0 +1,158 @@ + + + +erase_key + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of erase_key, given the sequence + and key types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename Key
+    >
+struct erase_key
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.84. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Associative + Sequence +

+
+

+ Operation's argument +

+
+

+ Key +

+
+

+ Any type +

+
+

+ Key type +

+
+
+
+ + Expression + Semantics +
+
+result_of::erase_key<Sequence, Key>::type
+
+

+ Return type: A model of Associative + Sequence. +

+

+ Semantics: Returns a sequence with the + elements of Sequence, + except those with key Key. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/erase_key.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/filter.html b/doc/html/fusion/algorithms/transformation/metafunctions/filter.html new file mode 100644 index 00000000..f15bf0a2 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/filter.html @@ -0,0 +1,160 @@ + + + +filter + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of filter given the sequence type + and type to retain. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+struct filter
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.73. Parameter

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ Type to retain +

+
+
+
+ + Expression + Semantics +
+
+result_of::filter<Sequence, T>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + the elements of Sequence + that are of type T. Equivalent + to result_of::filter_if<Sequence, + boost::is_same<mpl::_, T> >::type. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/filter.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/filter_if.html b/doc/html/fusion/algorithms/transformation/metafunctions/filter_if.html new file mode 100644 index 00000000..8906392b --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/filter_if.html @@ -0,0 +1,161 @@ + + + +filter_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of filter_if given the sequence + and unary MPL + Lambda Expression predicate type. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename Pred
+    >
+struct filter_if
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.74. Parameter

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ Pred +

+
+

+ A unary MPL + Lambda Expression +

+
+

+ Type to retain +

+
+
+
+ + Expression + Semantics +
+
+result_of::filter_if<Sequence, Pred>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + the elements of Sequence + for which Pred evaluates + to boost::mpl::true_. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/filter_if.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/insert.html b/doc/html/fusion/algorithms/transformation/metafunctions/insert.html new file mode 100644 index 00000000..20a5d409 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/insert.html @@ -0,0 +1,179 @@ + + + +insert + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of insert, given the sequence, + position iterator and insertion types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename Position,
+    typename T
+    >
+struct insert
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.85. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ Position +

+
+

+ A model of Forward + Iterator +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::insert<Sequence, Position, T>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence with an + element of type T inserted + at position Position + in Sequence. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/insert.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/insert_range.html b/doc/html/fusion/algorithms/transformation/metafunctions/insert_range.html new file mode 100644 index 00000000..a6482a74 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/insert_range.html @@ -0,0 +1,181 @@ + + + +insert_range + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of insert_range, given the input + sequence, position iterator and insertion range types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename Position,
+    typename Range
+    >
+struct insert_range
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.86. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ Position +

+
+

+ A model of Forward + Iterator +

+
+

+ Operation's argument +

+
+

+ Range +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::insert_range<Sequence, Position, Range>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence with the + elements of Range inserted + at position Position + into Sequence. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/insert_range.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/join.html b/doc/html/fusion/algorithms/transformation/metafunctions/join.html new file mode 100644 index 00000000..756668ab --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/join.html @@ -0,0 +1,93 @@ + + + +join + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result of joining 2 sequences, given the sequence types. +

+
+ + Synopsis +
+
+template<
+    typename LhSequence,
+    typename RhSequence
+    >
+struct join
+{
+    typedef unspecified type;
+};
+
+
+ + Expression + Semantics +
+
+result_of::join<LhSequence, RhSequence>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + the elements of LhSequence + followed by the elements of RhSequence. + The order of the elements in the 2 sequences is preserved. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/join.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/pop_back.html b/doc/html/fusion/algorithms/transformation/metafunctions/pop_back.html new file mode 100644 index 00000000..86a05857 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/pop_back.html @@ -0,0 +1,138 @@ + + + +pop_back + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of pop_back, given the input sequence + type. +

+
+ + Synopsis +
+
+template<
+    typename Sequence
+    >
+struct pop_back
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.87. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::pop_back<Sequence>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence with all + the elements of Sequence + except the last element. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/tranformation/pop_back.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/pop_front.html b/doc/html/fusion/algorithms/transformation/metafunctions/pop_front.html new file mode 100644 index 00000000..309d7ff8 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/pop_front.html @@ -0,0 +1,138 @@ + + + +pop_front + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of pop_front, given the input sequence + type. +

+
+ + Synopsis +
+
+template<
+    typename Sequence
+    >
+struct pop_front
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.88. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::pop_front<Sequence>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence with all + the elements of Sequence + except the first element. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/pop_front.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/push_back.html b/doc/html/fusion/algorithms/transformation/metafunctions/push_back.html new file mode 100644 index 00000000..651aef5d --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/push_back.html @@ -0,0 +1,159 @@ + + + +push_back + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of push_back, given the types of + the input sequence and element to push. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+struct push_back
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.89. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::push_back<Sequence, T>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence with the + elements of Sequence + and an element of type T + added to the end. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/push_back.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/push_front.html b/doc/html/fusion/algorithms/transformation/metafunctions/push_front.html new file mode 100644 index 00000000..ea40b769 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/push_front.html @@ -0,0 +1,159 @@ + + + +push_front + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of push_front, given the types + of the input sequence and element to push. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+struct push_front
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.90. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::push_front<Sequence, T>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence with the + elements of Sequence + and an element of type T + added to the beginning. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/push_front.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/remove.html b/doc/html/fusion/algorithms/transformation/metafunctions/remove.html new file mode 100644 index 00000000..e7fcd282 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/remove.html @@ -0,0 +1,160 @@ + + + +remove + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of remove, given the sequence and + removal types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+struct remove
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.79. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ Remove elements of this type +

+
+
+
+ + Expression + Semantics +
+
+result_of::remove<Sequence, T>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + the elements of Sequence + not of type T. Equivalent + to result_of::replace_if<Sequence, + boost::is_same<mpl::_, T> >::type. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/remove.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/remove_if.html b/doc/html/fusion/algorithms/transformation/metafunctions/remove_if.html new file mode 100644 index 00000000..c872fb81 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/remove_if.html @@ -0,0 +1,161 @@ + + + +remove_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of remove_if, given the input sequence + and unary MPL + Lambda Expression predicate types. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename Pred
+    >
+struct remove_if
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.80. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ Pred +

+
+

+ A model of unary MPL + Lambda Expression +

+
+

+ Remove elements which evaluate to boost::mpl::true_ +

+
+
+
+ + Expression + Semantics +
+
+result_of::remove_if<Sequence, Pred>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a sequence containing + the elements of Sequence + for which Pred evaluates + to boost::mpl::false_. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/remove_if.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/replace.html b/doc/html/fusion/algorithms/transformation/metafunctions/replace.html new file mode 100644 index 00000000..e294e80d --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/replace.html @@ -0,0 +1,157 @@ + + + +replace + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of replace, given the types of + the input sequence and element to replace. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename T
+    >
+struct replace
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.77. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type of the search and replacement objects +

+
+
+
+ + Expression + Semantics +
+
+result_of::replace<Sequence,T>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns the return type of + replace. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/replace.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/replace_if.html b/doc/html/fusion/algorithms/transformation/metafunctions/replace_if.html new file mode 100644 index 00000000..11a76dd0 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/replace_if.html @@ -0,0 +1,178 @@ + + + +replace_if + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of replace_if, given the types + of the sequence, Polymorphic + Function Object predicate and replacement object. +

+
+ + Synopsis +
+
+template<
+    typename Sequence,
+    typename F,
+    typename T>
+struct replace_if
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.78. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ F +

+
+

+ A model of unary Polymorphic + Function Object +

+
+

+ Replacement predicate +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type of the replacement object +

+
+
+
+ + Expression + Semantics +
+
+result_of::replace_if<Sequence,F,T>::type
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns the return type of + replace_if. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/replace_if.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/reverse.html b/doc/html/fusion/algorithms/transformation/metafunctions/reverse.html new file mode 100644 index 00000000..9cab050a --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/reverse.html @@ -0,0 +1,137 @@ + + + +reverse + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of reverse, given the input sequence + type. +

+
+ + Synopsis +
+
+template<
+    typename Sequence
+    >
+struct reverse
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.81. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A model of Bidirectional + Sequence +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::reverse<Sequence>::type
+
+

+ Return type: A model of Bidirectional + Sequence. +

+

+ Semantics: Returns a sequence with the + elements in the reverse order to Sequence. +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/reverse.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/transform.html b/doc/html/fusion/algorithms/transformation/metafunctions/transform.html new file mode 100644 index 00000000..dc21f9c4 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/transform.html @@ -0,0 +1,292 @@ + + + +transform + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ For a sequence seq and + function object or function pointer f, + transform returns a new + sequence with elements created by applying f(e) to each element of e + of seq. +

+
+ + Unary + version synopsis +
+
+template<
+    typename Sequence,
+    typename F
+    >
+typename result_of::transform<Sequence const, F>::type transform(
+    Sequence const& seq, F f);
+
+
+

Table 1.75. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ f +

+
+

+ f(e) + is a valid expression for each element e + of seq. boost::result_of<F(E)>::type is the return type of f when called with a value of + each element type E. +

+
+

+ Transformation function +

+
+
+
+ + Expression + Semantics +
+
+transform(seq, f);
+
+

+ Return type: A model of Forward + Sequence +

+

+ Semantics: Returns a new sequence, containing + the return values of f(e) for each element e + within seq. +

+
+ + Binary + version synopsis +
+
+template<
+    typename Sequence1,
+    typename Sequence2,
+    typename F
+    >
+typename result_of::transform<Sequence1 const, Sequence2 const, F>::type transform(
+    Sequence1 const& seq1, Sequence2 const& seq2, F f);
+
+
+

Table 1.76. Parameters

+ +++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq1 +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ seq2 +

+
+

+ A model of Forward + Sequence +

+
+

+ Operation's argument +

+
+

+ f +

+
+

+ f(e1,e2) + is a valid expression for each pair of elements e1 + of seq1 and e2 of seq2. + boost::result_of<F(E1,E2)>::type is the return type of f when called with elements of + type E1 and E2 +

+
+

+ Transformation function +

+
+
+

+ Return type: A model of Forward + Sequence. +

+

+ Semantics: Returns a new sequence, containing + the return values of f(e1, e2) for each pair of elements e1 and e2 + within seq1 and seq2 respectively. +

+
+ + Complexity +
+

+ Constant. Returns a view which is lazily evaluated. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/transform.hpp>
+
+
+ + Example +
+
+struct triple
+{
+    typedef int result_type;
+
+    int operator()(int t) const
+    {
+        return t * 3;
+    };
+};
+...
+assert(transform(make_vector(1,2,3), triple()) == make_vector(3,6,9));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/algorithms/transformation/metafunctions/zip.html b/doc/html/fusion/algorithms/transformation/metafunctions/zip.html new file mode 100644 index 00000000..9a629d83 --- /dev/null +++ b/doc/html/fusion/algorithms/transformation/metafunctions/zip.html @@ -0,0 +1,100 @@ + + + +zip + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+zip
+
+ + Description +
+

+ Zips sequences together to form a single sequence, whos members are tuples + of the members of the component sequences. +

+
+ + Synopsis +
+
+template<
+    typename Sequence1,
+    typename Sequence2,
+    ...
+    typename SequenceN
+    >
+struct zip
+{
+    typedef unspecified type;
+};
+
+
+ + Expression + Semantics +
+
+result_of::zip<Sequence1, Sequence2, ... SequenceN>::type
+
+

+ Return type: A model of the most restrictive + traversal category of sequences Sequence1 + to SequenceN. +

+

+ Semantics: Return a sequence containing + tuples of elements from each sequence. For example, applying zip to tuples + (1, 2, + 3) + and ('a', 'b', + 'c') + would return ((1, 'a'),(2, 'b'),(3, + 'c')) +

+
+ + Complexity +
+

+ Constant. +

+
+ + Header +
+
+#include <boost/fusion/algorithm/transformation/zip.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/change_log.html b/doc/html/fusion/change_log.html new file mode 100644 index 00000000..b21a629f --- /dev/null +++ b/doc/html/fusion/change_log.html @@ -0,0 +1,55 @@ + + + +Change log + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ This section summarizes significant changes to the Fusion library. +

+
    +
  • + Sep 27, 2006: Added boost::tuple + support. +
  • +
  • + Nov 17, 2006: Added boost::variant + support. +
  • +
  • + Feb 15, 2007: Added functional module. +
  • +
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/extension.html b/doc/html/fusion/extension.html new file mode 100644 index 00000000..6187ce86 --- /dev/null +++ b/doc/html/fusion/extension.html @@ -0,0 +1,536 @@ + + + +Extension + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The Fusion library is designed to be extensible, new sequences types can easily + be added. In fact, the library support for std::pair, + boost::array and MPL + sequences is entirely provided using the extension mechanism. +

+

+ The process for adding a new sequence type to Fusion is: +

+
    +
  1. + Enable the tag dispatching + mechanism used by Fusion for your sequence type +
  2. +
  3. + Design an iterator type for the sequence +
  4. +
  5. + Provide specialized behaviour for the intrinsic operations of the new Fusion + sequence +
  6. +
+

+ + Our example +

+

+ In order to illustrate enabling a new sequence type for use with Fusion, we + are going to use the type: +

+
+namespace example
+{
+    struct example_struct
+    {
+        std::string name;
+        int age;
+        example_struct(
+            const std::string& n,
+            int a)
+            : name(n), age(a)
+        {}
+    };
+}
+
+

+ We are going to pretend that this type has been provided by a 3rd party library, + and therefore cannot be modified. We shall work through all the necessary steps + to enable example_struct to + serve as an Associative + Sequence as described in the Quick + Start guide. +

+

+ + Enabling Tag Dispatching +

+

+ The Fusion extensibility mechanism uses tag + dispatching to call the correct code for a given sequence + type. In order to exploit the tag dispatching mechanism we must first declare + a new tag type for the mechanism to use. For example: +

+
+namespace example {
+    struct example_sequence_tag; // Only definition needed
+}
+
+

+ Next we need to enable the traits::tag_of + metafunction to return our newly chosen tag type for operations involving our + sequence. This is done by specializing traits::tag_of + for our sequence type. +

+
+#include <boost/fusion/support/tag_of_fwd.hpp>
+
+namespace boost { namespace fusion { namespace traits {        
+    template<>
+    struct tag_of<example_struct>
+    {
+        typedef example::example_sequence_tag type;
+    };
+}}}
+
+

+ traits::tag_of also has a second template argument, + that can be used in conjuction with boost::enable_if + to provide tag support for groups of related types. This feature is not necessary + for our sequence, but for an example see the code in: +

+
+#include <boost/fusion/sequence/adapted/mpl/tag_of.hpp>
+
+

+ + Designing a + suitable iterator +

+

+ We need an iterator to describe positions, and provide access to the data within + our sequence. As it is straightforward to do, we are going to provide a random + access iterator in our example. +

+

+ We will use a simple design, in which the 2 members of example_struct + are given numbered indices, 0 for name + and 1 for age respectively. +

+
+template<typename Struct, int Pos>
+struct example_struct_iterator
+    : boost::fusion::iterator_base<example_struct_iterator<Struct, Pos> >
+{
+    BOOST_STATIC_ASSERT(Pos >=0 && Pos < 3);
+    typedef Struct struct_type;
+    typedef boost::mpl::int_<Pos> index;
+    typedef boost::fusion::random_access_traversal_tag category;
+
+    example_struct_iterator(Struct& str)
+        : struct_(str) {}
+
+    Struct& struct_;
+};
+
+

+ A quick summary of the details of our iterator: +

+
    +
  1. + The iterator is parameterized by the type it is iterating over, and the index + of the current element. +
  2. +
  3. + The typedefs struct_type + and index provide convenient + access to information we will need later in the implementation. +
  4. +
  5. + The typedef category allows + the traits::category_of + metafunction to establish the traversal category of the iterator. +
  6. +
  7. + The constructor stores a reference to the example_struct + being iterated over. +
  8. +
+

+ We also need to enable tag + dispatching for our iterator type, with another specialization + of traits::tag_of. +

+

+ In isolation, the iterator implementation is pretty dry. Things should become + clearer as we add features to our implementation. +

+

+ + A first + couple of instructive features +

+

+ To start with, we will get the result_of::value_of metafunction working. To + do this, we provide a specialization of the boost::fusion::extension::value_of_impl + template for our iterator's tag type. +

+
+template<>
+struct value_of_impl<example::example_struct_iterator_tag>
+{
+    template<typename Iterator>
+    struct apply;
+
+    template<typename Struct>
+    struct apply<example::example_struct_iterator<Struct, 0> >
+    {
+        typedef std::string type;
+    };
+
+    template<typename Struct>
+    struct apply<example::example_struct_iterator<Struct, 1> >
+    {
+        typedef int type;
+    };
+};
+
+

+ The implementation itself is pretty simple, it just uses 2 partial specializations + to provide the type of the 2 different members of example_struct, + based on the index of the iterator. +

+

+ To understand how value_of_impl + is used by the library we will look at the implementation of value_of: +

+
+template <typename Iterator>
+struct value_of
+    : extension::value_of_impl<typename detail::tag_of<Iterator>::type>::
+        template apply<Iterator>
+{};
+
+

+ So value_of + uses tag dispatching + to select an MPL + Metafunction Class to provide its functionality. You will notice this + pattern throughout the implementation of Fusion. +

+

+ Ok, lets enable dereferencing of our iterator. In this case we must provide + a suitable specialization of deref_impl. +

+
+template<>
+struct deref_impl<example::example_struct_iterator_tag>
+{
+    template<typename Iterator>
+    struct apply;
+
+    template<typename Struct>
+    struct apply<example::example_struct_iterator<Struct, 0> >
+    {
+        typedef typename mpl::if_<
+            is_const<Struct>, std::string const&, std::string&>::type type;
+
+        static type
+        call(example::example_struct_iterator<Struct, 0> const& it)
+        {
+            return it.struct_.name;
+        }
+    };
+
+    template<typename Struct>
+    struct apply<example::example_struct_iterator<Struct, 1> >
+    {
+        typedef typename mpl::if_<
+            is_const<Struct>, int const&, int&>::type type;
+
+        static type
+        call(example::example_struct_iterator<Struct, 1> const& it)
+        {
+                return it.struct_.age;
+            }
+        };
+    };
+}
+
+

+ The use of deref_impl is very + similar to that of value_of_impl, + but it also provides some runtime functionality this time via the call static member function. To see how + deref_impl is used, lets have + a look at the implementation of deref: +

+
+namespace result_of
+{
+    template <typename Iterator>
+    struct deref
+        : extension::deref_impl<typename detail::tag_of<Iterator>::type>::
+            template apply<Iterator>
+    {};
+}
+
+template <typename Iterator>
+typename result_of::deref<Iterator>::type
+deref(Iterator const& i)
+{
+    typedef result_of::deref<Iterator> deref_meta;
+    return deref_meta::call(i);
+}
+
+

+ So again result_of::deref uses tag + dispatching in exactly the same way as the value_of implementation. The runtime + functionality used by deref is provided by the call static function of the selected MPL + Metafunction Class. +

+

+ The actual implementation of deref_impl + is slightly more complex than that of value_of_impl. + We also need to implement the call + function, which returns a reference to the appropriate member of the underlying + sequence. We also require a little bit of metaprogramming to return const references if the underlying sequence + is const. +

+
+ + + + + +
[Note]Note

+ Although there is a fair amount of left to do to produce a fully fledged + Fusion sequence, value_of and deref illustrate all the signficant + concepts required. The remainder of the process is very repetitive, simply + requiring implementation of a suitable xxxx_impl + for each feature xxxx. +

+

+ + Implementing + the remaining iterator functionality +

+

+ Ok, now we have seen the way value_of and deref work, everything else will work + in pretty much the same way. Lets start with forward iteration, by providing + a next_impl: +

+
+template<>
+struct next_impl<example::example_struct_iterator_tag>
+{
+    template<typename Iterator>
+    struct apply
+    {
+        typedef typename Iterator::struct_type struct_type;
+        typedef typename Iterator::index index;
+        typedef example::example_struct_iterator<struct_type, index::value + 1> type;
+
+        static type
+        call(Iterator const& i)
+        {
+             return type(i.struct_);
+        }
+    };
+};
+
+

+ This should be very familiar from our deref_impl + implementation, we will be using this approach again and again now. Our design + is simply to increment the index + counter to move on to the next element. The various other iterator manipulations + we need to perform will all just involve simple calculations with the index variables. +

+

+ We also need to provide a suitable equal_to_impl + so that iterators can be correctly compared. A Bidirectional + Iterator will also need an implementation of prior_impl. + For a Random + Access Iterator distance_impl + and advance_impl also need + to be provided in order to satisfy the necessary complexity guarantees. As + our iterator is a Random + Access Iterator we will have to implement all of these functions. +

+

+ Full implementations of prior_impl, + advance_impl, distance_impl and equal_to_impl + are provided in the example code. +

+

+ + Implementing + the intrinsic functions of the sequence +

+

+ In order that Fusion can correctly identify our sequence as a Fusion sequence, + we need to enable is_sequence + for our sequence type. As usual we just create an impl + type specialized for our sequence tag: +

+
+template<>
+struct is_sequence_impl<example::example_sequence_tag>
+{
+    template<typename T>
+    struct apply : mpl::true_ {};
+};
+
+

+ We've some similar formalities to complete, providing category_of_impl + so Fusion can correctly identify our sequence type, and is_view_impl + so Fusion can correctly identify our sequence as not being a View + type. Implementations are provide in the example code. +

+

+ Now we've completed some formalities, on to more interesting features. Lets + get begin working so that we can get an + iterator to start accessing the data in our sequence. +

+
+template<>
+struct begin_impl<example::example_sequence_tag>
+{
+    template<typename Sequence>
+    struct apply
+    {
+        typedef example::example_struct_iterator<Sequence, 0> type;
+
+        static type
+        call(Sequence& seq)
+        {
+            return type(seq);
+        }
+    };
+};
+
+

+ The implementation uses the same ideas we have applied throughout, in this + case we are just creating one of the iterators we developed earlier, pointing + to the first element in the sequence. The implementation of end is very similar, and is provided + in the example code. +

+

+ For our Random + Access Sequence we will also need to implement size_impl, + value_at_impl and at_impl. +

+

+ + Enabling + our type as an associative container +

+

+ In order for example_struct + to serve as an associative container, we need to enable 3 lookup features, + at_key, value_at_key and has_key. We also need to provide an + implementation of the is_associative + trait so that our sequence can be correctly identified as an associative container. +

+

+ To implement at_key_impl we + need to associate the fields::age and + fields::age types described in the Quick + Start guide with the appropriate members of example_struct. + Our implementation is as follows: +

+
+template<>
+struct at_key_impl<example::example_sequence_tag>
+{
+    template<typename Sequence, typename Key>
+    struct apply;
+
+    template<typename Sequence>
+    struct apply<Sequence, fields::name>
+    {
+        typedef typename mpl::if_<
+            is_const<Sequence>,
+            std::string const&,
+            std::string&>::type type;
+
+        static type
+        call(Sequence& seq)
+        {
+            return seq.name;
+        };
+    };
+
+    template<typename Sequence>
+    struct apply<Sequence, fields::age>
+    {
+        typedef typename mpl::if_<
+            is_const<Sequence>,
+            int const&,
+            int&>::type type;
+
+        static type
+        call(Sequence& seq)
+        {
+            return seq.age;
+        };
+    };
+};
+
+

+ Its all very similar to the implementations we've seen previously, such as + deref_impl and value_of_impl. Instead of identifying the + members by index or position, we are now selecting them using the types fields::name and fields::age. The + implementations of value_at_key_impl + and has_key_impl are equally + straightforward, and are provided in the example code, along with an implementation + of is_associative_impl. +

+

+ + Summary +

+

+ We've now worked through the entire process for adding a new random access + sequence and we've also enabled our type to serve as an associative container. + The implementation was slightly longwinded, but followed a simple repeating + pattern. +

+

+ The support for std::pair, MPL + sequences, and boost::array all use the same approach, and provide + additional examples of the approach for a variety of types. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional.html b/doc/html/fusion/functional.html new file mode 100644 index 00000000..be17d634 --- /dev/null +++ b/doc/html/fusion/functional.html @@ -0,0 +1,165 @@ + + + +Functional + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Components to call functions and function objects and to make Fusion code callable + through a function object interface. +

+

+ + Header +

+
+#include <boost/fusion/functional.hpp>
+
+

+ + Fused and unfused + forms +

+

+ What is a function call? +

+
+f (a,b,c)
+
+

+ It is a name and a tuple written next to each other, left-to-right. +

+

+ Although the C++ syntax does not allow to replace (a,b,c) + with some Fusion Sequence, introducing + yet another function provides a solution: +

+
+invoke(f,my_sequence)
+
+

+ Alternatively it is possible to apply a simple transformation to f + in order to achieve the same effect: +

+
+f tuple <=> f' (tuple)
+
+

+ Now, f' is an unary function that takes the arguments to + f as a tuple; f' + is the fused form of f. + Reading the above equivalence right-to-left to get the inverse transformation, + f is the unfused + form of f'. +

+

+ + Calling + functions and function objects +

+

+ Having generic C++ code call back arbitrary functions provided by the client + used to be a heavily repetitive task, as different functions can differ in + arity, invocation syntax and other properties that might be part of the type. + Transporting arguments as Fusion sequences and factoring out the invocation + makes Fusion algorithms applicable to function arguments and also reduces the + problem to one invocation syntax and a fixed arity (instead of an arbitrary + number of arbitrary arguments times several syntactic variants times additional + properties). +

+

+ Transforming an unfused function into its fused counterpart allows n-ary calls + from an algorithm that invokes an unary Polymorphic + Function Object with Sequence + arguments. +

+

+ The library provides several function templates to invoke different kinds of + functions and adapters to transform them into fused form, respectively. Every + variant has a corresponding generator function template that returns an adapter + instance for the given argument. +

+

+ + Making + Fusion code callable through a function object interface +

+

+ Transforming a fused function into its unfused counterpart allows to create + function objects to accept arbitrary calls. In other words, an unary function + object can be implemented instead of (maybe heavily overloaded) function templates + or function call operators. +

+

+ The library provides several adapter variants that implement this transformation, + ranging from strictly typed to fully generic. The latter provides a reusable, + approximate solution to The + Forwarding Problem. Every generic variant has a corresponding generator + function template that returns an adapter instance for the given argument. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/adapters.html b/doc/html/fusion/functional/adapters.html new file mode 100644 index 00000000..ae619462 --- /dev/null +++ b/doc/html/fusion/functional/adapters.html @@ -0,0 +1,52 @@ + + + + Adapters + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Function object templates to transform a particular target function. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/adapters/fused.html b/doc/html/fusion/functional/adapters/fused.html new file mode 100644 index 00000000..11971f4b --- /dev/null +++ b/doc/html/fusion/functional/adapters/fused.html @@ -0,0 +1,249 @@ + + + +fused + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ An unary Polymorphic Function + Object adapter template for Deferred + Callable Object target functions. It takes a Forward + Sequence that contains the arguments for the target function. +

+

+ The type of the target function is allowed to be const qualified or a reference. + Const qualification is preserved and propagated appropriately (in other + words, only const versions of operator() can be used + for a target function object that is const or, if the target function object + is held by value, the adapter is const - these semantics have nothing to + do with the const qualification of a member function, which is referring + to the type of object pointed to by this which is specified + with the first element in the sequence passed to the adapter). +

+

+ If the target function is a pointer to a class members, the corresponding + object can be specified as a reference, pointer, or smart pointer. In case + of the latter, a freestanding get_pointer function must + be defined (Boost provides this function for std::auto_ptr + and boost::shared_ptr). +

+
+ + Header +
+
+#include <boost/fusion/functional/adapter/fused.hpp>
+
+
+ + Synopsis +
+
+template <typename Function>
+class fused;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Function +

+
+

+ A Deferred + Callable Object +

+
+

+

+
+
+ + Model of +
+ +
+

Notation

+
+
R
+

+ A possibly const qualified Deferred + Callable Object type or reference type thereof +

+
r
+

+ An object convertible to R +

+
s
+

+ A Sequence of arguments that + are accepted by r +

+
f
+

+ An instance of fused<R> +

+
+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ fused<R>(r) +

+
+

+ Creates a fused function as described above, initializes the target + function with r. +

+
+

+ fused<R>() +

+
+

+ Creates a fused function as described above, attempts to use R's default constructor. +

+
+

+ f(s) +

+
+

+ Calls r with the + elements in s as + its arguments. +

+
+
+ + Example +
+
+fused< std::plus<long> > f;
+assert(f(make_vector(1,2l)) == 3l);
+
+
+ + See also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/adapters/fused_function_object.html b/doc/html/fusion/functional/adapters/fused_function_object.html new file mode 100644 index 00000000..29f32254 --- /dev/null +++ b/doc/html/fusion/functional/adapters/fused_function_object.html @@ -0,0 +1,272 @@ + + + +fused_function_object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ An unary Polymorphic Function + Object adapter template for a Polymorphic + Function Object target function. It takes a Forward + Sequence that contains the arguments for the target function. +

+

+ The type of the target function is allowed to be const qualified or a reference. + Const qualification is preserved and propagated appropriately (in other + words, only const versions of operator() can be used + for an target function object that is const or, if the target function + object is held by value, the adapter is const). +

+
+ + Header +
+
+#include <boost/fusion/functional/adapter/fused_function_object.hpp>
+
+
+ + Synopsis +
+
+template <class Function>
+class fused_function_object;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Function +

+
+

+ Polymorphic Function + Object type +

+
+

+

+
+
+ + Model + of +
+ +
+

Notation

+
+
R
+

+ A possibly const qualified Polymorphic + Function Object type or reference type thereof +

+
r
+

+ An object convertible to R +

+
s
+

+ A Sequence of arguments that + are accepted by r +

+
f
+

+ An instance of fused<R> +

+
+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ fused_function_object<R>(r) +

+
+

+ Creates a fused function as described above, initializes the target + function with r. +

+
+

+ fused_function_object<R>() +

+
+

+ Creates a fused function as described above, attempts to use R's default constructor. +

+
+

+ f(s) +

+
+

+ Calls r with the + elements in s as + its arguments. +

+
+
+ + Example +
+
+template<class SeqOfSeqs, class Func>
+typename result_of::transform< zip_view<SeqOfSeqs> const,
+    fused_function_object<Func const &> >::type
+n_ary_transform(SeqOfSeqs const & s, Func const & f)
+{
+    return transform(zip_view<SeqOfSeqs>(s), 
+        fused_function_object<Func const &>(f));
+} 
+
+struct sub
+{
+    template <typename Sig>
+    struct result;
+
+    template <class Self, typename T>
+    struct result< Self(T,T) > 
+    { typedef typename remove_reference<T>::type type; };
+
+    template<typename T>
+    T operator()(T lhs, T rhs) const
+    {
+        return lhs - rhs;
+    }
+};
+
+void try_it()
+{
+    vector<int,float> a(2,2.0f);
+    vector<int,float> b(1,1.5f);
+    vector<int,float> c(1,0.5f);
+    assert(c == n_ary_transform(vector_tie(a,b), sub()));
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/adapters/fused_procedure.html b/doc/html/fusion/functional/adapters/fused_procedure.html new file mode 100644 index 00000000..d8a83368 --- /dev/null +++ b/doc/html/fusion/functional/adapters/fused_procedure.html @@ -0,0 +1,269 @@ + + + +fused_procedure + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ An unary Polymorphic Function + Object adapter template for Callable + Object target functions. It takes a Forward + Sequence that contains the arguments for the target function. +

+

+ The result is discared and the adapter's return type is void. +

+

+ The type of the target function is allowed to be const qualified or a reference. + Const qualification is preserved and propagated appropriately (in other + words, only const versions of operator() can be used + for a target function object that is const or, if the target function object + is held by value, the adapter is const - these semantics have nothing to + do with the const qualification of a member function, which is referring + to the type of object pointed to by this which is specified + with the first element in the sequence passed to the adapter). +

+

+ If the target function is a pointer to a members function, the corresponding + object can be specified as a reference, pointer, or smart pointer. In case + of the latter, a freestanding get_pointer function must + be defined (Boost provides this function for std::auto_ptr + and boost::shared_ptr). +

+

+ The target function must not be a pointer to a member object (dereferencing + such a pointer without returning anything does not make sense, so this + case is not implemented). +

+
+ + Header +
+
+#include <boost/fusion/functional/adapter/fused_procedure.hpp>
+
+
+ + Synopsis +
+
+template <typename Function>
+class fused_procedure;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Function +

+
+

+ Callable Object + type +

+
+

+

+
+
+ + Model + of +
+ +
+

Notation

+
+
R
+

+ A possibly const qualified Callable + Object type or reference type thereof +

+
r
+

+ An object convertible to R +

+
s
+

+ A Sequence of arguments that + are accepted by r +

+
f
+

+ An instance of fused<R> +

+
+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ fused_procedure<R>(r) +

+
+

+ Creates a fused function as described above, initializes the target + function with r. +

+
+

+ fused_procedure<R>() +

+
+

+ Creates a fused function as described above, attempts to use R's default constructor. +

+
+

+ f(s) +

+
+

+ Calls r with the + elements in s as + its arguments. +

+
+
+ + Example +
+
+template<class SequenceOfSequences, class Func>
+void n_ary_for_each(SequenceOfSequences const & s, Func const & f)
+{
+    for_each(zip_view<SequenceOfSequences>(s), 
+        fused_procedure<Func const &>(f));
+} 
+
+void try_it()
+{
+    vector<int,float> a(2,2.0f);
+    vector<int,float> b(1,1.5f);
+    using namespace boost::lambda;
+    n_ary_for_each(vector_tie(a,b), _1 -= _2);
+    assert(a == make_vector(1,0.5f));
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/adapters/unfused_generic.html b/doc/html/fusion/functional/adapters/unfused_generic.html new file mode 100644 index 00000000..cb2e3738 --- /dev/null +++ b/doc/html/fusion/functional/adapters/unfused_generic.html @@ -0,0 +1,298 @@ + + + +unfused_generic + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ An n-ary Polymorphic Function + Object adapter template for an unary Polymorphic + Function Object target function. When called, its arguments are + bundled to a Random + Access Sequence of references that is passed to the target function. + Non-const LValue arguments are transported as references to non-const, + otherwise references to const are used. +

+ +

+ The type of the target function is allowed to be const qualified or a reference. + Const qualification is preserved and propagated appropriately (in other + words, only const versions of operator() can be used + if the target function object is const - or, in case the target function + object is held by value, the adapter is const). +

+
+ + Header +
+
+#include <boost/fusion/functional/adapter/unfused_generic.hpp>
+
+
+ + Synopsis +
+
+template <class Function>
+class unfused_generic;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Function +

+
+

+ An unary Polymorphic + Function Object +

+
+

+

+
+
+ + Model + of +
+ +
+

Notation

+
+
F
+

+ A possibly const qualified, unary Polymorphic + Function Object type or reference type thereof +

+
f
+

+ An object convertible to F +

+
UG
+

+ The type unfused_generic<F> +

+
ug
+

+ An instance of UG, + initialized with f +

+
a0...aN
+

+ Arguments to ug +

+
+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ UG(f) +

+
+

+ Creates a fused function as described above, initializes the target + function with f. +

+
+

+ UG() +

+
+

+ Creates a fused function as described above, attempts to use F's default constructor. +

+
+

+ ug(a0...aN) +

+
+

+ Calls f with a + Sequence that contains + references to the arguments a0...aN. +

+
+
+ + Example +
+
+template <typename Function, typename T>
+class fused_bound_1st
+{
+    typename traits::deduce<Function>::type fnc_deferred;
+    typename traits::deduce<T>::type        xxx_bound;
+public:
+
+    fused_bound_1st(Function deferred, T bound)
+        : fnc_deferred(deferred), xxx_bound(bound)
+    { }
+
+    template <typename Sig>
+    struct result;
+
+    template <class Self, class Seq>
+    struct result< Self(Seq) >
+        : result_of::invoke< Function, typename result_of::push_front<
+            typename remove_reference<Seq>::type, T>::type >
+    { };
+
+    template <class Seq>
+    typename result< void(Seq) >::type operator()(Seq const & s) const
+    {
+        return invoke(fnc_deferred, push_front(s,xxx_bound));
+    }
+};
+
+template <typename Function, typename T>
+unfused_generic< fused_bound_1st<Function,T> > 
+bind_1st(Function f, T const & x)
+{
+    return unfused_generic< fused_bound_1st<Function,T> >(
+        fused_bound_1st<Function,T>(f,x) ); 
+}
+
+int test_func(int a, int b, int c)
+{
+    return a+b+c;
+}
+
+void try_it()
+{
+    assert(bind_1st(& test_func,3)(-2,-1) == 0);
+    assert(bind_1st(std::plus<float>(), 1)(0.5f) == 1.5f);
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/adapters/unfused_lvalue_args.html b/doc/html/fusion/functional/adapters/unfused_lvalue_args.html new file mode 100644 index 00000000..af36414c --- /dev/null +++ b/doc/html/fusion/functional/adapters/unfused_lvalue_args.html @@ -0,0 +1,266 @@ + + + +unfused_lvalue_args + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ An n-ary Polymorphic Function + Object adapter template for an unary Polymorphic + Function Object target function. When called, its arguments are + bundled to a Random + Access Sequence of references that is passed to the target function + object. Only LValue arguments are accepted. +

+

+ The type of the target function is allowed to be const qualified or a reference. + Const qualification is preserved and propagated appropriately (in other + words, only const versions of operator() can be used + if the target function object is const - or, in case the target function + object is held by value, the adapter is const). +

+
+ + Header +
+
+#include <boost/fusion/functional/adapter/unfused_lvalue_args.hpp>
+
+
+ + Synopsis +
+
+template <class Function>
+class unfused_lvalue_args;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Function +

+
+

+ A unary Polymorphic + Function Object +

+
+

+

+
+
+ + Model + of +
+ +
+

Notation

+
+
F
+

+ A possibly const qualified, unary Polymorphic + Function Object type or reference type thereof +

+
f
+

+ An object convertible to F +

+
UL
+

+ The type unfused_lvalue_args<F> +

+
ul
+

+ An instance of UL, + initialized with f +

+
a0...aN
+

+ Arguments to ul +

+
+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ UL(f) +

+
+

+ Creates a fused function as described above, initializes the target + function with f. +

+
+

+ UL() +

+
+

+ Creates a fused function as described above, attempts to use F's default constructor. +

+
+

+ ul(a0...aN) +

+
+

+ Calls f with a + Sequence that contains + references to the arguments a0...aN. +

+
+
+ + Example +
+
+struct fused_incrementer
+{
+    template <class Seq> 
+    struct result 
+    { 
+        typedef void type;
+    };
+
+    template <class Seq>
+    void operator()(Seq const & s) const
+    {
+        for_each(s,++boost::lambda::_1);
+    }
+};
+
+void try_it()
+{
+    unfused_lvalue_args<fused_incrementer> increment;
+    int a = 2; char b = 'X';
+    increment(a,b);
+    assert(a == 3 && b == 'Y');
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/adapters/unfused_rvalue_args.html b/doc/html/fusion/functional/adapters/unfused_rvalue_args.html new file mode 100644 index 00000000..c7a3dedc --- /dev/null +++ b/doc/html/fusion/functional/adapters/unfused_rvalue_args.html @@ -0,0 +1,266 @@ + + + +unfused_rvalue_args + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ An n-ary Polymorphic Function + Object adapter template for an unary Polymorphic + Function Object target function. When called, its arguments are + bundled to a Random + Access Sequence of references that is passed to the target function + object. All referenced objects in the sequence are const qualified. +

+

+ The type of the target function is allowed to be const qualified or a reference. + Const qualification is preserved and propagated appropriately (in other + words, only const versions of operator() can be used + if the target function object is const - or, in case the target function + object is held by value, the adapter is const). +

+
+ + Header +
+
+#include <boost/fusion/functional/adapter/unfused_rvalue_args.hpp>
+
+
+ + Synopsis +
+
+template <class Function>
+class unfused_rvalue_args;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Function +

+
+

+ A unary Polymorphic + Function Object +

+
+

+

+
+
+ + Model + of +
+ +
+

Notation

+
+
F
+

+ A possibly const qualified, unary Polymorphic + Function Object type or reference type thereof +

+
f
+

+ An object convertible to F +

+
UR
+

+ The type unfused_rvalue_args<F> +

+
ur
+

+ An instance of UR, + initialized with f +

+
a0...aN
+

+ Arguments to ur +

+
+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ UR(f) +

+
+

+ Creates a fused function as described above, initializes the target + function with f. +

+
+

+ UR() +

+
+

+ Creates a fused function as described above, attempts to use F's default constructor. +

+
+

+ ur(a0...aN) +

+
+

+ Calls f with a + Sequence that contains + references to the arguments a0...aN. +

+
+
+ + Example +
+
+struct sequence_printer
+{
+    template <class Seq> 
+    struct result 
+    { 
+        typedef void type;
+    };
+
+    template <class Seq>
+    void operator()(Seq const & s) const
+    {
+        std::cout << s << std::endl;
+    }
+};
+
+void try_it()
+{
+    unfused_rvalue_args<sequence_printer> print;
+    print(24,"bottles of beer in",'a',"box.");
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/adapters/unfused_typed.html b/doc/html/fusion/functional/adapters/unfused_typed.html new file mode 100644 index 00000000..22c18ac2 --- /dev/null +++ b/doc/html/fusion/functional/adapters/unfused_typed.html @@ -0,0 +1,347 @@ + + + +unfused_typed + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ An n-ary Polymorphic Function + Object adapter template for an unary Polymorphic + Function Object target function. When called, its arguments are + bundled to a Random + Access Sequence that is passed to the target function object. +

+

+ The call operators of esulting function objects are strictly typed (in + other words, non-templatized) with the types from a Sequence. +

+

+ The type of the target function is allowed to be const qualified or a reference. + Const qualification is preserved and propagated appropriately (in other + words, only const versions of operator() can be used + if the target function object is const - or, in case the target function + object is held by value, the adapter is const). +

+ + +
+ + Header +
+
+#include <boost/fusion/functional/adapter/unfused_typed.hpp>
+
+
+ + Synopsis +
+
+template <class Function, class Sequence>
+class unfused_typed;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Function +

+
+

+ A unary Polymorphic + Function Object +

+
+

+

+
+

+ Sequence +

+
+

+ A Sequence +

+
+

+

+
+
+ + Model + of +
+ +
+

Notation

+
+
F
+

+ A possibly const qualified, unary Polymorphic + Function Object type or reference type thereof +

+
f
+

+ An object convertible to F +

+
S
+

+ A Sequence of parameter types +

+
UT
+

+ The type unfused_typed<F,S> +

+
ut
+

+ An instance of UT, + initialized with f +

+
a0...aN
+

+ Arguments to ut, convertible + to the types in S +

+
+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ UT(f) +

+
+

+ Creates a fused function as described above, initializes the target + function with f. +

+
+

+ UT() +

+
+

+ Creates a fused function as described above, attempts to use F's default constructor. +

+
+

+ ut(a0...aN) +

+
+

+ Calls f with an + instance of S (or + a subsequence of S + starting at the first element, if fewer arguments are given and + the overload hasn't been disabled) initialized with a0...aN. +

+
+
+ + Example +
+
+struct add_assign // applies operator+=
+{
+    typedef void result_type; // for simplicity
+
+    template <typename T>
+    void operator()(T & lhs, T const & rhs) const
+    {
+        lhs += rhs;
+    }
+};
+
+template <class Tie>
+class fused_parallel_adder
+{
+    Tie tie_dest;
+public:
+    explicit fused_parallel_adder(Tie const & dest)
+        : tie_dest(dest)
+    { }
+
+    typedef void result_type;
+
+    template <class Seq>
+    void operator()(Seq const & s) const
+    {
+        for_each( zip(tie_dest,s), fused<add_assign>() );
+    }
+};
+
+// accepts a tie and creates a typed function object from it
+struct fused_parallel_adder_maker
+{
+    template <typename Sig>
+    struct result;
+
+    template <class Self, class Seq>
+    struct result< Self(Seq) >
+    {
+        typedef typename remove_reference<Seq>::type seq;
+
+        typedef unfused_typed< fused_parallel_adder<seq>, 
+            typename mpl::transform<seq, remove_reference<_> >::type > type;
+    };
+
+    template <class Seq>
+    typename result< void(Seq) >::type operator()(Seq const & tie)
+    {
+        return typename result< void(Seq) >::type(
+            fused_parallel_adder<Seq>(tie) );
+    }
+};
+unfused_lvalue_args<fused_parallel_adder_maker> parallel_add;
+
+void try_it()
+{
+    int a = 2; char b = 'X';
+    // the second call is strictly typed with the types deduced from the
+    // first call 
+    parallel_add(a,b)(3,2);
+    parallel_add(a,b)(3);
+    parallel_add(a,b)();
+    assert(a == 8 && b == 'Z');
+}
+
+
+ + See also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/concepts.html b/doc/html/fusion/functional/concepts.html new file mode 100644 index 00000000..57f2d4ec --- /dev/null +++ b/doc/html/fusion/functional/concepts.html @@ -0,0 +1,48 @@ + + + +Concepts + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/concepts/callable.html b/doc/html/fusion/functional/concepts/callable.html new file mode 100644 index 00000000..7173fa39 --- /dev/null +++ b/doc/html/fusion/functional/concepts/callable.html @@ -0,0 +1,64 @@ + + + + Callable Object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A pointer to a function, a pointer to member function, a pointer to member + data, or a class type whose objects can appear immediately to the left + of a function call operator. +

+
+ + Models +
+
    +
  • + function pointer types +
  • +
  • + member (function or data) pointer types +
  • +
  • + all kinds of function objects +
  • +
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/concepts/def_callable.html b/doc/html/fusion/functional/concepts/def_callable.html new file mode 100644 index 00000000..3b1dcfea --- /dev/null +++ b/doc/html/fusion/functional/concepts/def_callable.html @@ -0,0 +1,146 @@ + + + + Deferred + Callable Object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Callable Object + types that work with Boost.ResultOf + to determine the result of a call. +

+
+ + Refinement + of +
+ + +
+

Notation

+
+
F
+

+ A possibly const qualified Deferred Callable Object type +

+
A1 + ...AN
+

+ Argument types +

+
a1 + ...aN
+

+ Objects or references to objects with types A1 + ...AN +

+
T1 + ...TN
+

+ Ti is Ai & + if ai is an LValue, + same as Ai, otherwise +

+
+
+
+ + Expression + requirements +
+
++++ + + + + + + + + +
+

+ Expression +

+
+

+ Type +

+
+

+ boost::result_of< F(T1 + ...TN) >::type +

+
+

+ Result of a call with A1 + ...AN-typed + arguments +

+
+
+ + Models +
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/concepts/poly.html b/doc/html/fusion/functional/concepts/poly.html new file mode 100644 index 00000000..51d40c94 --- /dev/null +++ b/doc/html/fusion/functional/concepts/poly.html @@ -0,0 +1,160 @@ + + + + Polymorphic Function + Object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A non-member-pointer Deferred + Callable Object type. +

+
+ + Refinement + of +
+ +
+

Notation

+
+
F
+

+ A possibly const-qualified Polymorphic Function Object type +

+
f
+

+ An object or reference to an object of type F +

+
A1 + ...AN
+

+ Argument types +

+
a1 + ...aN
+

+ Objects or references to objects with types A1 + ...AN +

+
T1 + ...TN
+

+ Ti is Ai & + if ai is an LValue, + same as Ai, otherwise +

+
+
+
+ + Expression + requirements +
+
+++++ + + + + + + + + + + +
+

+ Expression +

+
+

+ Return Type +

+
+

+ Runtime Complexity +

+
+

+ f(a1, + ...aN) +

+
+

+ result_of< + F(T1, + ...TN) >::type +

+
+

+ Unspecified +

+
+
+ + Models +
+
    +
  • + function pointers +
  • +
  • + function objects of the Standard Library +
  • +
  • + all Fusion functional adapters +
  • +
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/concepts/reg_callable.html b/doc/html/fusion/functional/concepts/reg_callable.html new file mode 100644 index 00000000..9c77799e --- /dev/null +++ b/doc/html/fusion/functional/concepts/reg_callable.html @@ -0,0 +1,141 @@ + + + + Regular Callable + Object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A non-member-pointer Callable + Object type: A pointer to a function or a class type whose objects + can appear immediately to the left of a function call operator. +

+
+ + Refinement + of +
+ +
+

Notation

+
+
F
+

+ A possibly const qualified Deferred Callable Object type +

+
f
+

+ An object or reference to an object of type F +

+
A1 + ...AN
+

+ Argument types +

+
a1 + ...aN
+

+ Objects or references to objects with types A1 + ...AN +

+
+
+
+ + Expression + requirements +
+
+++++ + + + + + + + + + + +
+

+ Expression +

+
+

+ Return Type +

+
+

+ Runtime Complexity +

+
+

+ f(a1, + ...aN) +

+
+

+ Unspecified +

+
+

+ Unspecified +

+
+
+ + Models +
+
    +
  • + function pointer types +
  • +
  • + all kinds of function objects +
  • +
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation.html b/doc/html/fusion/functional/generation.html new file mode 100644 index 00000000..e1357a8f --- /dev/null +++ b/doc/html/fusion/functional/generation.html @@ -0,0 +1,43 @@ + + + +Generation + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/functions.html b/doc/html/fusion/functional/generation/functions.html new file mode 100644 index 00000000..34884793 --- /dev/null +++ b/doc/html/fusion/functional/generation/functions.html @@ -0,0 +1,54 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/functions/mk_fused.html b/doc/html/fusion/functional/generation/functions/mk_fused.html new file mode 100644 index 00000000..90d094bd --- /dev/null +++ b/doc/html/fusion/functional/generation/functions/mk_fused.html @@ -0,0 +1,158 @@ + + + + + make_fused + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Creates a fused adapter for a given Deferred Callable Object. + The usual element + conversion is applied to the target function. +

+
+ + Synopsis +
+
+template <typename F>
+inline typename make_fused<F>::type
+make_fused(F const & f);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ Model of Deferred + Callable Object +

+
+

+ The function to transform. +

+
+
+ + Expression + Semantics +
+
+make_fused(f);
+
+

+ Return type: A specialization of fused. +

+

+ Semantics: Returns a fused adapter for f. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_fused.hpp>
+
+
+ + Example +
+
+float sub(float a, float b) { return a - b; }
+
+void try_it()
+{
+    vector<int,float> a(2,2.0f);
+    vector<int,float> b(1,1.5f);
+    vector<float,float> c(1.0f,0.5f);
+    assert(c == transform(zip(a,b), make_fused(& sub)));
+    assert(c == transform(zip(a,b), make_fused(std::minus<float>())));
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/functions/mk_fused_fobj.html b/doc/html/fusion/functional/generation/functions/mk_fused_fobj.html new file mode 100644 index 00000000..ce3e0273 --- /dev/null +++ b/doc/html/fusion/functional/generation/functions/mk_fused_fobj.html @@ -0,0 +1,174 @@ + + + + + make_fused_function_object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Creates a fused_function_object adapter + for a given Deferred + Callable Object. The usual element + conversion is applied to the target function. +

+
+ + Synopsis +
+
+template <typename F>
+inline typename make_fused_function_object<F>::type
+make_fused_function_object(F const & f);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ Model of Polymorphic + Function Object +

+
+

+ The function to transform. +

+
+
+ + Expression + Semantics +
+
+make_fused_function_object(f);
+
+

+ Return type: A specialization of fused_function_object. +

+

+ Semantics: Returns a fused_function_object adapter + for f. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_fused_function_object.hpp>
+
+
+ + Example +
+
+struct sub
+{
+    template <typename Sig>
+    struct result;
+
+    template <class Self, typename T>
+    struct result< Self(T,T) > 
+    { typedef typename remove_reference<T>::type type; };
+
+    template<typename T>
+    T operator()(T lhs, T rhs) const
+    {
+        return lhs - rhs;
+    }
+};
+
+void try_it()
+{
+    vector<int,float> a(2,2.0f);
+    vector<int,float> b(1,1.5f);
+    vector<int,float> c(1,0.5f);
+    assert(c == transform(zip(a,b), make_fused_function_object(sub())));
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/functions/mk_fused_proc.html b/doc/html/fusion/functional/generation/functions/mk_fused_proc.html new file mode 100644 index 00000000..595d4989 --- /dev/null +++ b/doc/html/fusion/functional/generation/functions/mk_fused_proc.html @@ -0,0 +1,154 @@ + + + + + make_fused_procedure + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Creates a fused_procedure adapter for + a given Deferred + Callable Object. The usual element + conversion applied to the target function. +

+
+ + Synopsis +
+
+template <typename F>
+inline typename make_fused_procedure<F>::type
+make_fused_procedure(F const & f);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ Model of Callable + Object +

+
+

+ The function to transform. +

+
+
+ + Expression + Semantics +
+
+make_fused_procedure(f);
+
+

+ Return type: A specialization of fused_procedure. +

+

+ Semantics: Returns a fused_procedure adapter for + f. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_fused_procedure.hpp>
+
+
+ + Example +
+
+vector<int,int,int> v(1,2,3);
+using namespace boost::lambda;
+make_fused_procedure(_1 += _2 - _3)(v);
+assert(front(v) == 0);
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/functions/mk_unfused_genrc.html b/doc/html/fusion/functional/generation/functions/mk_unfused_genrc.html new file mode 100644 index 00000000..80bbc223 --- /dev/null +++ b/doc/html/fusion/functional/generation/functions/mk_unfused_genrc.html @@ -0,0 +1,181 @@ + + + + + make_unfused_generic + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Creates a unfused_generic adapter for + a given, unary Polymorphic + Function Object. The usual element + conversion is applied to the target function. +

+
+ + Synopsis +
+
+template <typename F>
+inline typename make_unfused_generic<F>::type
+make_unfused_generic(F const & f);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ Model of Polymorphic + Function Object +

+
+

+ The function to transform. +

+
+
+ + Expression + Semantics +
+
+make_unfused_generic(f);
+
+

+ Return type: A specialization of unfused_generic. +

+

+ Semantics: Returns a unfused_generic adapter for + f. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_unfused_generic.hpp>
+
+
+ + Example +
+
+struct bottles_song
+{
+    typedef void result_type;
+
+    template<class Seq> 
+    void operator()(Seq & s) const
+    {
+        typename result_of::at_c<Seq,0>::type n = at_c<0>(s);
+        typename result_of::at_c<Seq,1>::type what = at_c<1>(s);
+
+        std::cout 
+            << n << " bottles of " << what << " on the wall.\n" 
+            << n << " bottles of " << what << "!\n"
+            << "Take one down - pass it around.\n";
+
+        n -= 1; // glug glug...
+
+        std::cout
+            << n << " bottles of " << what << " on the wall.\n" 
+            << std::endl;
+    }
+};
+
+void try_it()
+{
+    unsigned n_milk = 99;
+    for(int i = 0; i < 3; ++i)
+        make_unfused_generic(bottles_song())(n_milk,"milk");
+    // 96 bottles left for me
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/functions/mk_unfused_lvargs.html b/doc/html/fusion/functional/generation/functions/mk_unfused_lvargs.html new file mode 100644 index 00000000..52a2e9ab --- /dev/null +++ b/doc/html/fusion/functional/generation/functions/mk_unfused_lvargs.html @@ -0,0 +1,172 @@ + + + + + make_unfused_lvalue_args + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Creates a unfused_lvalue_args adapter + for a given, unary Polymorphic + Function Object. The usual element + conversion is applied to the target function. +

+
+ + Synopsis +
+
+template <typename F>
+inline typename make_unfused_lvalue_args<F>::type
+make_unfused_lvalue_args(F const & f);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ Model of Polymorphic + Function Object +

+
+

+ The function to transform. +

+
+
+ + Expression + Semantics +
+
+make_unfused_lvalue_args(f);
+
+

+ Return type: A specialization of unfused_lvalue_args. +

+

+ Semantics: Returns a unfused_lvalue_args adapter + for f. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_unfused_lvalue_args.hpp>
+
+
+ + Example +
+
+struct fused_incrementer
+{
+    template <class Seq> 
+    struct result 
+    { 
+        typedef void type;
+    };
+
+    template <class Seq>
+    void operator()(Seq const & s) const
+    {
+        for_each(s,++boost::lambda::_1);
+    }
+};
+
+void try_it()
+{
+    int a = 2; char b = 'X';
+    make_unfused_lvalue_args(fused_incrementer())(a,b);
+    assert(a == 3 && b == 'Y');
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/functions/mk_unfused_rvargs.html b/doc/html/fusion/functional/generation/functions/mk_unfused_rvargs.html new file mode 100644 index 00000000..81f544ec --- /dev/null +++ b/doc/html/fusion/functional/generation/functions/mk_unfused_rvargs.html @@ -0,0 +1,170 @@ + + + + + make_unfused_rvalue_args + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Creates a unfused_rvalue_args adapter + for a given, unary Polymorphic + Function Object. The usual element + conversion is applied to the target function. +

+
+ + Synopsis +
+
+template <typename F>
+inline typename make_unfused_rvalue_args<F>::type
+make_unfused_rvalue_args(F const & f);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ Model of Polymorphic + Function Object +

+
+

+ The function to transform. +

+
+
+ + Expression + Semantics +
+
+make_unfused_rvalue_args(f);
+
+

+ Return type: A specialization of unfused_rvalue_args. +

+

+ Semantics: Returns a unfused_rvalue_args adapter + for f. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_unfused_rvalue_args.hpp>
+
+
+ + Example +
+
+struct sequence_printer
+{
+    template <class Seq> 
+    struct result 
+    { 
+        typedef void type;
+    };
+
+    template <class Seq>
+    void operator()(Seq const & s) const
+    {
+        std::cout << s << std::endl;
+    }
+};
+
+void try_it()
+{
+    make_unfused_rvalue_args(sequence_printer())
+        (24,"bottles of beer in",'a',"box.");
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/metafunctions.html b/doc/html/fusion/functional/generation/metafunctions.html new file mode 100644 index 00000000..affc3033 --- /dev/null +++ b/doc/html/fusion/functional/generation/metafunctions.html @@ -0,0 +1,55 @@ + + + +Metafunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/metafunctions/mk_fused.html b/doc/html/fusion/functional/generation/metafunctions/mk_fused.html new file mode 100644 index 00000000..783bf3f4 --- /dev/null +++ b/doc/html/fusion/functional/generation/metafunctions/mk_fused.html @@ -0,0 +1,79 @@ + + + + + make_fused + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_fused. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_fused.hpp>
+
+
+ + Synopsis +
+
+namespace result_of
+{
+    template<typename Function>
+    struct make_fused
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/metafunctions/mk_fused_fobj.html b/doc/html/fusion/functional/generation/metafunctions/mk_fused_fobj.html new file mode 100644 index 00000000..dc086afa --- /dev/null +++ b/doc/html/fusion/functional/generation/metafunctions/mk_fused_fobj.html @@ -0,0 +1,80 @@ + + + + + make_fused_function_object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_fused_function_object. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_fused_function_object.hpp>
+
+
+ + Synopsis +
+
+namespace result_of
+{
+    template<typename Function>
+    struct make_fused_function_object
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/metafunctions/mk_fused_proc.html b/doc/html/fusion/functional/generation/metafunctions/mk_fused_proc.html new file mode 100644 index 00000000..311b2e53 --- /dev/null +++ b/doc/html/fusion/functional/generation/metafunctions/mk_fused_proc.html @@ -0,0 +1,80 @@ + + + + + make_fused_procedure + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_fused_procedure. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_fused_procedure.hpp>
+
+
+ + Synopsis +
+
+namespace result_of
+{
+    template<typename Function>
+    struct make_fused_procedure
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/metafunctions/mk_unfused_genrc.html b/doc/html/fusion/functional/generation/metafunctions/mk_unfused_genrc.html new file mode 100644 index 00000000..22902a51 --- /dev/null +++ b/doc/html/fusion/functional/generation/metafunctions/mk_unfused_genrc.html @@ -0,0 +1,80 @@ + + + + + make_unfused_generic + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_unfused_generic. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_unfused_generic.hpp>
+
+
+ + Synopsis +
+
+namespace result_of
+{
+    template<typename Function>
+    struct make_unfused_generic
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/metafunctions/mk_unfused_lvargs.html b/doc/html/fusion/functional/generation/metafunctions/mk_unfused_lvargs.html new file mode 100644 index 00000000..e4f19295 --- /dev/null +++ b/doc/html/fusion/functional/generation/metafunctions/mk_unfused_lvargs.html @@ -0,0 +1,80 @@ + + + + + make_unfused_lvalue_args + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_unfused_lvalue_args. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_unfused_lvalue_args.hpp>
+
+
+ + Synopsis +
+
+namespace result_of
+{
+    template<typename Function>
+    struct make_unfused_lvalue_args
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/generation/metafunctions/mk_unfused_rvargs.html b/doc/html/fusion/functional/generation/metafunctions/mk_unfused_rvargs.html new file mode 100644 index 00000000..ea4497e6 --- /dev/null +++ b/doc/html/fusion/functional/generation/metafunctions/mk_unfused_rvargs.html @@ -0,0 +1,79 @@ + + + + + make_unfused_rvalue_args + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_unfused_rvalue_args. +

+
+ + Header +
+
+#include <boost/fusion/functional/generation/make_unfused_rvalue_args.hpp>
+
+
+ + Synopsis +
+
+namespace result_of
+{
+    template<typename Function>
+    struct make_unfused_rvalue_args
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation.html b/doc/html/fusion/functional/invocation.html new file mode 100644 index 00000000..8c6f38ef --- /dev/null +++ b/doc/html/fusion/functional/invocation.html @@ -0,0 +1,44 @@ + + + +Invocation + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation/functions.html b/doc/html/fusion/functional/invocation/functions.html new file mode 100644 index 00000000..c7abfbba --- /dev/null +++ b/doc/html/fusion/functional/invocation/functions.html @@ -0,0 +1,46 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation/functions/invoke.html b/doc/html/fusion/functional/invocation/functions/invoke.html new file mode 100644 index 00000000..8c5f16a7 --- /dev/null +++ b/doc/html/fusion/functional/invocation/functions/invoke.html @@ -0,0 +1,192 @@ + + + +invoke + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Calls a Deferred + Callable Object with the arguments from a Sequence. +

+

+ The first template parameter can be specialized explicitly to avoid copying + and/or to control the const qualification of a function object. +

+

+ If the target function is a pointer to a class members, the corresponding + object can be specified as a reference, pointer, or smart pointer. In + case of the latter, a freestanding get_pointer function + must be defined (Boost provides this function for std::auto_ptr + and boost::shared_ptr). +

+
+ + Synopsis +
+
+template<
+    typename Function, 
+    class Sequence
+    >
+typename result_of::invoke<Function, Sequence>::type
+invoke(Function f, Sequence & s);
+
+template<
+    typename Function, 
+    class Sequence
+    >
+typename result_of::invoke<Function, Sequence const>::type 
+invoke(Function f, Sequence const & s);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ A Deferred + Callable Object +

+
+

+ The function to call. +

+
+

+ s +

+
+

+ A Forward + Sequence +

+
+

+ The arguments. +

+
+
+ + Expression + Semantics +
+
+invoke(f,s);
+
+

+ Return type: Return type of f when invoked with the elements in + s as its arguments. +

+

+ Semantics: Invokes f + with the elements in s + as arguments and returns the result of the call expression. +

+
+ + Header +
+
+#include <boost/fusion/functional/invocation/invoke.hpp>
+
+
+ + Example +
+
+std::plus<int> add;
+assert(invoke(add,make_vector(1,1)) == 2);
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation/functions/invoke_fobj.html b/doc/html/fusion/functional/invocation/functions/invoke_fobj.html new file mode 100644 index 00000000..6df89ed8 --- /dev/null +++ b/doc/html/fusion/functional/invocation/functions/invoke_fobj.html @@ -0,0 +1,209 @@ + + + + + invoke_function_object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Calls a Polymorphic Function + Object with the arguments from a Sequence. +

+

+ The first template parameter can be specialized explicitly to avoid copying + and/or to control the const qualification of a function object. +

+
+ + Synopsis +
+
+template<
+    typename Function, 
+    class Sequence
+    >
+typename result_of::invoke_function_object<Function, Sequence>::type
+invoke_function_object(Function f, Sequence & s);
+
+template<
+    typename Function, 
+    class Sequence
+    >
+typename result_of::invoke_function_object<Function, Sequence const>::type
+invoke_function_object(Function f, Sequence const & s);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ Model of Polymorphic + Function Object +

+
+

+ The function object to call. +

+
+

+ s +

+
+

+ Model of Forward + Sequence +

+
+

+ The arguments. +

+
+
+ + Expression + Semantics +
+
+invoke_function_object(f,s);
+
+

+ Return type: Return type of f when invoked with the elements in + s as its arguments. +

+

+ Semantics: Invokes f + with the elements in s + as arguments and returns the result of the call expression. +

+
+ + Header +
+
+#include <boost/fusion/functional/invocation/invoke_function_object.hpp>
+
+
+ + Example +
+
+struct sub
+{
+    template <typename Sig>
+    struct result;
+
+    template <class Self, typename T>
+    struct result< Self(T,T) > 
+    { typedef typename remove_reference<T>::type type; };
+
+    template<typename T>
+    T operator()(T lhs, T rhs) const
+    {
+        return lhs - rhs;
+    }
+};
+
+void try_it()
+{
+    sub f;
+    assert(f(2,1) == invoke_function_object(f,make_vector(2,1)));
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation/functions/invoke_proc.html b/doc/html/fusion/functional/invocation/functions/invoke_proc.html new file mode 100644 index 00000000..aa841307 --- /dev/null +++ b/doc/html/fusion/functional/invocation/functions/invoke_proc.html @@ -0,0 +1,201 @@ + + + + + invoke_procedure + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Calls a Callable + Object with the arguments from a Sequence. + The result of the call is ignored. +

+

+ The first template parameter can be specialized explicitly to avoid copying + and/or to control the const qualification of a function object. +

+

+ For pointers to class members corresponding object can be specified as + a reference, pointer, or smart pointer. In case of the latter, a freestanding + get_pointer function must be defined (Boost provides + this function for std::auto_ptr and boost::shared_ptr). +

+

+ The target function must not be a pointer to a member object (dereferencing + such a pointer without returning anything does not make sense, so it + isn't implemented). +

+
+ + Synopsis +
+
+template<
+    typename Function, 
+    class Sequence
+    >
+typename result_of::invoke_procedure<Function, Sequence>::type
+invoke_procedure(Function f, Sequence & s);
+
+template<
+    typename Function, 
+    class Sequence
+    >
+typename result_of::invoke_procedure<Function, Sequence const>::type
+invoke_procedure(Function f, Sequence const & s);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ f +

+
+

+ Model of Callable + Object +

+
+

+ The function to call. +

+
+

+ s +

+
+

+ Model of Forward + Sequence +

+
+

+ The arguments. +

+
+
+ + Expression + Semantics +
+
+invoke_procedure(f,s);
+
+

+ Return type: void +

+

+ Semantics: Invokes f + with the elements in s + as arguments. +

+
+ + Header +
+
+#include <boost/fusion/functional/invocation/invoke_procedure.hpp>
+
+
+ + Example +
+
+vector<int,int> v(1,2);
+using namespace boost::lambda;
+invoke_procedure(_1 += _2, v);
+assert(front(v) == 3);
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation/metafunctions.html b/doc/html/fusion/functional/invocation/metafunctions.html new file mode 100644 index 00000000..e9df0740 --- /dev/null +++ b/doc/html/fusion/functional/invocation/metafunctions.html @@ -0,0 +1,47 @@ + + + +Metafunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation/metafunctions/invoke.html b/doc/html/fusion/functional/invocation/metafunctions/invoke.html new file mode 100644 index 00000000..b50b8089 --- /dev/null +++ b/doc/html/fusion/functional/invocation/metafunctions/invoke.html @@ -0,0 +1,73 @@ + + + +invoke + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of invoke. +

+
+ + Synopsis +
+
+namespace result_of
+{
+    template<
+        typename Function, 
+        class Sequence
+        > 
+    struct invoke
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation/metafunctions/invoke_fobj.html b/doc/html/fusion/functional/invocation/metafunctions/invoke_fobj.html new file mode 100644 index 00000000..e1e7a2a4 --- /dev/null +++ b/doc/html/fusion/functional/invocation/metafunctions/invoke_fobj.html @@ -0,0 +1,78 @@ + + + + + invoke_function_object + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of invoke_function_object. +

+
+ + Synopsis +
+
+namespace result_of
+{
+    template<
+        class Function, 
+        class Sequence
+        > 
+    struct invoke_function_object
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/functional/invocation/metafunctions/invoke_proc.html b/doc/html/fusion/functional/invocation/metafunctions/invoke_proc.html new file mode 100644 index 00000000..cf9a65ef --- /dev/null +++ b/doc/html/fusion/functional/invocation/metafunctions/invoke_proc.html @@ -0,0 +1,78 @@ + + + + + invoke_procedure + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of invoke_procedure. +

+
+ + Synopsis +
+
+namespace result_of
+{
+    template<
+        typename Function, 
+        class Sequence
+        > 
+    struct invoke_procedure
+    {
+        typedef unspecified type;
+    };
+}
+
+
+ + See + also +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/introduction.html b/doc/html/fusion/introduction.html new file mode 100644 index 00000000..ec7fdb70 --- /dev/null +++ b/doc/html/fusion/introduction.html @@ -0,0 +1,141 @@ + + + +Introduction + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ An advantage other languages such as Python and Lisp/ Scheme, ML and Haskell, + etc., over C++ is the ability to have heterogeneous containers that can hold + arbitrary element types. All the containers in the standard library can only + hold a specific type. A vector<int> + can only hold ints. A list<X> can + only hold elements of type X, + and so on. +

+

+ True, you can use inheritance to make the containers hold different types, + related through subclassing. However, you have to hold the objects through + a pointer or smart reference of some sort. Doing this, you'll have to rely + on virtual functions to provide polymorphic behavior since the actual type + is erased as soon as you store a pointer to a derived class to a pointer to + its base. The held objects must be related: you cannot hold objects of unrelated + types such as char, int, class + X, float, + etc. Oh sure you can use something like Boost.Any + to hold arbitrary types, but then you pay more in terms of runtime costs and + due to the fact that you practically erased all type information, you'll have + to perform dangerous casts to get back the original type. +

+

+ The Boost.Tuple + library written by Jaakko + Jarvi provides heterogeneous containers in C++. The tuple + is a basic data structure that can hold heterogeneous types. It's a good first + step, but it's not complete. What's missing are the algorithms. It's nice that + we can store and retrieve data to and from tuples, pass them around as arguments + and return types. As it is, the Boost.Tuple + facility is already very useful. Yet, as soon as you use it more often, usage + patterns emerge. Eventually, you collect these patterns into algorithm libraries. +

+

+ Hmmm, kinda reminds us of STL right? Right! Can you imagine how it would be + like if you used STL without the algorithms? Everyone will have to reinvent + their own algorithm wheels. +

+

+ Fusion is a library and a framework similar to both STL + and the boost MPL. + The structure is modeled after MPL, + which is modeled after STL. + It is named "fusion" because the library is reminiscent of the "fusion" + of compile time meta-programming with runtime programming. The library inherently + has some interesting flavors and characteristics of both MPL + and STL. + It lives in the twilight zone between compile time meta-programming and run + time programming. STL + containers work on values. MPL containers work on types. Fusion containers + work on both types and values. +

+

+ Unlike MPL, Fusion + algorithms are lazy and non sequence-type preserving. What does that mean? + It means that when you operate on a sequence through a Fusion algorithm that + returns a sequence, the sequence returned may not be of the same class as the + original. This is by design. Runtime efficiency is given a high priority. Like + MPL, and unlike + STL, + fusion algorithms are functional in nature such that algorithms are non mutating + (no side effects). However, due to the high cost of returning full sequences + such as vectors and lists, Views are returned from Fusion + algorithms instead. For example, the transform algorithm does not actually + return a transformed version of the original sequence. transform returns a transform_view. This view holds a + reference to the original sequence plus the transform function. Iteration over + the transform_view + will apply the transform function over the sequence elements on demand. This + lazy evaluation scheme allows us to chain as many algorithms + as we want without incurring a high runtime penalty. +

+

+ The lazy evaluation scheme where algorithms return views + allows operations such as push_back to be totally generic. In + Fusion, push_back is actually a generic algorithm + that works on all sequences. Given an input sequence s + and a value x, Fusion's push_back algorithm simply returns + a joint_view: + a view that holds a reference to the original sequence s + and the value x. Functions + that were once sequence specific and need to be implemented N times over N + different sequences are now implemented only once. +

+

+ Fusion provides full round compatibility with MPL. + Fusion sequences are fully conforming MPL + sequences and MPL + sequences are fully compatible with Fusion. You can work with Fusion sequences + on MPL if you + wish to work solely on types. In MPL, + Fusion sequences follow MPL's + sequence-type preserving semantics (i.e. algorithms preserve the original sequence + type. e.g. transforming a vector returns a vector). You can also convert from + an MPL sequence + to a Fusion sequence. For example, there are times when it is convenient to + work solely on MPL + using pure MPL + sequences, then, convert them to Fusion sequences as a final step before actual + instantiation of real runtime objects with data. You have the best of both + worlds. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators.html b/doc/html/fusion/iterators.html new file mode 100644 index 00000000..48583fa5 --- /dev/null +++ b/doc/html/fusion/iterators.html @@ -0,0 +1,94 @@ + + + +Iterators + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Like MPL and + STL, + iterators are a fundamental concept in Fusion. As with MPL + and STL + iterators describe positions, and provide access to data within an underlying + Sequence. +

+

+ + Header +

+
+#include <boost/fusion/iterator.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/concepts.html b/doc/html/fusion/iterators/concepts.html new file mode 100644 index 00000000..2ec27b7e --- /dev/null +++ b/doc/html/fusion/iterators/concepts.html @@ -0,0 +1,61 @@ + + + +Concepts + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Fusion iterators are divided into different traversal categories. Forward + Iterator is the most basic concept. Bidirectional + Iterator is a refinement of Forward + Iterator. Random + Access Iterator is a refinement of Bidirectional + Iterator. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/concepts/bidirectional_iterator.html b/doc/html/fusion/iterators/concepts/bidirectional_iterator.html new file mode 100644 index 00000000..d0331405 --- /dev/null +++ b/doc/html/fusion/iterators/concepts/bidirectional_iterator.html @@ -0,0 +1,320 @@ + + + +Bidirectional + Iterator + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A Bidirectional Iterator traverses a Sequence + allowing movement in either direction one element at a time. +

+
+

Notation

+
+
i
+

+ A Bidirectional Iterator +

+
I
+

+ A Bidirectional Iterator type +

+
M
+

+ An MPL + integral constant +

+
N
+

+ An integral constant +

+
+
+
+ + Refinement + of +
+

+ Forward Iterator +

+
+ + Expression + requirements +
+

+ In addition to the requirements defined in Forward + Iterator, the following expressions must be valid: +

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Return type +

+
+

+ Runtime Complexity +

+
+

+ next(i) +

+
+

+ Bidirectional + Iterator +

+
+

+ Constant +

+
+

+ prior(i) +

+
+

+ Bidirectional + Iterator +

+
+

+ Constant +

+
+

+ advance_c<N>(i) +

+
+

+ Bidirectional + Iterator +

+
+

+ Constant +

+
+

+ advance<M>(i) +

+
+

+ Bidirectional + Iterator +

+
+

+ Constant +

+
+
+ + Meta + Expressions +
+
++++ + + + + + + + + +
+

+ Expression +

+
+

+ Compile Time Complexity +

+
+

+ result_of::prior<I>::type +

+
+

+ Amortized constant time +

+
+
+ + Expression + Semantics +
+

+ The semantics of an expression are defined only where they differ from, + or are not defined in Forward + Iterator +

+
++++ + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ prior(i) +

+
+

+ An iterator to the element preceding i +

+
+
+ + Invariants +
+

+ In addition to the invariants of Forward + Iterator, the following invariants always hold: +

+
+
+ + Models +
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/concepts/forward_iterator.html b/doc/html/fusion/iterators/concepts/forward_iterator.html new file mode 100644 index 00000000..428c454e --- /dev/null +++ b/doc/html/fusion/iterators/concepts/forward_iterator.html @@ -0,0 +1,577 @@ + + + +Forward + Iterator + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A Forward Iterator traverses a Sequence + allowing movement in only one direction through it's elements, one element + at a time. +

+
+

Notation

+
+
i, + j
+

+ Forward Iterators +

+
I, + J
+

+ Forward Iterator types +

+
M
+

+ An MPL + integral constant +

+
N
+

+ An integral constant +

+
+
+
+ + Expression + requirements +
+

+ A type models Forward Iterator if, in addition to being CopyConstructable, + the following expressions are valid: +

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Return type +

+
+

+ Runtime Complexity +

+
+

+ next(i) +

+
+

+ Forward + Iterator +

+
+

+ Constant +

+
+

+ i == + j +

+
+

+ Convertible to bool +

+
+

+ Constant +

+
+

+ i != + j +

+
+

+ Convertible to bool +

+
+

+ Constant +

+
+

+ advance_c<N>(i) +

+
+

+ Forward + Iterator +

+
+

+ Constant +

+
+

+ advance<M>(i) +

+
+

+ Forward + Iterator +

+
+

+ Constant +

+
+

+ distance(i, + j) +

+
+

+ result_of::distance<I, + J>::type +

+
+

+ Constant +

+
+

+ deref(i) +

+
+

+ result_of::deref<I>::type +

+
+

+ Constant +

+
+

+ *i +

+
+

+ result_of::deref<I>::type +

+
+

+ Constant +

+
+
+ + Meta + Expressions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Compile Time Complexity +

+
+

+ result_of::next<I>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::equal_to<I, + J>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::advance_c<I, + N>::type +

+
+

+ Linear +

+
+

+ result_of::advance<I ,M>::type +

+
+

+ Linear +

+
+

+ result_of::distance<I ,J>::type +

+
+

+ Linear +

+
+

+ result_of::deref<I>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::value_of<I>::type +

+
+

+ Amortized constant time +

+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ next(i) +

+
+

+ An iterator to the element following i +

+
+

+ i == + j +

+
+

+ Iterator equality comparison +

+
+

+ i != + j +

+
+

+ Iterator inequality comparison +

+
+

+ advance_c<N>(i) +

+
+

+ An iterator n elements after i + in the sequence +

+
+

+ advance<M>(i) +

+
+

+ Equivalent to advance_c<M::value>(i) +

+
+

+ distance(i, + j) +

+
+

+ The number of elements between i + and j +

+
+

+ deref(i) +

+
+

+ The element at positioni +

+
+

+ *i +

+
+

+ Equivalent to deref(i) +

+
+
+ + Invariants +
+

+ The following invariants always hold: +

+
    +
  • !(i + == j) == (i != j)
  • +
  • next(i) == advance_c<1>(i)
  • +
  • distance(i, advance_c<N>(i)) == N
  • +
  • + Using next to traverse the + sequence will never return to a previously seen position +
  • +
  • +deref(i) + is equivalent to *i +
  • +
  • + If i == + j then *i is equivalent to *j +
  • +
+
+ + Models +
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/concepts/random_access_iterator.html b/doc/html/fusion/iterators/concepts/random_access_iterator.html new file mode 100644 index 00000000..ce0ebfe2 --- /dev/null +++ b/doc/html/fusion/iterators/concepts/random_access_iterator.html @@ -0,0 +1,297 @@ + + + +Random + Access Iterator + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A Random Access Iterator traverses a Sequence + moving in either direction, permitting efficient arbitrary distance movements + back and forward through the sequence. +

+
+

Notation

+
+
i, + j
+

+ Random Access Iterators +

+
I, + J
+

+ Random Access Iterator types +

+
M
+

+ An MPL + integral constant +

+
N
+

+ An integral constant +

+
+
+
+ + Refinement + of +
+

+ Bidirectional + Iterator +

+
+ + Expression + requirements +
+

+ In addition to the requirements defined in Bidirectional + Iterator, the following expressions must be valid: +

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Return type +

+
+

+ Runtime Complexity +

+
+

+ next(i) +

+
+

+ Random + Access Iterator +

+
+

+ Constant +

+
+

+ prior(i) +

+
+

+ Random + Access Iterator +

+
+

+ Constant +

+
+

+ advance_c<N>(i) +

+
+

+ Random + Access Iterator +

+
+

+ Constant +

+
+

+ advance<M>(i) +

+
+

+ Random + Access Iterator +

+
+

+ Constant +

+
+
+ + Meta + Expressions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Compile Time Complexity +

+
+

+ result_of::advance_c<I, + N>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::advance<I, + M>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::distance<I ,J>::type +

+
+

+ Amortized constant time +

+
+
+ + Models +
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/functions.html b/doc/html/fusion/iterators/functions.html new file mode 100644 index 00000000..773ec877 --- /dev/null +++ b/doc/html/fusion/iterators/functions.html @@ -0,0 +1,53 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Fusion provides functions for manipulating iterators, analogous to the similar + functions from the MPL + library. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/functions/advance.html b/doc/html/fusion/iterators/functions/advance.html new file mode 100644 index 00000000..dc7ee092 --- /dev/null +++ b/doc/html/fusion/iterators/functions/advance.html @@ -0,0 +1,161 @@ + + + +advance + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Moves an iterator by a specified distance. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    typename M
+    >
+typename result_of::advance<I, M>::type advance(I const& i); 
+
+
+

Table 1.6. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i +

+
+

+ Model of Forward + Iterator +

+
+

+ Iterator to move relative to +

+
+

+ N +

+
+

+ An MPL + Integral Constant +

+
+

+ Number of positions to move +

+
+
+
+ + Expression + Semantics +
+
+advance<M>(i);
+
+

+ Return type: A model of the same iterator + concept as i. +

+

+ Semantics: Returns an iterator to the + element M positions from + i. If i + is a Bidirectional + Iterator then M + may be negative. +

+
+ + Header +
+
+#include <boost/fusion/iterator/advance.hpp>
+
+
+ + Example +
+
+typedef vector<int,int,int> vec;
+
+vec v(1,2,3);
+assert(deref(advance<mpl::int_<2> >(begin(v))) == 3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/functions/advance_c.html b/doc/html/fusion/iterators/functions/advance_c.html new file mode 100644 index 00000000..f4f402ce --- /dev/null +++ b/doc/html/fusion/iterators/functions/advance_c.html @@ -0,0 +1,160 @@ + + + +advance_c + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Moves an iterator by a specified distance. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    int N
+    >
+typename result_of::advance_c<I, N>::type advance_c(I const& i); 
+
+
+

Table 1.7. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i +

+
+

+ Model of Forward + Iterator +

+
+

+ Iterator to move relative to +

+
+

+ N +

+
+

+ Integer constant +

+
+

+ Number of positions to move +

+
+
+
+ + Expression + Semantics +
+
+advance_c<N>(i);
+
+

+ Return type: A model of the same iterator + concept as i. +

+

+ Semantics: Returns an iterator to the + element N positions from + i. If i + is a Bidirectional + Iterator then N + may be negative. +

+
+ + Header +
+
+#include <boost/fusion/iterator/advance.hpp>
+
+
+ + Example +
+
+typedef vector<int,int,int> vec;
+
+vec v(1,2,3);
+assert(deref(advance_c<2>(begin(v))) == 3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/functions/deref.html b/doc/html/fusion/iterators/functions/deref.html new file mode 100644 index 00000000..10629ccb --- /dev/null +++ b/doc/html/fusion/iterators/functions/deref.html @@ -0,0 +1,137 @@ + + + +deref + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Deferences an iterator. +

+
+ + Synopsis +
+
+template<
+    typename I
+    >
+typename result_of::deref<I>::type deref(I const& i);
+
+
+

Table 1.2. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i +

+
+

+ Model of Forward + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+deref(i);
+
+

+ Return type: result_of::deref<I>::type +

+

+ Semantics: Dereferences the iterator + i. +

+
+ + Header +
+
+#include <boost/fusion/iterator/deref.hpp>
+
+
+ + Example +
+
+typedef vector<int,int&> vec;
+
+int i(0);
+vec v(1,i);
+assert(deref(begin(v)) == 1);
+assert(deref(next(begin(v))) == 0);
+assert(&(deref(next(begin(v)))) == &i);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/functions/distance.html b/doc/html/fusion/iterators/functions/distance.html new file mode 100644 index 00000000..df606479 --- /dev/null +++ b/doc/html/fusion/iterators/functions/distance.html @@ -0,0 +1,135 @@ + + + +distance + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the distance between 2 iterators. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    typename J
+    >
+typename result_of::distance<I, J>::type distance(I const& i, J const& j);
+
+
+

Table 1.5. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i, j +

+
+

+ Models of Forward + Iterator into the same sequence +

+
+

+ The start and end points of the distance to be measured +

+
+
+
+ + Expression + Semantics +
+
+distance(i,j);
+
+

+ Return type: int +

+

+ Semantics: Returns the distance between + iterators i and j. +

+
+ + Header +
+
+#include <boost/fusion/iterator/distance.hpp>
+
+
+ + Example +
+
+typedef vector<int,int,int> vec;
+
+vec v(1,2,3);
+assert(distance(begin(v), next(next(begin(v)))) == 2);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/functions/next.html b/doc/html/fusion/iterators/functions/next.html new file mode 100644 index 00000000..b4dc0827 --- /dev/null +++ b/doc/html/fusion/iterators/functions/next.html @@ -0,0 +1,137 @@ + + + +next + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Moves an iterator 1 position forwards. +

+
+ + Synopsis +
+
+template<
+    typename I
+    >
+typename result_of::next<I>::type next(I const& i);
+
+
+

Table 1.3. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i +

+
+

+ Model of Forward + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+next(i);
+
+

+ Return type: A model of the same iterator + concept as i. +

+

+ Semantics: Returns an iterator to the + next element after i. +

+
+ + Header +
+
+#include <boost/fusion/iterator/next.hpp>
+
+
+ + Example +
+
+typedef vector<int,int,int> vec;
+
+vec v(1,2,3);
+assert(deref(begin(v)) == 1);
+assert(deref(next(begin(v))) == 2);
+assert(deref(next(next(begin(v)))) == 3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/functions/prior.html b/doc/html/fusion/iterators/functions/prior.html new file mode 100644 index 00000000..9eaba7b7 --- /dev/null +++ b/doc/html/fusion/iterators/functions/prior.html @@ -0,0 +1,136 @@ + + + +prior + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Moves an iterator 1 position backwards. +

+
+ + Synopsis +
+
+template<
+    typename I
+    >
+typename result_of::prior<I>::type prior(I const& i);
+
+
+

Table 1.4. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i +

+
+

+ Model of Bidirectional + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+prior(i);
+
+

+ Return type: A model of the same iterator + concept as i. +

+

+ Semantics: Returns an iterator to the + element prior to i. +

+
+ + Header +
+
+#include <boost/fusion/iterator/prior.hpp>
+
+
+ + Example +
+
+typedef vector<int,int> vec;
+
+vec v(1,2);
+assert(deref(next(begin(v))) == 2);
+assert(deref(prior(next(begin(v)))) == 1);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions.html b/doc/html/fusion/iterators/metafunctions.html new file mode 100644 index 00000000..22b175b9 --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions.html @@ -0,0 +1,50 @@ + + + +Metafunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions/advance.html b/doc/html/fusion/iterators/metafunctions/advance.html new file mode 100644 index 00000000..00b4468f --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions/advance.html @@ -0,0 +1,165 @@ + + + +advance + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Moves an iterator a specified distance. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    typename M
+    >
+struct advance
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.17. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ I +

+
+

+ Model of Forward + Iterator +

+
+

+ Iterator to move relative to +

+
+

+ M +

+
+

+ Model of MPL + Integral Constant +

+
+

+ Number of positions to move +

+
+
+
+ + Expression + Semantics +
+
+result_of::advance<I,M>::type
+
+

+ Return type: A model of the same iterator + concept as I. +

+

+ Semantics: Returns an iterator a distance + M from I. + If I is a Bidirectional + Iterator then M + may be negative. +

+
+ + Header +
+
+#include <boost/fusion/iterator/advance.hpp>
+
+
+ + Example +
+
+typedef vector<int,double,char> vec;
+typedef result_of::begin<vec>::type first;
+typedef result_of::next<first>::type second;
+typedef result_of::next<second>::type third;
+
+BOOST_MPL_ASSERT((result_of::equal_to<result_of::advance<first, boost::mpl::int_<2> >::type, third>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions/advance_c.html b/doc/html/fusion/iterators/metafunctions/advance_c.html new file mode 100644 index 00000000..0f174158 --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions/advance_c.html @@ -0,0 +1,164 @@ + + + +advance_c + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Moves an iterator by a specified distance. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    int N
+    >
+struct advance_c
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.18. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ I +

+
+

+ Model of Forward + Iterator +

+
+

+ Iterator to move relative to +

+
+

+ N +

+
+

+ Integer constant +

+
+

+ Number of positions to move +

+
+
+
+ + Expression + Semantics +
+
+result_of::advance_c<I, N>::type
+
+

+ Return type: A model of the same iterator + concept as I. +

+

+ Semantics: Returns an iterator a distance + N from I. + If I is a Bidirectional + Iterator then N + may be negative. Equivalent to result_of::advance<I, boost::mpl::int_<N> >::type. +

+
+ + Header +
+
+#include <boost/fusion/iterator/advance.hpp>
+
+
+ + Example +
+
+typedef vector<int,double,char> vec;
+typedef result_of::begin<vec>::type first;
+typedef result_of::next<first>::type second;
+typedef result_of::next<second>::type third;
+
+BOOST_MPL_ASSERT((result_of::equal_to<result_of::advance_c<first, 2>::type, third>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions/deref.html b/doc/html/fusion/iterators/metafunctions/deref.html new file mode 100644 index 00000000..b8d9b5b7 --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions/deref.html @@ -0,0 +1,143 @@ + + + +deref + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the type that will be returned by dereferencing an iterator. +

+
+ + Synposis +
+
+template<
+    typename I
+    >
+struct deref
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.12. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ I +

+
+

+ Model of Forward + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::deref<I>::type
+
+

+ Return type: Any type +

+

+ Semantics: Returns the result of dereferencing + an iterator of type I. +

+
+ + Header +
+
+#include <boost/fusion/iterator/deref.hpp>
+
+
+ + Example +
+
+typedef vector<int,int&> vec;
+typedef const vec const_vec;
+typedef result_of::begin<vec>::type first;
+typedef result_of::next<first>::type second;
+
+typedef result_of::begin<const_vec>::type const_first;
+typedef result_of::next<const_first>::type const_second;
+
+BOOST_MPL_ASSERT((boost::is_same<result_of::deref<first>::type, int&>));
+BOOST_MPL_ASSERT((boost::is_same<result_of::deref<second>::type, int&>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions/distance.html b/doc/html/fusion/iterators/metafunctions/distance.html new file mode 100644 index 00000000..743318e8 --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions/distance.html @@ -0,0 +1,143 @@ + + + +distance + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the distance between two iterators. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    typename J
+    >
+struct distance
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.16. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ I, J +

+
+

+ Models of Forward + Iterator into the same sequence +

+
+

+ The start and end points of the distance to be measured +

+
+
+
+ + Expression + Semantics +
+
+result_of::distance<I, J>::type
+
+

+ Return type: A model of MPL + Integral Constant. +

+

+ Semantics: Returns the distance between + iterators of types I and + J. +

+
+ + Header +
+
+#include <boost/fusion/iterator/distance.hpp>
+
+
+ + Example +
+
+typedef vector<int,double,char> vec;
+typedef result_of::begin<vec>::type first;
+typedef result_of::next<first>::type second;
+typedef result_of::next<second>::type third;
+typedef result_of::distance<first,third>::type dist;
+
+BOOST_MPL_ASSERT_RELATION(dist::value, ==, 2);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions/equal_to.html b/doc/html/fusion/iterators/metafunctions/equal_to.html new file mode 100644 index 00000000..a79af3d5 --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions/equal_to.html @@ -0,0 +1,141 @@ + + + +equal_to + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a true-valued MPL + Integral Constant if I + and J are equal. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    typename J
+    >
+struct equal_to
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.15. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ I, J +

+
+

+ Any fusion iterators +

+
+

+ Operation's arguments +

+
+
+
+ + Expression + Semantics +
+
+result_of::equal_to<I, J>::type
+
+

+ Return type: A model of MPL + Integral Constant. +

+

+ Semantics: Returns boost::mpl::true_ + if I and J are iterators to the same position. + Returns boost::mpl::false_ otherwise. +

+
+ + Header +
+
+#include <boost/fusion/iterator/equal_to.hpp>
+
+
+ + Example +
+
+typedef vector<int,double> vec;
+typedef result_of::begin<vec>::type first;
+typedef result_of::end<vec>::type last;
+BOOST_MPL_ASSERT((result_of::equal_to<first, first>));
+BOOST_MPL_ASSERT_NOT((result_of::equal_to<first,last>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions/next.html b/doc/html/fusion/iterators/metafunctions/next.html new file mode 100644 index 00000000..14873188 --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions/next.html @@ -0,0 +1,138 @@ + + + +next + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the type of the next iterator in a sequence. +

+
+ + Synposis +
+
+template<
+    typename I
+    >
+struct next
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.13. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ I +

+
+

+ Model of Forward + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::next<I>::type
+
+

+ Return type: A model of the same iterator + concept as I. +

+

+ Semantics: Returns an iterator to the + next element in the sequence after I. +

+
+ + Header +
+
+#include <boost/fusion/iterator/next.hpp>
+
+
+ + Example +
+
+typedef vector<int,double> vec;
+typedef result_of::next<result_of::begin<vec>::type>::type second;
+
+BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<second>::type, double>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions/prior.html b/doc/html/fusion/iterators/metafunctions/prior.html new file mode 100644 index 00000000..108996d0 --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions/prior.html @@ -0,0 +1,141 @@ + + + +prior + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the type of the previous iterator in a sequence. +

+
+ + Synopsis +
+
+template<
+    typename I
+    >
+struct prior
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.14. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ I +

+
+

+ Model of Bidirectional + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::prior<I>::type
+
+

+ Return type: A model of the same iterator + concept as I. +

+

+ Semantics: Returns an iterator to the + previous element in the sequence before I. +

+
+ + Header +
+
+#include <boost/fusion/iterator/prior.hpp>
+
+
+ + Example +
+
+typedef vector<int,double> vec;
+typedef result_of::next<result_of::begin<vec>::type>::type second;
+
+BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<second>::type, double>));
+
+typedef result_of::prior<second>::type first;
+BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<first>::type, int>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/metafunctions/value_of.html b/doc/html/fusion/iterators/metafunctions/value_of.html new file mode 100644 index 00000000..43183877 --- /dev/null +++ b/doc/html/fusion/iterators/metafunctions/value_of.html @@ -0,0 +1,141 @@ + + + +value_of + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the type stored at the position of an iterator. +

+
+ + Synopsis +
+
+template<
+    typename I
+    >
+struct value_of
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.11. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ I +

+
+

+ Model of Forward + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+result_of::value_of<I>::type
+
+

+ Return type: Any type +

+

+ Semantics: Returns the type stored in + a sequence at iterator position I. +

+
+ + Header +
+
+#include <boost/fusion/iterator/value_of.hpp>
+
+
+ + Example +
+
+typedef vector<int,int&,const int&> vec;
+typedef result_of::begin<vec>::type first;
+typedef result_of::next<first>::type second;
+typedef result_of::next<second>::type third;
+
+BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<first>::type, int>));
+BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<second>::type, int&>));
+BOOST_MPL_ASSERT((boost::is_same<result_of::value_of<third>::type, const int&>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/operators.html b/doc/html/fusion/iterators/operators.html new file mode 100644 index 00000000..5b4fff25 --- /dev/null +++ b/doc/html/fusion/iterators/operators.html @@ -0,0 +1,52 @@ + + + +Operators + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Overloaded operators are provided to provide a more natural syntax for dereferencing + iterators, and comparing them for equality. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/operators/operator_equality.html b/doc/html/fusion/iterators/operators/operator_equality.html new file mode 100644 index 00000000..11217f05 --- /dev/null +++ b/doc/html/fusion/iterators/operators/operator_equality.html @@ -0,0 +1,129 @@ + + + + Operator + == + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Compares 2 iterators for equality. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    typename J
+    >
+unspecified operator==(I const& i, J const& i);
+
+
+

Table 1.9. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i, j +

+
+

+ Any fusion iterators +

+
+

+ Operation's arguments +

+
+
+
+ + Expression + Semantics +
+
+i == j
+
+

+ Return type: Convertible to bool. +

+

+ Semantics: Equivalent to result_of::equal_to<I,J>::value + where I and J are the types of i + and j respectively. +

+
+ + Header +
+
+#include <boost/fusion/iterator/equal_to.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/operators/operator_inequality.html b/doc/html/fusion/iterators/operators/operator_inequality.html new file mode 100644 index 00000000..b45b56c0 --- /dev/null +++ b/doc/html/fusion/iterators/operators/operator_inequality.html @@ -0,0 +1,125 @@ + + + + Operator + != + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Compares 2 iterators for inequality. +

+
+ + Synopsis +
+
+template<
+    typename I,
+    typename J
+    >
+unspecified operator==(I const& i, J const& i);
+
+
+

Table 1.10. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i, j +

+
+

+ Any fusion iterators +

+
+

+ Operation's arguments +

+
+
+
+ + Expression + Semantics +
+

+ Return type: Convertible to bool. +

+

+ Semantics: Equivalent to !result_of::equal_to<I,J>::value + where I and J are the types of i + and j respectively. +

+
+ + Header +
+
+#include <boost/fusion/iterator/equal_to.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/iterators/operators/operator_unary_star.html b/doc/html/fusion/iterators/operators/operator_unary_star.html new file mode 100644 index 00000000..e662dc4b --- /dev/null +++ b/doc/html/fusion/iterators/operators/operator_unary_star.html @@ -0,0 +1,141 @@ + + + + Operator + * + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Dereferences an iterator. +

+
+ + Synopsis +
+
+template<
+    typename I
+    >
+typename result_of::deref<I>::type operator*(unspecified<I> const& i);
+
+
+

Table 1.8. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ i +

+
+

+ Model of Forward + Iterator +

+
+

+ Operation's argument +

+
+
+
+ + Expression + Semantics +
+
+*i
+
+

+ Return type: Equivalent to the return + type of deref(i). +

+

+ Semantics: Equivalent to deref(i). +

+
+ + Header +
+
+#include <boost/fusion/iterator/deref.hpp>
+
+
+ + Example +
+
+typedef vector<int,int&> vec;
+
+int i(0);
+vec v(1,i);
+assert(*begin(v) == 1);
+assert(*next(begin(v)) == 0);
+assert(&(*next(begin(v))) == &i);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/notes.html b/doc/html/fusion/notes.html new file mode 100644 index 00000000..cdb87296 --- /dev/null +++ b/doc/html/fusion/notes.html @@ -0,0 +1,257 @@ + + + +Notes + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Recursive Inlined + Functions +

+

+ An interesting peculiarity of functions like at when applied to a Forward + Sequence like list is that what could have been + linear runtime complexity effectively becomes constant O(1) due to compiler + optimization of C++ inlined functions, however deeply recursive (up to a certain + compiler limit of course). Compile time complexity remains linear. +

+

+ + Overloaded Functions +

+

+ Associative sequences use function overloading to implement membership testing + and type associated key lookup. This amounts to constant runtime and amortized + constant compile time complexities. There is an overloaded function, f(k), for each key type k. The compiler chooses the appropriate function + given a key, k. +

+

+ + Tag Dispatching +

+

+ Tag dispatching is a generic programming technique for selecting template specializations. + There are typically 3 components involved in the tag dispatching mechanism: +

+
    +
  1. + A type for which an appropriate template specialization is required +
  2. +
  3. + A metafunction that associates the type with a tag type +
  4. +
  5. + A template that is specialized for the tag type +
  6. +
+

+ For example, the fusion result_of::begin metafunction + is implemented as follows: +

+
+template <typename Sequence>
+struct begin
+{
+    typedef typename
+        result_of::begin_impl<typename traits::tag_of<Sequence>::type>::
+        template apply<Sequence>::type
+    type;
+};
+
+

+ In the case: +

+
    +
  1. +Sequence is the type for + which a suitable implementation of result_of::begin_impl + is required +
  2. +
  3. +traits::tag_of is the metafunction that associates + Sequence with an appropriate + tag +
  4. +
  5. +result_of::begin_impl is the template which is specialized + to provide an implementation for each tag type +
  6. +
+

+ + Extensibility +

+

+ Unlike MPL, there + is no extensibe sequence concept in fusion. This does not mean that Fusion + sequences are not extensible. In fact, all Fusion sequences are inherently + extensible. It is just that the manner of sequence extension in Fusion is diferent + from both STL + and MPL on account + of the lazy nature of fusion Algorithms. + STL + containers extend themselves in place though member functions such as push_back and insert. MPL + sequences, on the other hand, are extended through "intrinsic" functions + that actually return whole sequences. MPL + is purely functional and can not have side effects. For example, MPL's + push_back does not actually + mutate an mpl::vector. It can't do that. Instead, it returns + an extended mpl::vector. +

+

+ Like MPL, Fusion + too is purely functional and can not have side effects. With runtime efficiency + in mind, Fusion sequences are extended through generic functions that return + Views. Views + are sequences that do not actually contain data, but instead impart an alternative + presentation over the data from one or more underlying sequences. Views + are proxies. They provide an efficient yet purely functional way to work on + potentially expensive sequence operations. For example, given a vector, Fusion's push_back returns a joint_view, instead of an actual extended + vector. + A joint_view + holds a reference to the original sequence plus the appended data --making + it very cheap to pass around. +

+

+ + Element Conversion +

+

+ Functions that take in elemental values to form sequences (e.g. make_list) convert their arguments + to something suitable to be stored as a sequence element. In general, the element + types are stored as plain values. Example: +

+
+make_list(1, 'x')
+
+

+ returns a list<int, + char>. +

+

+ There are a few exceptions, however. +

+

+ Arrays: +

+

+ Array arguments are deduced to reference to const types. For example + [14] + : +

+
+make_list("Donald", "Daisy")
+
+

+ creates a list + of type +

+
+list<const char (&)[7], const char (&)[6]>
+
+

+ Function pointers: +

+

+ Function pointers are deduced to the plain non-reference type (i.e. to plain + function pointer). Example: +

+
+void f(int i);
+  ...
+make_list(&f);
+
+

+ creates a list + of type +

+
+list<void (*)(int)>
+
+

+ + boost::ref +

+

+ Fusion's generation functions (e.g. make_list) by default stores the element + types as plain non-reference types. Example: +

+
+void foo(const A& a, B& b) {
+    ...
+    make_list(a, b)
+
+

+ creates a list + of type +

+
+list<A, B>
+
+

+ Sometimes the plain non-reference type is not desired. You can use boost::ref + and boost::cref to store references or const references + (respectively) instead. The mechanism does not compromise const correctness + since a const object wrapped with ref results in a tuple element with const + reference type (see the fifth code line below). Examples: +

+

+ For example: +

+
+A a; B b; const A ca = a;
+make_list(cref(a), b);          // creates list<const A&, B>
+make_list(ref(a), b);           // creates list<A&, B>
+make_list(ref(a), cref(b));     // creates list<A&, const B&>
+make_list(cref(ca));            // creates list<const A&>
+make_list(ref(ca));             // creates list<const A&>
+
+

+ See Boost.Ref for + details. +

+
+

+

[14] + Note that the type of a string literal is an array of const characters, + not const char*. To get make_list to create a list with an element of a non-const + array type one must use the ref + wrapper (see boost::ref). +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/organization.html b/doc/html/fusion/organization.html new file mode 100644 index 00000000..71cb47b9 --- /dev/null +++ b/doc/html/fusion/organization.html @@ -0,0 +1,205 @@ + + + +Organization + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The library is organized into layers of modules, with each module addressing + a particular area of responsibility. A module may not depend on modules in + higher layers. +

+

+ The library is organized in three layers: +

+

+ + Layers +

+
+

+

+

+ fusion_org +

+

+

+
+

+ The entire library is found in the "boost/fusion" directory. Modules + are organized in directories. Each module has its own header file placed in + the same directory with the actual module-directory. For example, there exists + "boost/fusion/support.hpp" in the same directory as "boost/fusion/support". + Everything, except those found inside "detail" directories, is public. + The library is header-only. There is no need to build object files to link + against. +

+

+ + Directory +

+
    +
  • + tuple +
  • +
  • + algorithm +
      +
    • + iteration +
    • +
    • + query +
    • +
    • + transformation +
    • +
    +
  • +
  • + sequence +
      +
    • + adapted +
        +
      • + array +
      • +
      • + mpl +
      • +
      • + std_pair +
      • +
      +
    • +
    • + comparison +
    • +
    • + container +
        +
      • + list +
      • +
      • + map +
      • +
      • + set +
      • +
      • + vector +
      • +
      +
    • +
    • + conversion +
    • +
    • + generation +
    • +
    • + intrinsic +
    • +
    • + io +
    • +
    • + utility +
    • +
    • + view +
        +
      • + filter_view +
      • +
      • + iterator_range +
      • +
      • + joint_view +
      • +
      • + reverse_view +
      • +
      • + single_view +
      • +
      • + transform_view +
      • +
      • + zip_view +
      • +
      +
    • +
    +
  • +
  • + iterator +
  • +
  • + support +
  • +
+

+ + Example +

+

+ If, for example, you want to use list, + depending on the granularity that you desire, you may do so by including one + of +

+
+#include <boost/fusion/sequence.hpp>
+#include <boost/fusion/sequence/container.hpp>
+#include <boost/fusion/sequence/container/list.hpp>
+
+

+ The first includes all sequences. The second includes all of sequence containers. + The third includes only list + [3] + . +

+
+

+

[3] + Modules may contain smaller components. Header file information for each + component will be provided as part of the component's documentation. +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/preface.html b/doc/html/fusion/preface.html new file mode 100644 index 00000000..889a4b5e --- /dev/null +++ b/doc/html/fusion/preface.html @@ -0,0 +1,226 @@ + + + +Preface + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+

+

+

+ Algorithms + Data Structures = Programs. +

+

+

+
+
+

+

+

+ --Niklaus Wirth +

+

+

+
+

+ + Description +

+

+ Fusion is a library for working with heterogenous collections of data, commonly + referred to as tuples. A set of containers (vector, list, set and map) is provided, + along with views that provide a transformed presentation of their underlying + data. Collectively the containers and views are referred to as sequences, and + Fusion has a suite of algorithms that operate upon the various sequence types, + using an iterator concept that binds everything together. +

+

+ The architecture is modeled after MPL + which in turn is modeled after STL. + It is named "fusion" because the library is a "fusion" + of compile time metaprogramming with runtime programming. +

+

+ + Motivation +

+

+ Tuples are powerful beasts. After having developed two significant projects + (Spirit and Phoenix) + that relied heavily metaprogramming, it became apparent that tuples are a powerful + means to simplify otherwise tricky tasks; especially those that require a combination + of metaprogramming and manipulation of heterogenous data types with values. + While MPL is + an extremely powerful metaprogramming tool, MPL + focuses on type manipulation only. Ultimately, you'll have to map these types + to real values to make them useful in the runtime world where all the real + action takes place. +

+

+ As Spirit and Phoenix + evolved, patterns and idioms related to tuple manipulation emerged. Soon, it + became clear that those patterns and idioms were best assembled in a tuples + algorithms library. David + Abrahams outlined such a scheme in 2002. At that time, it just so happened + that Spirit and Phoenix + had an adhoc collection of tuple manipulation and traversal routines. It was + an instant AHA! moment. +

+

+ + How to use this manual +

+

+ Some icons are used to mark certain topics indicative of their relevance. These + icons precede some text to indicate: +

+
+

Table 1.1. Icons

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Icon +

+
+

+ Name +

+
+

+ Meaning +

+
+

+ note +

+
+

+ Note +

+
+

+ Information provided is auxiliary but will give the reader a deeper insight + into a specific topic. May be skipped. +

+
+

+ alert +

+
+

+ Alert +

+
+

+ Information provided is of utmost importance. +

+
+

+ caution +

+
+

+ Caution +

+
+

+ A mild warning. +

+
+

+ tip +

+
+

+ Tip +

+
+

+ A potentially useful and helpful piece of information. +

+
+
+

+ This documentation is automatically generated by Boost QuickBook documentation + tool. QuickBook can be found in the Boost + Tools. +

+

+ + Support +

+

+ Please direct all questions to Spirit's mailing list. You can subscribe to + the Spirit + Mailing List. The mailing list has a searchable archive. A search link + to this archive is provided in Spirit's + home page. You may also read and post messages to the mailing list through + Spirit General + NNTP news portal (thanks to Gmane). + The news group mirrors the mailing list. Here is a link to the archives: http://news.gmane.org/gmane.comp.parsers.spirit.general. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/quick_start.html b/doc/html/fusion/quick_start.html new file mode 100644 index 00000000..f3ca0949 --- /dev/null +++ b/doc/html/fusion/quick_start.html @@ -0,0 +1,261 @@ + + + +Quick Start + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ I assume the reader is already familiar with tuples (Boost.Tuple) + and its ancestor std::pair. The tuple is a generalization of std::pair + for multiple heterogeneous elements (triples, quadruples, etc.). The tuple + is more or less a synonym for fusion's vector. +

+

+ For starters, we shall include all of Fusion's _sequence_s + [1] + : +

+
+#include <boost/fusion/sequence.hpp>
+
+

+ Let's begin with a vector + [2] + : +

+
+vector<int, char, std::string> stuff(1, 'x', "howdy");
+int i = at_c<0>(stuff);
+char ch = at_c<1>(stuff);
+std::string s = at_c<2>(stuff);
+
+

+ Just replace tuple for vector + and get for at_c and this is exactly like + Boost.Tuple. + Actually, either names can be used interchangeably. Yet, the similarity ends + there. You can do a lot more with Fusion vector or tuple. + Let's see some examples. +

+

+ + Print the vector + as XML +

+

+ First, let's include the algorithms: +

+
+#include <boost/fusion/algorithm.hpp>
+
+

+ Now, let's write a function object that prints XML of the form <type>data</type> + for each member in the tuple. +

+
+struct print_xml
+{
+    template <typename T>
+    void operator()(T const& x) const
+    {
+        std::cout 
+            << '<' << typeid(x).name() << '>'
+            << x
+            << "</" << typeid(x).name() << '>'
+            ;
+    }
+};
+
+

+ Now, finally: +

+
+for_each(stuff, print_xml());
+
+

+ That's it! for_each is a fusion algorithm. + It is a generic algorithm similar to STL's. + It iterates over the sequence and calls a user supplied function. In our case, + it calls print_xml's operator() for + each element in stuff. +

+
+ + + + + +
[Caution]Caution

+ The result of typeid(x).name() is platform specific. The code here is + just for exposition. Of course you already know that :-) +

+

+ for_each is generic. With + print_xml, you can use it to + print just about any Fusion Sequence. +

+

+ + Print only pointers +

+

+ Let's get a little cleverer. Say we wish to write a generic + function that takes in an arbitrary sequence and XML prints only those elements + which are pointers. Ah, easy. First, let's include the is_pointer + boost type trait: +

+
+#include <boost/type_traits/is_pointer.hpp>
+
+

+ Then, simply: +

+
+template <typename Sequence>
+void xml_print_pointers(Sequence const& seq)
+{
+    for_each(filter_if<boost::is_pointer<_> >(seq), print_xml());
+}
+
+

+ filter_if is another Fusion + algorithm. It returns a filter_view, a conforming Fusion sequence. + This view reflects only those elements that pass the given predicate. In this + case, the predicate is boost::is_pointer<_>. + This "filtered view" is then passed to the for_each algorithm, which then prints + the "filtered view" as XML. +

+

+ Easy, right? +

+

+ + Associative tuples +

+

+ Ok, moving on... +

+

+ Apart from vector, fusion has a couple + of other sequence types to choose from. Each sequence has its own characteristics. + We have list, set, map, plus a multitude of views that provide various ways to present + the sequences. +

+

+ Fusion's map associate types with elements. + It can be used as a cleverer replacement of the struct. + Example: +

+
+namespace fields
+{
+    struct name;
+    struct age;
+}
+
+typedef map<
+    fusion::pair<fields::name, std::string>
+  , fusion::pair<fields::age, int> > 
+person;
+
+

+ map + is an associative sequence. Its elements are Fusion pairs which differ somewhat + from std::pair. Fusion pairs only contain one member, + with the type of their second template parameter. The first type parameter + of the pair is used as an index to the associated element in the sequence. + For example, given a a_person + of type, person, you can do: +

+
+using namespace fields;
+std::string person_name = at_key<name>(a_person);
+int person_age = at_key<age>(a_person);
+
+

+ Why go through all this trouble, you say? Well, for one, unlike the struct, we are dealing with a generic data structure. + There are a multitude of facilities available at your disposal provided out + of the box with fusion or written by others. With these facilities, introspection + comes for free, for example. We can write one serialization function (well, + two, if you consider loading and saving) that will work for all your fusion + maps. + Example: +

+
+struct saver
+{
+    template <typename Pair>
+    void operator()(Pair const& data) const
+    {
+        some_archive << data.second;
+    }
+};
+
+template <typename Stuff>
+void save(Stuff const& stuff)
+{
+    for_each(stuff, saver());
+}
+
+

+ The save function is generic + and will work for all types of stuff + regardless if it is a person, + a dog or a whole alternate_universe. +

+

+ + Tip of the Iceberg +

+

+ And... we've barely scratched the surface! You can compose and expand the data + structures, remove elements from the structures, find specific data types, + query the elements, filter out types for inspection, transform data structures, + etc. What you've seen is just the tip of the iceberg. +

+
+

+

[1] + There are finer grained header files available if you wish to have more + control over which components to include (see section Orgainization + for details). +

+

[2] + Unless otherwise noted, components are in namespace boost::fusion. + For the sake of simplicity, code in this quick start implies using directives for the fusion components + we will be using. +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/references.html b/doc/html/fusion/references.html new file mode 100644 index 00000000..452b9622 --- /dev/null +++ b/doc/html/fusion/references.html @@ -0,0 +1,68 @@ + + + +References + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHome +
+
+ +
    +
  1. +New + Iterator Concepts, David Abrahams, Jeremy Siek, Thomas Witt, 2004-11-01. +
  2. +
  3. +The Boost + Tuple Library, Jaakko Jarvi, 2001. +
  4. +
  5. +Spirit Parser Library, + Joel de Guzman, 2001-2006. +
  6. +
  7. +The Boost MPL Library, + Aleksey Gurtovoy and David Abrahams, 2002-2004. +
  8. +
  9. +Boost Array, + Nicolai Josuttis, 2002-2004. +
  10. +
  11. +Standard Template Library Programmer's + Guide, Hewlett-Packard Company, 1994. +
  12. +
  13. +Boost.Ref, Jaakko + Jarvi, Peter Dimov, Douglas Gregor, Dave Abrahams, 1999-2002. +
  14. +
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHome +
+ + diff --git a/doc/html/fusion/sequences.html b/doc/html/fusion/sequences.html new file mode 100644 index 00000000..8401c4a8 --- /dev/null +++ b/doc/html/fusion/sequences.html @@ -0,0 +1,115 @@ + + + +Sequences + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Like MPL, the + Sequence is a fundamental concept in Fusion. A Sequence may or may not actually + store or contain data. Containers + are sequences that hold data. Views, + on the other hand, are sequences that do not store any data. Instead, they + are proxies that impart an alternative presentation over another sequence. + All models of Sequence have an associated Iterator + type that can be used to iterate through the Sequence's elements. +

+

+ + Header +

+
+#include <boost/fusion/sequence.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/adapted.html b/doc/html/fusion/sequences/adapted.html new file mode 100644 index 00000000..a9c16943 --- /dev/null +++ b/doc/html/fusion/sequences/adapted.html @@ -0,0 +1,73 @@ + + + +Adapted + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Fusion provides a couple of adapters for other sequences such as std::pair, + MPL sequences, + and boost::array. These adapters are written using + Fusion's non-intrusive Extension + mechanism. If you wish to use these sequences with fusion, simply include + the necessary files and they will be regarded as first-class, fully conforming + fusion sequences + [4] + . +

+

+ + Header +

+
+#include <boost/fusion/sequence/adapted.hpp>
+
+
+

+

[4] + Fusion sequences may also be adapted as fully conforming MPL + sequences (see Intrinsics). + That way, we can have 2-way adaptation to and from MPL + and Fusion +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/adapted/boost__array.html b/doc/html/fusion/sequences/adapted/boost__array.html new file mode 100644 index 00000000..7a5ceae1 --- /dev/null +++ b/doc/html/fusion/sequences/adapted/boost__array.html @@ -0,0 +1,80 @@ + + + +boost::array + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ This module provides adapters for boost::array. + Including the module header makes boost::array + a fully conforming Random + Access Sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/adapted/array.hpp>
+
+
+ + Model of +
+ +
+ + Example +
+
+boost::array<int,3> arr = {{1,2,3}};
+
+std::cout << *begin(arr) << std::endl;
+std::cout << *next(begin(arr)) << std::endl;
+std::cout << *advance_c<2>(begin(arr)) << std::endl;
+std::cout << *prior(end(arr)) << std::endl;
+std::cout << at_c<2>(arr) << std::endl;
+
+
+ + See also +
+

+ Boost.Array Library +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/adapted/boost__tuple.html b/doc/html/fusion/sequences/adapted/boost__tuple.html new file mode 100644 index 00000000..18d00ad5 --- /dev/null +++ b/doc/html/fusion/sequences/adapted/boost__tuple.html @@ -0,0 +1,76 @@ + + + +boost::tuple + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ This module provides adapters for boost::tuple. + Including the module header makes boost::tuple + a fully conforming Forward + Sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/adapted/boost_tuple.hpp>
+
+
+ + Model of +
+ +
+ + Example +
+
+boost::tuple<int,std::string> example_tuple(101, "hello");
+std::cout << *boost::fusion::begin(example_tuple) << '\n';
+std::cout << *boost::fusion::next(boost::fusion::begin(example_tuple)) << '\n';
+
+
+ + See also +
+

+ Boost.Tuple + Library +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/adapted/boost__variant.html b/doc/html/fusion/sequences/adapted/boost__variant.html new file mode 100644 index 00000000..3f91a088 --- /dev/null +++ b/doc/html/fusion/sequences/adapted/boost__variant.html @@ -0,0 +1,80 @@ + + + +boost::variant + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ This module provides adapters for boost::variant. + Including the module header makes boost::variant + a fully conforming Forward + Sequence. The variant acts as a sequence of the types that can be + contained in the variant. Accessing types not currently stored int the + variant will lead to the variant being populated with a default constructed + value of that type. +

+
+ + Header +
+
+#include <boost/fusion/sequence/adapted/variant.hpp>
+
+
+ + Model + of +
+ +
+ + Example +
+
+boost::variant<int,std::string> example_variant = 101;
+std::cout << example_variant << '\n';
+*boost::fusion::find<std::string>(example_variant) = "hello";
+std::cout << example_variant << '\n';
+
+
+ + See also +
+

+ Boost.Variant Library +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/adapted/mpl_sequence.html b/doc/html/fusion/sequences/adapted/mpl_sequence.html new file mode 100644 index 00000000..4a2245ef --- /dev/null +++ b/doc/html/fusion/sequences/adapted/mpl_sequence.html @@ -0,0 +1,96 @@ + + + +mpl sequence + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ This module provides adapters for MPL + sequences. Including the module header makes all MPL + sequences fully conforming fusion sequences. +

+
+ + Header +
+
+#include <boost/fusion/sequence/adapted/mpl.hpp>
+
+
+ + Model of +
+
+
+ + Example +
+
+mpl::vector_c<int, 123, 456> vec_c;
+fusion::vector2<int, long> v(vec_c);
+std::cout << at_c<0>(v) << std::endl;
+std::cout << at_c<1>(v) << std::endl;
+
+v = mpl::vector_c<int, 456, 789>();
+std::cout << at_c<0>(v) << std::endl;
+std::cout << at_c<1>(v) << std::endl;
+
+
+ + See also +
+

+ MPL +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/adapted/std__pair.html b/doc/html/fusion/sequences/adapted/std__pair.html new file mode 100644 index 00000000..33e23443 --- /dev/null +++ b/doc/html/fusion/sequences/adapted/std__pair.html @@ -0,0 +1,79 @@ + + + +std::pair + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ This module provides adapters for std::pair. + Including the module header makes std::pair + a fully conforming Random + Access Sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/adapted/std_pair.hpp>
+
+
+ + Model of +
+ +
+ + Example +
+
+std::pair<int, std::string> p(123, "Hola!!!");
+std::cout << at_c<0>(p) << std::endl;
+std::cout << at_c<1>(p) << std::endl;
+std::cout << p << std::endl;
+
+
+ + See also +
+

+ std::pair, + TR1 + and std::pair +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/concepts.html b/doc/html/fusion/sequences/concepts.html new file mode 100644 index 00000000..82fea73a --- /dev/null +++ b/doc/html/fusion/sequences/concepts.html @@ -0,0 +1,81 @@ + + + +Concepts + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Fusion Sequences are organized into a hierarchy of concepts. +

+

+ + Traversal +

+

+ Fusion's sequence traversal related concepts parallel Fusion's Iterator + Concepts. Forward + Sequence is the most basic concept. Bidirectional + Sequence is a refinement of Forward + Sequence. Random + Access Sequence is a refinement of Bidirectional + Sequence. These concepts pertain to sequence traversal. +

+

+ + Associativity +

+

+ The Associative + Sequence concept is orthogonal to traversal. An Associative Sequence + allows efficient retrieval of elements based on keys. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/concepts/associative_sequence.html b/doc/html/fusion/sequences/concepts/associative_sequence.html new file mode 100644 index 00000000..90c5b78f --- /dev/null +++ b/doc/html/fusion/sequences/concepts/associative_sequence.html @@ -0,0 +1,328 @@ + + + +Associative + Sequence + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ An Associative Sequence allows efficient retrieval of elements based on + keys. Like associative sequences in MPL, + and unlike associative containers in STL, + Fusion associative sequences have no implied ordering relation. Instead, + type identity is used to impose an equivalence relation on keys, and the + order in which sequence elements are traversed during iteration is left + unspecified. In addition, unlike STL, + Associative Sequences have mutable iterators. This is due to the fact that + there is no associated ordering relation and the runtime value of the keys + themselves do not have any effect on the associativity of the sequence. +

+
+

Notation

+
+
s
+

+ An Associative Sequence +

+
S
+

+ An Associative Sequence type +

+
K
+

+ An arbitrary key type +

+
o
+

+ An arbitrary object +

+
e
+

+ A Sequence element +

+
+
+
+ + Valid + Expressions +
+

+ For any Associative Sequence the following expressions must be valid: +

+
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Return type +

+
+

+ Type Requirements +

+
+

+ Runtime Complexity +

+
+

+ has_key<K>(s) +

+
+

+ MPL + Boolean Constant. Convertible to bool. +

+
+

+

+
+

+ Constant +

+
+

+ at_key<K>(s) +

+
+

+ Any type +

+
+

+

+
+

+ Constant +

+
+

+ at_key<K>(s) + = o +

+
+

+ Any type +

+
+

+ s is mutable and + e = + o, where e is the first element in the + sequence, is a valid expression. +

+
+

+ Constant +

+
+
+ + Result + Type Expressions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Compile Time Complexity +

+
+

+ result_of::has_key<S, + K>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::at_key<S, + K>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::value_at_key<S, + K>::type +

+
+

+ Amortized constant time +

+
+ +
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ has_key<K>(s) +

+
+

+ A boolean Integral Constant c + such that c::value == + true if and only if there + is one or more elements with the key k + in s; see has_key. +

+
+

+ at_key<K>(s) +

+
+

+ The element associated with the key K + in the sequence s; + see at. +

+
+
+ + Models +
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/concepts/bidirectional_sequence.html b/doc/html/fusion/sequences/concepts/bidirectional_sequence.html new file mode 100644 index 00000000..ec2bcca6 --- /dev/null +++ b/doc/html/fusion/sequences/concepts/bidirectional_sequence.html @@ -0,0 +1,344 @@ + + + +Bidirectional + Sequence + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A Bidirectional Sequence is a Forward + Sequence whose iterators model Bidirectional + Iterator. +

+
+ + Refinement + of +
+

+ Forward Sequence +

+
+

Notation

+
+
s
+

+ A Forward Sequence +

+
S
+

+ A Forward Sequence type +

+
o
+

+ An arbitrary object +

+
e
+

+ A Sequence element +

+
+
+
+ + Valid + Expressions +
+

+ In addition to the requirements defined in Forward + Sequence, for any Bidirectional Sequence the following must be met: +

+
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Return type +

+
+

+ Type Requirements +

+
+

+ Runtime Complexity +

+
+

+ begin(s) +

+
+

+ Bidirectional + Iterator +

+
+

+

+
+

+ Constant +

+
+

+ end(s) +

+
+

+ Bidirectional + Iterator +

+
+

+

+
+

+ Constant +

+
+

+ back(s) +

+
+

+ Any type +

+
+

+

+
+

+ Constant +

+
+

+ back(s) + = o +

+
+

+ Any type +

+
+

+ s is mutable and + e = + o, where e is the first element in the + sequence, is a valid expression. +

+
+

+ Constant +

+
+
+ + Result + Type Expressions +
+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Compile Time Complexity +

+
+

+ result_of::begin<S>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::end<S>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::back<S>::type +

+
+

+ Amortized constant time +

+
+
+ + Expression + Semantics +
+

+ The semantics of an expression are defined only where they differ from, + or are not defined in Forward + Sequence. +

+
++++ + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ back(s) +

+
+

+ The last element in the sequence; see back. +

+
+
+ + Models +
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/concepts/forward_sequence.html b/doc/html/fusion/sequences/concepts/forward_sequence.html new file mode 100644 index 00000000..6c6f1912 --- /dev/null +++ b/doc/html/fusion/sequences/concepts/forward_sequence.html @@ -0,0 +1,471 @@ + + + +Forward + Sequence + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A Forward Sequence is a Sequence whose elements are arranged in a definite + order. The ordering is guaranteed not to change from iteration to iteration. + The requirement of a definite ordering allows the definition of element-by-element + equality (if the container's element type is Equality Comparable) and of + lexicographical ordering (if the container's element type is LessThan Comparable). +

+
+

Notation

+
+
s
+

+ A Forward Sequence +

+
S
+

+ A Forward Sequence type +

+
o
+

+ An arbitrary object +

+
e
+

+ A Sequence element +

+
+
+
+ + Valid + Expressions +
+

+ For any Forward Sequence the following expressions must be valid: +

+
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Return type +

+
+

+ Type Requirements +

+
+

+ Runtime Complexity +

+
+

+ begin(s) +

+
+

+ Forward + Iterator +

+
+

+

+
+

+ Constant +

+
+

+ end(s) +

+
+

+ Forward + Iterator +

+
+

+

+
+

+ Constant +

+
+

+ size(s) +

+
+

+ MPL + Integral Constant. Convertible to int. +

+
+

+

+
+

+ Constant +

+
+

+ empty(s) +

+
+

+ MPL + Boolean Constant. Convertible to bool. +

+
+

+

+
+

+ Constant +

+
+

+ front(s) +

+
+

+ Any type +

+
+

+

+
+

+ Constant +

+
+

+ front(s) + = o +

+
+

+ Any type +

+
+

+ s is mutable and + e = + o, where e is the first element in the + sequence, is a valid expression. +

+
+

+ Constant +

+
+
+ + Result + Type Expressions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Compile Time Complexity +

+
+

+ result_of::begin<S>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::end<S>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::size<S>::type +

+
+

+ Unspecified +

+
+

+ result_of::empty<S>::type +

+
+

+ Constant time +

+
+

+ result_of::front<S>::type +

+
+

+ Amortized constant time +

+
+
+ + Expression + Semantics +
+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ begin(s) +

+
+

+ An iterator to the first element of the sequence; see begin. +

+
+

+ end(s) +

+
+

+ A past-the-end iterator to the sequence; see end. +

+
+

+ size(s) +

+
+

+ The size of the sequence; see size. +

+
+

+ empty(s) +

+
+

+ A boolean Integral Constant c + such that c::value == + true if and only if the + sequence is empty; see empty. +

+
+

+ front(s) +

+
+

+ The first element in the sequence; see front. +

+
+
+ + Invariants +
+

+ For any Forward Sequence s the following invariants always hold: +

+
    +
  • +[begin(s), end(s)) is always a valid range. +
  • +
  • + An Algorithm that iterates through + the range [begin(s), end(s)) will pass through every element of + s exactly once. +
  • +
  • +begin(s) + is identical to end(s)) + if and only if s is empty. +
  • +
  • + Two different iterations through s + will access its elements in the same order. +
  • +
+
+ + Models +
+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/concepts/random_access_sequence.html b/doc/html/fusion/sequences/concepts/random_access_sequence.html new file mode 100644 index 00000000..284cdab5 --- /dev/null +++ b/doc/html/fusion/sequences/concepts/random_access_sequence.html @@ -0,0 +1,373 @@ + + + +Random + Access Sequence + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ A Random Access Sequence is a Bidirectional + Sequence whose iterators model Random + Access Iterator. It guarantees constant time access to arbitrary + sequence elements. +

+
+ + Refinement + of +
+

+ Bidirectional + Sequence +

+
+

Notation

+
+
s
+

+ A Random Access Sequence +

+
S
+

+ A Random Access Sequence type +

+
N
+

+ An MPL + Integral Constant +

+
o
+

+ An arbitrary object +

+
e
+

+ A Sequence element +

+
+
+
+ + Valid + Expressions +
+

+ In addition to the requirements defined in Bidirectional + Sequence, for any Random Access Sequence the following must be met: +

+
++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Return type +

+
+

+ Type Requirements +

+
+

+ Runtime Complexity +

+
+

+ begin(s) +

+
+

+ Random + Access Iterator +

+
+

+

+
+

+ Constant +

+
+

+ end(s) +

+
+

+ Random + Access Iterator +

+
+

+

+
+

+ Constant +

+
+

+ at<N>(s) +

+
+

+ Any type +

+
+

+

+
+

+ Constant +

+
+

+ at<N>(s) + = o +

+
+

+ Any type +

+
+

+ s is mutable and + e = + o, where e is the first element in the + sequence, is a valid expression. +

+
+

+ Constant +

+
+
+ + Result + Type Expressions +
+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Compile Time Complexity +

+
+

+ result_of::begin<S>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::end<S>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::at<S, + N>::type +

+
+

+ Amortized constant time +

+
+

+ result_of::value_at<S, + N>::type +

+
+

+ Amortized constant time +

+
+ +
+ + Expression + Semantics +
+

+ The semantics of an expression are defined only where they differ from, + or are not defined in Bidirectional + Sequence. +

+
++++ + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ at<N>(s) +

+
+

+ The Nth element from the beginning of the sequence; see at. +

+
+
+ + Models +
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/containers.html b/doc/html/fusion/sequences/containers.html new file mode 100644 index 00000000..3aaeab63 --- /dev/null +++ b/doc/html/fusion/sequences/containers.html @@ -0,0 +1,59 @@ + + + +Containers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Fusion provides a few predefined sequences out of the box. These containers + actually hold heterogenously typed data; unlike Views. + These containers are more or less counterparts of those in STL. +

+

+ + Header +

+
+#include <boost/fusion/sequence/container.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/containers/cons.html b/doc/html/fusion/sequences/containers/cons.html new file mode 100644 index 00000000..2cfb5359 --- /dev/null +++ b/doc/html/fusion/sequences/containers/cons.html @@ -0,0 +1,321 @@ + + + +cons + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ cons is a simple Forward Sequence. + It is a lisp style recursive list structure where car + is the head and cdr + is the tail: usually another cons structure or nil: the empty list. Fusion's list is built on top of this more + primitive data structure. It is more efficient than vector when the target sequence + is constructed piecemeal (a data at a time). The runtime cost of access + to each element is peculiarly constant (see Recursive + Inlined Functions). +

+
+ + Header +
+
+#include <boost/fusion/sequence/container/list/cons.hpp>
+
+
+ + Synopsis +
+
+template <typename Car, typename Cdr = nil>
+struct cons;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Car +

+
+

+ Head type +

+
+

+

+
+

+ Cdr +

+
+

+ Tail type +

+
+

+ nil +

+
+
+ + Model of +
+ +
+

Notation

+
+
nil
+

+ An empty cons +

+
C
+

+ A cons type +

+
l, + l2
+

+ Instances of cons +

+
car
+

+ An arbitrary data +

+
cdr
+

+ Another cons list +

+
s
+

+ A Forward + Sequence +

+
N
+

+ An MPL + Integral Constant +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Forward + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ nil() +

+
+

+ Creates an empty list. +

+
+

+ C() +

+
+

+ Creates a cons with default constructed elements. +

+
+

+ C(car) +

+
+

+ Creates a cons with car + head and default constructed tail. +

+
+

+ C(car, + cdr) +

+
+

+ Creates a cons with car + head and cdr tail. +

+
+

+ C(s) +

+
+

+ Copy constructs a cons from a Forward + Sequence, s. +

+
+

+ l = + s +

+
+

+ Assigns to a cons, l, + from a Forward + Sequence, s. +

+
+

+ at<N>(l) +

+
+

+ The Nth element from the beginning of the sequence; see at. +

+
+ +
+ + Example +
+
+cons<int, cons<float> > l(12, cons<float>(5.5f));
+std::cout << at_c<0>(l) << std::endl;
+std::cout << at_c<1>(l) << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/containers/list.html b/doc/html/fusion/sequences/containers/list.html new file mode 100644 index 00000000..53979305 --- /dev/null +++ b/doc/html/fusion/sequences/containers/list.html @@ -0,0 +1,289 @@ + + + +list + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ list is a Forward + Sequence of heterogenous typed data built on top of cons. It is more efficient than + vector + when the target sequence is constructed piecemeal (a data at a time). The + runtime cost of access to each element is peculiarly constant (see Recursive Inlined Functions). +

+
+ + Header +
+
+#include <boost/fusion/sequence/container/list.hpp>
+#include <boost/fusion/sequence/container/list/list_forward.hpp>
+
+
+ + Synopsis +
+
+template <
+    typename T0 = unspecified
+  , typename T1 = unspecified
+  , typename T2 = unspecified
+    ...
+  , typename TN = unspecified
+>
+struct list;
+
+

+ The variadic class interface accepts 0 + to FUSION_MAX_LIST_SIZE + elements, where FUSION_MAX_LIST_SIZE + is a user definable predefined maximum that defaults to 10. + Example: +

+
+list<int, char, double>
+
+

+ You may define the preprocessor constant FUSION_MAX_LIST_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_LIST_SIZE 20
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ T0...TN +

+
+

+ Element types +

+
+

+ unspecified-type +

+
+
+ + Model of +
+ +
+

Notation

+
+
L
+

+ A list type +

+
l
+

+ An instance of list +

+
e0...en
+

+ Heterogeneous values +

+
s
+

+ A Forward + Sequence +

+
N
+

+ An MPL + Integral Constant +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Forward + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ L() +

+
+

+ Creates a list with default constructed elements. +

+
+

+ L(e0, + e1,... + en) +

+
+

+ Creates a list with elements e0...en. +

+
+

+ L(s) +

+
+

+ Copy constructs a list from a Forward + Sequence, s. +

+
+

+ l = + s +

+
+

+ Assigns to a list, l, + from a Forward + Sequence, s. +

+
+

+ at<N>(l) +

+
+

+ The Nth element from the beginning of the sequence; see at. +

+
+ +
+ + Example +
+
+list<int, float> l(12, 5.5f);
+std::cout << at_c<0>(l) << std::endl;
+std::cout << at_c<1>(l) << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/containers/map.html b/doc/html/fusion/sequences/containers/map.html new file mode 100644 index 00000000..aa008e09 --- /dev/null +++ b/doc/html/fusion/sequences/containers/map.html @@ -0,0 +1,278 @@ + + + +map + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+map

+
+ + Description +
+

+ map is an Associative + Sequence of heteregenous typed data elements. Each element is a + key/data pair (see fusion::pair) + where the key has no data (type only). Type identity is used to impose + an equivalence relation on keys. A map may contain at most one element + for each key. Membership testing and element key lookup has constant runtime + complexity (see Overloaded + Functions). +

+
+ + Header +
+
+#include <boost/fusion/sequence/container/map.hpp>
+
+
+ + Synopsis +
+
+template <
+    typename T0 = unspecified
+  , typename T1 = unspecified
+  , typename T2 = unspecified
+    ...
+  , typename TN = unspecified
+>
+struct map;
+
+

+ The variadic class interface accepts 0 + to FUSION_MAX_MAP_SIZE + elements, where FUSION_MAX_MAP_SIZE + is a user definable predefined maximum that defaults to 10. + Example: +

+
+map<pair<int, char>, pair<char, char>, pair<double, char> >
+
+

+ You may define the preprocessor constant FUSION_MAX_MAP_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_MAP_SIZE 20
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ T0...TN +

+
+

+ Element types +

+
+

+ unspecified-type +

+
+
+ + Model of +
+ +
+

Notation

+
+
M
+

+ A map type +

+
m
+

+ An instance of map +

+
e0...en
+

+ Heterogeneous key/value pairs (see fusion::pair) +

+
s
+

+ A Forward + Sequence +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Random + Access Sequence and Associative + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ M() +

+
+

+ Creates a map with default constructed elements. +

+
+

+ M(e0, + e1,... + en) +

+
+

+ Creates a map with element pairs e0...en. +

+
+

+ M(s) +

+
+

+ Copy constructs a map from a Forward + Sequence s. +

+
+

+ m = + s +

+
+

+ Assigns to a map, m, + from a Forward + Sequence s. +

+
+
+ + Example +
+
+typedef map<
+    pair<int, char>
+  , pair<double, std::string> >
+map_type;
+
+map_type m(
+    make_pair<int>('X')
+  , make_pair<double>("Men"));
+
+std::cout << at_key<int>(m) << std::endl;
+std::cout << at_key<double>(m) << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/containers/set.html b/doc/html/fusion/sequences/containers/set.html new file mode 100644 index 00000000..27a4d5a1 --- /dev/null +++ b/doc/html/fusion/sequences/containers/set.html @@ -0,0 +1,270 @@ + + + +set + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+set

+
+ + Description +
+

+ set is an Associative + Sequence of heteregenous typed data elements. Type identity is used + to impose an equivalence relation on keys. The element's type is its key. + A set may contain at most one element for each key. Membership testing + and element key lookup has constant runtime complexity (see Overloaded + Functions). +

+
+ + Header +
+
+#include <boost/fusion/sequence/container/set.hpp>
+
+
+ + Synopsis +
+
+template <
+    typename T0 = unspecified
+  , typename T1 = unspecified
+  , typename T2 = unspecified
+    ...
+  , typename TN = unspecified
+>
+struct set;
+
+

+ The variadic class interface accepts 0 + to FUSION_MAX_SET_SIZE + elements, where FUSION_MAX_SET_SIZE + is a user definable predefined maximum that defaults to 10. + Example: +

+
+set<int, char, double>
+
+

+ You may define the preprocessor constant FUSION_MAX_SET_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_SET_SIZE 20
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ T0...TN +

+
+

+ Element types +

+
+

+ unspecified-type +

+
+
+ + Model of +
+ +
+

Notation

+
+
S
+

+ A set type +

+
s
+

+ An instance of set +

+
e0...en
+

+ Heterogeneous values +

+
fs
+

+ A Forward + Sequence +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Random + Access Sequence and Associative + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ S() +

+
+

+ Creates a set with default constructed elements. +

+
+

+ S(e0, + e1,... + en) +

+
+

+ Creates a set with elements e0...en. +

+
+

+ S(fs) +

+
+

+ Copy constructs a set from a Forward + Sequence fs. +

+
+

+ s = + fs +

+
+

+ Assigns to a set, s, + from a Forward + Sequence fs. +

+
+
+ + Example +
+
+typedef set<int, float> S;
+S s(12, 5.5f);
+std::cout << at_key<int>(s) << std::endl;
+std::cout << at_key<float>(s) << std::endl;
+std::cout << result_of::has_key<S, double>::value << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/containers/vector.html b/doc/html/fusion/sequences/containers/vector.html new file mode 100644 index 00000000..3171d7da --- /dev/null +++ b/doc/html/fusion/sequences/containers/vector.html @@ -0,0 +1,300 @@ + + + +vector + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ vector is a Random + Access Sequence of heterogenous typed data structured as a simple + struct where each element + is held as a member variable. vector + is the simplest of the Fusion sequence container, and in many cases the + most efficient. +

+
+ + Header +
+
+#include <boost/fusion/sequence/container/vector.hpp>
+#include <boost/fusion/sequence/container/vector/vector_fwd.hpp>
+
+// numbered forms
+#include <boost/fusion/sequence/container/vector/vector10.hpp>
+#include <boost/fusion/sequence/container/vector/vector20.hpp>
+#include <boost/fusion/sequence/container/vector/vector30.hpp>
+#include <boost/fusion/sequence/container/vector/vector40.hpp>
+#include <boost/fusion/sequence/container/vector/vector50.hpp>
+
+
+ + Synopsis +
+

+ Numbered forms +

+
+template <>
+struct vector0;
+
+template <typename T0>
+struct vector1;
+
+template <typename T0, typename T1>
+struct vector2;
+
+template <typename T0, typename T1, typename T2>
+struct vector3;
+
+...
+
+template <typename T0, typename T1, typename T2..., typename TN>
+struct vectorN;
+
+

+ Variadic form +

+
+template <
+    typename T0 = unspecified
+  , typename T1 = unspecified
+  , typename T2 = unspecified
+    ...
+  , typename TN = unspecified
+>
+struct vector;
+
+

+ The numbered form accepts the exact number of elements. Example: +

+
+vector3<int, char, double>
+
+

+ The variadic form accepts 0 + to FUSION_MAX_VECTOR_SIZE + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. + Example: +

+
+vector<int, char, double>
+
+

+ You may define the preprocessor constant FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ T0...TN +

+
+

+ Element types +

+
+

+ unspecified +

+
+
+ + Model of +
+ +
+

Notation

+
+
v
+

+ Instance of vector +

+
V
+

+ A vector type +

+
e0...en
+

+ Heterogeneous values +

+
s
+

+ A Forward + Sequence +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Random + Access Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ V() +

+
+

+ Creates a vector with default constructed elements. +

+
+

+ V(e0, + e1,... + en) +

+
+

+ Creates a vector with elements e0...en. +

+
+

+ V(s) +

+
+

+ Copy constructs a vector from a Forward + Sequence, s. +

+
+

+ v = + s +

+
+

+ Assigns to a vector, v, + from a Forward + Sequence, s. +

+
+
+ + Example +
+
+vector<int, float> v(12, 5.5f);
+std::cout << at_c<0>(v) << std::endl;
+std::cout << at_c<1>(v) << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion.html b/doc/html/fusion/sequences/conversion.html new file mode 100644 index 00000000..16a57f79 --- /dev/null +++ b/doc/html/fusion/sequences/conversion.html @@ -0,0 +1,54 @@ + + + +Conversion + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ All fusion sequences can be converted to one of the Containers + types using one of these conversion functions. +

+

+ + Header +

+
+#include <boost/fusion/sequence/conversion.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/functions.html b/doc/html/fusion/sequences/conversion/functions.html new file mode 100644 index 00000000..9f4b7851 --- /dev/null +++ b/doc/html/fusion/sequences/conversion/functions.html @@ -0,0 +1,45 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/functions/as_list.html b/doc/html/fusion/sequences/conversion/functions/as_list.html new file mode 100644 index 00000000..5f215095 --- /dev/null +++ b/doc/html/fusion/sequences/conversion/functions/as_list.html @@ -0,0 +1,133 @@ + + + +as_list + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Convert a fusion sequence to a list. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::as_list<Sequence>::type
+as_list(Sequence& seq);
+
+template <typename Sequence>
+typename result_of::as_list<Sequence const>::type
+as_list(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ An instance of Sequence +

+
+

+ The sequence to convert. +

+
+
+ + Expression + Semantics +
+
+as_list(seq);
+
+

+ Return type: result_of::as_list<Sequence>::type +

+

+ Semantics: Convert a fusion sequence, + seq, to a list. +

+
+ + Header +
+
+#include <boost/fusion/sequence/conversion/as_list.hpp>
+
+
+ + Example +
+
+as_list(make_vector('x', 123, "hello"))
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/functions/as_map.html b/doc/html/fusion/sequences/conversion/functions/as_map.html new file mode 100644 index 00000000..01786405 --- /dev/null +++ b/doc/html/fusion/sequences/conversion/functions/as_map.html @@ -0,0 +1,140 @@ + + + +as_map + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Convert a fusion sequence to a map. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::as_map<Sequence>::type
+as_map(Sequence& seq);
+
+template <typename Sequence>
+typename result_of::as_map<Sequence const>::type
+as_map(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ An instance of Sequence +

+
+

+ The sequence to convert. +

+
+
+ + Expression + Semantics +
+
+as_map(seq);
+
+

+ Return type: result_of::as_map<Sequence>::type +

+

+ Semantics: Convert a fusion sequence, + seq, to a map. +

+

+ Precondition: The elements of the sequence + are assumed to be __fusionpair_s. + There may be no duplicate fusion::pair key types. +

+
+ + Header +
+
+#include <boost/fusion/sequence/conversion/as_map.hpp>
+
+
+ + Example +
+
+as_map(make_vector(
+    make_pair<int>('X')
+  , make_pair<double>("Men")))
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/functions/as_set.html b/doc/html/fusion/sequences/conversion/functions/as_set.html new file mode 100644 index 00000000..1c86ca46 --- /dev/null +++ b/doc/html/fusion/sequences/conversion/functions/as_set.html @@ -0,0 +1,137 @@ + + + +as_set + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Convert a fusion sequence to a set. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::as_set<Sequence>::type
+as_set(Sequence& seq);
+
+template <typename Sequence>
+typename result_of::as_set<Sequence const>::type
+as_set(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ An instance of Sequence +

+
+

+ The sequence to convert. +

+
+
+ + Expression + Semantics +
+
+as_set(seq);
+
+

+ Return type: result_of::as_set<Sequence>::type +

+

+ Semantics: Convert a fusion sequence, + seq, to a set. +

+

+ Precondition: There may be no duplicate + key types. +

+
+ + Header +
+
+#include <boost/fusion/sequence/conversion/as_set.hpp>
+
+
+ + Example +
+
+as_set(make_vector('x', 123, "hello"))
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/functions/as_vector.html b/doc/html/fusion/sequences/conversion/functions/as_vector.html new file mode 100644 index 00000000..56a15e55 --- /dev/null +++ b/doc/html/fusion/sequences/conversion/functions/as_vector.html @@ -0,0 +1,133 @@ + + + +as_vector + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Convert a fusion sequence to a vector. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::as_vector<Sequence>::type
+as_vector(Sequence& seq);
+
+template <typename Sequence>
+typename result_of::as_vector<Sequence const>::type
+as_vector(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ An instance of Sequence +

+
+

+ The sequence to convert. +

+
+
+ + Expression + Semantics +
+
+as_vector(seq);
+
+

+ Return type: result_of::as_vector<Sequence>::type +

+

+ Semantics: Convert a fusion sequence, + seq, to a vector. +

+
+ + Header +
+
+#include <boost/fusion/sequence/conversion/as_vector.hpp>
+
+
+ + Example +
+
+as_vector(make_list('x', 123, "hello"))
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/metafunctions.html b/doc/html/fusion/sequences/conversion/metafunctions.html new file mode 100644 index 00000000..52c1c0ae --- /dev/null +++ b/doc/html/fusion/sequences/conversion/metafunctions.html @@ -0,0 +1,45 @@ + + + +Metafunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/metafunctions/as_list.html b/doc/html/fusion/sequences/conversion/metafunctions/as_list.html new file mode 100644 index 00000000..b3f42288 --- /dev/null +++ b/doc/html/fusion/sequences/conversion/metafunctions/as_list.html @@ -0,0 +1,129 @@ + + + +as_list + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of as_list. +

+
+ + Synopsis +
+
+template <typename Sequence>
+struct as_list;
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A fusion Sequence +

+
+

+ The sequence type to convert. +

+
+
+ + Expression + Semantics +
+
+result_of::as_list<Sequence>::type;
+
+

+ Return type: A list with same elements as the + input sequence, Sequence. +

+

+ Semantics: Convert a fusion sequence, + Sequence, to a list. +

+
+ + Header +
+
+#include <boost/fusion/sequence/conversion/as_list.hpp>
+
+
+ + Example +
+
+result_of::as_list<vector<char, int> >::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/metafunctions/as_map.html b/doc/html/fusion/sequences/conversion/metafunctions/as_map.html new file mode 100644 index 00000000..9d98539e --- /dev/null +++ b/doc/html/fusion/sequences/conversion/metafunctions/as_map.html @@ -0,0 +1,136 @@ + + + +as_map + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of as_map. +

+
+ + Synopsis +
+
+template <typename Sequence>
+struct as_map;
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A fusion Sequence +

+
+

+ The sequence to convert. +

+
+
+ + Expression + Semantics +
+
+result_of::as_map<Sequence>::type;
+
+

+ Return type: A map with same elements as the + input sequence, Sequence. +

+

+ Semantics: Convert a fusion sequence, + Sequence, to a map. +

+

+ Precondition: The elements of the sequence + are assumed to be __fusionpair_s. + There may be no duplicate fusion::pair key types. +

+
+ + Header +
+
+#include <boost/fusion/sequence/conversion/as_map.hpp>
+
+
+ + Example +
+
+result_of::as_map<vector<
+    fusion::pair<int, char>
+  , fusion::pair<double, std::string> > >::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/metafunctions/as_set.html b/doc/html/fusion/sequences/conversion/metafunctions/as_set.html new file mode 100644 index 00000000..eb0bc404 --- /dev/null +++ b/doc/html/fusion/sequences/conversion/metafunctions/as_set.html @@ -0,0 +1,133 @@ + + + +as_set + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of as_set. +

+
+ + Synopsis +
+
+template <typename Sequence>
+struct as_set;
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A fusion Sequence +

+
+

+ The sequence to convert. +

+
+
+ + Expression + Semantics +
+
+result_of::as_set<Sequence>::type;
+
+

+ Return type: A set with same elements as the + input sequence, Sequence. +

+

+ Semantics: Convert a fusion sequence, + Sequence, to a set. +

+

+ Precondition: There may be no duplicate + key types. +

+
+ + Header +
+
+#include <boost/fusion/sequence/conversion/as_set.hpp>
+
+
+ + Example +
+
+result_of::as_set<vector<char, int> >::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/conversion/metafunctions/as_vector.html b/doc/html/fusion/sequences/conversion/metafunctions/as_vector.html new file mode 100644 index 00000000..289e9464 --- /dev/null +++ b/doc/html/fusion/sequences/conversion/metafunctions/as_vector.html @@ -0,0 +1,129 @@ + + + +as_vector + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of as_vector. +

+
+ + Synopsis +
+
+template <typename Sequence>
+struct as_vector;
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Sequence +

+
+

+ A fusion Sequence +

+
+

+ The sequence to convert. +

+
+
+ + Expression + Semantics +
+
+result_of::as_vector<Sequence>::type;
+
+

+ Return type: A vector with same elements as + the input sequence, Sequence. +

+

+ Semantics: Convert a fusion sequence, + Sequence, to a vector. +

+
+ + Header +
+
+#include <boost/fusion/sequence/conversion/as_vector.hpp>
+
+
+ + Example +
+
+result_of::as_vector<list<char, int> >::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation.html b/doc/html/fusion/sequences/generation.html new file mode 100644 index 00000000..78b17c4f --- /dev/null +++ b/doc/html/fusion/sequences/generation.html @@ -0,0 +1,53 @@ + + + +Generation + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ These are the functions that you can use to generate various forms of Containers from elemental values. +

+

+ + Header +

+
+#include <boost/fusion/sequence/generation.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions.html b/doc/html/fusion/sequences/generation/functions.html new file mode 100644 index 00000000..e9bb2325 --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions.html @@ -0,0 +1,50 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/list_tie.html b/doc/html/fusion/sequences/generation/functions/list_tie.html new file mode 100644 index 00000000..11fdf647 --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/list_tie.html @@ -0,0 +1,144 @@ + + + +list_tie + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Constructs a tie using a list sequence. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+list<T0&, T1&,... TN&>
+list_tie(T0& x0, T1& x1... TN& xN);
+
+

+ The variadic function accepts 0 + to FUSION_MAX_LIST_SIZE + elements, where FUSION_MAX_LIST_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_LIST_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_LIST_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ x0, + x1,... + xN +

+
+

+ Instances of T0, T1,... TN +

+
+

+ The arguments to list_tie +

+
+
+ + Expression + Semantics +
+
+list_tie(x0, x1,... xN);
+
+

+ Return type: list<T0&, T1&,... + TN&> +

+

+ Semantics: Create a list of references from x0, x1,... xN. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/list_tie.hpp>
+
+
+ + Example +
+
+int i = 123;
+double d = 123.456;
+list_tie(i, d)
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/make_cons.html b/doc/html/fusion/sequences/generation/functions/make_cons.html new file mode 100644 index 00000000..e537943c --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/make_cons.html @@ -0,0 +1,163 @@ + + + +make_cons + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Create a cons from car + (head) and optional cdr + (tail). +

+
+ + Synopsis +
+
+template <typename Car>
+typename result_of::make_cons<Car>::type
+make_cons(Car const& car);
+
+template <typename Car, typename Cdr>
+typename result_of::make_cons<Car, Cdr>::type
+make_cons(Car const& car, Cdr const& cdr);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ car +

+
+

+ Instance of Car +

+
+

+ The list's head +

+
+

+ cdr +

+
+

+ Instance of Cdr +

+
+

+ The list's tail (optional) +

+
+
+ + Expression + Semantics +
+
+make_cons(car, cdr);
+
+

+ Return type: result_of::make_cons<Car, Cdr>::type or result_of::make_cons<Car>::type +

+

+ Semantics: Create a cons from car + (head) and optional cdr + (tail). +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_cons.hpp>
+
+
+ + Example +
+
+make_cons('x', make_cons(123))
+
+
+ + See + also +
+

+ boost::ref +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/make_list.html b/doc/html/fusion/sequences/generation/functions/make_list.html new file mode 100644 index 00000000..af4a360d --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/make_list.html @@ -0,0 +1,149 @@ + + + +make_list + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Create a list from one or more values. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+typename result_of::make_list<T0, T1,... TN>::type
+make_list(T0 const& x0, T1 const& x1... TN const& xN);
+
+

+ The variadic function accepts 0 + to FUSION_MAX_LIST_SIZE + elements, where FUSION_MAX_LIST_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_LIST_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_LIST_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ x0, + x1,... + xN +

+
+

+ Instances of T0, T1,... TN +

+
+

+ The arguments to make_list +

+
+
+ + Expression + Semantics +
+
+make_list(x0, x1,... xN);
+
+

+ Return type: result_of::make_list<T0, T1,... TN>::type +

+

+ Semantics: Create a list from x0, x1,... xN. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_list.hpp>
+
+
+ + Example +
+
+make_list(123, "hello", 12.5)
+
+
+ + See + also +
+

+ boost::ref +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/make_map.html b/doc/html/fusion/sequences/generation/functions/make_map.html new file mode 100644 index 00000000..455a52e3 --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/make_map.html @@ -0,0 +1,191 @@ + + + +make_map + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Create a map from one or more key/data + pairs. +

+
+ + Synopsis +
+
+template <
+    typename K0, typename K1,... typename KN
+  , typename T0, typename T1,... typename TN>
+typename result_of::make_map<K0, K0,... KN, T0, T1,... TN>::type
+make_map(T0 const& x0, T1 const& x1... TN const& xN);
+
+

+ The variadic function accepts 0 + to FUSION_MAX_VECTOR_SIZE + [10] + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ K0, + K1,... + KN +

+
+

+ The key types +

+
+

+ Keys associated with x0, x1,... xN +

+
+

+ x0, + x1,... + xN +

+
+

+ Instances of T0, T1,... TN +

+
+

+ The arguments to make_map +

+
+
+ + Expression + Semantics +
+
+make_map<K0, K1,... KN>(x0, x1,... xN);
+
+

+ Return type: result_of::make_map<K0, K0,... KN, T0, T1,... TN>::type +

+

+ Semantics: Create a map from K0, K1,... KN + keys and x0, + x1,... + xN data. +

+

+ Precondition: There may be no duplicate + key types. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_map.hpp>
+
+
+ + Example +
+
+make_map(
+    make_pair<int>('X')
+  , make_pair<double>("Men"))
+
+
+ + See + also +
+

+ boost::ref, + fusion::pair +

+
+

+

[10] + map is implemented + in terms of the vector. That is why we reuse FUSION_MAX_VECTOR_SIZE +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/make_set.html b/doc/html/fusion/sequences/generation/functions/make_set.html new file mode 100644 index 00000000..9651d660 --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/make_set.html @@ -0,0 +1,161 @@ + + + +make_set + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Create a set from one or more values. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+typename result_of::make_set<T0, T1,... TN>::type
+make_set(T0 const& x0, T1 const& x1... TN const& xN);
+
+

+ The variadic function accepts 0 + to FUSION_MAX_VECTOR_SIZE + [9] + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ x0, + x1,... + xN +

+
+

+ Instances of T0, T1,... TN +

+
+

+ The arguments to make_set +

+
+
+ + Expression + Semantics +
+
+make_set(x0, x1,... xN);
+
+

+ Return type: result_of::make_set<T0, T1,... TN>::type +

+

+ Semantics: Create a set from x0, x1,... xN. +

+

+ Precondition: There may be no duplicate + key types. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_set.hpp>
+
+
+ + Example +
+
+make_set(123, "hello", 12.5)
+
+
+ + See + also +
+

+ boost::ref +

+
+

+

[9] + set is implemented + in terms of the vector. That is why we reuse FUSION_MAX_VECTOR_SIZE +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/make_vector.html b/doc/html/fusion/sequences/generation/functions/make_vector.html new file mode 100644 index 00000000..5e749791 --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/make_vector.html @@ -0,0 +1,149 @@ + + + +make_vector + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Create a vector from one or more values. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+typename result_of::make_vector<T0, T1,... TN>::type
+make_vector(T0 const& x0, T1 const& x1... TN const& xN);
+
+

+ The variadic function accepts 0 + to FUSION_MAX_VECTOR_SIZE + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ x0, + x1,... + xN +

+
+

+ Instances of T0, T1,... TN +

+
+

+ The arguments to make_vector +

+
+
+ + Expression + Semantics +
+
+make_vector(x0, x1,... xN);
+
+

+ Return type: result_of::make_vector<T0, T1,... TN>::type +

+

+ Semantics: Create a vector from x0, x1,... xN. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_vector.hpp>
+
+
+ + Example +
+
+make_vector(123, "hello", 12.5)
+
+
+ + See + also +
+

+ boost::ref +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/map_tie.html b/doc/html/fusion/sequences/generation/functions/map_tie.html new file mode 100644 index 00000000..1560fb6a --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/map_tie.html @@ -0,0 +1,170 @@ + + + +map_tie + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Constructs a tie using a map sequence. +

+
+ + Synopsis +
+
+template <typename K0, typename K1,... typename KN, typename D0, typename D1,... typename DN>
+map<pair<K0, D0&>, pair<K1, D1&>,... pair<KN, DN&> >
+map_tie(D0& d0, D1& d1... DN& dN);
+
+

+ The variadic function accepts 0 + to FUSION_MAX_MAP_SIZE + elements, where FUSION_MAX_MAP_SIZE + is a user definable predefined maximum that defaults to 10, and a corresponding number of key types. + You may define the preprocessor constant FUSION_MAX_MAP_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_MAP_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ K0, + K1,... + KN +

+
+

+ Any type +

+
+

+ The key types associated with each of the x1,x2,...,xN + values +

+
+

+ x0, + x1,... + xN +

+
+

+ Instances of T0, T1,... TN +

+
+

+ The arguments to map_tie +

+
+
+ + Expression + Semantics +
+
+map_tie<K0, K1,... KN>(x0, x1,... xN);
+
+

+ Return type: map<pair<K0, D0&>, pair<K1, + D1&>,... pair<KN, + DN&> > +

+

+ Semantics: Create a map of references from x0, x1,... xN with keys K0, K1,... KN +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/map_tie.hpp>
+
+
+ + Example +
+
+struct int_key;
+struct double_key;
+...
+int i = 123;
+double d = 123.456;
+map_tie<int_key, double_key>(i, d)
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/tiers.html b/doc/html/fusion/sequences/generation/functions/tiers.html new file mode 100644 index 00000000..26fe3901 --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/tiers.html @@ -0,0 +1,101 @@ + + + +Tiers + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Tiers are sequences, where all elements are non-const reference types. + They are constructed with a call to a couple of tie + function templates. The succeeding sections document the various tier + flavors. +

+ +

+ Example: +

+
+int i; char c; double d;
+  ...
+vector_tie(i, c, a);
+
+

+ The vector_tie function creates + a vector + of type vector<int&, char&, double&>. + The same result could be achieved with the call make_vector(ref(i), ref(c), ref(a)) + [11] + . +

+

+ A tie can be used to 'unpack' another tuple into + variables. E.g.: +

+
+int i; char c; double d;
+vector_tie(i, c, d) = make_vector(1,'a', 5.5);
+std::cout << i << " " <<  c << " " << d;
+
+

+ This code prints 1 a 5.5 to the standard output stream. A sequence unpacking + operation like this is found for example in ML and Python. It is convenient + when calling functions which return sequences. +

+
+ + Ignore +
+

+ There is also an object called ignore which allows + you to ignore an element assigned by a sequence. The idea is that a function + may return a sequence, only part of which you are interested in. For + example: +

+
+char c;
+vector_tie(ignore, c) = make_vector(1, 'a');
+
+
+

+

[11] + see Boost.Ref + for details about ref +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/functions/vector_tie.html b/doc/html/fusion/sequences/generation/functions/vector_tie.html new file mode 100644 index 00000000..f355a583 --- /dev/null +++ b/doc/html/fusion/sequences/generation/functions/vector_tie.html @@ -0,0 +1,144 @@ + + + +vector_tie + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Constructs a tie using a vector sequence. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+vector<T0&, T1&,... TN&>
+vector_tie(T0& x0, T1& x1... TN& xN);
+
+

+ The variadic function accepts 0 + to FUSION_MAX_VECTOR_SIZE + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ x0, + x1,... + xN +

+
+

+ Instances of T0, T1,... TN +

+
+

+ The arguments to vector_tie +

+
+
+ + Expression + Semantics +
+
+vector_tie(x0, x1,... xN);
+
+

+ Return type: vector<T0&, T1&,... + TN&> +

+

+ Semantics: Create a vector of references from x0, x1,... xN. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/vector_tie.hpp>
+
+
+ + Example +
+
+int i = 123;
+double d = 123.456;
+vector_tie(i, d)
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions.html b/doc/html/fusion/sequences/generation/metafunctions.html new file mode 100644 index 00000000..a1372a3a --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions.html @@ -0,0 +1,49 @@ + + + +MetaFunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions/list_tie.html b/doc/html/fusion/sequences/generation/metafunctions/list_tie.html new file mode 100644 index 00000000..c32664db --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions/list_tie.html @@ -0,0 +1,141 @@ + + + +list_tie + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of list_tie. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+struct list_tie;
+
+

+ The variadic function accepts 0 + to FUSION_MAX_LIST_SIZE + elements, where FUSION_MAX_LIST_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_LIST_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_LIST_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T0, + T1,... + TN +

+
+

+ Any type +

+
+

+ The arguments to list_tie +

+
+
+ + Expression + Semantics +
+
+result_of::list_tie<T0, T1,... TN>::type;
+
+

+ Return type: list<T0&, T1&,... + TN&> +

+

+ Semantics: Create a list of references from T0, T1,... TN. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/list_tie.hpp>
+
+
+ + Example +
+
+result_of::list_tie<int, double>::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions/make_cons.html b/doc/html/fusion/sequences/generation/metafunctions/make_cons.html new file mode 100644 index 00000000..8bfb8183 --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions/make_cons.html @@ -0,0 +1,150 @@ + + + +make_cons + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_cons. +

+
+ + Synopsis +
+
+template <typename Car, typename Cdr = nil>
+struct make_cons;
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Car +

+
+

+ Any type +

+
+

+ The list's head type +

+
+

+ Cdr +

+
+

+ A cons +

+
+

+ The list's tail type (optional) +

+
+
+ + Expression + Semantics +
+
+result_of::make_cons<Car, Cdr>::type
+
+

+ Return type: A cons with head element, Car, of type converted following the + rules for element + conversion, and tail, Cdr. +

+

+ Semantics: Create a cons from Car + (head) and optional Cdr + (tail). +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_cons.hpp>
+
+
+ + Example +
+
+result_of::make_cons<char, result_of::make_cons<int>::type>::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions/make_list.html b/doc/html/fusion/sequences/generation/metafunctions/make_list.html new file mode 100644 index 00000000..c74b05d0 --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions/make_list.html @@ -0,0 +1,142 @@ + + + +make_list + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_list. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+struct make_list;
+
+

+ The variadic function accepts 0 + to FUSION_MAX_LIST_SIZE + elements, where FUSION_MAX_LIST_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_LIST_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_LIST_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T0, + T1,... + TN +

+
+

+ Any type +

+
+

+ Template arguments to make_list +

+
+
+ + Expression + Semantics +
+
+result_of::make_list<T0, T1,... TN>::type
+
+

+ Return type: A list with elements of types + converted following the rules for element + conversion. +

+

+ Semantics: Create a list from T0, T1,... TN. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_list.hpp>
+
+
+ + Example +
+
+result_of::make_list<int, const char(&)[7], double>::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions/make_map.html b/doc/html/fusion/sequences/generation/metafunctions/make_map.html new file mode 100644 index 00000000..a563385b --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions/make_map.html @@ -0,0 +1,185 @@ + + + +make_map + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_map. +

+
+ + Synopsis +
+
+template <
+    typename K0, typename K1,... typename KN
+  , typename T0, typename T1,... typename TN>
+struct make_map;
+
+

+ The variadic function accepts 0 + to FUSION_MAX_VECTOR_SIZE + [13] + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ K0, + K1,... + KN +

+
+

+ Any type +

+
+

+ Keys associated with T0, T1,... TN +

+
+

+ T0, + T1,... + TN +

+
+

+ Any type +

+
+

+ Data associated with keys K0, K1,... KN +

+
+
+ + Expression + Semantics +
+
+resulf_of::make_map<K0, K1,... KN, T0, T1,... TN>::type;
+
+

+ Return type: result_of::make_map<K0, K0,... KN, T0, T1,... TN>::type +

+

+ Semantics: A map with fusion::pair elements where the second_type is converted following + the rules for element + conversion. +

+

+ Precondition: There may be no duplicate + key types. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_map.hpp>
+
+
+ + Example +
+
+result_of::make_map<int, double, char, double>::type
+
+
+ + See + also +
+

+ fusion::pair +

+
+

+

[13] + map is implemented + in terms of the vector. That is why we reuse FUSION_MAX_VECTOR_SIZE +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions/make_set.html b/doc/html/fusion/sequences/generation/metafunctions/make_set.html new file mode 100644 index 00000000..a73414fe --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions/make_set.html @@ -0,0 +1,154 @@ + + + +make_set + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_set. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+struct make_set;
+
+

+ The variadic function accepts 0 + to FUSION_MAX_VECTOR_SIZE + [12] + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T0, + T1,... + TN +

+
+

+ Any type +

+
+

+ The arguments to make_set +

+
+
+ + Expression + Semantics +
+
+result_of::make_set<T0, T1,... TN>::type
+
+

+ Return type: A set with elements of types converted + following the rules for element + conversion. +

+

+ Semantics: Create a set from T0, T1,... TN. +

+

+ Precondition: There may be no duplicate + key types. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_set.hpp>
+
+
+ + Example +
+
+result_of::make_set<int, char, double>::type
+
+
+

+

[12] + set is implemented + in terms of the vector. That is why we reuse FUSION_MAX_VECTOR_SIZE +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions/make_vector.html b/doc/html/fusion/sequences/generation/metafunctions/make_vector.html new file mode 100644 index 00000000..31b4b56f --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions/make_vector.html @@ -0,0 +1,142 @@ + + + +make_vector + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of make_vector. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+struct make_vector;
+
+

+ The variadic function accepts 0 + to FUSION_MAX_VECTOR_SIZE + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T0, + T1,... + TN +

+
+

+ Any type +

+
+

+ Template arguments to make_vector +

+
+
+ + Expression + Semantics +
+
+result_of::make_vector<T0, T1,... TN>::type
+
+

+ Return type: A vector with elements of types + converted following the rules for element + conversion. +

+

+ Semantics: Create a vector from T0, T1,... TN. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/make_list.hpp>
+
+
+ + Example +
+
+result_of::make_vector<int, const char(&)[7], double>::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions/map_tie.html b/doc/html/fusion/sequences/generation/metafunctions/map_tie.html new file mode 100644 index 00000000..d1276f4c --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions/map_tie.html @@ -0,0 +1,166 @@ + + + +map_tie + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of map_tie. +

+
+ + Synopsis +
+
+template <typename K0, typename K1,... typename KN, typename D0, typename D1,... typename DN>
+struct map_tie;
+
+

+ The variadic function accepts 0 + to FUSION_MAX_MAP_SIZE + elements, where FUSION_MAX_MAP_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_MAP_SIZE before + including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_MAP_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ K0, + K1,... + KN +

+
+

+ Any type +

+
+

+ The key types for map_tie +

+
+

+ D0, + D1,... + DN +

+
+

+ Any type +

+
+

+ The arguments types for map_tie +

+
+
+ + Expression + Semantics +
+
+result_of::map_tie<K0, K1,... KN, D0, D1,... DN>::type;
+
+

+ Return type: map<pair<K0, D0&>, pair<K1, + D1&>,... pair<KN, + DN&> > +

+

+ Semantics: Create a map of references from D0, D1,... DN with keys K0, K1,... KN +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/map_tie.hpp>
+
+
+ + Example +
+
+struct int_key;
+struct double_key;
+...
+result_of::map_tie<int_key, double_key, int, double>::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/generation/metafunctions/vector_tie.html b/doc/html/fusion/sequences/generation/metafunctions/vector_tie.html new file mode 100644 index 00000000..2e1fbf21 --- /dev/null +++ b/doc/html/fusion/sequences/generation/metafunctions/vector_tie.html @@ -0,0 +1,141 @@ + + + +vector_tie + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of vector_tie. +

+
+ + Synopsis +
+
+template <typename T0, typename T1,... typename TN>
+struct vector_tie;
+
+

+ The variadic function accepts 0 + to FUSION_MAX_VECTOR_SIZE + elements, where FUSION_MAX_VECTOR_SIZE + is a user definable predefined maximum that defaults to 10. You may define the preprocessor constant + FUSION_MAX_VECTOR_SIZE + before including any Fusion header to change the default. Example: +

+
+#define FUSION_MAX_VECTOR_SIZE 20
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T0, + T1,... + TN +

+
+

+ Any type +

+
+

+ The arguments to vector_tie +

+
+
+ + Expression + Semantics +
+
+result_of::vector_tie<T0, T1,... TN>::type;
+
+

+ Return type: vector<T0&, T1&,... + TN&> +

+

+ Semantics: Create a vector of references from T0, T1,... TN. +

+
+ + Header +
+
+#include <boost/fusion/sequence/generation/vector_tie.hpp>
+
+
+ + Example +
+
+result_of::vector_tie<int, double>::type
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics.html b/doc/html/fusion/sequences/intrinsics.html new file mode 100644 index 00000000..5581fba4 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics.html @@ -0,0 +1,67 @@ + + + +Intrinsics + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Intrinsics form the essential interface of every Fusion Sequence. + STL + counterparts of these functions are usually implemented as member functions. + Intrinsic functions, unlike Algorithms, + are not generic across the full Sequence + repertoire. They need to be implemented for each Fusion Sequence + [5] + . +

+

+ + Header +

+
+#include <boost/fusion/sequence/intrinsic.hpp>
+
+
+

+

[5] + In practice, many of intrinsic functions have default implementations + that will work in majority of cases +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions.html b/doc/html/fusion/sequences/intrinsics/functions.html new file mode 100644 index 00000000..b4397075 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions.html @@ -0,0 +1,52 @@ + + + +Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/at.html b/doc/html/fusion/sequences/intrinsics/functions/at.html new file mode 100644 index 00000000..1a361356 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/at.html @@ -0,0 +1,169 @@ + + + +at + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+at
+
+ + Description +
+

+ Returns the N-th element from the beginning of the sequence. +

+
+ + Synopsis +
+
+template <typename N, typename Sequence>
+typename result_of::at<Sequence, N>::type
+at(Sequence& seq);
+
+template <typename N, typename Sequence>
+typename result_of::at<Sequence const, N>::type
+at(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Random + Access Sequence +

+
+

+ The sequence we wish to investigate. +

+
+

+ N +

+
+

+ An MPL + Integral Constant +

+
+

+ An index from the beginning of the sequence. +

+
+
+ + Expression + Semantics +
+
+at<N>(seq);
+
+

+ Return type: Returns a reference to + the N-th element from the beginning of the sequence seq + if seq is mutable and + e = + o, where e + is the N-th element from the beginning of the sequence, is a valid expression. + Else, returns a type convertable to the N-th element from the beginning + of the sequence. +

+

+ Precondition: 0 + <= N::value < size(s) +

+

+ Semantics: Equivalent to +

+
+deref(advance<N>(begin(s)))
+
+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/at.hpp>
+
+
+ + Example +
+
+vector<int, int, int> v(1, 2, 3);
+assert(at<mpl::int_<1> >(v) == 2);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/at_c.html b/doc/html/fusion/sequences/intrinsics/functions/at_c.html new file mode 100644 index 00000000..846c7695 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/at_c.html @@ -0,0 +1,169 @@ + + + +at_c + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the N-th element from the beginning of the sequence. +

+
+ + Synopsis +
+
+template <int N, typename Sequence>
+typename result_of::at_c<Sequence, N>::type
+at_c(Sequence& seq);
+
+template <int N, typename Sequence>
+typename result_of::at_c<Sequence const, N>::type
+at_c(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Random + Access Sequence +

+
+

+ The sequence we wish to investigate. +

+
+

+ N +

+
+

+ An integral constant +

+
+

+ An index from the beginning of the sequence. +

+
+
+ + Expression + Semantics +
+
+at_c<N>(seq);
+
+

+ Return type: Returns a reference to + the N-th element from the beginning of the sequence seq + if seq is mutable and + e = + o, where e + is the N-th element from the beginning of the sequence, is a valid expression. + Else, returns a type convertable to the N-th element from the beginning + of the sequence. +

+

+ Precondition: 0 + <= N + < size(s) +

+

+ Semantics: Equivalent to +

+
+deref(advance<N>(begin(s)))
+
+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/at_c.hpp>
+
+
+ + Example +
+
+vector<int, int, int> v(1, 2, 3);
+assert(at_c<1>(v) == 2);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/at_key.html b/doc/html/fusion/sequences/intrinsics/functions/at_key.html new file mode 100644 index 00000000..0fd878d9 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/at_key.html @@ -0,0 +1,164 @@ + + + +at_key + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the element associated with a Key from the sequence. +

+
+ + Synopsis +
+
+template <typename Key, typename Sequence>
+typename result_of::at_key<Sequence, Key>::type
+at_key(Sequence& seq);
+
+template <typename Key, typename Sequence>
+typename result_of::at_key<Sequence const, Key>::type
+at_key(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Associative + Sequence +

+
+

+ The sequence we wish to investigate. +

+
+

+ Key +

+
+

+ Any type +

+
+

+ The queried key. +

+
+
+ + Expression + Semantics +
+
+at_key<Key>(seq);
+
+

+ Return type: Returns a reference to + the element associated with Key from the sequence seq + if seq is mutable and + e = + o, where e + is the element associated with Key, is a valid expression. Else, returns + a type convertable to the element associated with Key. +

+

+ Precondition: has_key<Key>(seq) == true +

+

+ Semantics: Returns the element associated + with Key. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+
+
+ + Example +
+
+set<int, char, bool> s(1, 'x', true);
+assert(at_key<char>(s) == 'x');
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/back.html b/doc/html/fusion/sequences/intrinsics/functions/back.html new file mode 100644 index 00000000..d9ee2ca9 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/back.html @@ -0,0 +1,145 @@ + + + +back + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the last element in the sequence. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::back<Sequence>::type
+back(Sequence& seq);
+
+template <typename Sequence>
+typename result_of::back<Sequence const>::type
+back(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Bidirectional + Sequence +

+
+

+ The sequence we wish to investigate. +

+
+
+ + Expression + Semantics +
+
+back(seq);
+
+

+ Return type: Returns a reference to + the last element in the sequence seq + if seq is mutable and + e = + o, where e + is the last element in the sequence, is a valid expression. Else, returns + a type convertable to the last element in the sequence. +

+

+ Precondition: empty(seq) == false +

+

+ Semantics: Returns the last element + in the sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/back.hpp>
+
+
+ + Example +
+
+vector<int, int, int> v(1, 2, 3);
+assert(back(v) == 3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/begin.html b/doc/html/fusion/sequences/intrinsics/functions/begin.html new file mode 100644 index 00000000..2aad9e16 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/begin.html @@ -0,0 +1,151 @@ + + + +begin + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns an iterator pointing to the first element in the sequence. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::begin<Sequence>::type
+begin(Sequence& seq);
+
+template <typename Sequence>
+typename result_of::begin<Sequence const>::type
+begin(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Forward + Sequence +

+
+

+ The sequence we wish to get an iterator from. +

+
+
+ + Expression + Semantics +
+
+begin(seq);
+
+

+ Return type: Forward + Iterator if seq + is a Forward + Sequence else, Bidirectional + Iterator if seq + is a Bidirectional + Sequence else, Random + Access Iterator if seq + is a Random + Access Sequence. +

+

+ Semantics: Returns an iterator pointing + to the first element in the sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/begin.hpp>
+
+
+ + Example +
+
+vector<int, int, int> v(1, 2, 3);
+assert(deref(begin(v)) == 1);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/empty.html b/doc/html/fusion/sequences/intrinsics/functions/empty.html new file mode 100644 index 00000000..e4ec9a1a --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/empty.html @@ -0,0 +1,134 @@ + + + +empty + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a type convertible to bool + that evaluates to true if + the sequence is empty, else, evaluates to false. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::empty<Sequence>::type
+empty(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Forward + Sequence +

+
+

+ The sequence we wish to investigate. +

+
+
+ + Expression + Semantics +
+
+empty(seq);
+
+

+ Return type: Convertible to bool. +

+

+ Semantics: Evaluates to true if the sequence is empty, else, evaluates + to false. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/empty.hpp>
+
+
+ + Example +
+
+vector<int, int, int> v(1, 2, 3);
+assert(empty(v) == false);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/end.html b/doc/html/fusion/sequences/intrinsics/functions/end.html new file mode 100644 index 00000000..9ef0558d --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/end.html @@ -0,0 +1,151 @@ + + + +end + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+end
+
+ + Description +
+

+ Returns an iterator pointing to one element past the end of the sequence. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::end<Sequence>::type
+end(Sequence& seq);
+
+template <typename Sequence>
+typename result_of::end<Sequence const>::type
+end(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Forward + Sequence +

+
+

+ The sequence we wish to get an iterator from. +

+
+
+ + Expression + Semantics +
+
+end(seq);
+
+

+ Return type: Forward + Iterator if seq + is a Forward + Sequence else, Bidirectional + Iterator if seq + is a Bidirectional + Sequence else, Random + Access Iterator if seq + is a Random + Access Sequence. +

+

+ Semantics: Returns an iterator pointing + to one element past the end of the sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/end.hpp>
+
+
+ + Example +
+
+vector<int, int, int> v(1, 2, 3);
+assert(deref(prior(end(v))) == 3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/front.html b/doc/html/fusion/sequences/intrinsics/functions/front.html new file mode 100644 index 00000000..8f2758ac --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/front.html @@ -0,0 +1,145 @@ + + + +front + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the first element in the sequence. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::front<Sequence>::type
+front(Sequence& seq);
+
+template <typename Sequence>
+typename result_of::front<Sequence const>::type
+front(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Forward + Sequence +

+
+

+ The sequence we wish to investigate. +

+
+
+ + Expression + Semantics +
+
+front(seq);
+
+

+ Return type: Returns a reference to + the first element in the sequence seq + if seq is mutable and + e = + o, where e + is the first element in the sequence, is a valid expression. Else, returns + a type convertable to the first element in the sequence. +

+

+ Precondition: empty(seq) == false +

+

+ Semantics: Returns the first element + in the sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/front.hpp>
+
+
+ + Example +
+
+vector<int, int, int> v(1, 2, 3);
+assert(front(v) == 1);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/has_key.html b/doc/html/fusion/sequences/intrinsics/functions/has_key.html new file mode 100644 index 00000000..27ee1aa2 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/has_key.html @@ -0,0 +1,154 @@ + + + +has_key + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a type convertible to bool + that evaluates to true if + the sequence contains an element associated with a Key, else, evaluates + to false. +

+
+ + Synopsis +
+
+template <typename Key, typename Sequence>
+typename result_of::has_key<Sequence, Key>::type
+has_key(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Associative + Sequence +

+
+

+ The sequence we wish to investigate. +

+
+

+ Key +

+
+

+ Any type +

+
+

+ The queried key. +

+
+
+ + Expression + Semantics +
+
+has_key<Key>(seq);
+
+

+ Return type: Convertible to bool. +

+

+ Semantics: Evaluates to true if the sequence contains an element + associated with Key, else, evaluates to false. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/has_key.hpp>
+
+
+ + Example +
+
+set<int, char, bool> s(1, 'x', true);
+assert(has_key<char>(s) == true);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/size.html b/doc/html/fusion/sequences/intrinsics/functions/size.html new file mode 100644 index 00000000..f3366fd0 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/size.html @@ -0,0 +1,133 @@ + + + +size + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns a type convertible to int + that evaluates the number of elements in the sequence. +

+
+ + Synopsis +
+
+template <typename Sequence>
+typename result_of::size<Sequence>::type
+size(Sequence const& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq +

+
+

+ Model of Forward + Sequence +

+
+

+ The sequence we wish to investigate. +

+
+
+ + Expression + Semantics +
+
+size(seq);
+
+

+ Return type: Convertible to int. +

+

+ Semantics: Returns the number of elements + in the sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/size.hpp>
+
+
+ + Example +
+
+vector<int, int, int> v(1, 2, 3);
+assert(size(v) == 3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/functions/swap.html b/doc/html/fusion/sequences/intrinsics/functions/swap.html new file mode 100644 index 00000000..f152fae1 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/functions/swap.html @@ -0,0 +1,135 @@ + + + +swap + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Performs an element by element swap of the elements in 2 sequences. +

+
+ + Synopsis +
+
+template<typename Seq1, typename Seq2>
+void swap(Seq1& seq1, Seq2& seq2);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameters +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ seq1, seq2 +

+
+

+ Models of Forward + Sequence +

+
+

+ The sequences whos elements we wish to swap. +

+
+
+ + Expression + Semantics +
+
+swap(seq1, seq2);
+
+

+ Return type: void +

+

+ Precondition: size(seq1) == size(seq2) +

+

+ Semantics: Calls swap(a1, b1) for corresponding elements in seq1 and seq2. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/swap.hpp>
+
+
+ + Example +
+
+vector<int, std::string> v1(1, "hello"), v2(2, "world");
+swap(v1, v2);
+assert(v1 == make_vector(2, "world"));
+assert(v2 == make_vector(1, "hello"));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions.html b/doc/html/fusion/sequences/intrinsics/metafunctions.html new file mode 100644 index 00000000..6fad1b69 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions.html @@ -0,0 +1,55 @@ + + + +Metafunctions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+ + + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/at.html b/doc/html/fusion/sequences/intrinsics/metafunctions/at.html new file mode 100644 index 00000000..251efddc --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/at.html @@ -0,0 +1,166 @@ + + + +at + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+at
+
+ + Description +
+

+ Returns the result type of at + [6] + . +

+
+ + Synopsis +
+
+template<
+    typename Seq,
+    typename N>
+struct at
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.25. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+

+ N +

+
+

+ An MPL + Integral Constant +

+
+

+ Index of element +

+
+
+
+ + Expression + Semantics +
+
+result_of::at<Seq, N>::type
+
+

+ Return type: Any type. +

+

+ Semantics: Returns the result type of + using at to access the Nth element of Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/at.hpp>
+
+
+ + Example +
+
+typedef vector<int,float,char> vec;
+BOOST_MPL_ASSERT((boost::is_same<result_of::at<vec, boost::mpl::int_<1> >::type, float&>));
+
+
+

+

[6] + result_of::at reflects the actual return + type of the function at. _sequence_s + typically return references to its elements via the at function. If you want + to get the actual element type, use result_of::value_at +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/at_c.html b/doc/html/fusion/sequences/intrinsics/metafunctions/at_c.html new file mode 100644 index 00000000..cd3fd5b0 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/at_c.html @@ -0,0 +1,165 @@ + + + +at_c + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of at_c + [7] + . +

+
+ + Synopsis +
+
+template<
+    typename Seq,
+    int M>
+struct at_c
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.26. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+

+ M +

+
+

+ Positive integer index +

+
+

+ Index of element +

+
+
+
+ + Expression + Semantics +
+
+result_of::at_c<Seq, M>::type
+
+

+ Return type: Any type +

+

+ Semantics: Returns the result type of + using at_c to access the Mth element of Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/at.hpp>
+
+
+ + Example +
+
+typedef vector<int,float,char> vec;
+BOOST_MPL_ASSERT((boost::is_same<result_of::at_c<vec, 1>::type, float&>));
+
+
+

+

[7] + result_of::at_c reflects the actual + return type of the function at_c. _sequence_s + typically return references to its elements via the at_c function. If you want + to get the actual element type, use result_of::value_at_c +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/at_key.html b/doc/html/fusion/sequences/intrinsics/metafunctions/at_key.html new file mode 100644 index 00000000..cb48e6e0 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/at_key.html @@ -0,0 +1,167 @@ + + + +at_key + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of at_key + [8] + . +

+
+ + Synopsis +
+
+template<
+    typename Seq,
+    typename Key>
+struct at_key
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.30. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+

+ Key +

+
+

+ Any type +

+
+

+ Key type +

+
+
+
+ + Expression + Semantics +
+
+result_of::at_key<Seq, Key>::type
+
+

+ Return type: Any type. +

+

+ Semantics: Returns the result of using + at_key to access the element + with key type Key in + Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/at_key.hpp>
+
+
+ + Example +
+
+typedef map<pair<int, char>, pair<char, char>, pair<double, char> > mymap;
+BOOST_MPL_ASSERT((boost::is_same<result_of::at_key<mymap, int>::type, char&>));
+
+
+

+

[8] + result_of::at_key reflects the actual + return type of the function at_key. _sequence_s + typically return references to its elements via the at_key function. If you + want to get the actual element type, use result_of::value_at_key +

+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/back.html b/doc/html/fusion/sequences/intrinsics/metafunctions/back.html new file mode 100644 index 00000000..d1bf313a --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/back.html @@ -0,0 +1,133 @@ + + + +back + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of back. +

+
+ + Synopsis +
+
+template<typename Seq>
+struct back
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.23. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+
+
+ + Expression + Semantics +
+
+result_of::back<Seq>::type
+
+

+ Return type: Any type +

+

+ Semantics: The type returned by dereferencing + an iterator to the last element in the sequence. Equivalent to result_of::deref<result_of::prior<result_of::end<Seq>::type>::type>::type. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/back.hpp>
+
+
+ + Example +
+
+typedef vector<int,char> vec;
+BOOST_MPL_ASSERT((boost::is_same<result_of::back<vec>::type, char&>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/begin.html b/doc/html/fusion/sequences/intrinsics/metafunctions/begin.html new file mode 100644 index 00000000..26924148 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/begin.html @@ -0,0 +1,135 @@ + + + +begin + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of begin. +

+
+ + Synopsis +
+
+template<typename Seq>
+struct begin
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.19. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+
+
+ + Expression + Semantics +
+
+result_of::begin<Seq>::type
+
+

+ Return type: An iterator modelling the + same traversal concept as Seq. +

+

+ Semantics: Returns the type of an iterator + to the first element of Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/begin.hpp>
+
+
+ + Example +
+
+typedef vector<int> vec;
+typedef result_of::begin<vec>::type it;
+BOOST_MPL_ASSERT((boost::is_same<result_of::deref<it>::type, int&>))
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/empty.html b/doc/html/fusion/sequences/intrinsics/metafunctions/empty.html new file mode 100644 index 00000000..76262192 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/empty.html @@ -0,0 +1,138 @@ + + + +empty + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of empty. +

+
+ + Synopsis +
+
+template<typename Seq>
+struct empty
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.21. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+
+
+ + Expression + Semantics +
+
+result_of::empty<Seq>::type
+
+

+ Return type: An MPL + Integral Constant +

+

+ Semantics: Returns mpl::true_ + if Seq has zero elements, + mpl::false_ otherwise. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/empty.hpp>
+
+
+ + Example +
+
+typedef vector<> empty_vec;
+typedef vector<int,float,char> vec;
+
+BOOST_MPL_ASSERT((result_of::empty<empty_vec>));
+BOOST_MPL_ASSERT_NOT((result_of::empty<vec>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/end.html b/doc/html/fusion/sequences/intrinsics/metafunctions/end.html new file mode 100644 index 00000000..b4faf2c0 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/end.html @@ -0,0 +1,135 @@ + + + +end + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+end
+
+ + Description +
+

+ Returns the result type of end. +

+
+ + Synopsis +
+
+template<typename Seq>
+struct end
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.20. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+
+
+ + Expression + Semantics +
+
+result_of::end<Seq>::type
+
+

+ Return type: A model of the same traversal + concept as Seq. +

+

+ Semantics: Returns the type of an iterator + one past the end of Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/end.hpp>
+
+
+ + Example +
+
+typedef vector<int> vec;
+typedef result_of::prior<result_of::end<vec>::type>::type first;
+BOOST_MPL_ASSERT((result_of::equal_to<first, result_of::begin<vec>::type>))
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/front.html b/doc/html/fusion/sequences/intrinsics/metafunctions/front.html new file mode 100644 index 00000000..009c07d6 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/front.html @@ -0,0 +1,134 @@ + + + +front + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of front. +

+
+ + Synopsis +
+
+template<typename Seq>
+struct front
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.22. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+
+
+ + Expression + Semantics +
+
+result_of::front<Seq>::type
+
+

+ Return type: Any type +

+

+ Semantics: The type returned by dereferencing + an iterator to the first element in Seq. + Equivalent to result_of::deref<result_of::begin<Seq>::type>::type. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/front.hpp>
+
+
+ + Example +
+
+typedef vector<int,char> vec;
+BOOST_MPL_ASSERT((boost::is_same<result_of::front<vec>::type, int&>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/has_key.html b/doc/html/fusion/sequences/intrinsics/metafunctions/has_key.html new file mode 100644 index 00000000..03e83d4b --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/has_key.html @@ -0,0 +1,158 @@ + + + +has_key + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of has_key. +

+
+ + Synopsis +
+
+template<
+    typename Seq,
+    typename Key>
+struct has_key
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.29. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+

+ Key +

+
+

+ Any type +

+
+

+ Key type +

+
+
+
+ + Expression + Semantics +
+
+result_of::has_key<Seq, Key>::type
+
+

+ Return type: An MPL + Integral Constant. +

+

+ Semantics: Returns mpl::true_ + if Seq contains an element + with key type Key, returns + mpl::false_ otherwise. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/has_key.hpp>
+
+
+ + Example +
+
+typedef map<pair<int, char>, pair<char, char>, pair<double, char> > mymap;
+BOOST_MPL_ASSERT((result_of::has_key<mymap, int>));
+BOOST_MPL_ASSERT_NOT((result_of::has_key<mymap, void*>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/size.html b/doc/html/fusion/sequences/intrinsics/metafunctions/size.html new file mode 100644 index 00000000..50cec0bf --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/size.html @@ -0,0 +1,135 @@ + + + +size + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the result type of size. +

+
+ + Synopsis +
+
+template<typename Seq>
+struct size
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.24. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+
+
+ + Expression + Semantics +
+
+result_of::size<Seq>::type
+
+

+ Return type: An MPL + Integral Constant. +

+

+ Semantics: Returns the number of elements + in Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/size.hpp>
+
+
+ + Example +
+
+typedef vector<int,float,char> vec;
+typedef result_of::size<vec>::type size_mpl_integral_constant;
+BOOST_MPL_ASSERT_RELATION(size_mpl_integral_constant::value, ==, 3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/swap.html b/doc/html/fusion/sequences/intrinsics/metafunctions/swap.html new file mode 100644 index 00000000..01cb7598 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/swap.html @@ -0,0 +1,124 @@ + + + +swap + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the return type of swap. +

+
+ + Synopsis +
+
+template<typename Seq1, typename Seq2>
+struct swap
+{
+    typedef void type;
+};
+
+
+

Table 1.32. Parameters

+ +++++ + + + + + + + + + + +
+

+ Parameters +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq1, Seq2 +

+
+

+ Models of Forward + Sequence +

+
+

+ The sequences being swapped +

+
+
+
+ + Expression + Semantics +
+
+result_of::swap<Seq1, Seq2>::type
+
+

+ Return type: void. +

+

+ Semantics: Always returns void. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/swap.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/value_at.html b/doc/html/fusion/sequences/intrinsics/metafunctions/value_at.html new file mode 100644 index 00000000..9c2e2a90 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/value_at.html @@ -0,0 +1,155 @@ + + + +value_at + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the actual type at a given index from the Sequence. +

+
+ + Synopsis +
+
+template<
+    typename Seq,
+    typename N>
+struct value_at
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.27. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+

+ N +

+
+

+ An MPL + Integral Constant +

+
+

+ Index of element +

+
+
+
+ + Expression + Semantics +
+
+result_of::value_at<Seq, N>::type
+
+

+ Return type: Any type. +

+

+ Semantics: Returns the actual type at + the Nth element of Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/value_at.hpp>
+
+
+ + Example +
+
+typedef vector<int,float,char> vec;
+BOOST_MPL_ASSERT((boost::is_same<result_of::value_at<vec, boost::mpl::int_<1> >::type, float>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/value_at_c.html b/doc/html/fusion/sequences/intrinsics/metafunctions/value_at_c.html new file mode 100644 index 00000000..beb2a706 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/value_at_c.html @@ -0,0 +1,154 @@ + + + +value_at_c + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the actual type at a given index from the Sequence. +

+
+ + Synopsis +
+
+template<
+    typename Seq,
+    int M>
+struct value_at_c
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.28. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+

+ M +

+
+

+ Positive integer index +

+
+

+ Index of element +

+
+
+
+ + Expression + Semantics +
+
+result_of::value_at_c<Seq, M>::type
+
+

+ Return type: Any type +

+

+ Semantics: Returns the actual type at + the Mth element of Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/value_at.hpp>
+
+
+ + Example +
+
+typedef vector<int,float,char> vec;
+BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_c<vec, 1>::type, float>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/intrinsics/metafunctions/value_at_key.html b/doc/html/fusion/sequences/intrinsics/metafunctions/value_at_key.html new file mode 100644 index 00000000..f3395e58 --- /dev/null +++ b/doc/html/fusion/sequences/intrinsics/metafunctions/value_at_key.html @@ -0,0 +1,155 @@ + + + +value_at_key + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Returns the actual element type associated with a Key from the Sequence. +

+
+ + Synopsis +
+
+template<
+    typename Seq,
+    typename Key>
+struct value_at_key
+{
+    typedef unspecified type;
+};
+
+
+

Table 1.31. Parameters

+ +++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ Seq +

+
+

+ A model of Forward + Sequence +

+
+

+ Argument sequence +

+
+

+ Key +

+
+

+ Any type +

+
+

+ Key type +

+
+
+
+ + Expression + Semantics +
+
+result_of::value_at_key<Seq, Key>::type
+
+

+ Return type: Any type. +

+

+ Semantics: Returns the actual element + type associated with key type Key + in Seq. +

+
+ + Header +
+
+#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
+
+
+ + Example +
+
+typedef map<pair<int, char>, pair<char, char>, pair<double, char> > mymap;
+BOOST_MPL_ASSERT((boost::is_same<result_of::at_key<mymap, int>::type, char>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators.html b/doc/html/fusion/sequences/operators.html new file mode 100644 index 00000000..b073cf2d --- /dev/null +++ b/doc/html/fusion/sequences/operators.html @@ -0,0 +1,48 @@ + + + +Operators + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ These operators, like the Algorithms, + work generically on all Fusion sequences. All conforming Fusion sequences + automatically get these operators for free. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/comparison.html b/doc/html/fusion/sequences/operators/comparison.html new file mode 100644 index 00000000..fe52cb60 --- /dev/null +++ b/doc/html/fusion/sequences/operators/comparison.html @@ -0,0 +1,68 @@ + + + +Comparison + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ The Comparison operators: ==, + !=, <, + <=, >= + and >= work generically + on all Fusion sequences. Comparison operators are "short- circuited": + elementary comparisons start from the first elements and are performed + only until the result is clear. +

+
+ + Header +
+
+#include <boost/fusion/sequence/comparison.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/comparison/equal.html b/doc/html/fusion/sequences/operators/comparison/equal.html new file mode 100644 index 00000000..59bfbe55 --- /dev/null +++ b/doc/html/fusion/sequences/operators/comparison/equal.html @@ -0,0 +1,154 @@ + + + +equal + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ Compare two sequences for equality. +

+
+ + Synopsis +
+
+template <typename Seq1, typename Seq2>
+bool
+operator==(Seq1 const& a, Seq2 const& b);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ a, + b +

+
+

+ Instances of Sequence +

+
+

+ _sequence_s to compare +

+
+
+ + Expression + Semantics +
+
+a == b
+
+

+ Return type: bool +

+

+ Requirements: +

+

+ For each element, e1, + in sequence a, and for + each element, e2, in + sequence b, a == b is a valid expression returning a + type that is convertible to bool. +

+

+ An attempt to compare two Sequences of different lengths results in a + compile time error. +

+

+ Semantics: +

+

+ For each element, e1, + in sequence a, and for + each element, e2, in + sequence b, e1 == e2 returns true. For any 2 zero length + _sequence_s, e and f, e == f returns + true. +

+
+ + Header +
+
+#include <boost/fusion/sequence/comparison/equal_to.hpp>
+
+
+ + Example +
+
+vector<int, char> v1(5, 'a');
+vector<int, char> v2(5, 'a');
+assert(v1 == v2);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/comparison/greater_than.html b/doc/html/fusion/sequences/operators/comparison/greater_than.html new file mode 100644 index 00000000..ec62de5e --- /dev/null +++ b/doc/html/fusion/sequences/operators/comparison/greater_than.html @@ -0,0 +1,148 @@ + + + +greater + than + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Lexicographically compare two sequences. +

+
+ + Synopsis +
+
+template <typename Seq1, typename Seq2>
+bool
+operator>(Seq1 const& a, Seq2 const& b);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ a, + b +

+
+

+ Instances of Sequence +

+
+

+ _sequence_s to compare +

+
+
+ + Expression + Semantics +
+
+a > b
+
+

+ Return type: bool +

+

+ Requirements: +

+

+ For each element, e1, + in sequence a, and for + each element, e2, in + sequence b, a < b is a valid expression returning a + type that is convertible to bool. +

+

+ An attempt to compare two Sequences of different lengths results in a + compile time error. +

+

+ Semantics: Returns b < a. +

+
+ + Header +
+
+#include <boost/fusion/sequence/comparison/less_equal.hpp>
+
+
+ + Example +
+
+vector<int, float> v1(4, 3.3f);
+vector<short, float> v2(5, 3.3f);
+vector<long, double> v3(5, 4.4);
+assert(v2 > v1);
+assert(v3 > v2);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/comparison/greater_than_equal.html b/doc/html/fusion/sequences/operators/comparison/greater_than_equal.html new file mode 100644 index 00000000..68c5acbb --- /dev/null +++ b/doc/html/fusion/sequences/operators/comparison/greater_than_equal.html @@ -0,0 +1,147 @@ + + + +greater + than equal + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Lexicographically compare two sequences. +

+
+ + Synopsis +
+
+template <typename Seq1, typename Seq2>
+bool
+operator>=(Seq1 const& a, Seq2 const& b);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ a, + b +

+
+

+ Instances of Sequence +

+
+

+ _sequence_s to compare +

+
+
+ + Expression + Semantics +
+
+a >= b
+
+

+ Return type: bool +

+

+ Requirements: +

+

+ For each element, e1, + in sequence a, and for + each element, e2, in + sequence b, a < b is a valid expression returning a + type that is convertible to bool. +

+

+ An attempt to compare two Sequences of different lengths results in a + compile time error. +

+

+ Semantics: Returns !(a < b). +

+
+ + Header +
+
+#include <boost/fusion/sequence/comparison/greater_equal.hpp>
+
+
+ + Example +
+
+vector<int, float> v1(4, 3.3f);
+vector<short, float> v2(5, 3.3f);
+vector<long, double> v3(5, 4.4);
+assert(v2 >= v1);
+assert(v3 >= v2);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/comparison/less_than.html b/doc/html/fusion/sequences/operators/comparison/less_than.html new file mode 100644 index 00000000..ca68920c --- /dev/null +++ b/doc/html/fusion/sequences/operators/comparison/less_than.html @@ -0,0 +1,150 @@ + + + +less + than + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Lexicographically compare two sequences. +

+
+ + Synopsis +
+
+template <typename Seq1, typename Seq2>
+bool
+operator<(Seq1 const& a, Seq2 const& b);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ a, + b +

+
+

+ Instances of Sequence +

+
+

+ _sequence_s to compare +

+
+
+ + Expression + Semantics +
+
+a < b
+
+

+ Return type: bool +

+

+ Requirements: +

+

+ For each element, e1, + in sequence a, and for + each element, e2, in + sequence b, a < b is a valid expression returning a + type that is convertible to bool. +

+

+ An attempt to compare two Sequences of different lengths results in a + compile time error. +

+

+ Semantics: Returns the lexicographical + comparison of between a + and b. +

+
+ + Header +
+
+#include <boost/fusion/sequence/comparison/less.hpp>
+
+
+ + Example +
+
+vector<int, float> v1(4, 3.3f);
+vector<short, float> v2(5, 3.3f);
+vector<long, double> v3(5, 4.4);
+assert(v1 < v2);
+assert(v2 < v3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/comparison/less_than_equal.html b/doc/html/fusion/sequences/operators/comparison/less_than_equal.html new file mode 100644 index 00000000..13ceddac --- /dev/null +++ b/doc/html/fusion/sequences/operators/comparison/less_than_equal.html @@ -0,0 +1,148 @@ + + + +less + than equal + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Lexicographically compare two sequences. +

+
+ + Synopsis +
+
+template <typename Seq1, typename Seq2>
+bool
+operator<=(Seq1 const& a, Seq2 const& b);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ a, + b +

+
+

+ Instances of Sequence +

+
+

+ _sequence_s to compare +

+
+
+ + Expression + Semantics +
+
+a <= b
+
+

+ Return type: bool +

+

+ Requirements: +

+

+ For each element, e1, + in sequence a, and for + each element, e2, in + sequence b, a < b is a valid expression returning a + type that is convertible to bool. +

+

+ An attempt to compare two Sequences of different lengths results in a + compile time error. +

+

+ Semantics: Returns !(b < a). +

+
+ + Header +
+
+#include <boost/fusion/sequence/comparison/less_equal.hpp>
+
+
+ + Example +
+
+vector<int, float> v1(4, 3.3f);
+vector<short, float> v2(5, 3.3f);
+vector<long, double> v3(5, 4.4);
+assert(v1 <= v2);
+assert(v2 <= v3);
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/comparison/not_equal.html b/doc/html/fusion/sequences/operators/comparison/not_equal.html new file mode 100644 index 00000000..aff5882b --- /dev/null +++ b/doc/html/fusion/sequences/operators/comparison/not_equal.html @@ -0,0 +1,150 @@ + + + +not + equal + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ Compare two sequences for inequality. +

+
+ + Synopsis +
+
+template <typename Seq1, typename Seq2>
+bool
+operator!=(Seq1 const& a, Seq2 const& b);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ a, + b +

+
+

+ Instances of Sequence +

+
+

+ _sequence_s to compare +

+
+
+ + Expression + Semantics +
+
+a != b
+
+

+ Return type: bool +

+

+ Requirements: +

+

+ For each element, e1, + in sequence a, and for + each element, e2, in + sequence b, a == b is a valid expression returning a + type that is convertible to bool. +

+

+ An attempt to compare two Sequences of different lengths results in a + compile time error. +

+

+ Semantics: +

+

+ Returns !(a == b). +

+
+ + Header +
+
+#include <boost/fusion/sequence/comparison/not_equal_to.hpp>
+
+
+ + Example +
+
+vector<int, char> v3(5, 'b');
+vector<int, char> t4(2, 'a');
+assert(v1 != v3);
+assert(v1 != t4);
+assert(!(v1 != v2));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/i_o.html b/doc/html/fusion/sequences/operators/i_o.html new file mode 100644 index 00000000..baf03cbf --- /dev/null +++ b/doc/html/fusion/sequences/operators/i_o.html @@ -0,0 +1,135 @@ + + + +I/O + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+

+I/O

+
+
in
+
out
+
+

+ The I/O operators: << + and >> work generically + on all Fusion sequences. The global operator<< has been overloaded for generic + output streams such that _sequence_s + are output by recursively calling operator<< for each element. Analogously, + the global operator>> + has been overloaded to extract _sequence_s + from generic input streams by recursively calling operator>> for each element. +

+

+ The default delimiter between the elements is space, and the Sequence + is enclosed in parenthesis. For Example: +

+
+vector<float, int, std::string> a(1.0f, 2, std::string("Howdy folks!");
+cout << a;
+
+

+ outputs the vector as: (1.0 2 Howdy folks!) +

+

+ The library defines three manipulators for changing the default behavior: +

+
+

Manipulators

+
+
tuple_open(arg)
+

+ Defines the character that is output before the first element. +

+
tuple_close(arg)
+

+ Defines the character that is output after the last element. +

+
tuple_delimiter(arg)
+

+ Defines the delimiter character between elements. +

+
+
+

+ The argument to tuple_open, + tuple_close and tuple_delimiter may be a char, wchar_t, + a C-string, or a wide C-string. +

+

+ Example: +

+
+std::cout << tuple_open('[') << tuple_close(']') << tuple_delimiter(", ") << a;
+
+

+ outputs the same vector, a + as: [1.0, 2, Howdy folks!] +

+

+ The same manipulators work with operator>> and istream + as well. Suppose the std::cin + stream contains the following data: +

+
+(1 2 3) [4:5]
+
+

+ The code: +

+
+vector<int, int, int> i;
+vector<int, int> j;
+
+std::cin >> i;
+std::cin >> set_open('[') >> set_close(']') >> set_delimiter(':');
+std::cin >> j;
+
+

+ reads the data into the _vector_s + i and j. +

+

+ Note that extracting _sequence_s + with std::string or C-style string elements does + not generally work, since the streamed Sequence + representation may not be unambiguously parseable. +

+
+ + Header +
+
+#include <boost/fusion/sequence/io.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/i_o/in.html b/doc/html/fusion/sequences/operators/i_o/in.html new file mode 100644 index 00000000..bfac3141 --- /dev/null +++ b/doc/html/fusion/sequences/operators/i_o/in.html @@ -0,0 +1,151 @@ + + + +in + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+in
+
+ + Description +
+

+ Read a Sequence from an input + stream. +

+
+ + Synopsis +
+
+template <typename IStream, typename Sequence>
+IStream&
+operator>>(IStream& is, Sequence& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ is +

+
+

+ An input stream. +

+
+

+ Stream to extract information from. +

+
+

+ seq +

+
+

+ A Sequence. +

+
+

+ The sequence to read. +

+
+
+ + Expression + Semantics +
+
+is >> seq
+
+

+ Return type: IStream& +

+

+ Semantics: For each element, e, in sequence, seq, + call is >> + e. +

+
+ + Header +
+
+#include <boost/fusion/sequence/io/in.hpp>
+
+
+ + Example +
+
+vector<int, std::string, char> v;
+std::cin >> v;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/operators/i_o/out.html b/doc/html/fusion/sequences/operators/i_o/out.html new file mode 100644 index 00000000..80ca62f7 --- /dev/null +++ b/doc/html/fusion/sequences/operators/i_o/out.html @@ -0,0 +1,150 @@ + + + +out + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+
+out
+
+ + Description +
+

+ Write a Sequence to an output + stream. +

+
+ + Synopsis +
+
+template <typename OStream, typename Sequence>
+OStream&
+operator<<(OStream& os, Sequence& seq);
+
+
+ + Parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ os +

+
+

+ An output stream. +

+
+

+ Stream to write information to. +

+
+

+ seq +

+
+

+ A Sequence. +

+
+

+ The sequence to write. +

+
+
+ + Expression + Semantics +
+
+os << seq
+
+

+ Return type: OStream& +

+

+ Semantics: For each element, e, in sequence, seq, + call os << + e. +

+
+ + Header +
+
+#include <boost/fusion/sequence/io/out.hpp>
+
+
+ + Example +
+
+std::cout << make_vector(123, "Hello", 'x') << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/views.html b/doc/html/fusion/sequences/views.html new file mode 100644 index 00000000..cf4d2095 --- /dev/null +++ b/doc/html/fusion/sequences/views.html @@ -0,0 +1,64 @@ + + + +Views + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Views are sequences that do not actually contain data, but instead impart + an alternative presentation over the data from one or more underlying sequences. + Views are proxies. They provide an efficient yet purely functional way to + work on potentially expensive sequence operations. Views are inherently lazy. + Their elements are only computed on demand only when the elements of the + underlying sequence(s) are actually accessed. Views' lazy nature make them + very cheap to copy and be passed around by value. +

+

+ + Header +

+
+#include <boost/fusion/sequence/view.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/views/filter_view.html b/doc/html/fusion/sequences/views/filter_view.html new file mode 100644 index 00000000..758b9540 --- /dev/null +++ b/doc/html/fusion/sequences/views/filter_view.html @@ -0,0 +1,244 @@ + + + +filter_view + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ filter_view is a view into + a subset of its underlying sequence's elements satisfying a given predicate + (an MPL metafunction). + The filter_view presents + only those elements for which its predicate evaluates to mpl::true_. +

+
+ + Header +
+
+#include <boost/fusion/sequence/view/filter_view.hpp>
+
+
+ + Synopsis +
+
+template <typename Sequence, typename Pred>
+struct filter_view;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Sequence +

+
+

+ A Forward + Sequence +

+
+

+

+
+

+ Pred +

+
+

+ Unary Metafunction returning an mpl::bool_ +

+
+

+

+
+
+ + Model of +
+ +
+

Notation

+
+
F
+

+ A filter_view type +

+
f, + f2
+

+ Instances of filter_view +

+
s
+

+ A Forward + Sequence +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Forward + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ F(s) +

+
+

+ Creates a filter_view + given a sequence, s. +

+
+

+ F(f) +

+
+

+ Copy constructs a filter_view + from another filter_view, + f. +

+
+

+ f = + f2 +

+
+

+ Assigns to a filter_view, + f, from another + filter_view, f2. +

+
+
+ + Example +
+
+using boost::mpl::_;
+using boost::mpl::not_;
+using boost::is_class;
+
+typedef vector<std::string, char, long, bool, double> vector_type;
+
+vector_type v("a-string", '@', 987654, true, 6.6);
+filter_view<vector_type const, not_<is_class<_> > > view(v);
+std::cout << view << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/views/iterator_range.html b/doc/html/fusion/sequences/views/iterator_range.html new file mode 100644 index 00000000..e53bc815 --- /dev/null +++ b/doc/html/fusion/sequences/views/iterator_range.html @@ -0,0 +1,258 @@ + + + +iterator_range + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ iterator_range presents + a sub-range of its underlying sequence delimited by a pair of iterators. +

+
+ + Header +
+
+#include <boost/fusion/sequence/view/iterator_range.hpp>
+
+
+ + Synopsis +
+
+template <typename First, typename Last>
+struct iterator_range;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ First +

+
+

+ A fusion Iterator +

+
+

+

+
+

+ Last +

+
+

+ A fusion Iterator +

+
+

+

+
+
+ + Model of +
+
+
+

Notation

+
+
IR
+

+ An iterator_range type +

+
f
+

+ An instance of First +

+
l
+

+ An instance of Last +

+
ir, + ir2
+

+ Instances of iterator_range +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Forward + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ IR(f, + l) +

+
+

+ Creates an iterator_range + given iterators, f + and l. +

+
+

+ IR(ir) +

+
+

+ Copy constructs an iterator_range + from another iterator_range, + ir. +

+
+

+ ir = + ir2 +

+
+

+ Assigns to a iterator_range, + ir, from another + iterator_range, + ir2. +

+
+
+ + Example +
+
+char const* s = "Ruby";
+typedef vector<int, char, double, char const*> vector_type;
+vector_type vec(1, 'x', 3.3, s);
+
+typedef result_of::begin<vector_type>::type A;
+typedef result_of::end<vector_type>::type B;
+typedef result_of::next<A>::type C;
+typedef result_of::prior<B>::type D;
+
+C c(vec);
+D d(vec);
+
+iterator_range<C, D> range(c, d);
+std::cout << range << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/views/joint_view.html b/doc/html/fusion/sequences/views/joint_view.html new file mode 100644 index 00000000..2a1bfd21 --- /dev/null +++ b/doc/html/fusion/sequences/views/joint_view.html @@ -0,0 +1,245 @@ + + + +joint_view + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ joint_view presents a view + which is a concatenation of two sequences. +

+
+ + Header +
+
+#include <boost/fusion/sequence/view/joint_view.hpp>
+
+
+ + Synopsis +
+
+template <typename Sequence1, typename Sequence2>
+struct joint_view;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Sequence1 +

+
+

+ A Forward + Sequence +

+
+

+

+
+

+ Sequence2 +

+
+

+ A Forward + Sequence +

+
+

+

+
+
+ + Model of +
+ +
+

Notation

+
+
JV
+

+ A joint_view type +

+
s1
+

+ An instance of Sequence1 +

+
s2
+

+ An instance of Sequence2 +

+
jv, + jv2
+

+ Instances of joint_view +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Forward + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ JV(s1, + s2) +

+
+

+ Creates a joint_view + given sequences, s1 + and s2. +

+
+

+ JV(jv) +

+
+

+ Copy constructs a joint_view + from another joint_view, + jv. +

+
+

+ jv = + jv2 +

+
+

+ Assigns to a joint_view, + jv, from another + joint_view, jv2. +

+
+
+ + Example +
+
+vector<int, char> v1(3, 'x');
+vector<std::string, int> v2("hello", 123);
+joint_view<
+    vector<int, char>
+  , vector<std::string, int>
+> view(v1, v2);
+std::cout << view << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/views/reverse_view.html b/doc/html/fusion/sequences/views/reverse_view.html new file mode 100644 index 00000000..f071a5f1 --- /dev/null +++ b/doc/html/fusion/sequences/views/reverse_view.html @@ -0,0 +1,216 @@ + + + +reverse_view + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ reverse_view presents a + reversed view of underlying sequence. The first element will be its last + and the last element will be its first. +

+
+ + Header +
+
+#include <boost/fusion/sequence/view/reverse_view.hpp>
+
+
+ + Synopsis +
+
+template <typename Sequence>
+struct reverse_view;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Sequence +

+
+

+ A Bidirectional + Sequence +

+
+

+

+
+
+ + Model of +
+ +
+

Notation

+
+
RV
+

+ A reverse_view type +

+
s
+

+ An instance of Sequence +

+
rv, + rv2
+

+ Instances of reverse_view +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Bidirectional + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ RV(s) +

+
+

+ Creates a unary reverse_view + given sequence, s. +

+
+

+ RV(rv) +

+
+

+ Copy constructs a reverse_view + from another reverse_view, + rv. +

+
+

+ rv = + rv2 +

+
+

+ Assigns to a reverse_view, + rv, from another + reverse_view, + rv2. +

+
+
+ + Example +
+
+typedef vector<int, short, double> vector_type;
+vector_type vec(2, 5, 3.3);
+
+reverse_view<vector_type> reverse(vec);
+std::cout << reverse << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/views/single_view.html b/doc/html/fusion/sequences/views/single_view.html new file mode 100644 index 00000000..ae40751b --- /dev/null +++ b/doc/html/fusion/sequences/views/single_view.html @@ -0,0 +1,208 @@ + + + +single_view + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ single_view is a view into + a value as a single element sequence. +

+
+ + Header +
+
+#include <boost/fusion/sequence/view/single_view.hpp>
+
+
+ + Synopsis +
+
+template <typename T>
+struct single_view;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ T +

+
+

+ Any type +

+
+

+

+
+
+ + Model of +
+ +
+

Notation

+
+
S
+

+ A single_view type +

+
s, + s2
+

+ Instances of single_view +

+
x
+

+ An instance of T +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Forward + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ S(x) +

+
+

+ Creates a single_view + from x. +

+
+

+ S(s) +

+
+

+ Copy constructs a single_view + from another single_view, + s. +

+
+

+ s = + s2 +

+
+

+ Assigns to a single_view, + s, from another + single_view, s2. +

+
+
+ + Example +
+
+single_view<int> view(3);
+std::cout << view << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/views/transform_view.html b/doc/html/fusion/sequences/views/transform_view.html new file mode 100644 index 00000000..00c990b8 --- /dev/null +++ b/doc/html/fusion/sequences/views/transform_view.html @@ -0,0 +1,383 @@ + + + +transform_view + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ The unary version of transform_view + presents a view of its underlying sequence given a unary function object + or function pointer. The binary version of transform_view + presents a view of 2 underlying sequences, given a binary function object + or function pointer. The transform_view + inherits the traversal characteristics (see Sequence + Traversal Concept) of its underlying sequence or sequences. +

+
+ + Header +
+
+#include <boost/fusion/sequence/view/transform_view.hpp>
+
+
+ + Synopsis +
+

+ Unary Version +

+
+template <typename Sequence, typename F1>
+struct transform_view;
+
+

+ Binary Version +

+
+template <typename Sequence1, typename Sequence2, typename F2>
+struct transform_view;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Sequence +

+
+

+ A Forward + Sequence +

+
+

+

+
+

+ Sequence1 +

+
+

+ A Forward + Sequence +

+
+

+

+
+

+ Sequence2 +

+
+

+ A Forward + Sequence +

+
+

+

+
+

+ F1 +

+
+

+ A unary function object or function pointer. boost::result_of<F1(E)>::type is the return type of an + instance of F1 + when called with a value of each element type E + in the input sequence. +

+
+

+

+
+

+ F2 +

+
+

+ A binary function object or function pointer. boost::result_of<F2(E1, + E2)>::type is the return type of an + instance of F2 + when called with a value of each corresponding pair of element + type E1 and E2 in the input sequences. +

+
+

+

+
+
+ + Model of +
+
+
+

Notation

+
+
TV
+

+ A transform_view type +

+
BTV
+

+ A binary transform_view + type +

+
UTV
+

+ A unary transform_view + type +

+
f1
+

+ An instance of F1 +

+
f2
+

+ An instance of F2 +

+
s
+

+ An instance of Sequence +

+
s1
+

+ An instance of Sequence1 +

+
s2
+

+ An instance of Sequence2 +

+
tv, + tv2
+

+ Instances of transform_view +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Forward + Sequence, Bidirectional + Sequence or Random + Access Sequence depending on the traversal characteristics (see + Sequence Traversal + Concept) of its underlying sequence or sequences. +

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ UTV(s, + f1) +

+
+

+ Creates a unary transform_view + given sequence, s + and unary function object or function pointer, f1. +

+
+

+ BTV(s1, + s2, + f2) +

+
+

+ Creates a binary transform_view + given sequences, s1 + and s2 and binary + function object or function pointer, f2. +

+
+

+ TV(tv) +

+
+

+ Copy constructs a transform_view + from another transform_view, + tv. +

+
+

+ tv = + tv2 +

+
+

+ Assigns to a transform_view, + tv, from another + transform_view, + tv2. +

+
+
+ + Example +
+
+struct square
+{
+    template<typename Sig>
+    struct result;
+
+    template<typename U>
+    struct result<square(U)>
+    : remove_reference<U>
+    {};
+
+    template <typename T>
+    T operator()(T x) const
+    {
+        return x * x;
+    }
+};
+
+typedef vector<int, short, double> vector_type;
+vector_type vec(2, 5, 3.3);
+
+transform_view<vector_type, square> transform(vec, square());
+std::cout << transform << std::endl;
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/sequences/views/zip_view.html b/doc/html/fusion/sequences/views/zip_view.html new file mode 100644 index 00000000..866a7866 --- /dev/null +++ b/doc/html/fusion/sequences/views/zip_view.html @@ -0,0 +1,230 @@ + + + +zip_view + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ zip_view presents a view + which iterates over a collection of _sequence_s + in parallel. A zip_view + is constructed from a Sequence + of references to the component _sequence_s. +

+
+ + Header +
+
+#include <boost/fusion/sequence/view/zip_view.hpp>
+
+
+ + Synopsis +
+
+template <typename Sequences>
+struct zip_view;
+
+
+ + Template + parameters +
+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ Default +

+
+

+ Sequences +

+
+

+ A Forward + Sequence of references to other Fusion _sequence_s +

+
+

+

+
+
+ + Model of +
+
+
+

Notation

+
+
ZV
+

+ A joint_view type +

+
s
+

+ An instance of Sequences +

+
zv1, + zv2
+

+ Instances of ZV +

+
+
+
+ + Expression + Semantics +
+

+ Semantics of an expression is defined only where it differs from, or is + not defined in Forward + Sequence. +

+
++++ + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ ZV(s) +

+
+

+ Creates a zip_view + given a sequence of references to the component _sequence_s. +

+
+

+ ZV(zv1) +

+
+

+ Copy constructs a zip_view + from another zip_view, + zv. +

+
+

+ zv1 = + zv2 +

+
+

+ Assigns to a zip_view, + zv, from another + zip_view, zv2. +

+
+
+ + Example +
+
+typedef vector<int,int> vec1;
+typedef vector<char,char> vec2;
+vec1 v1(1,2);
+vec2 v2('a','b');
+typedef vector<vec1&, vec2&> sequences;
+std::cout << zip_view<sequences>(sequences(v1, v2)) << std::endl; // ((1 a) (2 b))
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/support.html b/doc/html/fusion/support.html new file mode 100644 index 00000000..06a56770 --- /dev/null +++ b/doc/html/fusion/support.html @@ -0,0 +1,51 @@ + + + +Support + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ A couple of classes and metafunctions provide basic support for Fusion. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/support/category_of.html b/doc/html/fusion/support/category_of.html new file mode 100644 index 00000000..599c514b --- /dev/null +++ b/doc/html/fusion/support/category_of.html @@ -0,0 +1,192 @@ + + + +category_of + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Description +

+

+ A metafunction that establishes the conceptual classification of a particular + Sequence or Iterator + (see Iterator Concepts and + Sequence Concepts). +

+

+ + Synopsis +

+
+namespace traits
+{
+    template <typename T>
+    struct category_of 
+    {
+        typedef unspecified type;
+    };
+}
+
+

+ + Parameters +

+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type to query. +

+
+

+ + Expression + Semantics +

+
+typedef traits::category_of<T>::type category;
+
+

+ Return type: +

+

+ For Iterators, the return type is derived from one of: +

+
+namespace boost { namespace fusion
+{
+    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 {};
+}}
+
+

+ For Sequences, the return type is derived from one of: +

+
+namespace boost { namespace fusion
+{
+    struct incrementable_sequence_tag {};
+
+    struct single_pass_sequence_tag
+        : incrementable_sequence_tag {};
+
+    struct forward_traversal_tag
+        : single_pass_sequence_tag {};
+
+    struct bidirectional_traversal_tag
+        : forward_traversal_tag {};
+
+    struct random_access_traversal_tag
+        : bidirectional_traversal_tag {};
+}}
+
+

+ And optionally from: +

+
+namespace boost { namespace fusion
+{
+    struct associative_sequence_tag {};
+}}
+
+

+ Semantics: Establishes the conceptual classification + of a particular Sequence or Iterator. +

+

+ + Header +

+
+#include <boost/fusion/support/category_of.hpp>
+
+

+ + Example +

+
+using boost::is_base_of;
+typedef traits::category_of<list<> >::type list_category;
+typedef traits::category_of<vector<> >::type vector_category;
+BOOST_MPL_ASSERT(( is_base_of<forward_traversal_tag, list_category> ));
+BOOST_MPL_ASSERT(( is_base_of<random_access_traversal_tag, vector_category> ));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/support/deduce.html b/doc/html/fusion/support/deduce.html new file mode 100644 index 00000000..4b7b035b --- /dev/null +++ b/doc/html/fusion/support/deduce.html @@ -0,0 +1,99 @@ + + + +deduce + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Description +

+

+ Metafunction to apply element + conversion to the full argument type. +

+

+ It removes references to const, + references to array types are kept, even if the array is const. + Reference wrappers are removed (see boost::ref). +

+

+ + Header +

+
+#include <boost/fusion/support/deduce.hpp>
+
+

+ + Synopsis +

+
+namespace traits
+{
+    template <typename T> 
+    struct deduce
+    {
+        typedef unspecified type;
+    };
+}
+
+

+ + Example +

+
+template <typename T>
+struct holder
+{
+    typename traits::deduce<T const &>::type element;
+
+    holder(T const & a)
+      : element(a)
+    { }
+};
+
+template <typename T>
+holder<T> make_holder(T const & a)
+{
+    return holder<T>(a);
+}
+
+

+ + See also +

+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/support/deduce_sequence.html b/doc/html/fusion/support/deduce_sequence.html new file mode 100644 index 00000000..c7423807 --- /dev/null +++ b/doc/html/fusion/support/deduce_sequence.html @@ -0,0 +1,101 @@ + + + +deduce_sequence + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Description +

+

+ Applies element + conversion to each element in a Forward + Sequence. The resulting type is a Random + Access Sequence that provides a converting constructor accepting the + original type as its argument. +

+

+ + Header +

+
+#include <boost/fusion/support/deduce_sequence.hpp>
+
+

+ + Synopsis +

+
+namespace traits
+{
+    template <class Sequence> 
+    struct deduce_sequence
+    {
+        typedef unspecified type;
+    };
+}
+
+

+ + Example +

+
+template <class Seq>
+struct holder
+{
+    typename traits::deduce_sequence<Seq>::type element;
+
+    holder(Seq const & a)
+      : element(a)
+    { }
+};
+
+template <typename T0, typename T1>
+holder< vector<T0 const &, T1 const &> > 
+make_holder(T0 const & a0, T1 const & a1)
+{
+    typedef vector<T0 const &, T1 const &> arg_vec_t;
+    return holder<arg_vec_t>( arg_vec_t(a0,a1) ); 
+}
+
+

+ + See also +

+ +
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/support/is_sequence.html b/doc/html/fusion/support/is_sequence.html new file mode 100644 index 00000000..c2e96c86 --- /dev/null +++ b/doc/html/fusion/support/is_sequence.html @@ -0,0 +1,146 @@ + + + +is_sequence + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Description +

+

+ Metafunction that evaluates to mpl::true_ + if a certain type T is a + conforming Fusion Sequence, mpl::false_ + otherwise. This may be specialized to accomodate clients which provide Fusion + conforming sequences. +

+

+ + Synopsis +

+
+namespace traits
+{
+    template <typename T>
+    struct is_sequence 
+    {
+        typedef unspecified type;
+    };
+}
+
+

+ + Parameters +

+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type to query. +

+
+

+ + Expression + Semantics +

+
+typedef traits::is_sequence<T>::type c;
+
+

+ Return type: An MPL + Boolean Constant. +

+

+ Semantics: Metafunction that evaluates to + mpl::true_ if a certain type T + is a conforming Fusion sequence, mpl::false_ + otherwise. +

+

+ + Header +

+
+#include <boost/fusion/support/is_sequence.hpp>
+
+

+ + Example +

+
+BOOST_MPL_ASSERT_NOT(( traits::is_sequence< std::vector<int> > ));
+BOOST_MPL_ASSERT_NOT(( is_sequence< int > ));
+BOOST_MPL_ASSERT(( traits::is_sequence<list<> > ));
+BOOST_MPL_ASSERT(( traits::is_sequence<list<int> > ));
+BOOST_MPL_ASSERT(( traits::is_sequence<vector<> > ));
+BOOST_MPL_ASSERT(( traits::is_sequence<vector<int> > ));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/support/is_view.html b/doc/html/fusion/support/is_view.html new file mode 100644 index 00000000..9f245620 --- /dev/null +++ b/doc/html/fusion/support/is_view.html @@ -0,0 +1,150 @@ + + + +is_view + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Description +

+

+ Metafunction that evaluates to mpl::true_ + if a certain type T is a + conforming Fusion View, mpl::false_ + otherwise. A view is a specialized sequence that does not actually contain + data. Views hold sequences which may be other views. In general, views are + held by other views by value, while non-views are held by other views by + reference. is_view may be + specialized to accomodate clients providing Fusion conforming views. +

+

+ + Synopsis +

+
+namespace traits
+{
+    template <typename T>
+    struct is_view 
+    {
+        typedef unspecified type;
+    };
+}
+
+

+ + Parameters +

+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type to query. +

+
+

+ + Expression Semantics +

+
+typedef traits::is_view<T>::type c;
+
+

+ Return type: An MPL + Boolean Constant. +

+

+ Semantics: Metafunction that evaluates to + mpl::true_ if a certain type T + is a conforming Fusion view, mpl::false_ + otherwise. +

+

+ + Header +

+
+#include <boost/fusion/support/is_view.hpp>
+
+

+ + Example +

+
+BOOST_MPL_ASSERT_NOT(( traits::is_view<std::vector<int> > ));
+BOOST_MPL_ASSERT_NOT(( traits::is_view<int> ));
+
+using boost::mpl::_
+using boost::is_pointer;
+typedef vector<int*, char, long*, bool, double> vector_type;
+typedef filter_view<vector_type, is_pointer<_> > filter_view_type;
+BOOST_MPL_ASSERT(( traits::is_view<filter_view_type> ));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/support/pair.html b/doc/html/fusion/support/pair.html new file mode 100644 index 00000000..92548e61 --- /dev/null +++ b/doc/html/fusion/support/pair.html @@ -0,0 +1,337 @@ + + + +pair + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Description +

+

+ Fusion pair type is a half + runtime pair. A half runtime pair is similar to a std::pair, + but, unlike std::pair, + the first type does not have data. It is used as elements in _map_s, + for example. +

+

+ + Synopsis +

+
+template <typename First, typename Second>
+struct pair;
+
+namespace result_of
+{
+    template <typename First, typename Second>
+    struct first;
+
+    template <typename First, typename Second>
+    struct second;
+
+    template <typename First, typename Second>
+    struct make_pair;
+}
+
+template <typename First, typename Second>
+typename result_of::make_pair<First,Second>::type
+make_pair(Second const &);
+
+

+ + Template parameters +

+
++++ + + + + + + + + + + + + + + +
+

+ Parameter +

+
+

+ Description +

+
+

+ First +

+
+

+ The first type. This is purely a type. No data is held. +

+
+

+ Second +

+
+

+ The second type. This contains data. +

+
+
+

Notation

+
+
P
+

+ Fusion pair type +

+
p, + p2
+

+ Fusion pairs +

+
F, + S
+

+ Arbitrary types +

+
s
+

+ Value of type S +

+
o
+

+ Output stream +

+
i
+

+ Input stream +

+
+
+

+ + Expression Semantics +

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Expression +

+
+

+ Semantics +

+
+

+ P::first_type +

+
+

+ The type of the first template parameter, F, + equivalent to result_of::first<P>::type. +

+
+

+ P::second_type +

+
+

+ The type of the second template parameter, S, + equivalent to result_of::second<P>::type. +

+
+

+ P() +

+
+

+ Default construction. +

+
+

+ P(s) +

+
+

+ Construct a pair given value for the second type, s. +

+
+

+ P(p2) +

+
+

+ Copy constructs a pair from another pair, p2. +

+
+

+ p = + p2 +

+
+

+ Assigns a pair, p1, from another pair, p2. +

+
+

+ make_pair<F>(s) +

+
+

+ Make a pair given the first type, F, + and a value for the second type, s. + The second type assumes the type of s +

+
+

+ o << + p +

+
+

+ Output p to output + stream, o. +

+
+

+ i >> + p +

+
+

+ Input p from input + stream, i. +

+
+

+ p == + p2 +

+
+

+ Tests two pairs for equality. +

+
+

+ p != + p2 +

+
+

+ Tests two pairs for inequality. +

+
+

+ + Header +

+
+#include <boost/fusion/support/pair.hpp>
+
+

+ + Example +

+
+pair<int, char> p('X');
+std::cout << p << std::endl;
+std::cout << make_pair<int>('X') << std::endl;
+assert((p == make_pair<int>('X')));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/support/tag_of.html b/doc/html/fusion/support/tag_of.html new file mode 100644 index 00000000..57404fd6 --- /dev/null +++ b/doc/html/fusion/support/tag_of.html @@ -0,0 +1,146 @@ + + + +tag_of + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Description +

+

+ All conforming Fusion sequences and iterators have an associated tag type. + The purpose of the tag is to enable tag + dispatching from Intrinsic + functions to implementations appropriate for the type. +

+

+ This metafunction may be specialized to accomodate clients providing Fusion + conforming sequences. +

+

+ + Synopsis +

+
+namespace traits
+{
+    template<typename Sequence>
+    struct tag_of 
+    {
+        typedef unspecified type;
+    };
+}
+
+

+ + Parameters +

+
+++++ + + + + + + + + + + +
+

+ Parameter +

+
+

+ Requirement +

+
+

+ Description +

+
+

+ T +

+
+

+ Any type +

+
+

+ The type to query. +

+
+

+ + Expression Semantics +

+
+typedef traits::tag_of<T>::type tag;
+
+

+ Return type: Any type. +

+

+ Semantics: Returns the tag type associated + with T. +

+

+ + Header +

+
+#include <boost/fusion/support/tag_of.hpp>
+
+

+ + Example +

+
+typedef traits::tag_of<list<> >::type tag1;
+typedef traits::tag_of<list<int> >::type tag2;
+typedef traits::tag_of<vector<> >::type tag3;
+typedef traits::tag_of<vector<int> >::type tag4;
+
+BOOST_MPL_ASSERT((boost::is_same<tag1, tag2>));
+BOOST_MPL_ASSERT((boost::is_same<tag3, tag4>));
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/tuples.html b/doc/html/fusion/tuples.html new file mode 100644 index 00000000..d6045ced --- /dev/null +++ b/doc/html/fusion/tuples.html @@ -0,0 +1,65 @@ + + + +Tuples + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ The TR1 technical report describes extensions to the C++ standard library. + Many of these extensions will be considered for the next iteration of the C++ + standard. TR1 describes a tuple type, and support for treating std::pair + as a type of tuple. +

+

+ Fusion provides full support for the TR1 + Tuple interface, and the extended uses of std::pair described + in the TR1 document. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/tuples/class_template_tuple.html b/doc/html/fusion/tuples/class_template_tuple.html new file mode 100644 index 00000000..2ee19c9a --- /dev/null +++ b/doc/html/fusion/tuples/class_template_tuple.html @@ -0,0 +1,80 @@ + + + +Class template tuple + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ + +

+ Fusion's implementation of the TR1 + Tuple is also a fusion Forward + Sequence. As such the fusion tuple type provides a lot of functionality + beyond that required by TR1. +

+

+ Currently tuple is basically a synonym for vector, although this may be changed + in future releases of fusion. +

+

+ + Synopsis +

+
+template<
+    typename T1 = unspecified,
+    typename T2 = unspecified,
+    ...
+    typename TN = unspecified>
+class tuple;
+
+

+ + Header +

+
+#include <boost/fusion/tuple.hpp>
+
+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/tuples/class_template_tuple/construction.html b/doc/html/fusion/tuples/class_template_tuple/construction.html new file mode 100644 index 00000000..5577f155 --- /dev/null +++ b/doc/html/fusion/tuples/class_template_tuple/construction.html @@ -0,0 +1,130 @@ + + + +Construction + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ The TR1 + Tuple type provides a default constructor, a constructor that takes + initializers for all of its elements, a copy constructor, and a converting + copy constructor. The details of the various constructors are described + in this section. +

+
+ + Specification +
+
+

Notation

+
+
T1 + ... TN, + U1 ... + UN
+

+ Tuple element types +

+
P1 + ... PN
+

+ Parameter types +

+
Ti, + Ui
+

+ The type of the ith + element of a tuple +

+
Pi
+

+ The type of the ith + parameter +

+
+
+
+tuple();
+
+

+ Requirements: Each Ti + is default constructable. +

+

+ Semantics: Default initializes each element + of the tuple. +

+
+tuple(P1,P2,...,PN);
+
+

+ Requirements: Each Pi + is Ti if Ti is a reference type, const Ti& otherwise. +

+

+ Semantics: Copy initializes each element + with the corresponding parameter. +

+
+tuple(const tuple& t);
+
+

+ Requirements: Each Ti + should be copy constructable. +

+

+ Semantics: Copy constructs each element + of *this + with the corresponding element of t. +

+
+template<typename U1, typename U2, ..., typename UN>
+tuple(const tuple<U1, U2, ..., UN>& t);
+
+

+ Requirements: Each Ti + shall be constructible from the corresponding Ui. +

+

+ Semantics: Constructs each element of + *this + with the corresponding element of t. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/tuples/class_template_tuple/element_access.html b/doc/html/fusion/tuples/class_template_tuple/element_access.html new file mode 100644 index 00000000..119585a2 --- /dev/null +++ b/doc/html/fusion/tuples/class_template_tuple/element_access.html @@ -0,0 +1,95 @@ + + + +Element + access + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ The TR1 + Tuple provides the get + function to provide access to it's elements by zero based numeric index. +

+
+ + Specification +
+
+template<int I, T>
+RJ get(T& t);
+
+

+ Requires: 0 + < I + <= N. + The program is ill formed if I + is out of bounds. T is + any fusion sequence type, including tuple. +

+

+ Return type: RJ + is equivalent to result_of::at_c<I,T>::type. +

+

+ Returns: A reference to the Ith element of T. +

+
+template<int I, typename T>
+PJ get(T const& t);
+
+

+ Requires: 0 + < I + <= N. + The program is ill formed if I + is out of bounds. T is + any fusion sequence type, including tuple. +

+

+ Return type: PJ + is equivalent to result_of::at_c<I,T>::type. +

+

+ Returns: A const reference to the Ith element of T. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/tuples/class_template_tuple/relational_operators.html b/doc/html/fusion/tuples/class_template_tuple/relational_operators.html new file mode 100644 index 00000000..90d031bd --- /dev/null +++ b/doc/html/fusion/tuples/class_template_tuple/relational_operators.html @@ -0,0 +1,207 @@ + + + +Relational + operators + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ The TR1 + Tuple provides the standard boolean relational operators. +

+
+ + Specification +
+
+

Notation

+
+
T1 + ... TN, + U1 ... + UN
+

+ Tuple element types +

+
P1 + ... PN
+

+ Parameter types +

+
Ti, + Ui
+

+ The type of the ith + element of a tuple +

+
Pi
+

+ The type of the ith + parameter +

+
+
+
+template<typename T1, typename T2, ..., typename TN,
+         typename U1, typename U2, ..., typename UN>
+bool operator==(
+    const tuple<T1, T2, ..., TN>& lhs,
+    const tuple<U1, U2, ..., UN>& rhs);
+
+

+ Requirements: For all i, + 1 <= + i < + N, get<i>(lhs) == get<i>(rhs) + is a valid expression returning a type that is convertible to bool. +

+

+ Semantics: Returns true + if and only if get<i>(lhs) == get<i>(rhs) + for all i. For any 2 zero + length tuples e and f, e + == f + returns true. +

+
+template<typename T1, typename T2, ..., typename TN,
+         typename U1, typename U2, ..., typename UN>
+bool operator<(
+    const tuple<T1, T2, ..., TN>& lhs,
+    const tuple<U1, U2, ..., UN>& rhs);
+
+

+ Requirements: For all i, + 1 <= + i < + N, get<i>(lhs) < get<i>(rhs) + is a valid expression returning a type that is convertible to bool. +

+

+ Semantics: Returns the lexicographical + comparison of between lhs + and rhs. +

+
+template<typename T1, typename T2, ..., typename TN,
+         typename U1, typename U2, ..., typename UN>
+bool operator!=(
+    const tuple<T1, T2, ..., TN>& lhs,
+    const tuple<U1, U2, ..., UN>& rhs);
+
+

+ Requirements: For all i, + 1 <= + i < + N, get<i>(lhs) == get<i>(rhs) + is a valid expression returning a type that is convertible to bool. +

+

+ Semantics: Returns !(lhs == rhs). +

+
+template<typename T1, typename T2, ..., typename TN,
+         typename U1, typename U2, ..., typename UN>
+bool operator<=(
+    const tuple<T1, T2, ..., TN>& lhs,
+    const tuple<U1, U2, ..., UN>& rhs);
+
+

+ Requirements: For all i, + 1 <= + i < + N, get<i>(rhs) < get<i>(lhs) + is a valid expression returning a type that is convertible to bool. +

+

+ Semantics: Returns !(rhs < lhs) +

+
+template<typename T1, typename T2, ..., typename TN,
+         typename U1, typename U2, ..., typename UN>
+bool operator>(
+    const tuple<T1, T2, ..., TN>& lhs,
+    const tuple<U1, U2, ..., UN>& rhs);
+
+

+ Requirements: For all i, + 1 <= + i < + N, get<i>(rhs) < get<i>(lhs) + is a valid expression returning a type that is convertible to bool. +

+

+ Semantics: Returns rhs + < lhs. +

+
+template<typename T1, typename T2, ..., typename TN,
+         typename U1, typename U2, ..., typename UN>
+bool operator>=(
+    const tuple<T1, T2, ..., TN>& lhs,
+    const tuple<U1, U2, ..., UN>& rhs);
+
+

+ Requirements: For all i, + 1 <= + i < + N, get<i>(lhs) < get<i>(rhs) + is a valid expression returning a type that is convertible to bool. +

+

+ Semantics: Returns !(lhs < rhs). +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/tuples/class_template_tuple/tuple_creation_functions.html b/doc/html/fusion/tuples/class_template_tuple/tuple_creation_functions.html new file mode 100644 index 00000000..814625bb --- /dev/null +++ b/doc/html/fusion/tuples/class_template_tuple/tuple_creation_functions.html @@ -0,0 +1,80 @@ + + + +Tuple + creation functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ TR1 describes 2 utility functions for creating _tr1tuple_s. make_tuple + builds a tuple out of it's argument list, and tie + builds a tuple of references to it's arguments. The details of these creation + functions are described in this section. +

+
+ + Specification +
+
+template<typename T1, typename T2, ..., typename TN>
+tuple<V1, V2, ..., VN> make_tuple(const T1& t1, const T2& t2, ..., const TN& tn);
+
+

+ Where Vi is X& + if the cv-unqualified type Ti + is reference_wrapper<X>, + otherwise Vi is Ti. +

+

+ Returns: tuple<V1, V2, ..., VN>(t1, t2, ..., tN) +

+
+template<typename T1, typename T2, ..., typename TN>
+tuple<T1&, T2&, ..., TN&> tie(T1& t1, T2& t2, ..., TN& tn);
+
+

+ Returns: tuple<T1&, T2&, ..., + TN&>(t1, t2, ..., tN). When argument ti + is ignore, assigning any + value to the corresponding tuple element has has no effect. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/tuples/class_template_tuple/tuple_helper_classes.html b/doc/html/fusion/tuples/class_template_tuple/tuple_helper_classes.html new file mode 100644 index 00000000..1bd436e1 --- /dev/null +++ b/doc/html/fusion/tuples/class_template_tuple/tuple_helper_classes.html @@ -0,0 +1,87 @@ + + + +Tuple + helper classes + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Description +
+

+ The TR1 + Tuple provides 2 helper traits, for compile time access to the + tuple size, and the element types. +

+
+ + Specification +
+
+tuple_size<T>::value
+
+

+ Requires: T + is any fusion sequence type, including tuple. +

+

+ Type: MPL + Integral Constant +

+

+ Value: The number of elements in the sequence. + Equivalent to result_of::size<T>::type. +

+
+tuple_element<I, T>::type
+
+

+ Requires: T + is any fusion sequence type, including tuple. + 0 <= + I < + N or the program is ill formed. +

+

+ Value: The type of the Ith + element of T. Equivalent + to result_of::value_at<I,T>::type. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/fusion/tuples/pairs.html b/doc/html/fusion/tuples/pairs.html new file mode 100644 index 00000000..5060e796 --- /dev/null +++ b/doc/html/fusion/tuples/pairs.html @@ -0,0 +1,108 @@ + + + +Pairs + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +

+ + Description +

+

+ The TR1 + Tuple interface is specified to provide uniform access to std::pair + as if it were a 2 element tuple. +

+

+ + Specification +

+
+tuple_size<std::pair<T1, T2> >::value
+
+

+ Type: An MPL + Integral Constant +

+

+ Value: Returns 2, the number of elements + in a pair. +

+
+tuple_element<0, std::pair<T1, T2> >::type
+
+

+ Type: T1 +

+

+ Value: Returns the type of the first element + of the pair +

+
+tuple_element<1, std::pair<T1, T2> >::type
+
+

+ Type: T2 +

+

+ Value: Returns thetype of the second element + of the pair +

+
+template<int I, typename T1, typename T2>
+P& get(std::pair<T1, T2>& pr);
+
+template<int I, typename T1, typename T2>
+const P& get(const std::pair<T1, T2>& pr);
+
+

+ Type: If I + == 0 + P is T1, + else if I == + 1 P + is T2 else the program is + ill-formed. +

+

+ Returns: pr.first + if I == + 0 else pr.second.[*Returns: + pr.first if I + == 0 + else pr.second. +

+
+ + + +
Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias + Schwinger
+
+
+PrevUpHomeNext +
+ + diff --git a/doc/html/images/alert.png b/doc/html/images/alert.png new file mode 100755 index 0000000000000000000000000000000000000000..b4645bc7e7cd81f2818bf22aa898e95f89f7b154 GIT binary patch literal 603 zcmeAS@N?(olHy`uVBq!ia0y~yV31^BU=ZVAW?*1oN<7}ez`(#Bl2vQw%VQUVy#($c(b7<_!Z&&*`7 zwYIFTuIA!kP?6(!`t<3^g$y0J3{Q73WQH(YSjJ#(AQj-}VXe>LZ_gkv$q?hiVP&Xj ztS4or%^)MjpsB?1|Nnp9pi5p13=F0vL4Lvi$p8#BTQ7jZgtNdSvY3H^>jMZgI;}C8 z!N9FSxfgB=H7N+NC77H_+N#nawR{=RqTMBX)(LXL|IjinhDSdCyWWZ3S$0kBOZbahGm>{cU3L4X z*xaKNrl+L*2&>`tT{GF}sK6TCoSy58@94C>csZ@3se0z)OD!J`ePg?KNk!eRu!nuZ zwIuy5g5`UyU*2!`JMiPV^UIVvmW1t{f1*^~1#9h_jDIZO*R6JmbN8&QBXd?)zY=(& z`HG+Mis#k2-hNM1nwI_8efYU@yAuCZhY42|Be;Juo!svFUA16}A_D^hgQu&X%Q~lo FCIA+53ZVc1 literal 0 HcmV?d00001 diff --git a/doc/html/images/caution.png b/doc/html/images/caution.png new file mode 100644 index 0000000000000000000000000000000000000000..5b7809ca4a9c8d778087522e5ce04b6e90099595 GIT binary patch literal 1250 zcmeAS@N?(olHy`uVBq!ia0y~yV2}V|4rT@hhU+WOo?>8NW(e>Jab;j&;NV~o5MYpy zU{F+KFf?Rva$<;zVn|MA$j)XcE@r5%W@u?)XlW_#>0#*UDemd%nKFf8%9P?MQ>y38 zVVEwkZjIWyHF@jSt$X(}?A@Du?i|Cp zbLXyIW4Lzh+_h`h?%iX!chB(NJdh*`E$$X&!4}4&+z{J`|sZwzJC|^ z{$1kxcf;@BzyJTw@c+NS|Nj#IN5NBISn~R-X--a%afBxQ|J!3zMjr_SU zk_iHr)f*lf{$5^Qz}I)@3FlWvw(w~u=1P@VsTP+$RNGvxbHL-(%M6nc6`{zlU zjGQJeveps+!&Jb&mD)L@hA} z1_tL6*NBqf{Irtt#G+IN2MuLS&)mfHRNut(%;anZ6Fnn63k6F{eFF=914D)6qRirw zN{8Ia;*!i{z0_j8l+uFyyb`_S{M?DV6n8K%Fld2|%S_KpEGaEYWk@zRFt#waFg8d` zG)YZPF-fe)lBATd3a!N{b-$VA&f+n^|#(~yCI Ofx*+&&t;ucLK6T%G-N*j literal 0 HcmV?d00001 diff --git a/doc/html/images/fusion_org.png b/doc/html/images/fusion_org.png new file mode 100644 index 0000000000000000000000000000000000000000..3bb56539d6f91cf0025ac6a5ca804cea46388cb0 GIT binary patch literal 1849 zcmeAS@N?(olHy`uVBq!ia0y~yV4TUoz!1&B%)r1fO^4$<0|Ntdv6E*A2M5RPhyD*3 z7#Latd_r8gxw)S`dv@l`nVB_o}QlgxOhoP$$R(iSy@>fIdWv?%$aFvX_}gv0{j9kEiGPN zUW$r}PEJn6#l->~99~Xdd3kwGR!)kNihH+i)l^hWOG}H7i)*N_5BRz8F9QREPDzko z@P8D*fWkxP-2cY^l!1YPv%n*=n1O-o0|+xZtudLwz`&qd;u=vBoS#-wo>-L1;G39S zl%JcLl9{OBmRXcqo?nz*tl%4=U}Rum(q6XaJOcykV^0^ykcv5PXTL34Wh3Io>LuWF z@54-k4CXUGR`31)ySkhs>{p?itL|@^Z?i6Dtobm3HRbS?v-O)jd_7{0%{Sl0Ji9WU z`@Zlar6`>QwMs?3q!TKdqbmq?@x@;b!O7 zS&Tx={-stnua+6QRjCDDFuQo^qE5DX^85!Ab4u2irc7F(dwNx*)vVSt7RI^%CcPI{ z_SIBP_jcbrK{EYVg}z+H#2)9^3;MEWH&q#1eUdV>OuIKl{nOILk=OFvWDadg%A0rd zkj>?g)SGhC`_dveN=8rHyP|ETU9D$D<}8_Y=}N2479>8GOqnpVQ6v*l8>RO+H}Pb>$zlc>&o+HqyW>2@i@xuPt9gI^_wJxOW^#>t_wl`pczAeH1XJ4L z8;w7`=4nZ+o^Q8P?PPD-lEAK$iR)$etv@z>lI!wwx67YPA9voeOQS;DZ}qP|hd$o@ zviNoX2FbLVyIJ)TGd{1nYp}w@#UQNg#JT3uw@J@uywtwO-geVA^>~j&99Qf??KJDw z#J{@UU-IPmcZzd`DKBc<5#IJsvDhzWqb*jq#)iuX&#@@%6;=vj{#WM*FUxZ=saPm>o-l{H^>yLYwhnGFZN_Oegt zHfpPN6IyVi;IKI>k59q9e;Xyw&WY!3E(e*DDg5;GiFIn3+>+&Cr!&(H{mmBpytv&N zzR99XsL(1cVZKQ2gI|7WZ`_l3ez&N6meTKT~pD`i*l}<+sUgI(p&Ulbt_Toc(os+u7N*wvTsP`ApGyR-|+Bm|gga zo2$-<=KHTcdn6#+wO3&8+Os~|dp{dE#Pf^Z`r-BGW73D`D#h;@HB9%q6o@~O4>vQO zQOp0}G1H+F`r<~{L2w zpLp!Fyoo}&s$c-Ojn^6bnny}^h4!7HgZE!+Go7{|D*+r)R zd!fuwCbzyYcM}>ke|kZqMrEmP96;6^YHwZVX=h^(XJlpQSSd_vu#%6g=$fe}BAZYthcC zYCUa};GV6K1qq2u+d0*WKl_x;N?$WmcX8#j?UL)$7x2BF#l|;nUG@3e>vOVL=UG#DiN7GS6%b%DwcU5ua6(*+nzF*onKLh6zO-%YmOy{sw6wJU|Nk%gvq74Hfq|za z$S?Rm0x$^OKX;CSfq}EYBeIx*fm;ZK886+f`@_J%pjzS@Q4*Y=R#Ki=l*-_nm|T>f zo0^iDsNj}alvU8YOY t9}F9JU6`43jMG5vNQA&8NcoN_f;wr$vARr(hAt9lu zscC6x>EvV>6{VS+EaBwj6ciMco$ZvI98_E!l$@NLot<4>UER|o(bHqOcQ41TYc{y!?kM?_wFg)yJvXsp5^oB z9Pi&Vyniq7|3Ab3{~Z7S3p{_W`TV)z`}cpO z$(;G%_wGG* z?AW<;=dNA5cJJQ3=g*(NfB*jb_wWDz|6hCQ@I3|w2F4_BcNgdM3%p4T42R|DNig) zWpL0?*7VFxOi%SqOwUZtRxr^s(z8&owA44S&^IttNG{4OE~#|Ltt>9dOx8;+)=McZ z$j>X$OU}=oxJz*d0|SE=*tpE}yu^~yqEv=t literal 0 HcmV?d00001 diff --git a/doc/html/images/next.png b/doc/html/images/next.png new file mode 100755 index 0000000000000000000000000000000000000000..59800b4e87f60c0e3383ede2b384b9be0f5ffe8d GIT binary patch literal 336 zcmeAS@N?(olHy`uVBq!ia0y~yU=Rjj7G?$phK4%r{|pQa%*9TgAsieWw;%dHU|?WS z3GfMV6&Dfg?(8r&Hr}>%OQ656nzF)*4nJa0`Jj)#l9-t%+}PK^d+g590~2^trx_V+aGYt)W#Kgko@Q{~>i6>w}LxPb)_bi1gN;4a>^d{wcURt*495hZOYc8|NsA=8=F$dz`$Tq666>BpLD?B9j=thz`(#+;1OBOz`*qZgc+UI zn9N{cU{Eb_jVKAuPb(=;EJ|hYO-wGz&rMCqOjK~oEJ`iUFUl@f@QqL~GB7Y{FI#h- zfq_xR)5S5QVovU)+hxrP02oy7clOl(|F;(fCx<^{O+3$d{!GJf zAT>%@)+Kac%o^ zm8~at%dZNSg`XDA>HpujeRb(tA@xWH1+`xhu}_a!eJ{ORYJcMi$Ma>cBHv0)HBxa4 zSGC~^nY{G5@1(nj{7!xJ-s1V$LbWCK_xDFLe3_MRf4msHv}xJrfBaF7=BYjUcQ!FF PFfe$!`njxgN@xNAS|c%7 literal 0 HcmV?d00001 diff --git a/doc/html/images/prev.png b/doc/html/images/prev.png new file mode 100755 index 0000000000000000000000000000000000000000..d88a40f923e3c554125f01cd366707c60cfcad04 GIT binary patch literal 334 zcmeAS@N?(olHy`uVBq!ia0y~yU=Rjj7G?$phK4%r{|pQa%*9TgAsieWw;%dHU|?WS z3GfMV6&DdqOG`60Hr}>%%ZlYo1O0u~loc*tzSP~>;p||S5Et|R|Noh1c$yg)73T~N2spa`a*~JRJ5eh~I1}5!gYtAz;Fo=OPI2WZRmSpDVDTHL^rZN~B=o=X8 z8<-ql-^0nkz!2u?;uumfC;0|1OPoRyGxLNShYX~Tl_Wf9G1_imu)%RA9}mw<0X2^e zQioc&m}WXSvRw^OFi2qFa&lm1W^U?K=~^Ook|m{hVvche^Q6-g?(V)Vn8U=toEqFE UkjD9gfq{X+)78&qol`;+00?PtqyPW_ literal 0 HcmV?d00001 diff --git a/doc/html/images/smiley.png b/doc/html/images/smiley.png new file mode 100755 index 0000000000000000000000000000000000000000..30a77f71ce16872d046a1a5d6fd698a2f65a3f62 GIT binary patch literal 867 zcmeAS@N?(olHy`uVBq!ia0y~yU=U|uV36QoW?*1YTQtp`fq{X!*vT`5gM;JtL;nX1 z42*&SJ|V8+B7&<|tz5IBw4@*~EXexT*H!m!O?Pp!sH>^CckiyDuKJ|Dl+(w%CQay1 zOYu8%=FGd73zHKgmoF}|u{3I~kKDVXVbQ_`9c`_Fz7{iQrl~4QMTGi1fByW=jcKLD z*?C#s*_rWAAIx@f)c16=+qAB-t1T`u&hzVsWjnTSn>lml<@5cSX&!B@jUfSci{|F_ z_w^KKXB!)+#6)_3`t<4gwQEt~&MzL%J+!ao-_JD<@64PzGws6Z-hv$8-Me=7btN{` zl~t96rKP3$c$&I9TcsogXQl?mL%y{W;-5&-92C)*?h!W?b)Wnj^{5*w_%-mE4Lj!$7BYguC zr{Y6*7#J8-K`Mgt(@M${i&7bU6O)Vbb5m0?6BXPti&D$;i?WLqd?OT$3=B-#%hsG{ zU|`huba4!+n3FrHHoVC|#v<-Y&ynX`2+ z)ci{*-@n^>-frGI_MA-9eHCQCFMs-NiTvCzJ8a&6h<9#D<(d3(^{E}JLTitR9GSK2 z$*O4*8tU!OHS*&Yg~mSMD)7~hd93j+u`cf5MM<4*zJ;yfFKhYEn9bv3Xeg3g;K-G= z;q?Q<5Qk-d*rznCncd{p+umG~t-YZ3L%_f9;YyrSd?k7nE}0j~xg-T!p1r_pXw_8J z^q9XtRP=q)pSk7_!?YePxacL!`8E4~v$oZii_iB4y^t?YSBana!LlH(Q{_whcc+EB z6^^opPM-68`QEg&=hc<^;brIeKBf1+k=uTZ@Aa)4^R8_EExPXM@|~g)-OB%bBP#i` ie0$=QHXfdLO8@!p%oni+1)dBH3=E#GelF{r5}E*N2(Kal literal 0 HcmV?d00001 diff --git a/doc/html/images/tip.png b/doc/html/images/tip.png new file mode 100755 index 0000000000000000000000000000000000000000..9f596b0b88eb42562b2d0b0e30d054509be42af2 GIT binary patch literal 640 zcmeAS@N?(olHy`uVBq!ia0y~yV2}V|4rT@hhU+WOo?>8NU@ms@4B_D5xc$)o0Rsa= zZ-7sTtD>UflSfBq&1}s`kJ`U?skgWH)2B~oOmF`E^TxIg4+D?5M~H-?Y?- zI&~E<1_lQGk|4j}{|LZEaktF(-D? z%Sp`&0xgDm?d}|!0v)M>{a+K-KKU!3@9L8LOa5Z1>0OX+j1SY)GfWc?{l8U z$2VD9PtNu%kvS~%Xw8E;=95FN9-q3V{gPE~*|fjR%QkDRKeb=t2Ll5GgQu&X%Q~lo FCIFO8ExiB$ literal 0 HcmV?d00001 diff --git a/doc/html/images/up.png b/doc/html/images/up.png new file mode 100755 index 0000000000000000000000000000000000000000..17d9c3ec491ae1ba22188ce85985623c92ffa9be GIT binary patch literal 370 zcmeAS@N?(olHy`uVBq!ia0y~yU=Rjj7G?$phK4%r{|pQa%*9TgAsieWw;%dHU|?X- z3h)VW6&DdqOG|Thu-mqE%ZlYoyE{8BU%nLR@2jS)FmvY2qel)W#Kk;%^zi@x|I?Un z*fKCM@RbDl1^-6|46X<6oM2#J;4JWnEM{Qf76M_$OLy!3FfcHvmbgZg1m~xflqVLY zGWaGY7v<-srer26xMdclmgg5`7c2NiC>R+Sn6#IzInThrAO_OlT$Gwvl9`{U5R#dj z%3x@qZ(yu%U~+tY4<`cyLy@P8V@SoEspmFwHW&!FJyeg_(XezvV9WvAI|r@_>dZZG zPW6aiOT!J--9O?NG0%AP;}ge|4lDQN4=-}8`?JGwx}?mMnO)OdyQdu$nQCjPRV}jm z$u!Qa8E-cQ-r3Nz>Y(YPTd#BPEH+&8GWqfD!}4*53%dA!%#3$cIv;a~fq{X+)78&q Iol`;+0POUaApigX literal 0 HcmV?d00001 diff --git a/doc/html/images/warning.png b/doc/html/images/warning.png new file mode 100644 index 0000000000000000000000000000000000000000..1c33db8f34a8b42b373179b46a2d8d8a10e061a9 GIT binary patch literal 1241 zcmeAS@N?(olHy`uVBq!ia0y~yV2}V|4rT@hhU+WOo?>8NW(e>JaphoO5CF?5GB9W| zFc>m0I59AIF)#!%FhnshWHT@nGcZ&$Ftji*^e`|?VPKe2T|Fl#Xiikroa*YO3=B&x zEth(EEp2I8I%UezrAyZ`FswB+TsvjTRtAQxnwndCdbZA)vvujxty{P5WnkF5cJ1D+ zTaPg?91{>YCLwX`*s*gA4Ce#{&Phm|)6~4iz;I1d^V+p*_ZS%N-Mjakf#JEL;`8Uv z-!m}0=iqq%{{43bhVS3M|7T$MKMF=efJz}yVEuRs0|NtNlDE4HLkFv@2Ll7c3r`ov zkcwNmlWOyu3izvS7ejxP>R-!INP5f(XN|IS^C^Iyp?`SUk1vQO?s(K&l| zi|Nkt0@~*ymDp65*E-HED6u(s{Mfrxmah{JrgAMTIq)Du?nC5nnYTRgThA|azEdIl zD^uvV>~q(b?>`Fd;xnAbe7so1I$-&keKN}|vNNOCvX<~g{)wp7{&hR__v^cBU*Gq* zV3YS!cBPWsl#eNWc|~nAXWMOB8tQWBuXo=4>}cytyX_5F^Az{bVJ>7~U~n#RjVKAu zPb(=;EJ|f?&`{R&%uP&B^-WCAOwLv?(KFJsP_VSrH?Yt*FjPn`$}BFabjYnNF3C*R zOD)z*DJ{s)E742N&z-nSaR&nfgBIAh%=Em(lG377hGY|?B=Z!b6jL*k#Ka_13kwTN zLrZf@a|7cv1EVApQ-8txlNlHo_&~Y>64O%|j7%zwOtcNO4T_>U4H+017(8A5T-G@y GGywozG)2h( literal 0 HcmV?d00001 diff --git a/doc/html/index.html b/doc/html/index.html new file mode 100644 index 00000000..7be69e34 --- /dev/null +++ b/doc/html/index.html @@ -0,0 +1,234 @@ + + + +Chapter 1. Fusion 2.0 + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
Next
+
+
+

+Chapter 1. Fusion 2.0

+
+
+

+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +

+
+
+
+

Table of Contents

+
+
Preface
+
Introduction
+
Quick Start
+
Organization
+
Support
+
+
is_sequence
+
is_view
+
tag_of
+
category_of
+
deduce
+
deduce_sequence
+
pair
+
+
Iterators
+
+
Concepts
+
+
Forward + Iterator
+
Bidirectional + Iterator
+
Random + Access Iterator
+
+
Functions
+
+
deref
+
next
+
prior
+
distance
+
advance
+
advance_c
+
+
Operators
+
+
Operator + *
+
Operator + ==
+
Operator + !=
+
+
Metafunctions
+
+
value_of
+
deref
+
next
+
prior
+
equal_to
+
distance
+
advance
+
advance_c
+
+
+
Sequences
+
+
Concepts
+
+
Forward + Sequence
+
Bidirectional + Sequence
+
Random + Access Sequence
+
Associative + Sequence
+
+
Containers
+
+
vector
+
cons
+
list
+
set
+
map
+
+
Views
+
+
single_view
+
filter_view
+
iterator_range
+
joint_view
+
zip_view
+
transform_view
+
reverse_view
+
+
Adapted
+
+
std::pair
+
mpl sequence
+
boost::array
+
boost::tuple
+
boost::variant
+
+
Intrinsics
+
+
Functions
+
Metafunctions
+
+
Generation
+
+
Functions
+
MetaFunctions
+
+
Conversion
+
+
Functions
+
Metafunctions
+
+
Operators
+
+
I/O
+
Comparison
+
+
+
Algorithms
+
+
Iteration
+
+
Functions
+
Metafunctions
+
+
Query
+
+
Functions
+
Metafunctions
+
+
Transformation
+
+
Functions
+
Metafunctions
+
+
+
Tuples
+
+
Class template tuple
+
+
Construction
+
Tuple + creation functions
+
Tuple + helper classes
+
Element + access
+
Relational + operators
+
+
Pairs
+
+
Extension
+
Functional
+
+
Concepts
+
+
Callable Object
+
Regular Callable + Object
+
Deferred + Callable Object
+
Polymorphic Function + Object
+
+
Invocation
+
+
Functions
+
Metafunctions
+
+
Adapters
+
+
fused
+
fused_procedure
+
fused_function_object
+
unfused_generic
+
unfused_lvalue_args
+
unfused_rvalue_args
+
unfused_typed
+
+
Generation
+
+
Functions
+
Metafunctions
+
+
+
Notes
+
Change log
+
Acknowledgements
+
References
+
+
+
+ + + +

Last revised: September 22, 2007 at 01:00:16 GMT

+
+
Next
+ + diff --git a/doc/introduction.qbk b/doc/introduction.qbk new file mode 100644 index 00000000..d8f3f880 --- /dev/null +++ b/doc/introduction.qbk @@ -0,0 +1,81 @@ +[section Introduction] + +An advantage other languages such as Python and Lisp/ Scheme, ML and +Haskell, etc., over C++ is the ability to have heterogeneous containers +that can hold arbitrary element types. All the containers in the standard +library can only hold a specific type. A `vector` can only hold +`int`s. A `list` can only hold elements of type `X`, and so on. + +True, you can use inheritance to make the containers hold different types, +related through subclassing. However, you have to hold the objects through +a pointer or smart reference of some sort. Doing this, you'll have to rely +on virtual functions to provide polymorphic behavior since the actual type +is erased as soon as you store a pointer to a derived class to a pointer to +its base. The held objects must be related: you cannot hold objects of +unrelated types such as `char`, `int`, `class X`, `float`, etc. Oh sure you +can use something like __boost_any__ to hold arbitrary types, but then you +pay more in terms of runtime costs and due to the fact that you practically +erased all type information, you'll have to perform dangerous casts to get +back the original type. + +The __tuple__ library written by __jaakko_jarvi__ provides heterogeneous +containers in C++. The `tuple` is a basic data structure that can hold +heterogeneous types. It's a good first step, but it's not complete. What's +missing are the algorithms. It's nice that we can store and retrieve data +to and from tuples, pass them around as arguments and return types. As it +is, the __tuple__ facility is already very useful. Yet, as soon as you use +it more often, usage patterns emerge. Eventually, you collect these +patterns into algorithm libraries. + +Hmmm, kinda reminds us of STL right? Right! Can you imagine how it would be +like if you used STL without the algorithms? Everyone will have to reinvent +their own /algorithm/ wheels. + +Fusion is a library and a framework similar to both __stl__ and the boost +__mpl__. The structure is modeled after __mpl__, which is modeled +after __stl__. It is named "fusion" because the library is reminiscent of +the "fusion" of compile time meta-programming with runtime programming. The +library inherently has some interesting flavors and characteristics of both +__mpl__ and __stl__. It lives in the twilight zone between compile time +meta-programming and run time programming. __stl__ containers work on +values. MPL containers work on types. Fusion containers work on both types +and values. + +Unlike __mpl__, Fusion algorithms are lazy and non sequence-type +preserving. What does that mean? It means that when you operate on a +sequence through a Fusion algorithm that returns a sequence, the sequence +returned may not be of the same class as the original. This is by design. +Runtime efficiency is given a high priority. Like __mpl__, and unlike +__stl__, fusion algorithms are functional in nature such that algorithms +are non mutating (no side effects). However, due to the high cost of +returning full sequences such as vectors and lists, /Views/ are returned +from Fusion algorithms instead. For example, the __transform__ algorithm +does not actually return a transformed version of the original sequence. +__transform__ returns a __transform_view__. This view holds a reference to +the original sequence plus the transform function. Iteration over the +__transform_view__ will apply the transform function over the sequence +elements on demand. This /lazy/ evaluation scheme allows us to chain as +many algorithms as we want without incurring a high runtime penalty. + +The /lazy/ evaluation scheme where algorithms return views allows +operations such as __push_back__ to be totally generic. In Fusion, +__push_back__ is actually a generic algorithm that works on all sequences. +Given an input sequence `s` and a value `x`, Fusion's __push_back__ +algorithm simply returns a __joint_view__: a view that holds a reference to +the original sequence `s` and the value `x`. Functions that were once +sequence specific and need to be implemented N times over N different +sequences are now implemented only once. + +Fusion provides full round compatibility with __mpl__. Fusion sequences are +fully conforming __mpl__ sequences and __mpl__ sequences are fully +compatible with Fusion. You can work with Fusion sequences on __mpl__ if +you wish to work solely on types. In __mpl__, Fusion sequences follow +__mpl__'s sequence-type preserving semantics (i.e. algorithms preserve the +original sequence type. e.g. transforming a vector returns a vector). You +can also convert from an __mpl__ sequence to a Fusion sequence. For +example, there are times when it is convenient to work solely on __mpl__ +using pure __mpl__ sequences, then, convert them to Fusion sequences as a +final step before actual instantiation of real runtime objects with data. +You have the best of both worlds. + +[endsect] diff --git a/doc/iterators.qbk b/doc/iterators.qbk new file mode 100644 index 00000000..1607242a --- /dev/null +++ b/doc/iterators.qbk @@ -0,0 +1,855 @@ +[section Iterators] +Like __mpl__ and __stl__, iterators are a fundamental concept in Fusion. +As with __mpl__ and __stl__ iterators describe positions, and +provide access to data within an underlying __sequence__. + +[heading Header] + #include + +[section Concepts] + +Fusion iterators are divided into different traversal categories. +__forward_iterator__ is the most basic concept. __bidirectional_iterator__ +is a refinement of __forward_iterator__. __random_access_iterator__ is a +refinement of __bidirectional_iterator__. + +[section Forward Iterator] + +[heading Description] +A Forward Iterator traverses a __sequence__ allowing movement in only one direction through +it's elements, one element at a time. + +[variablelist Notation + [[`i`, `j`] [Forward Iterators]] + [[`I`, `J`] [Forward Iterator types]] + [[`M`] [An __mpl__ integral constant]] + [[`N`] [An integral constant]] +] + +[heading Expression requirements] +A type models Forward Iterator if, in addition to being CopyConstructable, +the following expressions are valid: + +[table + [[Expression] [Return type] [Runtime Complexity]] + [[`__next__(i)`] [__forward_iterator__] [Constant]] + [[`i == j`] [Convertible to bool] [Constant]] + [[`i != j`] [Convertible to bool] [Constant]] + [[`__advance_c__(i)`] [__forward_iterator__] [Constant]] + [[`__advance__(i)`] [__forward_iterator__] [Constant]] + [[`__distance__(i, j)`] [`__result_of_distance__::type`][Constant]] + [[`__deref__(i)`] [`__result_of_deref__::type`] [Constant]] + [[`*i`] [`__result_of_deref__::type`] [Constant]] +] + +[heading Meta Expressions] +[table + [[Expression] [Compile Time Complexity]] + [[`__result_of_next__::type`] [Amortized constant time]] + [[`__result_of_equal_to__::type`] [Amortized constant time]] + [[`__result_of_advance_c__::type`] [Linear]] + [[`__result_of_advance__::type`] [Linear]] + [[`__result_of_distance__::type`] [Linear]] + [[`__result_of_deref__::type`] [Amortized constant time]] + [[`__result_of_value_of__::type`] [Amortized constant time]] +] + +[heading Expression Semantics] +[ +table + [[Expression] [Semantics]] + [[`__next__(i)`] [An iterator to the element following `i`]] + [[`i == j`] [Iterator equality comparison]] + [[`i != j`] [Iterator inequality comparison]] + [[`__advance_c__(i)`] [An iterator n elements after `i` in the sequence]] + [[`__advance__(i)`] [Equivalent to `advance_c(i)`]] + [[`__distance__(i, j)`] [The number of elements between `i` and `j`]] + [[`__deref__(i)`] [The element at position`i`]] + [[`*i`] [Equivalent to `deref(i)`]] +] + +[heading Invariants] +The following invariants always hold: + +* `!(i == j) == (i != j)` +* `__next__(i) == __advance_c__<1>(i)` +* `__distance__(i, __advance_c__(i)) == N` +* Using `__next__` to traverse the sequence will never return to a previously seen position +* `__deref__(i)` is equivalent to `*i` +* If `i == j` then `*i` is equivalent to `*j` + +[heading Models] +* __std_pair__ iterator +* __boost_array__ iterator +* __vector__ iterator +* __cons__ iterator +* __list__ iterator +* __set__ iterator +* __map__ iterator +* __single_view__ iterator +* __filter_view__ iterator +* __iterator_range__ iterator +* __joint_view__ iterator +* __transform_view__ iterator +* __reverse_view__ iterator + +[endsect] + +[section Bidirectional Iterator] +[heading Description] +A Bidirectional Iterator traverses a __sequence__ allowing movement in either direction one +element at a time. + +[variablelist Notation + [[`i`] [A Bidirectional Iterator]] + [[`I`] [A Bidirectional Iterator type]] + [[`M`] [An __mpl__ integral constant]] + [[`N`] [An integral constant]] +] + +[heading Refinement of] +__forward_iterator__ + +[heading Expression requirements] +In addition to the requirements defined in __forward_iterator__, +the following expressions must be valid: + +[table + [[Expression] [Return type] [Runtime Complexity]] + [[`__next__(i)`] [__bidirectional_iterator__] [Constant]] + [[`__prior__(i)`] [__bidirectional_iterator__] [Constant]] + [[`__advance_c__(i)`] [__bidirectional_iterator__] [Constant]] + [[`__advance__(i)`] [__bidirectional_iterator__] [Constant]] +] + +[heading Meta Expressions] +[table + [[Expression] [Compile Time Complexity]] + [[`__result_of_prior__::type`] [Amortized constant time]] +] + +[heading Expression Semantics] +The semantics of an expression are defined only where they differ from, or are not defined +in __forward_iterator__ + +[table + [[Expression] [Semantics]] + [[`__prior__(i)`] [An iterator to the element preceding `i`]] +] + +[heading Invariants] +In addition to the invariants of __forward_iterator__, +the following invariants always hold: + +* `__prior__(__next__(i)) == i && __prior__(__next__(i)) == __next__(__prior__(i))` +* `__prior__(i) == __advance_c__<-1>(i)` +* Using `__prior__` to traverse a sequence will never return a previously seen position + +[heading Models] +* __std_pair__ iterator +* __boost_array__ iterator +* __vector__ iterator +* __iterator_range__ (where adapted sequence is a __bidirectional_sequence__) +* __transform_view__ (where adapted sequence is a __bidirectional_sequence__) +* __reverse_view__ + +[endsect] + +[section Random Access Iterator] +[heading Description] +A Random Access Iterator traverses a __sequence__ moving in either direction, +permitting efficient arbitrary distance movements back and forward through the +sequence. + +[variablelist Notation + [[`i`, `j`] [Random Access Iterators]] + [[`I`, `J`] [Random Access Iterator types]] + [[`M`] [An __mpl__ integral constant]] + [[`N`] [An integral constant]] +] + +[heading Refinement of] +__bidirectional_iterator__ + +[heading Expression requirements] +In addition to the requirements defined in __bidirectional_iterator__, +the following expressions must be valid: + +[table + [[Expression] [Return type] [Runtime Complexity]] + [[`__next__(i)`] [__random_access_iterator__] [Constant]] + [[`__prior__(i)`] [__random_access_iterator__] [Constant]] + [[`__advance_c__(i)`] [__random_access_iterator__] [Constant]] + [[`__advance__(i)`] [__random_access_iterator__] [Constant]] +] + +[heading Meta Expressions] +[table + [[Expression] [Compile Time Complexity]] + [[`__result_of_advance_c__::type`] [Amortized constant time]] + [[`__result_of_advance__::type`] [Amortized constant time]] + [[`__result_of_distance__::type`] [Amortized constant time]] +] + +[heading Models] +* __vector__ iterator +* __std_pair__ iterator +* __boost_array__ iterator +* __iterator_range__ iterator (where adapted sequence is a __random_access_sequence__) +* __transform_view__ iterator (where adapted sequence is a __random_access_sequence__) +* __reverse_view__ iterator (where adapted sequence is a __random_access_sequence__) + +[endsect] + +[endsect] + +[section Functions] +Fusion provides functions for manipulating iterators, analogous to the similar functions +from the __mpl__ library. + +[section deref] + +[heading Description] +Deferences an iterator. + +[heading Synopsis] + template< + typename I + > + typename __result_of_deref__::type deref(I const& i); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`] [Model of __forward_iterator__] [Operation's argument]] +] + +[heading Expression Semantics] + __deref__(i); + +[*Return type]: `__result_of_deref__::type` + +[*Semantics]: Dereferences the iterator `i`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + + int i(0); + vec v(1,i); + assert(__deref__(__begin__(v)) == 1); + assert(__deref__(__next__(__begin__(v))) == 0); + assert(&(__deref__(__next__(__begin__(v)))) == &i); + +[endsect] + +[section next] + +[heading Description] +Moves an iterator 1 position forwards. + +[heading Synopsis] + template< + typename I + > + typename __result_of_next__::type next(I const& i); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`] [Model of __forward_iterator__] [Operation's argument]] +] + +[heading Expression Semantics] + next(i); + +[*Return type]: A model of the same iterator concept as `i`. + +[*Semantics]: Returns an iterator to the next element after `i`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + + vec v(1,2,3); + assert(__deref__(__begin__(v)) == 1); + assert(__deref__(__next__(__begin__(v))) == 2); + assert(__deref__(__next__(__next__(__begin__(v)))) == 3); + +[endsect] + +[section prior] + +[heading Description] +Moves an iterator 1 position backwards. + +[heading Synopsis] + template< + typename I + > + typename __result_of_prior__::type prior(I const& i); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`] [Model of __bidirectional_iterator__] [Operation's argument]] +] + +[heading Expression Semantics] + __prior__(i); + +[*Return type]: A model of the same iterator concept as `i`. + +[*Semantics]: Returns an iterator to the element prior to `i`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + + vec v(1,2); + assert(__deref__(__next__(__begin__(v))) == 2); + assert(__deref__(__prior__(__next__(__begin__(v)))) == 1); + +[endsect] + +[section distance] + +[heading Description] +Returns the distance between 2 iterators. + +[heading Synopsis] + template< + typename I, + typename J + > + typename __result_of_distance__::type distance(I const& i, J const& j); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`, `j`] [Models of __forward_iterator__ into the same sequence] [The start and end points of the distance to be measured]] +] + +[heading Expression Semantics] + __distance__(i,j); + +[*Return type]: `int` + +[*Semantics]: Returns the distance between iterators `i` and `j`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + + vec v(1,2,3); + assert(__distance__(__begin__(v), __next__(__next__(__begin__(v)))) == 2); + +[endsect] + +[section advance] + +[heading Description] +Moves an iterator by a specified distance. + +[heading Synopsis] + template< + typename I, + typename M + > + typename __result_of_advance__::type advance(I const& i); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`] [Model of __forward_iterator__] [Iterator to move relative to]] + [[`N`] [An __mpl_integral_constant__] [Number of positions to move]] +] + +[heading Expression Semantics] + __advance__(i); + +[*Return type]: A model of the same iterator concept as `i`. + +[*Semantics]: Returns an iterator to the element `M` positions from `i`. If `i` is a __bidirectional_iterator__ then `M` may be negative. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + + vec v(1,2,3); + assert(__deref__(__advance__ >(__begin__(v))) == 3); + +[endsect] + +[section advance_c] + +[heading Description] +Moves an iterator by a specified distance. + +[heading Synopsis] + template< + typename I, + int N + > + typename __result_of_advance_c__::type advance_c(I const& i); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`] [Model of __forward_iterator__] [Iterator to move relative to]] + [[`N`] [Integer constant] [Number of positions to move]] +] + +[heading Expression Semantics] + __advance_c__(i); + +[*Return type]: A model of the same iterator concept as `i`. + +[*Semantics]: Returns an iterator to the element `N` positions from `i`. If `i` is a __bidirectional_iterator__ then `N` may be negative. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + + vec v(1,2,3); + assert(__deref__(__advance_c__<2>(__begin__(v))) == 3); + +[endsect] + +[endsect] + +[section Operators] +Overloaded operators are provided to provide a more natural syntax for dereferencing iterators, and comparing them for equality. + +[section:operator_unary_star Operator *] + +[heading Description] +Dereferences an iterator. + +[heading Synopsis] + template< + typename I + > + typename __result_of_deref__::type operator*(__unspecified__ const& i); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`] [Model of __forward_iterator__] [Operation's argument]] +] + +[heading Expression Semantics] + *i + +[*Return type]: Equivalent to the return type of `__deref__(i)`. + +[*Semantics]: Equivalent to `__deref__(i)`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + + int i(0); + vec v(1,i); + assert(*__begin__(v) == 1); + assert(*__next__(__begin__(v)) == 0); + assert(&(*__next__(__begin__(v))) == &i); + +[endsect] + +[section:operator_equality Operator ==] + +[heading Description] +Compares 2 iterators for equality. + +[heading Synopsis] + template< + typename I, + typename J + > + __unspecified__ operator==(I const& i, J const& i); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`, `j`] [Any fusion iterators] [Operation's arguments]] +] + +[heading Expression Semantics] + i == j + +[*Return type]: Convertible to `bool`. + +[*Semantics]: Equivalent to `__result_of_equal_to__::value` where `I` and `J` are the types of `i` and `j` respectively. + +[heading Header] + #include + +[endsect] + +[section:operator_inequality Operator !=] + +[heading Description] +Compares 2 iterators for inequality. + +[heading Synopsis] + template< + typename I, + typename J + > + __unspecified__ operator==(I const& i, J const& i); + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`i`, `j`] [Any fusion iterators] [Operation's arguments]] +] + +[heading Expression Semantics] + +[*Return type]: Convertible to `bool`. + +[*Semantics]: Equivalent to `!__result_of_equal_to__::value` where `I` and `J` are the types of `i` and `j` respectively. + +[heading Header] + #include + +[endsect] + +[endsect] + +[section Metafunctions] + +[section value_of] + +[heading Description] + +Returns the type stored at the position of an iterator. + +[heading Synopsis] + template< + typename I + > + struct value_of + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`I`] [Model of __forward_iterator__] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_value_of__::type + +[*Return type]: Any type + +[*Semantics]: Returns the type stored in a sequence at iterator position `I`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_begin__::type first; + typedef __result_of_next__::type second; + typedef __result_of_next__::type third; + + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_of__::type, int>)); + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_of__::type, int&>)); + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_of__::type, const int&>)); + +[endsect] + +[section deref] + +[heading Description] +Returns the type that will be returned by dereferencing an iterator. + +[heading Synposis] + template< + typename I + > + struct deref + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`I`] [Model of __forward_iterator__] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_deref__::type + +[*Return type]: Any type + +[*Semantics]: Returns the result of dereferencing an iterator of type `I`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef const vec const_vec; + typedef __result_of_begin__::type first; + typedef __result_of_next__::type second; + + typedef __result_of_begin__::type const_first; + typedef __result_of_next__::type const_second; + + BOOST_MPL_ASSERT((boost::is_same<__result_of_deref__::type, int&>)); + BOOST_MPL_ASSERT((boost::is_same<__result_of_deref__::type, int&>)); + +[endsect] + +[section next] + +[heading Description] +Returns the type of the next iterator in a sequence. + +[heading Synposis] + template< + typename I + > + struct next + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`I`] [Model of __forward_iterator__] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_next__::type + +[*Return type]: A model of the same iterator concept as `I`. + +[*Semantics]: Returns an iterator to the next element in the sequence after `I`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_next__<__result_of_begin__::type>::type second; + + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_of__::type, double>)); + +[endsect] + +[section prior] + +[heading Description] +Returns the type of the previous iterator in a sequence. + +[heading Synopsis] + template< + typename I + > + struct prior + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`I`] [Model of __bidirectional_iterator__] [Operation's argument]] +] + +[heading Expression Semantics] + __result_of_prior__::type + +[*Return type]: A model of the same iterator concept as `I`. + +[*Semantics]: Returns an iterator to the previous element in the sequence before `I`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_next__<__result_of_begin__::type>::type second; + + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_of__::type, double>)); + + typedef __result_of_prior__::type first; + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_of__::type, int>)); + +[endsect] + +[section equal_to] + +[heading Description] +Returns a true-valued __mpl_integral_constant__ if `I` and `J` are equal. + +[heading Synopsis] + template< + typename I, + typename J + > + struct equal_to + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`I`, `J`] [Any fusion iterators] [Operation's arguments]] +] + +[heading Expression Semantics] + __result_of_equal_to__::type + +[*Return type]: A model of __mpl_integral_constant__. + +[*Semantics]: Returns `boost::mpl::true_` if `I` and `J` are iterators to the same position. Returns `boost::mpl::false_` otherwise. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_begin__::type first; + typedef __result_of_end__::type last; + BOOST_MPL_ASSERT((__result_of_equal_to__)); + BOOST_MPL_ASSERT_NOT((__result_of_equal_to__)); + +[endsect] + +[section distance] + +[heading Description] +Returns the distance between two iterators. + +[heading Synopsis] + template< + typename I, + typename J + > + struct distance + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`I`, `J`] [Models of __forward_iterator__ into the same sequence] [The start and end points of the distance to be measured]] +] + +[heading Expression Semantics] + __result_of_distance__::type + +[*Return type]: A model of __mpl_integral_constant__. + +[*Semantics]: Returns the distance between iterators of types `I` and `J`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_begin__::type first; + typedef __result_of_next__::type second; + typedef __result_of_next__::type third; + typedef __result_of_distance__::type dist; + + BOOST_MPL_ASSERT_RELATION(dist::value, ==, 2); + +[endsect] + +[section advance] + +[heading Description] +Moves an iterator a specified distance. + +[heading Synopsis] + template< + typename I, + typename M + > + struct advance + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`I`] [Model of __forward_iterator__] [Iterator to move relative to]] + [[`M`] [Model of __mpl_integral_constant__] [Number of positions to move]] +] + +[heading Expression Semantics] + __result_of_advance__::type + +[*Return type]: A model of the same iterator concept as `I`. + +[*Semantics]: Returns an iterator a distance `M` from `I`. If `I` is a __bidirectional_iterator__ then `M` may be negative. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_begin__::type first; + typedef __result_of_next__::type second; + typedef __result_of_next__::type third; + + BOOST_MPL_ASSERT((__result_of_equal_to__<__result_of_advance__ >::type, third>)); + +[endsect] + +[section advance_c] + +[heading Description] +Moves an iterator by a specified distance. + +[heading Synopsis] + template< + typename I, + int N + > + struct advance_c + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`I`] [Model of __forward_iterator__] [Iterator to move relative to]] + [[`N`] [Integer constant] [Number of positions to move]] +] + +[heading Expression Semantics] + __result_of_advance_c__::type + +[*Return type]: A model of the same iterator concept as `I`. + +[*Semantics]: Returns an iterator a distance `N` from `I`. If `I` is a __bidirectional_iterator__ then `N` may be negative. Equivalent to `__result_of_advance__ >::type`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_begin__::type first; + typedef __result_of_next__::type second; + typedef __result_of_next__::type third; + + BOOST_MPL_ASSERT((__result_of_equal_to__<__result_of_advance_c__::type, third>)); + +[endsect] + +[endsect] + +[endsect] + diff --git a/doc/notes.qbk b/doc/notes.qbk new file mode 100644 index 00000000..f6fab805 --- /dev/null +++ b/doc/notes.qbk @@ -0,0 +1,146 @@ +[section Notes] + +[heading Recursive Inlined Functions] + +An interesting peculiarity of functions like __at__ when applied to a +__forward_sequence__ like __list__ is that what could have been linear +runtime complexity effectively becomes constant O(1) due to compiler +optimization of C++ inlined functions, however deeply recursive (up to a +certain compiler limit of course). Compile time complexity remains linear. + +[heading Overloaded Functions] + +Associative sequences use function overloading to implement membership +testing and type associated key lookup. This amounts to constant runtime +and amortized constant compile time complexities. There is an overloaded +function, `f(k)`, for each key /type/ `k`. The compiler chooses the +appropriate function given a key, `k`. + +[heading Tag Dispatching] + +Tag dispatching is a generic programming technique for selecting template +specializations. There are typically 3 components involved in the tag +dispatching mechanism: + +# A type for which an appropriate template specialization is required +# A metafunction that associates the type with a tag type +# A template that is specialized for the tag type + +For example, the fusion `result_of::begin` metafunction is implemented +as follows: + + template + struct begin + { + typedef typename + result_of::begin_impl::type>:: + template apply::type + type; + }; + +In the case: + +# `Sequence` is the type for which a suitable implementation of + `result_of::begin_impl` is required +# `traits::tag_of` is the metafunction that associates `Sequence` + with an appropriate tag +# `result_of::begin_impl` is the template which is specialized to provide + an implementation for each tag type + +[heading Extensibility] + +Unlike __mpl__, there is no extensibe sequence concept in fusion. This does +not mean that Fusion sequences are not extensible. In fact, all Fusion +sequences are inherently extensible. It is just that the manner of sequence +extension in Fusion is diferent from both __stl__ and __mpl__ on account of +the lazy nature of fusion __algorithms__. __stl__ containers extend +themselves in place though member functions such as __push_back__ and +__insert__. __mpl__ sequences, on the other hand, are extended through +"intrinsic" functions that actually return whole sequences. __mpl__ is +purely functional and can not have side effects. For example, __mpl__'s +`push_back` does not actually mutate an `mpl::vector`. It can't do that. +Instead, it returns an extended `mpl::vector`. + +Like __mpl__, Fusion too is purely functional and can not have side +effects. With runtime efficiency in mind, Fusion sequences are extended +through generic functions that return __views__. __views__ are sequences +that do not actually contain data, but instead impart an alternative +presentation over the data from one or more underlying sequences. __views__ +are proxies. They provide an efficient yet purely functional way to work on +potentially expensive sequence operations. For example, given a __vector__, +Fusion's __push_back__ returns a __joint_view__, instead of an actual +extended __vector__. A __joint_view__ holds a reference to the original +sequence plus the appended data --making it very cheap to pass around. + +[heading Element Conversion] + +Functions that take in elemental values to form sequences (e.g. +__make_list__) convert their arguments to something suitable to be stored +as a sequence element. In general, the element types are stored as plain +values. Example: + + __make_list__(1, 'x') + +returns a __list__``. + +There are a few exceptions, however. + +[*Arrays:] + +Array arguments are deduced to reference to const types. For example +[footnote Note that the type of a string literal is an array of const +characters, not `const char*`. To get __make_list__ to create a __list__ +with an element of a non-const array type one must use the `ref` wrapper +(see __note_boost_ref__).]: + + __make_list__("Donald", "Daisy") + +creates a __list__ of type + + __list__ + +[*Function pointers:] + +Function pointers are deduced to the plain non-reference type (i.e. to +plain function pointer). Example: + + void f(int i); + ... + __make_list__(&f); + +creates a __list__ of type + + __list__ + +[heading boost::ref] + +Fusion's generation functions (e.g. __make_list__) by default stores the +element types as plain non-reference types. Example: + + void foo(const A& a, B& b) { + ... + __make_list__(a, b) + +creates a __list__ of type + + __list__ + +Sometimes the plain non-reference type is not desired. You can use +`boost::ref` and `boost::cref` to store references or const references +(respectively) instead. The mechanism does not compromise const correctness +since a const object wrapped with ref results in a tuple element with const +reference type (see the fifth code line below). Examples: + +For example: + + A a; B b; const A ca = a; + __make_list__(cref(a), b); // creates list + __make_list__(ref(a), b); // creates list + __make_list__(ref(a), cref(b)); // creates list + __make_list__(cref(ca)); // creates list + __make_list__(ref(ca)); // creates list + +See __boost_ref__ for details. + +[endsect] + diff --git a/doc/organization.qbk b/doc/organization.qbk new file mode 100644 index 00000000..cff048f8 --- /dev/null +++ b/doc/organization.qbk @@ -0,0 +1,68 @@ +[section Organization] + +The library is organized into layers of modules, with each module addressing a particular +area of responsibility. A module may not depend on modules in higher layers. + +The library is organized in three layers: + +[heading Layers] + +[:[$images/fusion_org.png]] + +The entire library is found in the "boost/fusion" directory. Modules are +organized in directories. Each module has its own header file placed in the +same directory with the actual module-directory. For example, there exists +"boost/fusion/support.hpp" in the same directory as "boost/fusion/support". +Everything, except those found inside "detail" directories, is public. The +library is header-only. There is no need to build object files to link +against. + +[heading Directory] + +* tuple +* algorithm + * iteration + * query + * transformation +* sequence + * adapted + * array + * mpl + * std_pair + * comparison + * container + * list + * map + * set + * vector + * conversion + * generation + * intrinsic + * io + * utility + * view + * filter_view + * iterator_range + * joint_view + * reverse_view + * single_view + * transform_view + * zip_view +* iterator +* support + +[heading Example] + +If, for example, you want to use `list`, depending on the granularity that +you desire, you may do so by including one of + + #include + #include + #include + +The first includes all sequences. The second includes all of sequence +containers. The third includes only `list` [footnote Modules may contain +smaller components. Header file information for each component will be +provided as part of the component's documentation.]. + +[endsect] diff --git a/doc/preface.qbk b/doc/preface.qbk new file mode 100644 index 00000000..f6a9ff95 --- /dev/null +++ b/doc/preface.qbk @@ -0,0 +1,68 @@ +[section Preface] + +[:['["Algorithms + Data Structures = Programs.]]] +[:*--Niklaus Wirth*] + +[heading Description] + +Fusion is a library for working with heterogenous collections of data, +commonly referred to as tuples. A set of containers (vector, list, set and map) +is provided, along with views that provide a transformed presentation +of their underlying data. Collectively the containers and views are referred to +as sequences, and Fusion has a suite of algorithms that operate upon the +various sequence types, using an iterator concept that binds everything +together. + +The architecture is modeled after __mpl__ which in turn is modeled after +__stl__. It is named "fusion" because the library is a "fusion" of compile +time metaprogramming with runtime programming. + +[heading Motivation] + +Tuples are powerful beasts. After having developed two significant projects +(__spirit__ and __phoenix__) that relied heavily metaprogramming, it +became apparent that tuples are a powerful means to simplify otherwise tricky +tasks; especially those that require a combination of metaprogramming and +manipulation of heterogenous data types with values. While __mpl__ is an +extremely powerful metaprogramming tool, __mpl__ focuses on type +manipulation only. Ultimately, you'll have to map these types to real +values to make them useful in the runtime world where all the real action +takes place. + +As __spirit__ and __phoenix__ evolved, patterns and idioms related to tuple +manipulation emerged. Soon, it became clear that those patterns and idioms +were best assembled in a tuples algorithms library. __david_abrahams__ +outlined such a scheme in 2002. At that time, it just so happened that +__spirit__ and __phoenix__ had an adhoc collection of tuple manipulation +and traversal routines. It was an instant /AHA!/ moment. + +[heading How to use this manual] + +Some icons are used to mark certain topics indicative of their relevance. +These icons precede some text to indicate: + +[table Icons + [[Icon] [Name] [Meaning]] + [[__note__] [Note] [Information provided is auxiliary but will + give the reader a deeper insight into a specific + topic. May be skipped.]] + [[__alert__] [Alert] [Information provided is of utmost importance.]] + [[__caution__] [Caution] [A mild warning.]] + [[__tip__] [Tip] [A potentially useful and helpful piece of + information.]] +] + +This documentation is automatically generated by Boost QuickBook documentation +tool. QuickBook can be found in the __boost_tools__. + +[heading Support] + +Please direct all questions to Spirit's mailing list. You can subscribe to the +__spirit_list__. The mailing list has a searchable archive. A search link to +this archive is provided in __spirit__'s home page. You may also read and post +messages to the mailing list through __spirit_general__ (thanks to __gmane__). +The news group mirrors the mailing list. Here is a link to the archives: +__mlist_archive__. + +[endsect] + diff --git a/doc/quick_start.qbk b/doc/quick_start.qbk new file mode 100644 index 00000000..8857b5ea --- /dev/null +++ b/doc/quick_start.qbk @@ -0,0 +1,159 @@ +[section Quick Start] + +I assume the reader is already familiar with tuples (__tuple__) and its +ancestor `std::pair`. The tuple is a generalization of `std::pair` for +multiple heterogeneous elements (triples, quadruples, etc.). The tuple is +more or less a synonym for fusion's `__vector__`. + +For starters, we shall include all of Fusion's __sequence__s [footnote There +are finer grained header files available if you wish to have more control +over which components to include (see section __organization__ for +details).]: + + #include + +Let's begin with a `__vector__` [footnote Unless otherwise noted, components are +in namespace `boost::fusion`. For the sake of simplicity, code in this +quick start implies `using` directives for the fusion components we will be +using.]: + + __vector__ stuff(1, 'x', "howdy"); + int i = __at_c__<0>(stuff); + char ch = __at_c__<1>(stuff); + std::string s = __at_c__<2>(stuff); + +Just replace `tuple` for `__vector__` and `get` for `__at_c__` and this is exactly +like __tuple__. Actually, either names can be used interchangeably. Yet, +the similarity ends there. You can do a lot more with Fusion `__vector__` or +`tuple`. Let's see some examples. + +[heading Print the vector as XML] + +First, let's include the algorithms: + + #include + +Now, let's write a function object that prints XML of the form data +for each member in the tuple. + + struct print_xml + { + template + void operator()(T const& x) const + { + std::cout + << '<' << typeid(x).name() << '>' + << x + << "' + ; + } + }; + +Now, finally: + + __for_each__(stuff, print_xml()); + +That's it! `__for_each__` is a fusion algorithm. It is a generic algorithm +similar to __stl__'s. It iterates over the sequence and calls a user +supplied function. In our case, it calls `print_xml`'s `operator()` for +each element in `stuff`. + +[caution The result of `typeid(x).name()` is platform specific. The code +here is just for exposition. Of course you already know that :-)] + +`__for_each__` is generic. With `print_xml`, you can use it to print just about +any Fusion __sequence__. + +[heading Print only pointers] + +Let's get a little cleverer. Say we wish to write a /generic/ function +that takes in an arbitrary sequence and XML prints only those elements +which are pointers. Ah, easy. First, let's include the `is_pointer` boost +type trait: + + #include + +Then, simply: + + template + void xml_print_pointers(Sequence const& seq) + { + __for_each__(__filter_if__ >(seq), print_xml()); + } + +`__filter_if__` is another Fusion algorithm. It returns a __filter_view__, +a conforming Fusion sequence. This view reflects only those elements that +pass the given predicate. In this case, the predicate is +`boost::is_pointer<_>`. This "filtered view" is then passed to the +__for_each__ algorithm, which then prints the "filtered view" as XML. + +Easy, right? + +[heading Associative tuples] + +Ok, moving on... + +Apart from `__vector__`, fusion has a couple of other sequence types to choose +from. Each sequence has its own characteristics. We have `__list__`, `__set__`, +`__map__`, plus a multitude of `views` that provide various ways to present the +sequences. + +Fusion's `__map__` associate types with elements. It can be used as a cleverer +replacement of the `struct`. Example: + + namespace fields + { + struct name; + struct age; + } + + typedef __map__< + __fusion_pair__ + , __fusion_pair__ > + person; + +`__map__` is an associative sequence. Its elements are Fusion pairs which differ +somewhat from `std::pair`. Fusion pairs only contain one member, with the type of +their second template parameter. The first type parameter of the pair is used as an +index to the associated element in the sequence. For example, given a `a_person` +of type, `person`, you can do: + + using namespace fields; + std::string person_name = __at_key__(a_person); + int person_age = __at_key__(a_person); + +Why go through all this trouble, you say? Well, for one, unlike the +`struct`, we are dealing with a generic data structure. There are a +multitude of facilities available at your disposal provided out of the box +with fusion or written by others. With these facilities, introspection +comes for free, for example. We can write one serialization function (well, +two, if you consider loading and saving) that will work for all your fusion +`__map__`s. Example: + + struct saver + { + template + void operator()(Pair const& data) const + { + some_archive << data.second; + } + }; + + template + void save(Stuff const& stuff) + { + __for_each__(stuff, saver()); + } + +The `save` function is generic and will work for all types of `stuff` +regardless if it is a `person`, a `dog` or a whole `alternate_universe`. + +[heading Tip of the Iceberg] + +And... we've barely scratched the surface! You can compose and expand the +data structures, remove elements from the structures, find specific data +types, query the elements, filter out types for inspection, transform data +structures, etc. What you've seen is just the tip of the iceberg. + +[endsect] + diff --git a/doc/references.qbk b/doc/references.qbk new file mode 100644 index 00000000..840e83a3 --- /dev/null +++ b/doc/references.qbk @@ -0,0 +1,19 @@ +[section References] + +# [@http://boost.org/libs/iterator/doc/new-iter-concepts.html New Iterator Concepts], + David Abrahams, Jeremy Siek, Thomas Witt, 2004-11-01. +# [@http://boost.org/libs/tuple/doc/tuple_users_guide.html The Boost Tuple Library], + Jaakko Jarvi, 2001. +# [@http://www.boost.org/libs/spirit/ Spirit Parser Library], + Joel de Guzman, 2001-2006. +# [@http://www.boost.org/libs/mpl/ The Boost MPL Library], + Aleksey Gurtovoy and David Abrahams, 2002-2004. +# [@http://www.boost.org/doc/html/array.html Boost Array], + Nicolai Josuttis, 2002-2004. +# [@http://www.sgi.com/tech/stl/ Standard Template Library Programmer's Guide], + Hewlett-Packard Company, 1994. +# [@http://www.boost.org/doc/html/ref.html Boost.Ref], + Jaakko Jarvi, Peter Dimov, Douglas Gregor, Dave Abrahams, 1999-2002. + +[endsect] + diff --git a/doc/sequences.qbk b/doc/sequences.qbk new file mode 100644 index 00000000..ae1ce0ea --- /dev/null +++ b/doc/sequences.qbk @@ -0,0 +1,4036 @@ +[section Sequences] + +Like __mpl__, the Sequence is a fundamental concept in Fusion. A Sequence +may or may not actually store or contain data. __containers__ are sequences +that hold data. __views__, on the other hand, are sequences that do not +store any data. Instead, they are proxies that impart an alternative +presentation over another sequence. All models of Sequence have an +associated __iterator__ type that can be used to iterate through the +Sequence's elements. + +[heading Header] + + #include + +[section Concepts] + +Fusion Sequences are organized into a hierarchy of concepts. + +[heading Traversal] + +Fusion's sequence traversal related concepts parallel Fusion's +__iterator_concepts__. __forward_sequence__ is the most basic concept. +__bidirectional_sequence__ is a refinement of __forward_sequence__. +__random_access_sequence__ is a refinement of __bidirectional_sequence__. +These concepts pertain to sequence traversal. + +[heading Associativity] + +The __associative_sequence__ concept is orthogonal to traversal. An Associative +Sequence allows efficient retrieval of elements based on keys. + +[section Forward Sequence] + +[heading Description] + +A Forward Sequence is a Sequence whose elements are arranged in a definite +order. The ordering is guaranteed not to change from iteration to +iteration. The requirement of a definite ordering allows the definition of +element-by-element equality (if the container's element type is Equality +Comparable) and of lexicographical ordering (if the container's element +type is LessThan Comparable). + +[variablelist Notation + [[`s`] [A Forward Sequence]] + [[`S`] [A Forward Sequence type]] + [[`o`] [An arbitrary object]] + [[`e`] [A Sequence element]] +] + +[heading Valid Expressions] + +For any Forward Sequence the following expressions must be valid: + +[table + [[Expression] [Return type] [Type Requirements] [Runtime Complexity]] + [[`__begin__(s)`] [__forward_iterator__] [] [Constant]] + [[`__end__(s)`] [__forward_iterator__] [] [Constant]] + [[`__size__(s)`] [__mpl_integral_constant__. + Convertible to int.] [] [Constant]] + [[`__empty__(s)`] [__mpl_boolean_constant__. + Convertible to bool.] [] [Constant]] + [[`__front__(s)`] [Any type] [] [Constant]] + [[`__front__(s) = o`] [Any type] [`s` is mutable and + `e = o`, where `e` + is the first element + in the sequence, is + a valid expression.] [Constant]] +] + +[heading Result Type Expressions] + +[table + [[Expression] [Compile Time Complexity]] + [[`__result_of_begin__::type`] [Amortized constant time]] + [[`__result_of_end__::type`] [Amortized constant time]] + [[`__result_of_size__::type`] [Unspecified]] + [[`__result_of_empty__::type`] [Constant time]] + [[`__result_of_front__::type`] [Amortized constant time]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`__begin__(s)`] [An iterator to the first element of the sequence; see __begin__.]] + [[`__end__(s)`] [A past-the-end iterator to the sequence; see __end__.]] + [[`__size__(s)`] [The size of the sequence; see __size__.]] + [[`__empty__(s)`] [A boolean Integral Constant `c` such that + `c::value == true` if and only if the sequence + is empty; see __empty__.]] + [[`__front__(s)`] [The first element in the sequence; see __front__.]] +] + +[heading Invariants] + +For any Forward Sequence s the following invariants always hold: + +* `[__begin__(s), __end__(s))` is always a valid range. +* An __algorithm__ that iterates through the range `[__begin__(s), __end__(s))` + will pass through every element of `s` exactly once. +* `__begin__(s)` is identical to `__end__(s))` if and only if `s` is empty. +* Two different iterations through `s` will access its elements in + the same order. + +[heading Models] + +* __std_pair__ +* __boost_array__ +* __vector__ +* __cons__ +* __list__ +* __set__ +* __map__ +* __single_view__ +* __filter_view__ +* __iterator_range__ +* __joint_view__ +* __transform_view__ +* __reverse_view__ +* __zip_view__ + +[endsect] + +[section Bidirectional Sequence] + +[heading Description] + +A Bidirectional Sequence is a __forward_sequence__ whose iterators model +__bidirectional_iterator__. + +[heading Refinement of] + +__forward_sequence__ + +[variablelist Notation + [[`s`] [A Forward Sequence]] + [[`S`] [A Forward Sequence type]] + [[`o`] [An arbitrary object]] + [[`e`] [A Sequence element]] +] + +[heading Valid Expressions] + +In addition to the requirements defined in __forward_sequence__, for any +Bidirectional Sequence the following must be met: + +[table + [[Expression] [Return type] [Type Requirements] [Runtime Complexity]] + [[`__begin__(s)`] [__bidirectional_iterator__] [] [Constant]] + [[`__end__(s)`] [__bidirectional_iterator__] [] [Constant]] + [[`__back__(s)`] [Any type] [] [Constant]] + [[`__back__(s) = o`] [Any type] [`s` is mutable and + `e = o`, where `e` + is the first element + in the sequence, is + a valid expression.] [Constant]] +] + +[heading Result Type Expressions] + +[table + [[Expression] [Compile Time Complexity]] + [[`__result_of_begin__::type`] [Amortized constant time]] + [[`__result_of_end__::type`] [Amortized constant time]] + [[`__result_of_back__::type`] [Amortized constant time]] +] + +[heading Expression Semantics] + +The semantics of an expression are defined only where they differ from, or +are not defined in __forward_sequence__. + +[table + [[Expression] [Semantics]] + [[`__back__(s)`] [The last element in the sequence; see __back__.]] +] + +[heading Models] + +* __std_pair__ +* __boost_array__ +* __vector__ +* __reverse_view__ +* __iterator_range__ (where adapted sequence is a Bidirectional Sequence) +* __transform_view__ (where adapted sequence is a Bidirectional Sequence) +* __zip_view__ (where adapted sequences are models Bidirectional Sequence) + +[endsect] + +[section Random Access Sequence] + +[heading Description] + +A Random Access Sequence is a __bidirectional_sequence__ whose iterators +model __random_access_iterator__. It guarantees constant time access to +arbitrary sequence elements. + +[heading Refinement of] + +__bidirectional_sequence__ + +[variablelist Notation + [[`s`] [A Random Access Sequence]] + [[`S`] [A Random Access Sequence type]] + [[`N`] [An __mpl_integral_constant__]] + [[`o`] [An arbitrary object]] + [[`e`] [A Sequence element]] +] + +[heading Valid Expressions] + +In addition to the requirements defined in __bidirectional_sequence__, for +any Random Access Sequence the following must be met: + +[table + [[Expression] [Return type] [Type Requirements] [Runtime Complexity]] + [[`__begin__(s)`] [__random_access_iterator__] [] [Constant]] + [[`__end__(s)`] [__random_access_iterator__] [] [Constant]] + [[`__at__(s)`] [Any type] [] [Constant]] + [[`__at__(s) = o`] [Any type] [`s` is mutable and + `e = o`, where `e` + is the first element + in the sequence, is + a valid expression.] [Constant]] +] + +[heading Result Type Expressions] + +[table + [[Expression] [Compile Time Complexity]] + [[`__result_of_begin__::type`] [Amortized constant time]] + [[`__result_of_end__::type`] [Amortized constant time]] + [[`__result_of_at__::type`] [Amortized constant time]] + [[`__result_of_value_at__::type`] [Amortized constant time]] +] + +[blurb __note__ `__result_of_at__` returns the actual type returned by +`__at__(s)`. In most cases, this is a reference. Hence, there is no way to +know the exact element type using `__result_of_at__`.The element at `N` +may actually be a reference to begin with. For this purpose, you can use +`__result_of_value_at__`.] + +[heading Expression Semantics] + +The semantics of an expression are defined only where they differ from, or +are not defined in __bidirectional_sequence__. + +[table + [[Expression] [Semantics]] + [[`__at__(s)`] [The Nth element from the beginning of the sequence; see __at__.]] +] + +[heading Models] + +* __std_pair__ +* __boost_array__ +* __vector__ +* __reverse_view__ +* __iterator_range__ (where adapted sequence is a Random Access Sequence) +* __transform_view__ (where adapted sequence is a Random Access Sequence) +* __zip_view__ (where adapted sequences are models Random Access Sequence) + +[endsect] + +[section Associative Sequence] + +[heading Description] + +An Associative Sequence allows efficient retrieval of elements based on keys. +Like associative sequences in __mpl__, and unlike associative containers in +__stl__, Fusion associative sequences have no implied ordering relation. +Instead, type identity is used to impose an equivalence relation on keys, and +the order in which sequence elements are traversed during iteration is left +unspecified. In addition, unlike __stl__, Associative Sequences have mutable +iterators. This is due to the fact that there is no associated ordering relation +and the runtime value of the keys themselves do not have any effect on the +associativity of the sequence. + + +[variablelist Notation + [[`s`] [An Associative Sequence]] + [[`S`] [An Associative Sequence type]] + [[`K`] [An arbitrary /key/ type]] + [[`o`] [An arbitrary object]] + [[`e`] [A Sequence element]] +] + +[heading Valid Expressions] + +For any Associative Sequence the following expressions must be valid: + +[table + [[Expression] [Return type] [Type Requirements] [Runtime Complexity]] + [[`__has_key__(s)`] [__mpl_boolean_constant__. + Convertible to bool.] [] [Constant]] + [[`__at_key__(s)`] [Any type] [] [Constant]] + [[`__at_key__(s) = o`] [Any type] [`s` is mutable and + `e = o`, where `e` + is the first element + in the sequence, is + a valid expression.] [Constant]] +] + +[heading Result Type Expressions] + +[table + [[Expression] [Compile Time Complexity]] + [[`__result_of_has_key__::type`] [Amortized constant time]] + [[`__result_of_at_key__::type`] [Amortized constant time]] + [[`__result_of_value_at_key__::type`] [Amortized constant time]] +] + +[blurb __note__ `__result_of_at_key__` returns the actual type returned +by `__at_key__(s)`. In most cases, this is a reference. Hence, there is no +way to know the exact element type using `__result_of_at_key__`.The +element at `K` may actually be a reference to begin with. For this purpose, +you can use `__result_of_value_at_key__`.] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`__has_key__(s)`] [A boolean Integral Constant `c` such that + `c::value == true` if and only if there is + one or more elements with the key `k` in `s`; + see __has_key__.]] + [[`__at_key__(s)`] [The element associated with the key + `K` in the sequence `s`; see __at__.]] +] + +[heading Models] + +* __set__ +* __map__ + +[endsect] + +[endsect] + +[section Containers] + +Fusion provides a few predefined sequences out of the box. These +/containers/ actually hold heterogenously typed data; unlike +__views__. These containers are more or less counterparts of those in __stl__. + +[heading Header] + + #include + +[section vector] + +[heading Description] + +`vector` is a __random_access_sequence__ of heterogenous typed +data structured as a simple `struct` where each element is held +as a member variable. `vector` is the simplest of the Fusion +sequence container, and in many cases the most efficient. + +[heading Header] + + #include + #include + + // numbered forms + #include + #include + #include + #include + #include + +[heading Synopsis] + +[*Numbered forms] + + template <> + struct vector0; + + template + struct vector1; + + template + struct vector2; + + template + struct vector3; + + ... + + template + struct vectorN; + +[*Variadic form] + + template < + typename T0 = __unspecified__ + , typename T1 = __unspecified__ + , typename T2 = __unspecified__ + ... + , typename TN = __unspecified__ + > + struct vector; + +The numbered form accepts the exact number of elements. Example: + + vector3 + +The variadic form accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, where +`FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that +defaults to `10`. Example: + + vector + +You may define the preprocessor constant `FUSION_MAX_VECTOR_SIZE` before +including any Fusion header to change the default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`T0`...`TN`] [Element types] [['unspecified]]] +] + +[heading Model of] + +* __random_access_sequence__ + +[variablelist Notation + [[`v`] [Instance of `vector`]] + [[`V`] [A `vector` type]] + [[`e0`...`en`] [Heterogeneous values]] + [[`s`] [A __forward_sequence__]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __random_access_sequence__. + +[table + [[Expression] [Semantics]] + [[`V()`] [Creates a vector with default constructed elements.]] + [[`V(e0, e1,... en)`] [Creates a vector with elements `e0`...`en`.]] + [[`V(s)`] [Copy constructs a vector from a __forward_sequence__, `s`.]] + [[`v = s`] [Assigns to a vector, `v`, from a __forward_sequence__, `s`.]] +] + +[heading Example] + + vector v(12, 5.5f); + std::cout << __at_c__<0>(v) << std::endl; + std::cout << __at_c__<1>(v) << std::endl; + +[endsect] + +[section cons] + +[heading Description] + +`cons` is a simple __forward_sequence__. It is a lisp style recursive list +structure where `car` is the /head/ and `cdr` is the /tail/: usually +another cons structure or `nil`: the empty list. Fusion's __list__ is built +on top of this more primitive data structure. It is more efficient than +__vector__ when the target sequence is constructed piecemeal (a data at a +time). The runtime cost of access to each element is peculiarly constant +(see __recursive_inline__). + +[heading Header] + + #include + +[heading Synopsis] + + template + struct cons; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Car`] [Head type] []] + [[`Cdr`] [Tail type] [`nil`]] +] + +[heading Model of] + +* __forward_sequence__ + +[variablelist Notation + [[`nil`] [An empty `cons`]] + [[`C`] [A `cons` type]] + [[`l`, `l2`] [Instances of `cons`]] + [[`car`] [An arbitrary data]] + [[`cdr`] [Another `cons` list]] + [[`s`] [A __forward_sequence__]] + [[`N`] [An __mpl_integral_constant__]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __forward_sequence__. + +[table + [[Expression] [Semantics]] + [[`nil()`] [Creates an empty list.]] + [[`C()`] [Creates a cons with default constructed elements.]] + [[`C(car)`] [Creates a cons with `car` head and default constructed tail.]] + [[`C(car, cdr)`] [Creates a cons with `car` head and `cdr` tail.]] + [[`C(s)`] [Copy constructs a cons from a __forward_sequence__, `s`.]] + [[`l = s`] [Assigns to a cons, `l`, from a __forward_sequence__, `s`.]] + [[`__at__(l)`] [The Nth element from the beginning of the sequence; see __at__.]] +] + +[blurb __note__ `__at__(l)` is provided for convenience and compatibility +with the original __tuple__ library, despite `cons` being a +__forward_sequence__ only (`at` is supposed to be a +__random_access_sequence__ requirement). The runtime complexity of __at__ is +constant (see __recursive_inline__).] + +[heading Example] + + cons > l(12, cons(5.5f)); + std::cout << __at_c__<0>(l) << std::endl; + std::cout << __at_c__<1>(l) << std::endl; + +[endsect] + +[section list] + +[heading Description] + +`list` is a __forward_sequence__ of heterogenous typed data built on top of +__cons__. It is more efficient than __vector__ when the target sequence is +constructed piecemeal (a data at a time). The runtime cost of access to +each element is peculiarly constant (see __recursive_inline__). + +[heading Header] + + #include + #include + +[heading Synopsis] + + template < + typename T0 = __unspecified__ + , typename T1 = __unspecified__ + , typename T2 = __unspecified__ + ... + , typename TN = __unspecified__ + > + struct list; + +The variadic class interface accepts `0` to `FUSION_MAX_LIST_SIZE` +elements, where `FUSION_MAX_LIST_SIZE` is a user definable predefined +maximum that defaults to `10`. Example: + + list + +You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` before +including any Fusion header to change the default. Example: + + #define FUSION_MAX_LIST_SIZE 20 + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`T0`...`TN`] [Element types] [['unspecified-type]]] +] + +[heading Model of] + +* __forward_sequence__ + +[variablelist Notation + [[`L`] [A `list` type]] + [[`l`] [An instance of `list`]] + [[`e0`...`en`] [Heterogeneous values]] + [[`s`] [A __forward_sequence__]] + [[`N`] [An __mpl_integral_constant__]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __forward_sequence__. + +[table + [[Expression] [Semantics]] + [[`L()`] [Creates a list with default constructed elements.]] + [[`L(e0, e1,... en)`] [Creates a list with elements `e0`...`en`.]] + [[`L(s)`] [Copy constructs a list from a __forward_sequence__, `s`.]] + [[`l = s`] [Assigns to a list, `l`, from a __forward_sequence__, `s`.]] + [[`__at__(l)`] [The Nth element from the beginning of the sequence; see __at__.]] +] + +[blurb __note__ `__at__(l)` is provided for convenience and compatibility +with the original __tuple__ library, despite `list` being a +__forward_sequence__ only (__at__ is supposed to be a +__random_access_sequence__ requirement). The runtime complexity of __at__ is +constant (see __recursive_inline__).] + +[heading Example] + + list l(12, 5.5f); + std::cout << __at_c__<0>(l) << std::endl; + std::cout << __at_c__<1>(l) << std::endl; + +[endsect] + +[section set] + +[heading Description] + +set is an __associative_sequence__ of heteregenous typed data elements. +Type identity is used to impose an equivalence relation on keys. The +element's type is its key. A set may contain at most one element for each +key. Membership testing and element key lookup has constant runtime +complexity (see __overloaded_functions__). + +[heading Header] + + #include + +[heading Synopsis] + + template < + typename T0 = __unspecified__ + , typename T1 = __unspecified__ + , typename T2 = __unspecified__ + ... + , typename TN = __unspecified__ + > + struct set; + +The variadic class interface accepts `0` to `FUSION_MAX_SET_SIZE` elements, +where `FUSION_MAX_SET_SIZE` is a user definable predefined maximum that +defaults to `10`. Example: + + set + +You may define the preprocessor constant `FUSION_MAX_SET_SIZE` before +including any Fusion header to change the default. Example: + + #define FUSION_MAX_SET_SIZE 20 + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`T0`...`TN`] [Element types] [['unspecified-type]]] +] + +[heading Model of] + +* __associative_sequence__ +* __forward_sequence__ + +[variablelist Notation + [[`S`] [A `set` type]] + [[`s`] [An instance of `set`]] + [[`e0`...`en`] [Heterogeneous values]] + [[`fs`] [A __forward_sequence__]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __random_access_sequence__ and __associative_sequence__. + +[table + [[Expression] [Semantics]] + [[`S()`] [Creates a set with default constructed elements.]] + [[`S(e0, e1,... en)`] [Creates a set with elements `e0`...`en`.]] + [[`S(fs)`] [Copy constructs a set from a __forward_sequence__ `fs`.]] + [[`s = fs`] [Assigns to a set, `s`, from a __forward_sequence__ `fs`.]] +] + +[heading Example] + + typedef set S; + S s(12, 5.5f); + std::cout << __at_key__(s) << std::endl; + std::cout << __at_key__(s) << std::endl; + std::cout << __result_of_has_key__::value << std::endl; + +[endsect] + +[section map] + +[heading Description] + +map is an __associative_sequence__ of heteregenous typed data elements. +Each element is a key/data pair (see __fusion_pair__) where the key has no +data (type only). Type identity is used to impose an equivalence relation +on keys. A map may contain at most one element for each key. Membership +testing and element key lookup has constant runtime complexity (see +__overloaded_functions__). + +[heading Header] + + #include + +[heading Synopsis] + + template < + typename T0 = __unspecified__ + , typename T1 = __unspecified__ + , typename T2 = __unspecified__ + ... + , typename TN = __unspecified__ + > + struct map; + +The variadic class interface accepts `0` to `FUSION_MAX_MAP_SIZE` elements, +where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that +defaults to `10`. Example: + + map<__pair__, __pair__, __pair__ > + +You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before +including any Fusion header to change the default. Example: + + #define FUSION_MAX_MAP_SIZE 20 + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`T0`...`TN`] [Element types] [['unspecified-type]]] +] + +[heading Model of] + +* __associative_sequence__ +* __forward_sequence__ + +[variablelist Notation + [[`M`] [A `map` type]] + [[`m`] [An instance of `map`]] + [[`e0`...`en`] [Heterogeneous key/value pairs (see __fusion_pair__)]] + [[`s`] [A __forward_sequence__]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __random_access_sequence__ and __associative_sequence__. + +[table + [[Expression] [Semantics]] + [[`M()`] [Creates a map with default constructed elements.]] + [[`M(e0, e1,... en)`] [Creates a map with element pairs `e0`...`en`.]] + [[`M(s)`] [Copy constructs a map from a __forward_sequence__ `s`.]] + [[`m = s`] [Assigns to a map, `m`, from a __forward_sequence__ `s`.]] +] + +[heading Example] + + typedef map< + __pair__ + , __pair__ > + map_type; + + map_type m( + __fusion_make_pair__('X') + , __fusion_make_pair__("Men")); + + std::cout << __at_key__(m) << std::endl; + std::cout << __at_key__(m) << std::endl; + +[endsect] + +[endsect] + +[section Views] + +Views are sequences that do not actually contain data, but instead impart +an alternative presentation over the data from one or more underlying +sequences. Views are proxies. They provide an efficient yet purely +functional way to work on potentially expensive sequence operations. Views +are inherently lazy. Their elements are only computed on demand only when +the elements of the underlying sequence(s) are actually accessed. Views' +lazy nature make them very cheap to copy and be passed around by value. + +[heading Header] + + #include + +[section single_view] + +`single_view` is a view into a value as a single element sequence. + +[heading Header] + + #include + +[heading Synopsis] + + template + struct single_view; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`T`] [Any type] []] +] + +[heading Model of] + +* __forward_sequence__ + +[variablelist Notation + [[`S`] [A `single_view` type]] + [[`s`, `s2`] [Instances of `single_view`]] + [[`x`] [An instance of `T`]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __forward_sequence__. + +[table + [[Expression] [Semantics]] + [[`S(x)`] [Creates a `single_view` from `x`.]] + [[`S(s)`] [Copy constructs a `single_view` from another `single_view`, `s`.]] + [[`s = s2`] [Assigns to a `single_view`, `s`, from another `single_view`, `s2`.]] +] + +[heading Example] + + single_view view(3); + std::cout << view << std::endl; + +[endsect] + +[section filter_view] + +[heading Description] + +`filter_view` is a view into a subset of its underlying sequence's elements +satisfying a given predicate (an __mpl__ metafunction). The `filter_view` +presents only those elements for which its predicate evaluates to +`mpl::true_`. + +[heading Header] + + #include + +[heading Synopsis] + + template + struct filter_view; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Sequence`] [A __forward_sequence__] []] + [[`Pred`] [Unary Metafunction + returning an `mpl::bool_`] []] +] + +[heading Model of] + +* __forward_sequence__ + +[variablelist Notation + [[`F`] [A `filter_view` type]] + [[`f`, `f2`] [Instances of `filter_view`]] + [[`s`] [A __forward_sequence__]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __forward_sequence__. + +[table + [[Expression] [Semantics]] + [[`F(s)`] [Creates a `filter_view` given a sequence, `s`.]] + [[`F(f)`] [Copy constructs a `filter_view` from another `filter_view`, `f`.]] + [[`f = f2`] [Assigns to a `filter_view`, `f`, from another `filter_view`, `f2`.]] +] + +[heading Example] + + using boost::mpl::_; + using boost::mpl::not_; + using boost::is_class; + + typedef __vector__ vector_type; + + vector_type v("a-string", '@', 987654, true, 6.6); + filter_view > > view(v); + std::cout << view << std::endl; + +[endsect] + +[section iterator_range] + +[heading Description] + +`iterator_range` presents a sub-range of its underlying sequence delimited +by a pair of iterators. + +[heading Header] + + #include + +[heading Synopsis] + + template + struct iterator_range; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`First`] [A fusion __iterator__] []] + [[`Last`] [A fusion __iterator__] []] +] + +[heading Model of] + +* __forward_sequence__, __bidirectional_sequence__ or +__random_access_sequence__ depending on the traversal characteristics (see +__traversal_concept__) of its underlying sequence. + +[variablelist Notation + [[`IR`] [An `iterator_range` type]] + [[`f`] [An instance of `First`]] + [[`l`] [An instance of `Last`]] + [[`ir`, `ir2`] [Instances of `iterator_range`]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __forward_sequence__. + +[table + [[Expression] [Semantics]] + [[`IR(f, l)`] [Creates an `iterator_range` given iterators, `f` and `l`.]] + [[`IR(ir)`] [Copy constructs an `iterator_range` from another `iterator_range`, `ir`.]] + [[`ir = ir2`] [Assigns to a `iterator_range`, `ir`, from another `iterator_range`, `ir2`.]] +] + +[heading Example] + + char const* s = "Ruby"; + typedef __vector__ vector_type; + vector_type vec(1, 'x', 3.3, s); + + typedef __result_of_begin__::type A; + typedef __result_of_end__::type B; + typedef __result_of_next__::type C; + typedef __result_of_prior__::type D; + + C c(vec); + D d(vec); + + iterator_range range(c, d); + std::cout << range << std::endl; + +[endsect] + +[section joint_view] + +[heading Description] + +`joint_view` presents a view which is a concatenation of two sequences. + +[heading Header] + + #include + +[heading Synopsis] + + template + struct joint_view; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Sequence1`] [A __forward_sequence__] []] + [[`Sequence2`] [A __forward_sequence__] []] +] + +[heading Model of] + +* __forward_sequence__ + +[variablelist Notation + [[`JV`] [A `joint_view` type]] + [[`s1`] [An instance of `Sequence1`]] + [[`s2`] [An instance of `Sequence2`]] + [[`jv`, `jv2`] [Instances of `joint_view`]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __forward_sequence__. + +[table + [[Expression] [Semantics]] + [[`JV(s1, s2)`] [Creates a `joint_view` given sequences, `s1` and `s2`.]] + [[`JV(jv)`] [Copy constructs a `joint_view` from another `joint_view`, `jv`.]] + [[`jv = jv2`] [Assigns to a `joint_view`, `jv`, from another `joint_view`, `jv2`.]] +] + +[heading Example] + + __vector__ v1(3, 'x'); + __vector__ v2("hello", 123); + joint_view< + __vector__ + , __vector__ + > view(v1, v2); + std::cout << view << std::endl; + +[endsect] + +[section zip_view] + +[heading Description] + +`zip_view` presents a view which iterates over a collection of __sequence__s in parallel. A `zip_view` +is constructed from a __sequence__ of references to the component __sequence__s. + +[heading Header] + + #include + +[heading Synopsis] + + template + struct zip_view; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Sequences`] [A __forward_sequence__ of references to other Fusion __sequence__s] []] +] + +[heading Model of] + +* __forward_sequence__, __bidirectional_sequence__ or +__random_access_sequence__ depending on the traversal characteristics (see +__traversal_concept__) of its underlying sequence. + +[variablelist Notation + [[`ZV`] [A `joint_view` type]] + [[`s`] [An instance of `Sequences`]] + [[`zv1`, `zv2`] [Instances of `ZV`]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __forward_sequence__. + +[table + [[Expression] [Semantics]] + [[`ZV(s)`] [Creates a `zip_view` given a sequence of references to the component __sequence__s.]] + [[`ZV(zv1)`] [Copy constructs a `zip_view` from another `zip_view`, `zv`.]] + [[`zv1 = zv2`] [Assigns to a `zip_view`, `zv`, from another `zip_view`, `zv2`.]] +] + +[heading Example] + typedef __vector__ vec1; + typedef __vector__ vec2; + vec1 v1(1,2); + vec2 v2('a','b'); + typedef __vector__ sequences; + std::cout << zip_view(sequences(v1, v2)) << std::endl; // ((1 a) (2 b)) + +[endsect] + +[section transform_view] + +The unary version of `transform_view` presents a view of its underlying +sequence given a unary function object or function pointer. The binary +version of `transform_view` presents a view of 2 underlying sequences, +given a binary function object or function pointer. The `transform_view` +inherits the traversal characteristics (see __traversal_concept__) of +its underlying sequence or sequences. + +[heading Header] + + #include + +[heading Synopsis] + +[*Unary Version] + + template + struct transform_view; + +[*Binary Version] + + template + struct transform_view; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Sequence`] [A __forward_sequence__] []] + [[`Sequence1`] [A __forward_sequence__] []] + [[`Sequence2`] [A __forward_sequence__] []] + [[`F1`] [A unary function object or function pointer. `__boost_result_of_call__::type` is the return type of an instance of `F1` when called with a value of each element type `E` in the input sequence.] []] + [[`F2`] [A binary function object or function pointer. `__boost_result_of_call__::type` is the return type of an instance of `F2` when called with a value of each corresponding pair of element type `E1` and `E2` in the input sequences.] []] +] + +[heading Model of] + +* __forward_sequence__, __bidirectional_sequence__ or +__random_access_sequence__ depending on the traversal characteristics (see +__traversal_concept__) of its underlying sequence. + +[variablelist Notation + [[`TV`] [A `transform_view` type]] + [[`BTV`] [A binary `transform_view` type]] + [[`UTV`] [A unary `transform_view` type]] + [[`f1`] [An instance of `F1`]] + [[`f2`] [An instance of `F2`]] + [[`s`] [An instance of `Sequence`]] + [[`s1`] [An instance of `Sequence1`]] + [[`s2`] [An instance of `Sequence2`]] + [[`tv`, `tv2`] [Instances of `transform_view`]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __forward_sequence__, __bidirectional_sequence__ or +__random_access_sequence__ depending on the traversal characteristics (see +__traversal_concept__) of its underlying sequence or sequences. + +[table + [[Expression] [Semantics]] + [[`UTV(s, f1)`] [Creates a unary `transform_view` given sequence, + `s` and unary function object or function pointer, `f1`.]] + [[`BTV(s1, s2, f2)`] [Creates a binary `transform_view` given sequences, `s1` and `s2` + and binary function object or function pointer, `f2`.]] + [[`TV(tv)`] [Copy constructs a `transform_view` from another `transform_view`, `tv`.]] + [[`tv = tv2`] [Assigns to a `transform_view`, `tv`, from another `transform_view`, `tv2`.]] +] + +[heading Example] + + struct square + { + template + struct result; + + template + struct result + : remove_reference + {}; + + template + T operator()(T x) const + { + return x * x; + } + }; + + typedef __vector__ vector_type; + vector_type vec(2, 5, 3.3); + + transform_view transform(vec, square()); + std::cout << transform << std::endl; + +[endsect] + +[section reverse_view] + +`reverse_view` presents a reversed view of underlying sequence. The first +element will be its last and the last element will be its first. + +[heading Header] + + #include + +[heading Synopsis] + + template + struct reverse_view; + +[heading Template parameters] + +[table + [[Parameter] [Description] [Default]] + [[`Sequence`] [A __bidirectional_sequence__] []] +] + +[heading Model of] + +* __bidirectional_sequence__ + +[variablelist Notation + [[`RV`] [A `reverse_view` type]] + [[`s`] [An instance of `Sequence`]] + [[`rv`, `rv2`] [Instances of `reverse_view`]] +] + +[heading Expression Semantics] + +Semantics of an expression is defined only where it differs from, or is not +defined in __bidirectional_sequence__. + +[table + [[Expression] [Semantics]] + [[`RV(s)`] [Creates a unary `reverse_view` given sequence, `s`.]] + [[`RV(rv)`] [Copy constructs a `reverse_view` from another `reverse_view`, `rv`.]] + [[`rv = rv2`] [Assigns to a `reverse_view`, `rv`, from another `reverse_view`, `rv2`.]] +] + +[heading Example] + + typedef __vector__ vector_type; + vector_type vec(2, 5, 3.3); + + reverse_view reverse(vec); + std::cout << reverse << std::endl; + +[endsect] + +[endsect] + +[section Adapted] + +Fusion provides a couple of adapters for other sequences such as +`std::pair`, __mpl__ sequences, and `boost::array`. These adapters are +written using Fusion's non-intrusive __extension__ mechanism. If you wish +to use these sequences with fusion, simply include the necessary files and +they will be regarded as first-class, fully conforming fusion sequences +[footnote Fusion sequences may also be adapted as fully conforming __mpl__ +sequences (see __intrinsics__). That way, we can have 2-way adaptation to +and from __mpl__ and Fusion]. + +[heading Header] + + #include + +[section std::pair] + +This module provides adapters for `std::pair`. Including the module header +makes `std::pair` a fully conforming __random_access_sequence__. + +[heading Header] + + #include + +[heading Model of] + +* __random_access_sequence__ + +[heading Example] + + std::pair p(123, "Hola!!!"); + std::cout << __at_c__<0>(p) << std::endl; + std::cout << __at_c__<1>(p) << std::endl; + std::cout << p << std::endl; + +[heading See also] + +__std_pair_doc__, __tr1_tuple_pair__ + +[endsect] + +[section mpl sequence] + +This module provides adapters for __mpl__ sequences. Including the module +header makes all __mpl__ sequences fully conforming fusion sequences. + +[heading Header] + + #include + +[heading Model of] + +* __forward_sequence__ (If the __mpl__ sequence is a forward sequence.) +* __bidirectional_sequence__ (If the __mpl__ sequence is a bidirectional sequence.) +* __random_access_sequence__ (If the __mpl__ sequence is a random access sequence.) + +[heading Example] + + mpl::vector_c vec_c; + fusion::vector2 v(vec_c); + std::cout << __at_c__<0>(v) << std::endl; + std::cout << __at_c__<1>(v) << std::endl; + + v = mpl::vector_c(); + std::cout << __at_c__<0>(v) << std::endl; + std::cout << __at_c__<1>(v) << std::endl; + +[heading See also] + +__mpl__ + +[endsect] + +[section boost::array] + +This module provides adapters for `boost::array`. Including the module +header makes `boost::array` a fully conforming __random_access_sequence__. + +[heading Header] + + #include + +[heading Model of] + +* __random_access_sequence__ + +[heading Example] + + boost::array arr = {{1,2,3}}; + + std::cout << *__begin__(arr) << std::endl; + std::cout << *__next__(__begin__(arr)) << std::endl; + std::cout << *__advance_c__<2>(__begin__(arr)) << std::endl; + std::cout << *__prior__(__end__(arr)) << std::endl; + std::cout << __at_c__<2>(arr) << std::endl; + +[heading See also] + +__boost_array_library__ + +[endsect] + +[section boost::tuple] +This module provides adapters for `boost::tuple`. Including the module +header makes `boost::tuple` a fully conforming __forward_sequence__. + +[heading Header] + + #include + +[heading Model of] + +* __forward_sequence__ + +[heading Example] + + boost::tuple example_tuple(101, "hello"); + std::cout << *boost::fusion::begin(example_tuple) << '\n'; + std::cout << *boost::fusion::next(boost::fusion::begin(example_tuple)) << '\n'; + +[heading See also] + +__boost_tuple_library__ + +[endsect] + +[section boost::variant] +This module provides adapters for `boost::variant`. Including the module +header makes `boost::variant` a fully conforming __forward_sequence__. +The variant acts as a sequence of the types that can be contained in the variant. +Accessing types not currently stored int the variant will lead to the variant +being populated with a default constructed value of that type. + +[heading Header] + + #include + +[heading Model of] + +* __forward_sequence__ + +[heading Example] + + boost::variant example_variant = 101; + std::cout << example_variant << '\n'; + *boost::fusion::find(example_variant) = "hello"; + std::cout << example_variant << '\n'; + +[heading See also] + +__boost_variant_library__ + +[endsect] + +[endsect] + +[section Intrinsics] + +Intrinsics form the essential interface of every Fusion __sequence__. __stl__ +counterparts of these functions are usually implemented as member +functions. Intrinsic functions, unlike __algorithms__, are not generic +across the full __sequence__ repertoire. They need to be implemented for +each Fusion __sequence__[footnote In practice, many of intrinsic functions +have default implementations that will work in majority of cases]. + +[heading Header] + + #include + +[section Functions] + +[section begin] + +[heading Description] + +Returns an iterator pointing to the first element in the sequence. + +[heading Synopsis] + + template + typename __result_of_begin__::type + begin(Sequence& seq); + + template + typename __result_of_begin__::type + begin(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __forward_sequence__] [The sequence we wish to get an iterator from.]] +] + +[heading Expression Semantics] + + begin(seq); + +[*Return type]: __forward_iterator__ if `seq` is a __forward_sequence__ +else, __bidirectional_iterator__ if `seq` is a __bidirectional_sequence__ +else, __random_access_iterator__ if `seq` is a __random_access_sequence__. + +[*Semantics]: Returns an iterator pointing to the first element in the sequence. + +[heading Header] + + #include + +[heading Example] + + __vector__ v(1, 2, 3); + assert(__deref__(begin(v)) == 1); + +[endsect] + +[section end] + +[heading Description] + +Returns an iterator pointing to one element past the end of the sequence. + +[heading Synopsis] + + template + typename __result_of_end__::type + end(Sequence& seq); + + template + typename __result_of_end__::type + end(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __forward_sequence__] [The sequence we wish to get an iterator from.]] +] + +[heading Expression Semantics] + + end(seq); + +[*Return type]: __forward_iterator__ if `seq` is a __forward_sequence__ +else, __bidirectional_iterator__ if `seq` is a __bidirectional_sequence__ +else, __random_access_iterator__ if `seq` is a __random_access_sequence__. + +[*Semantics]: Returns an iterator pointing to one element past the end of +the sequence. + +[heading Header] + + #include + +[heading Example] + + __vector__ v(1, 2, 3); + assert(__deref__(__prior__(end(v))) == 3); + +[endsect] + +[section empty] + +[heading Description] + +Returns a type convertible to `bool` that evaluates to `true` if the +sequence is empty, else, evaluates to `false`. + +[heading Synopsis] + + template + typename __result_of_empty__::type + empty(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __forward_sequence__] [The sequence we wish to investigate.]] +] + +[heading Expression Semantics] + + empty(seq); + +[*Return type]: Convertible to `bool`. + +[*Semantics]: Evaluates to `true` if the sequence is empty, else, evaluates +to `false`. + +[heading Header] + + #include + +[heading Example] + + __vector__ v(1, 2, 3); + assert(empty(v) == false); + +[endsect] + +[section front] + +[heading Description] + +Returns the first element in the sequence. + +[heading Synopsis] + + template + typename __result_of_front__::type + front(Sequence& seq); + + template + typename __result_of_front__::type + front(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __forward_sequence__] [The sequence we wish to investigate.]] +] + +[heading Expression Semantics] + + front(seq); + +[*Return type]: Returns a reference to the first element in the sequence +`seq` if `seq` is mutable and `e = o`, where `e` is the first element in +the sequence, is a valid expression. Else, returns a type convertable to +the first element in the sequence. + +[*Precondition]: `__empty__(seq) == false` + +[*Semantics]: Returns the first element in the sequence. + +[heading Header] + + #include + +[heading Example] + + __vector__ v(1, 2, 3); + assert(front(v) == 1); + +[endsect] + +[section back] + +[heading Description] + +Returns the last element in the sequence. + +[heading Synopsis] + + template + typename __result_of_back__::type + back(Sequence& seq); + + template + typename __result_of_back__::type + back(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __bidirectional_sequence__] [The sequence we wish to investigate.]] +] + +[heading Expression Semantics] + + back(seq); + +[*Return type]: Returns a reference to the last element in the sequence +`seq` if `seq` is mutable and `e = o`, where `e` is the last element in the +sequence, is a valid expression. Else, returns a type convertable to the +last element in the sequence. + +[*Precondition]: `__empty__(seq) == false` + +[*Semantics]: Returns the last element in the sequence. + +[heading Header] + + #include + +[heading Example] + + __vector__ v(1, 2, 3); + assert(back(v) == 3); + +[endsect] + +[section size] + +[heading Description] + +Returns a type convertible to `int` that evaluates the number of elements +in the sequence. + +[heading Synopsis] + + template + typename __result_of_size__::type + size(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __forward_sequence__] [The sequence we wish to investigate.]] +] + +[heading Expression Semantics] + + size(seq); + +[*Return type]: Convertible to `int`. + +[*Semantics]: Returns the number of elements in the sequence. + +[heading Header] + + #include + +[heading Example] + + __vector__ v(1, 2, 3); + assert(size(v) == 3); + +[endsect] + +[section at] + +[heading Description] + +Returns the N-th element from the beginning of the sequence. + +[heading Synopsis] + + template + typename __result_of_at__::type + at(Sequence& seq); + + template + typename __result_of_at__::type + at(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __random_access_sequence__] [The sequence we wish to investigate.]] + [[`N`] [An __mpl_integral_constant__] [An index from the beginning of the + sequence.]] +] + +[heading Expression Semantics] + + at(seq); + +[*Return type]: Returns a reference to the N-th element from the beginning +of the sequence `seq` if `seq` is mutable and `e = o`, where `e` is the N-th +element from the beginning of the sequence, is a valid expression. Else, +returns a type convertable to the N-th element from the beginning of the +sequence. + +[*Precondition]: `0 <= N::value < __size__(s)` + +[*Semantics]: Equivalent to + + __deref__(__advance__(__begin__(s))) + +[heading Header] + + #include + +[heading Example] + + __vector__ v(1, 2, 3); + assert(at >(v) == 2); + +[endsect] + +[section at_c] + +[heading Description] + +Returns the N-th element from the beginning of the sequence. + +[heading Synopsis] + + template + typename __result_of_at_c__::type + at_c(Sequence& seq); + + template + typename __result_of_at_c__::type + at_c(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __random_access_sequence__] [The sequence we wish to investigate.]] + [[`N`] [An integral constant] [An index from the beginning of the + sequence.]] +] + +[heading Expression Semantics] + + at_c(seq); + +[*Return type]: Returns a reference to the N-th element from the beginning +of the sequence `seq` if `seq` is mutable and `e = o`, where `e` is the N-th +element from the beginning of the sequence, is a valid expression. Else, +returns a type convertable to the N-th element from the beginning of the +sequence. + +[*Precondition]: `0 <= N < __size__(s)` + +[*Semantics]: Equivalent to + + __deref__(__advance__(__begin__(s))) + +[heading Header] + + #include + +[heading Example] + + __vector__ v(1, 2, 3); + assert(at_c<1>(v) == 2); + +[endsect] + +[section has_key] + +[heading Description] + +Returns a type convertible to `bool` that evaluates to `true` if the +sequence contains an element associated with a Key, else, evaluates to +`false`. + +[heading Synopsis] + + template + typename __result_of_has_key__::type + has_key(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __associative_sequence__] [The sequence we wish to investigate.]] + [[`Key`] [Any type] [The queried key.]] +] + +[heading Expression Semantics] + + has_key(seq); + +[*Return type]: Convertible to `bool`. + +[*Semantics]: Evaluates to `true` if the sequence contains an element +associated with Key, else, evaluates to `false`. + +[heading Header] + + #include + +[heading Example] + + __set__ s(1, 'x', true); + assert(has_key(s) == true); + +[endsect] + +[section at_key] + +[heading Description] + +Returns the element associated with a Key from the sequence. + +[heading Synopsis] + + template + typename __result_of_at_key__::type + at_key(Sequence& seq); + + template + typename __result_of_at_key__::type + at_key(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [Model of __associative_sequence__] [The sequence we wish to investigate.]] + [[`Key`] [Any type] [The queried key.]] +] + +[heading Expression Semantics] + + at_key(seq); + +[*Return type]: Returns a reference to the element associated with Key from +the sequence `seq` if `seq` is mutable and `e = o`, where `e` is the +element associated with Key, is a valid expression. Else, returns a type +convertable to the element associated with Key. + +[*Precondition]: `has_key(seq) == true` + +[*Semantics]: Returns the element associated with Key. + +[heading Header] + + #include + +[heading Example] + + __set__ s(1, 'x', true); + assert(at_key(s) == 'x'); + +[endsect] + +[section swap] + +[heading Description] + +Performs an element by element swap of the elements in 2 sequences. + +[heading Synopsis] + template + void swap(Seq1& seq1, Seq2& seq2); + +[heading Parameters] + +[table + [[Parameters] [Requirement] [Description]] + [[`seq1`, `seq2`] [Models of __forward_sequence__][The sequences whos elements we wish to swap.]] +] + +[heading Expression Semantics] + + swap(seq1, seq2); + +[*Return type]: `void` + +[*Precondition]: `__size__(seq1) == __size__(seq2)` + +[*Semantics]: Calls `swap(a1, b1)` for corresponding elements in `seq1` and `seq2`. + +[heading Header] + #include + +[heading Example] + __vector__ v1(1, "hello"), v2(2, "world"); + swap(v1, v2); + assert(v1 == __make_vector__(2, "world")); + assert(v2 == __make_vector__(1, "hello")); + +[endsect] + +[endsect] + +[section Metafunctions] + +[section begin] + +[heading Description] +Returns the result type of __begin__. + +[heading Synopsis] + template + struct begin + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] +] + +[heading Expression Semantics] + result_of::begin::type + +[*Return type]: An iterator modelling the same traversal concept as `Seq`. + +[*Semantics]: Returns the type of an iterator to the first element of `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_begin__::type it; + BOOST_MPL_ASSERT((boost::is_same<__result_of_deref__::type, int&>)) + +[endsect] + +[section end] + +[heading Description] +Returns the result type of __end__. + +[heading Synopsis] + template + struct end + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] +] + +[heading Expression Semantics] + result_of::end::type + +[*Return type]: A model of the same traversal concept as `Seq`. + +[*Semantics]: Returns the type of an iterator one past the end of `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_prior__<__result_of_end__::type>::type first; + BOOST_MPL_ASSERT((__result_of_equal_to__::type>)) + +[endsect] + +[section empty] + +[heading Description] +Returns the result type of __empty__. + +[heading Synopsis] + template + struct empty + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] +] + +[heading Expression Semantics] + result_of::empty::type + +[*Return type]: An __mpl_integral_constant__ + +[*Semantics]: Returns `mpl::true_` if `Seq` has zero elements, `mpl::false_` otherwise. + +[heading Header] + #include + +[heading Example] + typedef __vector__<> empty_vec; + typedef __vector__ vec; + + BOOST_MPL_ASSERT((__result_of_empty__)); + BOOST_MPL_ASSERT_NOT((__result_of_empty__)); + +[endsect] + +[section front] + +[heading Description] +Returns the result type of __front__. + +[heading Synopsis] + template + struct front + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] +] + +[heading Expression Semantics] + result_of::front::type + +[*Return type]: Any type + +[*Semantics]: The type returned by dereferencing an iterator to the first element in `Seq`. Equivalent to `__result_of_deref__<__result_of_begin__::type>::type`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + BOOST_MPL_ASSERT((boost::is_same<__result_of_front__::type, int&>)); + +[endsect] + +[section back] + +[heading Description] +Returns the result type of __back__. + +[heading Synopsis] + template + struct back + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] +] + +[heading Expression Semantics] + result_of::back::type + +[*Return type]: Any type + +[*Semantics]: The type returned by dereferencing an iterator to the last element in the sequence. Equivalent to `__result_of_deref__<__result_of_prior__<__result_of_end__::type>::type>::type`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + BOOST_MPL_ASSERT((boost::is_same<__result_of_back__::type, char&>)); + +[endsect] + +[section size] + +[heading Description] +Returns the result type of __size__. + +[heading Synopsis] + template + struct size + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] +] + +[heading Expression Semantics] + result_of::size::type + +[*Return type]: An __mpl_integral_constant__. + +[*Semantics]: Returns the number of elements in `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + typedef __result_of_size__::type size_mpl_integral_constant; + BOOST_MPL_ASSERT_RELATION(size_mpl_integral_constant::value, ==, 3); + +[endsect] + +[section at] + +[heading Description] + +Returns the result type of __at__[footnote __result_of_at__ reflects the +actual return type of the function __at__. __sequence__s typically return +references to its elements via the __at__ function. If you want to get +the actual element type, use __result_of_value_at__]. + +[heading Synopsis] + template< + typename Seq, + typename N> + struct at + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] + [[`N`][An __mpl_integral_constant__][Index of element]] +] + +[heading Expression Semantics] + result_of::at::type + +[*Return type]: Any type. + +[*Semantics]: Returns the result type of using __at__ to access the `N`th element of `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + BOOST_MPL_ASSERT((boost::is_same<__result_of_at__ >::type, float&>)); + +[endsect] + +[section at_c] + +[heading Description] + +Returns the result type of __at_c__[footnote __result_of_at_c__ reflects +the actual return type of the function __at_c__. __sequence__s typically +return references to its elements via the __at_c__ function. If you want to +get the actual element type, use __result_of_value_at_c__]. + +[heading Synopsis] + template< + typename Seq, + int M> + struct at_c + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] + [[`M`][Positive integer index][Index of element]] +] + +[heading Expression Semantics] + result_of::at_c::type + +[*Return type]: Any type + +[*Semantics]: Returns the result type of using __at_c__ to access the `M`th element of `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + BOOST_MPL_ASSERT((boost::is_same<__result_of_at_c__::type, float&>)); + +[endsect] + +[section value_at] + +[heading Description] + +Returns the actual type at a given index from the __sequence__. + +[heading Synopsis] + template< + typename Seq, + typename N> + struct value_at + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] + [[`N`][An __mpl_integral_constant__][Index of element]] +] + +[heading Expression Semantics] + result_of::value_at::type + +[*Return type]: Any type. + +[*Semantics]: Returns the actual type at the `N`th element of `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_at__ >::type, float>)); + +[endsect] + +[section value_at_c] + +[heading Description] + +Returns the actual type at a given index from the __sequence__. + +[heading Synopsis] + template< + typename Seq, + int M> + struct value_at_c + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] + [[`M`][Positive integer index][Index of element]] +] + +[heading Expression Semantics] + result_of::value_at_c::type + +[*Return type]: Any type + +[*Semantics]: Returns the actual type at the `M`th element of `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __vector__ vec; + BOOST_MPL_ASSERT((boost::is_same<__result_of_value_at_c__::type, float>)); + +[endsect] + +[section has_key] + +[heading Description] +Returns the result type of __has_key__. + +[heading Synopsis] + template< + typename Seq, + typename Key> + struct has_key + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] + [[`Key`][Any type][Key type]] +] + +[heading Expression Semantics] + result_of::has_key::type + +[*Return type]: An __mpl_integral_constant__. + +[*Semantics]: Returns `mpl::true_` if `Seq` contains an element with key type `Key`, returns `mpl::false_` otherwise. + +[heading Header] + #include + +[heading Example] + typedef __map__<__pair__, __pair__, __pair__ > mymap; + BOOST_MPL_ASSERT((__result_of_has_key__)); + BOOST_MPL_ASSERT_NOT((__result_of_has_key__)); + +[endsect] + +[section at_key] + +[heading Description] + +Returns the result type of __at_key__[footnote __result_of_at_key__ +reflects the actual return type of the function __at_key__. __sequence__s +typically return references to its elements via the __at_key__ function. If +you want to get the actual element type, use __result_of_value_at_key__]. + +[heading Synopsis] + template< + typename Seq, + typename Key> + struct at_key + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] + [[`Key`][Any type][Key type]] +] + +[heading Expression Semantics] + result_of::at_key::type + +[*Return type]: Any type. + +[*Semantics]: Returns the result of using __at_key__ to access the element with key type `Key` in `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __map__<__pair__, __pair__, __pair__ > mymap; + BOOST_MPL_ASSERT((boost::is_same<__result_of_at_key__::type, char&>)); + +[endsect] + +[section value_at_key] + +[heading Description] +Returns the actual element type associated with a Key from the __sequence__. + +[heading Synopsis] + template< + typename Seq, + typename Key> + struct value_at_key + { + typedef __unspecified__ type; + }; + +[table Parameters + [[Parameter] [Requirement] [Description]] + [[`Seq`][A model of __forward_sequence__][Argument sequence]] + [[`Key`][Any type][Key type]] +] + +[heading Expression Semantics] + result_of::value_at_key::type + +[*Return type]: Any type. + +[*Semantics]: Returns the actual element type associated with key type +`Key` in `Seq`. + +[heading Header] + #include + +[heading Example] + typedef __map__<__pair__, __pair__, __pair__ > mymap; + BOOST_MPL_ASSERT((boost::is_same<__result_of_at_key__::type, char>)); + +[endsect] + +[section swap] + +[heading Description] +Returns the return type of swap. + +[heading Synopsis] + template + struct swap + { + typedef void type; + }; + +[table Parameters + [[Parameters] [Requirement] [Description]] + [[`Seq1`, `Seq2`][Models of __forward_sequence__][The sequences being swapped]] +] + +[heading Expression Semantics] + result_of::swap::type + +[*Return type]: `void`. + +[*Semantics]: Always returns `void`. + +[heading Header] + #include + +[endsect] + +[endsect] + +[endsect] + +[section Generation] + +These are the functions that you can use to generate various forms of +__containers__ from elemental values. + +[heading Header] + + #include + +[section Functions] + +[section make_list] + +[heading Description] + +Create a __list__ from one or more values. + +[heading Synopsis] + + template + typename __result_of_make_list__::type + make_list(T0 const& x0, T1 const& x1... TN const& xN); + +The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where +`FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults +to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` +before including any Fusion header to change the default. Example: + + #define FUSION_MAX_LIST_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `make_list`]] +] + +[heading Expression Semantics] + + make_list(x0, x1,... xN); + +[*Return type]: __result_of_make_list__`::type` + +[*Semantics]: Create a __list__ from `x0, x1,... xN`. + +[heading Header] + + #include + +[heading Example] + + make_list(123, "hello", 12.5) + +[heading See also] + +__note_boost_ref__ + +[endsect] + +[section make_cons] + +[heading Description] + +Create a __cons__ from `car` (/head/) and optional `cdr` (/tail/). + +[heading Synopsis] + + template + typename __result_of_make_cons__::type + make_cons(Car const& car); + + template + typename __result_of_make_cons__::type + make_cons(Car const& car, Cdr const& cdr); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`car`] [Instance of `Car`] [The list's head]] + [[`cdr`] [Instance of `Cdr`] [The list's tail (optional)]] +] + +[heading Expression Semantics] + + make_cons(car, cdr); + +[*Return type]: __result_of_make_cons__`::type` or +__result_of_make_cons__`::type` + +[*Semantics]: Create a __cons__ from `car` (/head/) and optional `cdr` (/tail/). + +[heading Header] + + #include + +[heading Example] + + make_cons('x', make_cons(123)) + +[heading See also] + +__note_boost_ref__ + +[endsect] + +[section make_vector] + +[heading Description] + +Create a __vector__ from one or more values. + +[heading Synopsis] + + template + typename __result_of_make_vector__::type + make_vector(T0 const& x0, T1 const& x1... TN const& xN); + +The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, +where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that +defaults to `10`. You may define the preprocessor constant +`FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the +default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `make_vector`]] +] + +[heading Expression Semantics] + + make_vector(x0, x1,... xN); + +[*Return type]: __result_of_make_vector__`::type` + +[*Semantics]: Create a __vector__ from `x0, x1,... xN`. + +[heading Header] + + #include + +[heading Example] + + make_vector(123, "hello", 12.5) + +[heading See also] + +__note_boost_ref__ + +[endsect] + +[section make_set] + +[heading Description] + +Create a __set__ from one or more values. + +[heading Synopsis] + + template + typename __result_of_make_set__::type + make_set(T0 const& x0, T1 const& x1... TN const& xN); + +The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE`[footnote +`set` is implemented in terms of the vector. That is why we reuse +`FUSION_MAX_VECTOR_SIZE`] elements, where `FUSION_MAX_VECTOR_SIZE` is a user +definable predefined maximum that defaults to `10`. You may define the +preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion +header to change the default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `make_set`]] +] + +[heading Expression Semantics] + + make_set(x0, x1,... xN); + +[*Return type]: __result_of_make_set__`::type` + +[*Semantics]: Create a __set__ from `x0, x1,... xN`. + +[*Precondition]: There may be no duplicate key types. + +[heading Header] + + #include + +[heading Example] + + make_set(123, "hello", 12.5) + +[heading See also] + +__note_boost_ref__ + +[endsect] + +[section make_map] + +[heading Description] + +Create a __map__ from one or more key/data pairs. + +[heading Synopsis] + + template < + typename K0, typename K1,... typename KN + , typename T0, typename T1,... typename TN> + typename __result_of_make_map__::type + make_map(T0 const& x0, T1 const& x1... TN const& xN); + +The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE`[footnote +`map` is implemented in terms of the vector. That is why we reuse +`FUSION_MAX_VECTOR_SIZE`] elements, where `FUSION_MAX_VECTOR_SIZE` is a user +definable predefined maximum that defaults to `10`. You may define the +preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion +header to change the default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`K0, K1,... KN`] [The key types] [Keys associated with `x0, x1,... xN`]] + [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `make_map`]] +] + +[heading Expression Semantics] + + make_map(x0, x1,... xN); + +[*Return type]: __result_of_make_map__`::type` + +[*Semantics]: Create a __map__ from `K0, K1,... KN` keys and +`x0, x1,... xN` data. + +[*Precondition]: There may be no duplicate key types. + +[heading Header] + + #include + +[heading Example] + + make_map( + __fusion_make_pair__('X') + , __fusion_make_pair__("Men")) + +[heading See also] + +__note_boost_ref__, __fusion_pair__ + +[endsect] + +[section Tiers] + +Tiers are sequences, where all elements are non-const reference types. They +are constructed with a call to a couple of /tie/ function templates. The +succeeding sections document the various /tier/ flavors. + +* __list_tie__ +* __vector_tie__ +* __map_tie__ + +Example: + + int i; char c; double d; + ... + __vector_tie__(i, c, a); + +The __vector_tie__ function creates a __vector__ of type +`__vector__`. The same result could be achieved with the call +__make_vector__(__boost_ref_call__(i), __boost_ref_call__(c), __boost_ref_call__(a)) +[footnote see __boost_ref__ for details about `ref`]. + +A /tie/ can be used to 'unpack' another tuple into variables. E.g.: + + int i; char c; double d; + __vector_tie__(i, c, d) = __make_vector__(1,'a', 5.5); + std::cout << i << " " << c << " " << d; + +This code prints 1 a 5.5 to the standard output stream. A sequence +unpacking operation like this is found for example in ML and Python. It is +convenient when calling functions which return sequences. + +[heading Ignore] + +There is also an object called /ignore/ which allows you to ignore an +element assigned by a sequence. The idea is that a function may return a +sequence, only part of which you are interested in. For example: + + char c; + __vector_tie__(ignore, c) = __make_vector__(1, 'a'); + +[endsect] + +[section list_tie] + +[heading Description] + +Constructs a tie using a __list__ sequence. + +[heading Synopsis] + + template + __list__ + list_tie(T0& x0, T1& x1... TN& xN); + +The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where +`FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults +to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` +before including any Fusion header to change the default. Example: + + #define FUSION_MAX_LIST_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `list_tie`]] +] + +[heading Expression Semantics] + + list_tie(x0, x1,... xN); + +[*Return type]: __list__ + +[*Semantics]: Create a __list__ of references from `x0, x1,... xN`. + +[heading Header] + + #include + +[heading Example] + + int i = 123; + double d = 123.456; + list_tie(i, d) + +[endsect] + +[section vector_tie] + +[heading Description] + +Constructs a tie using a __vector__ sequence. + +[heading Synopsis] + + template + __vector__ + vector_tie(T0& x0, T1& x1... TN& xN); + +The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, +where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that +defaults to `10`. You may define the preprocessor constant +`FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the +default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `vector_tie`]] +] + +[heading Expression Semantics] + + vector_tie(x0, x1,... xN); + +[*Return type]: __vector__ + +[*Semantics]: Create a __vector__ of references from `x0, x1,... xN`. + +[heading Header] + + #include + +[heading Example] + + int i = 123; + double d = 123.456; + vector_tie(i, d) + +[endsect] + +[section map_tie] + +[heading Description] + +Constructs a tie using a __map__ sequence. + +[heading Synopsis] + + template + __map__<__pair__, __pair__,... __pair__ > + map_tie(D0& d0, D1& d1... DN& dN); + +The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, +where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that +defaults to `10`, and a corresponding number of key types. +You may define the preprocessor constant `FUSION_MAX_MAP_SIZE` before +including any Fusion header to change the default. Example: + + #define FUSION_MAX_MAP_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`K0, K1,... KN`] [Any type][The key types associated with each of the `x1,x2,...,xN` values]] + [[`x0, x1,... xN`] [Instances of `T0, T1,... TN`] [The arguments to `map_tie`]] +] + +[heading Expression Semantics] + + map_tie(x0, x1,... xN); + +[*Return type]: __map__<__pair__, __pair__,... __pair__ > + +[*Semantics]: Create a __map__ of references from `x0, x1,... xN` with keys `K0, K1,... KN` + +[heading Header] + + #include + +[heading Example] + + struct int_key; + struct double_key; + ... + int i = 123; + double d = 123.456; + map_tie(i, d) + +[endsect] + +[endsect] + +[section MetaFunctions] + +[section make_list] + +[heading Description] + +Returns the result type of __make_list__. + +[heading Synopsis] + + template + struct make_list; + +The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where +`FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults +to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` +before including any Fusion header to change the default. Example: + + #define FUSION_MAX_LIST_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T0, T1,... TN`] [Any type] [Template arguments to `make_list`]] +] + +[heading Expression Semantics] + + result_of::make_list::type + +[*Return type]: A __list__ with elements of types converted following the +rules for __element_conversion__. + +[*Semantics]: Create a __list__ from `T0, T1,... TN`. + +[heading Header] + + #include + +[heading Example] + + result_of::make_list::type + +[endsect] + +[section make_cons] + +[heading Description] + +Returns the result type of __make_cons__. + +[heading Synopsis] + + template + struct make_cons; + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`Car`] [Any type] [The list's head type]] + [[`Cdr`] [A `cons`] [The list's tail type (optional)]] +] + +[heading Expression Semantics] + + result_of::make_cons::type + +[*Return type]: A __cons__ with head element, `Car`, of type converted +following the rules for __element_conversion__, and tail, `Cdr`. + +[*Semantics]: Create a __cons__ from `Car` (/head/) and optional `Cdr` (/tail/). + +[heading Header] + + #include + +[heading Example] + + result_of::make_cons::type>::type + +[endsect] + +[section make_vector] + +[heading Description] + +Returns the result type of __make_vector__. + +[heading Synopsis] + + template + struct make_vector; + +The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, +where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that +defaults to `10`. You may define the preprocessor constant +`FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the +default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T0, T1,... TN`] [Any type] [Template arguments to `make_vector`]] +] + +[heading Expression Semantics] + + result_of::make_vector::type + +[*Return type]: A __vector__ with elements of types converted following the +rules for __element_conversion__. + +[*Semantics]: Create a __vector__ from `T0, T1,... TN`. + +[heading Header] + + #include + +[heading Example] + + result_of::make_vector::type + +[endsect] + +[section make_set] + +[heading Description] + +Returns the result type of __make_set__. + +[heading Synopsis] + + template + struct make_set; + +The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE`[footnote +`set` is implemented in terms of the vector. That is why we reuse +`FUSION_MAX_VECTOR_SIZE`] elements, where `FUSION_MAX_VECTOR_SIZE` is a user +definable predefined maximum that defaults to `10`. You may define the +preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion +header to change the default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T0, T1,... TN`] [Any type] [The arguments to `make_set`]] +] + +[heading Expression Semantics] + + result_of::make_set::type + +[*Return type]: A __set__ with elements of types converted following the +rules for __element_conversion__. + +[*Semantics]: Create a __set__ from `T0, T1,... TN`. + +[*Precondition]: There may be no duplicate key types. + +[heading Header] + + #include + +[heading Example] + + result_of::make_set::type + +[endsect] + +[section make_map] + +[heading Description] + +Returns the result type of __make_map__. + +[heading Synopsis] + + template < + typename K0, typename K1,... typename KN + , typename T0, typename T1,... typename TN> + struct make_map; + +The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE`[footnote +`map` is implemented in terms of the vector. That is why we reuse +`FUSION_MAX_VECTOR_SIZE`] elements, where `FUSION_MAX_VECTOR_SIZE` is a user +definable predefined maximum that defaults to `10`. You may define the +preprocessor constant `FUSION_MAX_VECTOR_SIZE` before including any Fusion +header to change the default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`K0, K1,... KN`] [Any type] [Keys associated with `T0, T1,... TN`]] + [[`T0, T1,... TN`] [Any type] [Data associated with keys `K0, K1,... KN`]] +] + +[heading Expression Semantics] + + resulf_of::make_map::type; + +[*Return type]: __result_of_make_map__`::type` + +[*Semantics]: A __map__ with __fusion_pair__ elements where the +`second_type` is converted following the rules for __element_conversion__. + +[*Precondition]: There may be no duplicate key types. + +[heading Header] + + #include + +[heading Example] + + result_of::make_map::type + +[heading See also] + +__fusion_pair__ + +[endsect] + +[section list_tie] + +[heading Description] + +Returns the result type of __list_tie__. + +[heading Synopsis] + + template + struct list_tie; + +The variadic function accepts `0` to `FUSION_MAX_LIST_SIZE` elements, where +`FUSION_MAX_LIST_SIZE` is a user definable predefined maximum that defaults +to `10`. You may define the preprocessor constant `FUSION_MAX_LIST_SIZE` +before including any Fusion header to change the default. Example: + + #define FUSION_MAX_LIST_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T0, T1,... TN`] [Any type] [The arguments to `list_tie`]] +] + +[heading Expression Semantics] + + result_of::list_tie::type; + +[*Return type]: __list__ + +[*Semantics]: Create a __list__ of references from `T0, T1,... TN`. + +[heading Header] + + #include + +[heading Example] + + result_of::list_tie::type + +[endsect] + +[section vector_tie] + +[heading Description] + +Returns the result type of __vector_tie__. + +[heading Synopsis] + + template + struct vector_tie; + +The variadic function accepts `0` to `FUSION_MAX_VECTOR_SIZE` elements, +where `FUSION_MAX_VECTOR_SIZE` is a user definable predefined maximum that +defaults to `10`. You may define the preprocessor constant +`FUSION_MAX_VECTOR_SIZE` before including any Fusion header to change the +default. Example: + + #define FUSION_MAX_VECTOR_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T0, T1,... TN`] [Any type] [The arguments to `vector_tie`]] +] + +[heading Expression Semantics] + + result_of::vector_tie::type; + +[*Return type]: __vector__ + +[*Semantics]: Create a __vector__ of references from `T0, T1,... TN`. + +[heading Header] + + #include + +[heading Example] + + result_of::vector_tie::type + +[endsect] + +[section map_tie] + +[heading Description] + +Returns the result type of __map_tie__. + +[heading Synopsis] + + template + struct map_tie; + +The variadic function accepts `0` to `FUSION_MAX_MAP_SIZE` elements, +where `FUSION_MAX_MAP_SIZE` is a user definable predefined maximum that +defaults to `10`. You may define the preprocessor constant +`FUSION_MAX_MAP_SIZE` before including any Fusion header to change the +default. Example: + + #define FUSION_MAX_MAP_SIZE 20 + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`K0, K1,... KN`] [Any type] [The key types for `map_tie`]] + [[`D0, D1,... DN`] [Any type] [The arguments types for `map_tie`]] +] + +[heading Expression Semantics] + + result_of::map_tie::type; + +[*Return type]: __map__<__pair__, __pair__,... __pair__ > + +[*Semantics]: Create a __map__ of references from `D0, D1,... DN` with keys `K0, K1,... KN` + +[heading Header] + + #include + +[heading Example] + + struct int_key; + struct double_key; + ... + result_of::map_tie::type + +[endsect] + +[endsect] + +[endsect] + +[section Conversion] + +All fusion sequences can be converted to one of the __containers__ types +using one of these conversion functions. + +[heading Header] + + #include + +[section Functions] + +[section as_list] + +[heading Description] + +Convert a fusion sequence to a __list__. + +[heading Synopsis] + + template + typename result_of::as_list::type + as_list(Sequence& seq); + + template + typename result_of::as_list::type + as_list(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [An instance of Sequence] [The sequence to convert.]] +] + +[heading Expression Semantics] + + as_list(seq); + +[*Return type]: __result_of_as_list__`::type` + +[*Semantics]: Convert a fusion sequence, `seq`, to a __list__. + +[heading Header] + + #include + +[heading Example] + + as_list(__make_vector__('x', 123, "hello")) + +[endsect] + +[section as_vector] + +[heading Description] + +Convert a fusion sequence to a __vector__. + +[heading Synopsis] + + template + typename result_of::as_vector::type + as_vector(Sequence& seq); + + template + typename result_of::as_vector::type + as_vector(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [An instance of Sequence] [The sequence to convert.]] +] + +[heading Expression Semantics] + + as_vector(seq); + +[*Return type]: __result_of_as_vector__`::type` + +[*Semantics]: Convert a fusion sequence, `seq`, to a __vector__. + +[heading Header] + + #include + +[heading Example] + + as_vector(__make_list__('x', 123, "hello")) + +[endsect] + +[section as_set] + +[heading Description] + +Convert a fusion sequence to a __set__. + +[heading Synopsis] + + template + typename result_of::as_set::type + as_set(Sequence& seq); + + template + typename result_of::as_set::type + as_set(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [An instance of Sequence] [The sequence to convert.]] +] + +[heading Expression Semantics] + + as_set(seq); + +[*Return type]: __result_of_as_set__`::type` + +[*Semantics]: Convert a fusion sequence, `seq`, to a __set__. + +[*Precondition]: There may be no duplicate key types. + +[heading Header] + + #include + +[heading Example] + + as_set(__make_vector__('x', 123, "hello")) + +[endsect] + +[section as_map] + +[heading Description] + +Convert a fusion sequence to a __map__. + +[heading Synopsis] + + template + typename result_of::as_map::type + as_map(Sequence& seq); + + template + typename result_of::as_map::type + as_map(Sequence const& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`seq`] [An instance of Sequence] [The sequence to convert.]] +] + +[heading Expression Semantics] + + as_map(seq); + +[*Return type]: __result_of_as_map__`::type` + +[*Semantics]: Convert a fusion sequence, `seq`, to a __map__. + +[*Precondition]: The elements of the sequence are assumed to be +__fusion_pair__s. There may be no duplicate __fusion_pair__ key types. + +[heading Header] + + #include + +[heading Example] + + as_map(__make_vector__( + __fusion_make_pair__('X') + , __fusion_make_pair__("Men"))) + +[endsect] + +[endsect] + +[section Metafunctions] + +[section as_list] + +[heading Description] + +Returns the result type of __as_list__. + +[heading Synopsis] + + template + struct as_list; + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A fusion __sequence__] [The sequence type to convert.]] +] + +[heading Expression Semantics] + + result_of::as_list::type; + +[*Return type]: A __list__ with same elements as the input sequence, +`Sequence`. + +[*Semantics]: Convert a fusion sequence, `Sequence`, to a __list__. + +[heading Header] + + #include + +[heading Example] + + result_of::as_list<__vector__ >::type + +[endsect] + +[section as_vector] + +[heading Description] + +Returns the result type of __as_vector__. + +[heading Synopsis] + + template + struct as_vector; + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A fusion __sequence__] [The sequence to convert.]] +] + +[heading Expression Semantics] + + result_of::as_vector::type; + +[*Return type]: A __vector__ with same elements as the input sequence, +`Sequence`. + +[*Semantics]: Convert a fusion sequence, `Sequence`, to a __vector__. + +[heading Header] + + #include + +[heading Example] + + result_of::as_vector<__list__ >::type + +[endsect] + +[section as_set] + +[heading Description] + +Returns the result type of __as_set__. + +[heading Synopsis] + + template + struct as_set; + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A fusion __sequence__] [The sequence to convert.]] +] + +[heading Expression Semantics] + + result_of::as_set::type; + +[*Return type]: A __set__ with same elements as the input sequence, +`Sequence`. + +[*Semantics]: Convert a fusion sequence, `Sequence`, to a __set__. + +[*Precondition]: There may be no duplicate key types. + +[heading Header] + + #include + +[heading Example] + + result_of::as_set<__vector__ >::type + +[endsect] + +[section as_map] + +[heading Description] + +Returns the result type of __as_map__. + +[heading Synopsis] + + template + struct as_map; + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`Sequence`] [A fusion __sequence__] [The sequence to convert.]] +] + +[heading Expression Semantics] + + result_of::as_map::type; + +[*Return type]: A __map__ with same elements as the input sequence, +`Sequence`. + +[*Semantics]: Convert a fusion sequence, `Sequence`, to a __map__. + +[*Precondition]: The elements of the sequence are assumed to be +__fusion_pair__s. There may be no duplicate __fusion_pair__ key types. + +[heading Header] + + #include + +[heading Example] + + result_of::as_map<__vector__< + __fusion_pair__ + , __fusion_pair__ > >::type + +[endsect] + +[endsect] + +[endsect] + +[section Operators] + +These operators, like the __algorithms__, work generically on all Fusion +sequences. All conforming Fusion sequences automatically get these +operators for free. + +[section I/O] + +The I/O operators: `<<` and `>>` work generically on all Fusion sequences. +The global `operator<<` has been overloaded for generic output streams such +that __sequence__s are output by recursively calling `operator<<` for each +element. Analogously, the global `operator>>` has been overloaded to +extract __sequence__s from generic input streams by recursively calling +`operator>>` for each element. + +The default delimiter between the elements is space, and the __sequence__ +is enclosed in parenthesis. For Example: + + __vector__ a(1.0f, 2, std::string("Howdy folks!"); + cout << a; + +outputs the __vector__ as: (1.0 2 Howdy folks!) + +The library defines three manipulators for changing the default behavior: + +[variablelist Manipulators + [[`tuple_open(arg)`] [Defines the character that is output before the first element.]] + [[`tuple_close(arg)`] [Defines the character that is output after the last element.]] + [[`tuple_delimiter(arg)`] [Defines the delimiter character between elements.]] +] + +The argument to `tuple_open`, `tuple_close` and `tuple_delimiter` may be a +`char`, `wchar_t`, a C-string, or a wide C-string. + +Example: + + std::cout << tuple_open('[') << tuple_close(']') << tuple_delimiter(", ") << a; + +outputs the same __vector__, `a` as: [1.0, 2, Howdy folks!] + +The same manipulators work with `operator>>` and `istream` as well. Suppose +the `std::cin` stream contains the following data: + + (1 2 3) [4:5] + +The code: + + __vector__ i; + __vector__ j; + + std::cin >> i; + std::cin >> set_open('[') >> set_close(']') >> set_delimiter(':'); + std::cin >> j; + +reads the data into the __vector__s `i` and `j`. + +Note that extracting __sequence__s with `std::string` or C-style string +elements does not generally work, since the streamed __sequence__ +representation may not be unambiguously parseable. + +[heading Header] + + #include + +[section in] + +[heading Description] + +Read a __sequence__ from an input stream. + +[heading Synopsis] + + template + IStream& + operator>>(IStream& is, Sequence& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[is] [An input stream.] [Stream to extract information from.]] + [[seq] [A __sequence__.] [The sequence to read.]] +] + +[heading Expression Semantics] + + is >> seq + +[*Return type]: IStream& + +[*Semantics]: For each element, `e`, in sequence, `seq`, call `is >> e`. + +[heading Header] + + #include + +[heading Example] + + __vector__ v; + std::cin >> v; + +[endsect] + +[section out] + +[heading Description] + +Write a __sequence__ to an output stream. + +[heading Synopsis] + + template + OStream& + operator<<(OStream& os, Sequence& seq); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[os] [An output stream.] [Stream to write information to.]] + [[seq] [A __sequence__.] [The sequence to write.]] +] + +[heading Expression Semantics] + + os << seq + +[*Return type]: OStream& + +[*Semantics]: For each element, `e`, in sequence, `seq`, call `os << e`. + +[heading Header] + + #include + +[heading Example] + + std::cout << __make_vector__(123, "Hello", 'x') << std::endl; + +[endsect] + +[endsect] + +[section Comparison] + +The Comparison operators: `==`, `!=`, `<`, `<=`, `>=` and `>=` work +generically on all Fusion sequences. Comparison operators are "short- +circuited": elementary comparisons start from the first elements and are +performed only until the result is clear. + +[heading Header] + + #include + +[section equal] + +[heading Description] + +Compare two sequences for equality. + +[heading Synopsis] + + template + bool + operator==(Seq1 const& a, Seq2 const& b); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`a, b`] [Instances of __sequence__] [__sequence__s to compare]] +] + +[heading Expression Semantics] + + a == b + +[*Return type]: `bool` + +[*Requirements]: + +For each element, `e1`, in sequence `a`, and for each element, `e2`, in +sequence `b`, `a == b` is a valid expression returning a type that is +convertible to bool. + +An attempt to compare two Sequences of different lengths results in a +compile time error. + +[*Semantics]: + +For each element, `e1`, in sequence `a`, and for each element, `e2`, in +sequence `b`, `e1 == e2` returns true. For any 2 zero length __sequence__s, +e and f, e == f returns true. + +[heading Header] + + #include + +[heading Example] + + __vector__ v1(5, 'a'); + __vector__ v2(5, 'a'); + assert(v1 == v2); + +[endsect] + +[section not equal] + +Compare two sequences for inequality. + +[heading Synopsis] + + template + bool + operator!=(Seq1 const& a, Seq2 const& b); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`a, b`] [Instances of __sequence__] [__sequence__s to compare]] +] + +[heading Expression Semantics] + + a != b + +[*Return type]: `bool` + +[*Requirements]: + +For each element, `e1`, in sequence `a`, and for each element, `e2`, in +sequence `b`, `a == b` is a valid expression returning a type that is +convertible to bool. + +An attempt to compare two Sequences of different lengths results in a +compile time error. + +[*Semantics]: + +Returns !(a == b). + +[heading Header] + + #include + +[heading Example] + + __vector__ v3(5, 'b'); + __vector__ t4(2, 'a'); + assert(v1 != v3); + assert(v1 != t4); + assert(!(v1 != v2)); + +[endsect] + +[section less than] + +Lexicographically compare two sequences. + +[heading Synopsis] + + template + bool + operator<(Seq1 const& a, Seq2 const& b); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`a, b`] [Instances of __sequence__] [__sequence__s to compare]] +] + +[heading Expression Semantics] + + a < b + +[*Return type]: `bool` + +[*Requirements]: + +For each element, `e1`, in sequence `a`, and for each element, `e2`, in +sequence `b`, `a < b` is a valid expression returning a type that is +convertible to bool. + +An attempt to compare two Sequences of different lengths results in a +compile time error. + +[*Semantics]: Returns the lexicographical comparison of between `a` and `b`. + +[heading Header] + + #include + +[heading Example] + + __vector__ v1(4, 3.3f); + __vector__ v2(5, 3.3f); + __vector__ v3(5, 4.4); + assert(v1 < v2); + assert(v2 < v3); + +[endsect] + +[section less than equal] + +Lexicographically compare two sequences. + +[heading Synopsis] + + template + bool + operator<=(Seq1 const& a, Seq2 const& b); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`a, b`] [Instances of __sequence__] [__sequence__s to compare]] +] + +[heading Expression Semantics] + + a <= b + +[*Return type]: `bool` + +[*Requirements]: + +For each element, `e1`, in sequence `a`, and for each element, `e2`, in +sequence `b`, `a < b` is a valid expression returning a type that is +convertible to bool. + +An attempt to compare two Sequences of different lengths results in a +compile time error. + +[*Semantics]: Returns !(b < a). + +[heading Header] + + #include + +[heading Example] + + __vector__ v1(4, 3.3f); + __vector__ v2(5, 3.3f); + __vector__ v3(5, 4.4); + assert(v1 <= v2); + assert(v2 <= v3); + +[endsect] + +[section greater than] + +Lexicographically compare two sequences. + +[heading Synopsis] + + template + bool + operator>(Seq1 const& a, Seq2 const& b); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`a, b`] [Instances of __sequence__] [__sequence__s to compare]] +] + +[heading Expression Semantics] + + a > b + +[*Return type]: `bool` + +[*Requirements]: + +For each element, `e1`, in sequence `a`, and for each element, `e2`, in +sequence `b`, `a < b` is a valid expression returning a type that is +convertible to bool. + +An attempt to compare two Sequences of different lengths results in a +compile time error. + +[*Semantics]: Returns b < a. + +[heading Header] + + #include + +[heading Example] + + __vector__ v1(4, 3.3f); + __vector__ v2(5, 3.3f); + __vector__ v3(5, 4.4); + assert(v2 > v1); + assert(v3 > v2); + +[endsect] + +[section greater than equal] + +Lexicographically compare two sequences. + +[heading Synopsis] + + template + bool + operator>=(Seq1 const& a, Seq2 const& b); + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`a, b`] [Instances of __sequence__] [__sequence__s to compare]] +] + +[heading Expression Semantics] + + a >= b + +[*Return type]: `bool` + +[*Requirements]: + +For each element, `e1`, in sequence `a`, and for each element, `e2`, in +sequence `b`, `a < b` is a valid expression returning a type that is +convertible to bool. + +An attempt to compare two Sequences of different lengths results in a +compile time error. + +[*Semantics]: Returns !(a < b). + +[heading Header] + + #include + +[heading Example] + + __vector__ v1(4, 3.3f); + __vector__ v2(5, 3.3f); + __vector__ v3(5, 4.4); + assert(v2 >= v1); + assert(v3 >= v2); + +[endsect] + +[endsect] + +[endsect] + +[endsect] + diff --git a/doc/support.qbk b/doc/support.qbk new file mode 100644 index 00000000..0efd05b2 --- /dev/null +++ b/doc/support.qbk @@ -0,0 +1,427 @@ +[section Support] + +A couple of classes and metafunctions provide basic support for Fusion. + +[section is_sequence] + +[heading Description] + +Metafunction that evaluates to `mpl::true_` if a certain type `T` is a +conforming Fusion __sequence__, `mpl::false_` otherwise. This may be +specialized to accomodate clients which provide Fusion conforming sequences. + +[heading Synopsis] + + namespace traits + { + template + struct is_sequence + { + typedef __unspecified__ type; + }; + } + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T`] [Any type] [The type to query.]] +] + +[heading Expression Semantics] + + typedef traits::is_sequence::type c; + +[*Return type]: An __mpl_boolean_constant__. + +[*Semantics]: Metafunction that evaluates to `mpl::true_` if a certain type +`T` is a conforming Fusion sequence, `mpl::false_` otherwise. + +[heading Header] + + #include + +[heading Example] + + BOOST_MPL_ASSERT_NOT(( traits::is_sequence< std::vector > )); + BOOST_MPL_ASSERT_NOT(( is_sequence< int > )); + BOOST_MPL_ASSERT(( traits::is_sequence<__list__<> > )); + BOOST_MPL_ASSERT(( traits::is_sequence<__list__ > )); + BOOST_MPL_ASSERT(( traits::is_sequence<__vector__<> > )); + BOOST_MPL_ASSERT(( traits::is_sequence<__vector__ > )); + +[endsect] + +[section is_view] + +[heading Description] + +Metafunction that evaluates to `mpl::true_` if a certain type `T` is a +conforming Fusion __view__, `mpl::false_` otherwise. A view is a +specialized sequence that does not actually contain data. Views hold +sequences which may be other views. In general, views are held by other +views by value, while non-views are held by other views by reference. `is_view` +may be specialized to accomodate clients providing Fusion conforming views. + +[heading Synopsis] + + namespace traits + { + template + struct is_view + { + typedef __unspecified__ type; + }; + } + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T`] [Any type] [The type to query.]] +] + +[heading Expression Semantics] + + typedef traits::is_view::type c; + +[*Return type]: An __mpl_boolean_constant__. + +[*Semantics]: Metafunction that evaluates to `mpl::true_` if a certain type +`T` is a conforming Fusion view, `mpl::false_` otherwise. + +[heading Header] + + #include + +[heading Example] + + BOOST_MPL_ASSERT_NOT(( traits::is_view > )); + BOOST_MPL_ASSERT_NOT(( traits::is_view )); + + using boost::mpl::_ + using boost::is_pointer; + typedef __vector__ vector_type; + typedef __filter_view__ > filter_view_type; + BOOST_MPL_ASSERT(( traits::is_view )); + +[endsect] + +[section tag_of] + +[heading Description] + +All conforming Fusion sequences and iterators have an associated tag type. The +purpose of the tag is to enable __tag_dispatching__ from __intrinsic__ +functions to implementations appropriate for the type. + +This metafunction may be specialized to accomodate clients providing Fusion +conforming sequences. + +[heading Synopsis] + + namespace traits + { + template + struct tag_of + { + typedef __unspecified__ type; + }; + } + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T`] [Any type] [The type to query.]] +] + +[heading Expression Semantics] + + typedef traits::tag_of::type tag; + +[*Return type]: Any type. + +[*Semantics]: Returns the tag type associated with `T`. + +[heading Header] + + #include + +[heading Example] + + typedef traits::tag_of<__list__<> >::type tag1; + typedef traits::tag_of<__list__ >::type tag2; + typedef traits::tag_of<__vector__<> >::type tag3; + typedef traits::tag_of<__vector__ >::type tag4; + + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + +[endsect] + +[section category_of] + +[heading Description] + +A metafunction that establishes the conceptual classification of a particular +__sequence__ or __iterator__ (see __iterator_concepts__ and +__sequence_concepts__). + +[heading Synopsis] + + namespace traits + { + template + struct category_of + { + typedef __unspecified__ type; + }; + } + +[heading Parameters] + +[table + [[Parameter] [Requirement] [Description]] + [[`T`] [Any type] [The type to query.]] +] + +[heading Expression Semantics] + + typedef traits::category_of::type category; + +[*Return type]: + +For Iterators, the return type is derived from one of: + + namespace boost { namespace fusion + { + 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 {}; + }} + +For Sequences, the return type is derived from one of: + + namespace boost { namespace fusion + { + struct incrementable_sequence_tag {}; + + struct single_pass_sequence_tag + : incrementable_sequence_tag {}; + + struct forward_traversal_tag + : single_pass_sequence_tag {}; + + struct bidirectional_traversal_tag + : forward_traversal_tag {}; + + struct random_access_traversal_tag + : bidirectional_traversal_tag {}; + }} + +And optionally from: + + namespace boost { namespace fusion + { + struct associative_sequence_tag {}; + }} + +[*Semantics]: Establishes the conceptual classification of a particular +__sequence__ or __iterator__. + +[heading Header] + + #include + +[heading Example] + + using boost::is_base_of; + typedef traits::category_of<__list__<> >::type list_category; + typedef traits::category_of<__vector__<> >::type vector_category; + BOOST_MPL_ASSERT(( is_base_of )); + BOOST_MPL_ASSERT(( is_base_of )); + +[endsect] + +[section deduce] + +[heading Description] +Metafunction to apply __element_conversion__ to the full argument type. + +It removes references to `const`, references to array types are kept, even +if the array is `const`. Reference wrappers are removed (see +__note_boost_ref__). + +[heading Header] + + #include + +[heading Synopsis] + namespace traits + { + template + struct deduce + { + typedef __unspecified__ type; + }; + } + +[heading Example] + template + struct holder + { + typename traits::deduce::type element; + + holder(T const & a) + : element(a) + { } + }; + + template + holder make_holder(T const & a) + { + return holder(a); + } + +[heading See also] +* __deduce_sequence__ + +[endsect] + +[section deduce_sequence] + +[heading Description] +Applies __element_conversion__ to each element in a __forward_sequence__. +The resulting type is a __random_access_sequence__ that provides a converting +constructor accepting the original type as its argument. + +[heading Header] + + #include + +[heading Synopsis] + namespace traits + { + template + struct deduce_sequence + { + typedef __unspecified__ type; + }; + } + +[heading Example] + template + struct holder + { + typename traits::deduce_sequence::type element; + + holder(Seq const & a) + : element(a) + { } + }; + + template + holder< __vector__ > + make_holder(T0 const & a0, T1 const & a1) + { + typedef __vector__ arg_vec_t; + return holder( arg_vec_t(a0,a1) ); + } + +[heading See also] +* __deduce__ + +[endsect] + +[section pair] + +[heading Description] + +Fusion `pair` type is a half runtime pair. A half runtime pair is similar +to a __std_pair__, but, unlike __std_pair__, the first type does not have data. +It is used as elements in __map__s, for example. + +[heading Synopsis] + + template + struct pair; + + namespace result_of + { + template + struct first; + + template + struct second; + + template + struct make_pair; + } + + template + typename result_of::make_pair::type + make_pair(Second const &); + +[heading Template parameters] + +[table + [[Parameter] [Description]] + [[First] [The first type. This is purely a type. No data is held.]] + [[Second] [The second type. This contains data.]] +] + +[variablelist Notation + [[`P`] [Fusion pair type]] + [[`p`, `p2`] [Fusion pairs]] + [[`F`, `S`] [Arbitrary types]] + [[`s`] [Value of type `S`]] + [[`o`] [Output stream]] + [[`i`] [Input stream]] +] + +[heading Expression Semantics] + +[table + [[Expression] [Semantics]] + [[`P::first_type`] [The type of the first template parameter, `F`, equivalent to + `result_of::first

::type`. ]] + [[`P::second_type`] [The type of the second template parameter, `S`, equivalent to + `result_of::second


+

© Copyright Beman Dawes, 2001

+

Distributed under the Boost Software License, Version 1.0. (See + accompanying file + LICENSE_1_0.txt or copy at + www.boost.org/LICENSE_1_0.txt)

+ + \ No newline at end of file diff --git a/test/Jamfile b/test/Jamfile new file mode 100644 index 00000000..f70629b8 --- /dev/null +++ b/test/Jamfile @@ -0,0 +1,147 @@ +##============================================================================== +# Copyright (c) 2003-2006 Joel de Guzman +# +# 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) +#============================================================================== +# bring in rules for testing +import testing ; + +{ + test-suite fusion : + + [ run algorithm/all.cpp : : : : ] + [ run algorithm/any.cpp : : : : ] + [ run algorithm/clear.cpp : : : : ] + [ run algorithm/count.cpp : : : : ] + [ run algorithm/count_if.cpp : : : : ] + [ run algorithm/erase.cpp : : : : ] + [ run algorithm/erase_key.cpp : : : : ] + [ run algorithm/filter.cpp : : : : ] + [ run algorithm/filter_if.cpp : : : : ] + [ run algorithm/find.cpp : : : : ] + [ run algorithm/find_if.cpp : : : : ] + [ run algorithm/fold.cpp : : : : ] + [ run algorithm/for_each.cpp : : : : ] + [ run algorithm/insert.cpp : : : : ] + [ run algorithm/insert_range.cpp : : : : ] + [ run algorithm/none.cpp : : : : ] + [ run algorithm/pop_back.cpp : : : : ] + [ run algorithm/pop_front.cpp : : : : ] + [ run algorithm/push_back.cpp : : : : ] + [ run algorithm/push_front.cpp : : : : ] + [ run algorithm/remove.cpp : : : : ] + [ run algorithm/remove_if.cpp : : : : ] + [ run algorithm/replace.cpp : : : : ] + [ run algorithm/replace_if.cpp : : : : ] + [ run algorithm/reverse.cpp : : : : ] + [ run algorithm/transform.cpp : : : : ] + [ run algorithm/join.cpp : : : : ] + [ run algorithm/zip.cpp : : : : ] + [ run algorithm/zip2.cpp : : : : ] + [ run algorithm/zip_ignore.cpp : : : : ] + + [ run sequence/as_list.cpp : : : : ] + [ run sequence/as_map.cpp : : : : ] + [ run sequence/as_set.cpp : : : : ] + [ run sequence/as_vector.cpp : : : : ] + [ run sequence/boost_tuple.cpp : : : : ] + [ run sequence/cons.cpp : : : : ] + [ run sequence/filter_view.cpp : : : : ] + [ run sequence/io.cpp : : : : ] + [ run sequence/iterator_range.cpp : : : : ] + [ run sequence/joint_view.cpp : : : : ] + [ run sequence/list_comparison.cpp : : : : ] + [ run sequence/list_construction.cpp : : : : ] + [ run sequence/list_copy.cpp : : : : ] + [ run sequence/list_iterator.cpp : : : : ] + [ run sequence/list_make.cpp : : : : ] + [ run sequence/list_misc.cpp : : : : ] + [ run sequence/list_mutate.cpp : : : : ] + [ run sequence/list_tie.cpp : : : : ] + [ run sequence/list_value_at.cpp : : : : ] + [ run sequence/deque_comparison.cpp : : : : ] + [ run sequence/deque_construction.cpp : : : : ] + [ run sequence/deque_copy.cpp : : : : ] + [ run sequence/deque_iterator.cpp : : : : ] + [ run sequence/deque_make.cpp : : : : ] + [ run sequence/deque_misc.cpp : : : : ] + [ run sequence/deque_mutate.cpp : : : : ] + [ run sequence/deque_tie.cpp : : : : ] + [ run sequence/deque_value_at.cpp : : : : ] + [ run sequence/front_extended_deque.cpp : : : : ] + [ run sequence/back_extended_deque.cpp : : : : ] + [ run sequence/make_list.cpp : : : : ] + [ run sequence/make_vector.cpp : : : : ] + [ run sequence/map.cpp : : : : ] + [ run sequence/map_tie.cpp : : : : ] + [ run sequence/reverse_view.cpp : : : : ] + [ run sequence/set.cpp : : : : ] + [ run sequence/single_view.cpp : : : : ] + [ run sequence/std_pair.cpp : : : : ] + [ run sequence/array.cpp : : : : ] + [ run sequence/variant.cpp : : : : ] + [ run sequence/tuple_comparison.cpp : : : : ] + [ run sequence/tuple_construction.cpp : : : : ] + [ run sequence/tuple_copy.cpp : : : : ] + [ run sequence/tuple_element.cpp : : : : ] + [ run sequence/tuple_make.cpp : : : : ] + [ run sequence/tuple_misc.cpp : : : : ] + [ run sequence/tuple_mutate.cpp : : : : ] + [ run sequence/tuple_tie.cpp : : : : ] + [ run sequence/transform_view.cpp : : : : ] + [ run sequence/vector_comparison.cpp : : : : ] + [ run sequence/vector_construction.cpp : : : : ] + [ run sequence/vector_copy.cpp : : : : ] + [ run sequence/vector_iterator.cpp : : : : ] + [ run sequence/vector_make.cpp : : : : ] + [ run sequence/vector_misc.cpp : : : : ] + [ run sequence/vector_mutate.cpp : : : : ] + [ run sequence/vector_n.cpp : : : : ] + [ run sequence/vector_tie.cpp : : : : ] + [ run sequence/vector_value_at.cpp : : : : ] + [ run sequence/zip_view.cpp : : : : ] + [ run sequence/zip_view2.cpp : : : : ] + [ run sequence/zip_view_ignore.cpp : : : : ] + [ run sequence/repetitive_view.cpp : : : : ] + [ run sequence/deduce_sequence.cpp : : : : ] + [ run sequence/adapt_struct.cpp : : : : ] + [ run sequence/adapt_assoc_struct.cpp : : : : ] + + [ run functional/fused.cpp : : : : ] + [ run functional/fused_function_object.cpp : : : : ] + [ run functional/fused_procedure.cpp : : : : ] + [ run functional/unfused_generic.cpp : : : : ] + [ run functional/unfused_lvalue_args.cpp : : : : ] + [ run functional/unfused_rvalue_args.cpp : : : : ] + [ run functional/unfused_typed.cpp : : : : ] + [ run functional/make_fused.cpp : : : : ] + [ run functional/make_fused_function_object.cpp : : : : ] + [ run functional/make_fused_procedure.cpp : : : : ] + [ run functional/make_unfused_generic.cpp : : : : ] + [ run functional/make_unfused_lvalue_args.cpp : : : : ] + [ run functional/make_unfused_rvalue_args.cpp : : : : ] + [ run functional/invoke.cpp : : : : ] + [ run functional/invoke_function_object.cpp : : : : ] + [ run functional/invoke_procedure.cpp : : : : ] + [ run sequence/swap.cpp : : : : ] + +# [ compile-fail xxx.cpp : : : : ] + + ; +} + +{ + # Text for extension features, must be explicitly specified on the command line to be run + # TODO these are not in a test-suite because currently test-suites cannot be marked "explicit" + + run algorithm/ext_/for_each_s.cpp ; + explicit for_each_s ; + + run algorithm/ext_/find_if_s.cpp ; + explicit find_if_s ; + + run sequence/ext_/iterator_range_s.cpp ; + explicit iterator_range_s ; +} diff --git a/test/algorithm/all.cpp b/test/algorithm/all.cpp new file mode 100644 index 00000000..47c65e50 --- /dev/null +++ b/test/algorithm/all.cpp @@ -0,0 +1,58 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +namespace +{ + struct search_for + { + explicit search_for(int search) + : search(search) + {} + + template + bool operator()(T const& v) const + { + return v == search; + } + + int search; + }; +} + +int +main() +{ + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 < 4))); + BOOST_TEST((boost::fusion::all(t, boost::lambda::_1 > 0))); + } + + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST((!boost::fusion::all(t, boost::lambda::_1 == 1))); + BOOST_TEST((!boost::fusion::all(t, boost::lambda::_1 < 3))); + } + + { + typedef boost::mpl::vector_c mpl_vec; + // We cannot use lambda here as mpl vec iterators return + // rvalues, and lambda needs lvalues. + BOOST_TEST(boost::fusion::all(mpl_vec(), search_for(1))); + BOOST_TEST(!boost::fusion::all(mpl_vec(), search_for(2))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/any.cpp b/test/algorithm/any.cpp new file mode 100644 index 00000000..69f114f8 --- /dev/null +++ b/test/algorithm/any.cpp @@ -0,0 +1,57 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005 Eric Niebler + Copyright (c) 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +namespace +{ + struct search_for + { + explicit search_for(int search) + : search(search) + {} + + template + bool operator()(T const& v) const + { + return v == search; + } + + int search; + }; +} + +int +main() +{ + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST(boost::fusion::any(t, boost::lambda::_1 == 2)); + } + + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST(!boost::fusion::any(t, boost::lambda::_1 == 3)); + } + + { + typedef boost::mpl::vector_c mpl_vec; + // We cannot use lambda here as mpl vec iterators return + // rvalues, and lambda needs lvalues. + BOOST_TEST(boost::fusion::any(mpl_vec(), search_for(2))); + BOOST_TEST(!boost::fusion::any(mpl_vec(), search_for(4))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/clear.cpp b/test/algorithm/clear.cpp new file mode 100644 index 00000000..3ab42030 --- /dev/null +++ b/test/algorithm/clear.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing pop_back + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 'x', 3.3, s); + + { + std::cout << clear(t1) << std::endl; + BOOST_TEST((clear(t1) == make_vector())); + } + } + + { + typedef boost::mpl::vector_c mpl_vec; + std::cout << boost::fusion::clear(mpl_vec()) << std::endl; + BOOST_TEST((boost::fusion::clear(mpl_vec()) == make_vector())); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/count.cpp b/test/algorithm/count.cpp new file mode 100644 index 00000000..e87ff9d8 --- /dev/null +++ b/test/algorithm/count.cpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2001-2006 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +int +main() +{ + { + boost::fusion::vector t(1, 1, 1); + BOOST_TEST(boost::fusion::count(t, 1) == 3); + } + + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST(boost::fusion::count(t, 3) == 0); + } + + { + boost::fusion::vector t(4, "hello", 4); + BOOST_TEST(boost::fusion::count(t, "hello") == 1); + } + + { + typedef boost::mpl::vector_c mpl_vec; + BOOST_TEST(boost::fusion::count(mpl_vec(), 2) == 3); + BOOST_TEST(boost::fusion::count(mpl_vec(), 3) == 2); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/count_if.cpp b/test/algorithm/count_if.cpp new file mode 100644 index 00000000..d67e464c --- /dev/null +++ b/test/algorithm/count_if.cpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2001-2006 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST(boost::fusion::count_if(t, boost::lambda::_1 == 2) == 1); + } + + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST(boost::fusion::count_if(t, boost::lambda::_1 == 3) == 0); + } + + { + typedef boost::mpl::vector_c mpl_vec; + // Cannot use lambda here as mpl iterators return rvalues and lambda needs lvalues + BOOST_TEST(boost::fusion::count_if(mpl_vec(), std::bind2nd(std::less_equal(), 2)) == 2); + BOOST_TEST(boost::fusion::count_if(mpl_vec(), std::bind2nd(std::greater(), 2)) == 1); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/erase.cpp b/test/algorithm/erase.cpp new file mode 100644 index 00000000..44f641f3 --- /dev/null +++ b/test/algorithm/erase.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using boost::mpl::vector_c; + using boost::mpl::begin; + using boost::mpl::advance; + using boost::mpl::int_; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing erase + + { + typedef vector vector_type; + vector_type t1(1, 'x', 3.3, "Ruby"); + vector_iterator pos(t1); + + std::cout << erase(t1, pos) << std::endl; + BOOST_TEST((erase(t1, pos) == make_vector(1, 'x', std::string("Ruby")))); + BOOST_TEST((erase(t1, end(t1)) == make_vector(1, 'x', 3.3, std::string("Ruby")))); + } + + { + typedef vector_c mpl_vec; + typedef boost::mpl::begin::type mpl_vec_begin; + typedef boost::mpl::advance >::type mpl_vec_at3; + typedef boost::mpl::next::type n1; + typedef boost::mpl::next::type n2; + typedef boost::mpl::next::type n3; + + BOOST_STATIC_ASSERT((boost::is_same::value)); + + + std::cout << erase(mpl_vec(), mpl_vec_at3()) << std::endl; + BOOST_TEST((erase(mpl_vec(), mpl_vec_at3()) + == make_vector(1, 2, 3, 5))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/erase_key.cpp b/test/algorithm/erase_key.cpp new file mode 100644 index 00000000..2685bfd2 --- /dev/null +++ b/test/algorithm/erase_key.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template +void test_set(Set const& set) +{ + using namespace boost::fusion; + std::cout << set << std::endl; + + BOOST_STATIC_ASSERT(result_of::size::value == 3); + BOOST_TEST((*find(set) == 1)); + BOOST_TEST((*find(set) == 1.5)); + BOOST_TEST((*find(set) == "hello")); +} + +typedef boost::mpl::int_<1> _1; +typedef boost::mpl::int_<2> _2; +typedef boost::mpl::int_<3> _3; +typedef boost::mpl::int_<4> _4; + +template +void test_map(Map const& map) +{ + using namespace boost::fusion; + std::cout << map << std::endl; + + BOOST_STATIC_ASSERT(result_of::size::value == 3); + BOOST_TEST(((*find<_1>(map)).second == 1)); + BOOST_TEST(((*find<_3>(map)).second == 1.5)); + BOOST_TEST(((*find<_4>(map)).second == std::string("hello"))); +} + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using namespace std; + using boost::fusion::pair; + using boost::fusion::make_pair; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + test_set(as_set(erase_key(make_set(1, 'x', 1.5, std::string("hello"))))); + test_map(as_map(erase_key<_2>(make_map<_1, _2, _3, _4>(1, 'x', 1.5, "hello")))); + + return boost::report_errors(); +} + diff --git a/test/algorithm/ext_/find_if_s.cpp b/test/algorithm/ext_/find_if_s.cpp new file mode 100755 index 00000000..f3b06d2b --- /dev/null +++ b/test/algorithm/ext_/find_if_s.cpp @@ -0,0 +1,109 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct X +{ + operator int() const + { + return 12345; + } +}; + +template +void +process_tree(Tree const &tree) +{ + using namespace boost; + using mpl::_; + + typedef typename fusion::result_of::find_if_s >::type short_iter; + typedef typename fusion::result_of::find_if_s >::type float_iter; + + // find_if_s of a segmented data structure returns generic + // segmented iterators + short_iter si = fusion::find_if_s >(tree); + float_iter fi = fusion::find_if_s >(tree); + + // they behave like ordinary Fusion iterators ... + BOOST_TEST((*si == short('d'))); + BOOST_TEST((*fi == float(1))); +} + +int +main() +{ + using namespace boost::fusion; + + { + using boost::is_same; + using boost::mpl::_; + + typedef vector vector_type; + vector_type v(12345, 'x', 678910, 3.36); + + std::cout << *find_if_s >(v) << std::endl; + BOOST_TEST((*find_if_s >(v) == 'x')); + + std::cout << *find_if_s >(v) << std::endl; + BOOST_TEST((*find_if_s >(v) == 12345)); + + std::cout << *find_if_s >(v) << std::endl; + BOOST_TEST((*find_if_s >(v) == 3.36)); + } + + { + using boost::mpl::vector; + using boost::is_same; + using boost::mpl::_; + + typedef vector mpl_vec; + BOOST_TEST((*find_if_s >(mpl_vec()) == 12345)); + } + + { + using boost::mpl::vector_c; + using boost::mpl::less; + using boost::mpl::int_; + using boost::is_same; + using boost::mpl::_; + + typedef vector_c mpl_vec; + BOOST_TEST((*find_if_s > >(mpl_vec()) == 1)); + } + + { + process_tree( + make_tree( + make_vector(double(0),'B') + , make_tree( + make_vector(1,2,long(3)) + , make_tree(make_vector('a','b','c')) + , make_tree(make_vector(short('d'),'e','f')) + ) + , make_tree( + make_vector(4,5,6) + , make_tree(make_vector(float(1),'h','i')) + , make_tree(make_vector('j','k','l')) + ) + ) + ); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/ext_/for_each_s.cpp b/test/algorithm/ext_/for_each_s.cpp new file mode 100755 index 00000000..bf4e2bbd --- /dev/null +++ b/test/algorithm/ext_/for_each_s.cpp @@ -0,0 +1,82 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman, 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include + +struct print +{ + template + void operator()(T const& v) const + { + std::cout << "[ " << v << " ] "; + } +}; + +struct increment +{ + template + void operator()(T& v) const + { + ++v; + } +}; + +int +main() +{ + using namespace boost::fusion; + using boost::mpl::vector_c; + namespace fusion = boost::fusion; + + { + typedef vector vector_type; + vector_type v(1, 'x', 3.3, "Ruby"); + for_each_s(v, print()); + std::cout << std::endl; + } + + { + typedef vector vector_type; + vector_type v(1, 'x', 3.3, "Ruby"); + for_each_s(v, increment()); + std::cout << v << std::endl; + } + + { + typedef vector_c mpl_vec; + fusion::for_each_s(mpl_vec(), print()); + std::cout << std::endl; + } + + { + fusion::for_each_s( + make_tree( + make_vector(double(0),'B') + , make_tree( + make_vector(1,2,long(3)) + , make_tree(make_vector('a','b','c')) + , make_tree(make_vector(short('d'),'e','f')) + ) + , make_tree( + make_vector(4,5,6) + , make_tree(make_vector(float(1),'h','i')) + , make_tree(make_vector('j','k','l')) + ) + ) + , print() + ); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/filter.cpp b/test/algorithm/filter.cpp new file mode 100644 index 00000000..4c21d03a --- /dev/null +++ b/test/algorithm/filter.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + typedef boost::fusion::vector vector_type; + vector_type t('a', 6.6, 'b'); + + { + std::cout << filter(t) << std::endl; + BOOST_TEST((filter(t) + == make_vector('a', 'b'))); + } + + { + typedef boost::mpl::vector mpl_vec; + BOOST_TEST((filter(mpl_vec()) + == make_vector('\0', '\0'))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/filter_if.cpp b/test/algorithm/filter_if.cpp new file mode 100644 index 00000000..e1bbb230 --- /dev/null +++ b/test/algorithm/filter_if.cpp @@ -0,0 +1,77 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct X +{ + operator char const*() const + { + return ""; + } +}; + +struct Y +{ + operator char const*() const + { + return ""; + } +}; + +int +main() +{ + using namespace boost::fusion; + + using boost::mpl::_; + using boost::mpl::not_; + using boost::is_class; + using boost::is_same; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing filter_if + + X x; Y y; + typedef boost::fusion::vector vector_type; + vector_type t(y, '@', 987654, x, true, 6.6); + + { + std::cout << filter_if > >(t) << std::endl; + BOOST_TEST((filter_if > >(t) + == make_vector('@', 987654, true, 6.6))); + } + + { + std::cout << filter_if >(t) << std::endl; + BOOST_TEST((filter_if >(t) + == make_vector(y, x))); + } + + { + typedef boost::mpl::vector mpl_vec; + BOOST_TEST((filter_if > >(mpl_vec()) + == make_vector(char(), long(), bool()))); + BOOST_TEST((filter_if >(mpl_vec()) + == make_vector(y, x))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/find.cpp b/test/algorithm/find.cpp new file mode 100644 index 00000000..25a61e94 --- /dev/null +++ b/test/algorithm/find.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct X +{ + operator int() const + { + return 12345; + } +}; +int +main() +{ + using namespace boost::fusion; + using boost::mpl::identity; + + { + typedef vector seq_type; + seq_type seq(12345, 'x', 678910, 3.36); + + std::cout << *boost::fusion::find(seq) << std::endl; + BOOST_TEST(*boost::fusion::find(seq) == 'x'); + + std::cout << *boost::fusion::find(seq) << std::endl; + BOOST_TEST(*boost::fusion::find(seq) == 12345); + + std::cout << *boost::fusion::find(seq) << std::endl; + BOOST_TEST(*boost::fusion::find(seq) == 3.36); + + BOOST_TEST(boost::fusion::find(seq) == boost::fusion::end(seq)); + } + + { + typedef set seq_type; + seq_type seq(12345, 'x', 3.36); + std::cout << *boost::fusion::find(seq) << std::endl; + BOOST_TEST(*boost::fusion::find(seq) == 'x'); + BOOST_TEST(boost::fusion::find(seq) == boost::fusion::end(seq)); + } + + { + typedef map< + pair + , pair > + map_type; + + map_type seq( + make_pair('X') + , make_pair("Men")); + + std::cout << *boost::fusion::find(seq) << std::endl; + std::cout << *boost::fusion::find(seq) << std::endl; + BOOST_TEST((*boost::fusion::find(seq)).second == 'X'); + BOOST_TEST((*boost::fusion::find(seq)).second == "Men"); + BOOST_TEST(boost::fusion::find(seq) == boost::fusion::end(seq)); + } + + { + typedef boost::mpl::vector mpl_vec; + BOOST_TEST((*boost::fusion::find(mpl_vec()) == 12345)); + BOOST_TEST(boost::fusion::find(mpl_vec()) == boost::fusion::end(mpl_vec())); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/find_if.cpp b/test/algorithm/find_if.cpp new file mode 100644 index 00000000..2b402b9f --- /dev/null +++ b/test/algorithm/find_if.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct X +{ + operator int() const + { + return 12345; + } +}; + +int +main() +{ + using namespace boost::fusion; + + { + using boost::is_same; + using boost::mpl::_; + + typedef vector vector_type; + vector_type v(12345, 'x', 678910, 3.36); + + std::cout << *find_if >(v) << std::endl; + BOOST_TEST((*find_if >(v) == 'x')); + + std::cout << *find_if >(v) << std::endl; + BOOST_TEST((*find_if >(v) == 12345)); + + std::cout << *find_if >(v) << std::endl; + BOOST_TEST((*find_if >(v) == 3.36)); + } + + { + using boost::mpl::vector; + using boost::is_same; + using boost::mpl::_; + + typedef vector mpl_vec; + BOOST_TEST((*find_if >(mpl_vec()) == 12345)); + } + + { + using boost::mpl::vector_c; + using boost::mpl::less; + using boost::mpl::int_; + using boost::is_same; + using boost::mpl::_; + + typedef vector_c mpl_vec; + BOOST_TEST((*find_if > >(mpl_vec()) == 1)); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/fold.cpp b/test/algorithm/fold.cpp new file mode 100644 index 00000000..55641677 --- /dev/null +++ b/test/algorithm/fold.cpp @@ -0,0 +1,222 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +using boost::mpl::if_; +using boost::mpl::int_; +using boost::is_same; + +struct add_ints_only +{ + template + struct result; + + template + struct result + { + typedef typename boost::remove_const< + typename boost::remove_reference::type>::type type; + }; + + template + State const& + operator()(T const& x, State const& state) const + { + return state; + } + + int + operator()(int x, int state) const + { + return x + state; + } +}; + +struct count_ints +{ + template + struct result; + + template + struct result + { + typedef typename boost::remove_const< + typename boost::remove_reference::type>::type elem; + typedef typename boost::remove_const< + typename boost::remove_reference::type>::type state; + + typedef typename + if_< + is_same + , typename boost::mpl::next::type + , state + >::type + type; + }; + + template + typename result::type + operator()(T const&, CountT const&) const + { + typedef typename result::type result; + return result(); + } +}; + +struct appender +{ + typedef std::string result_type; + + std::string operator()(char c, std::string const& str) const + { + return str + c; + } +}; + +struct lvalue_adder +{ + template + struct result; + + template + struct result + { + // Second argument still needs to support rvalues - see definition of fusion::fold + typedef T0 type; + }; + + template + T0 operator()(T0& lhs, T1 const& rhs) const + { + return lhs + rhs; + } +}; + +int add(int lhs, int rhs) +{ + return lhs + rhs; +} + +int +main() +{ + using namespace boost::fusion; + namespace fusion = boost::fusion; + + { + typedef vector vector_type; + vector_type v(12345, 'x', 678910, 3.36); + int result = fold(v, 0, add_ints_only()); + std::cout << result << std::endl; + BOOST_TEST(result == 12345+678910); + } + + { + typedef vector vector_type; + vector_type v(12345); + + int n = fusion::fold(v, int_<0>(), count_ints()); + std::cout << n << std::endl; + BOOST_TEST(n == 1); + } + + { + typedef vector vector_type; + vector_type v(12345, 'x', 678910, 3.36, 8756); + + int n = fusion::fold(v, int_<0>(), count_ints()); + std::cout << n << std::endl; + BOOST_TEST(n == 3); + } + + { + typedef boost::mpl::vector mpl_vec; + int n = fusion::fold(mpl_vec(), int_<0>(), count_ints()); + std::cout << n << std::endl; + BOOST_TEST(n == 3); + } + + { + BOOST_TEST(fusion::fold(fusion::make_vector('a','b','c','d','e'), std::string(""), appender()) + == "abcde"); + } + + { + vector vec(1,2); + BOOST_TEST(fusion::fold(vec, 0, lvalue_adder()) == 3); + } + + { + vector vec(1,2); + BOOST_TEST(fusion::fold(vec, 0, add) == 3); + } + + { + typedef vector vector_type; + vector_type v(12345, 'x', 678910, 3.36); + int result = accumulate(v, 0, add_ints_only()); + std::cout << result << std::endl; + BOOST_TEST(result == 12345+678910); + } + + { + typedef vector vector_type; + vector_type v(12345); + + int n = fusion::accumulate(v, int_<0>(), count_ints()); + std::cout << n << std::endl; + BOOST_TEST(n == 1); + } + + { + typedef vector vector_type; + vector_type v(12345, 'x', 678910, 3.36, 8756); + + int n = fusion::accumulate(v, int_<0>(), count_ints()); + std::cout << n << std::endl; + BOOST_TEST(n == 3); + } + + { + typedef boost::mpl::vector mpl_vec; + int n = fusion::accumulate(mpl_vec(), int_<0>(), count_ints()); + std::cout << n << std::endl; + BOOST_TEST(n == 3); + } + + { + BOOST_TEST(fusion::accumulate(fusion::make_vector('a','b','c','d','e'), std::string(""), appender()) + == "abcde"); + } + + { + vector vec(1,2); + BOOST_TEST(fusion::accumulate(vec, 0, add) == 3); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/for_each.cpp b/test/algorithm/for_each.cpp new file mode 100644 index 00000000..a0054fad --- /dev/null +++ b/test/algorithm/for_each.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +struct print +{ + template + void operator()(T const& v) const + { + std::cout << "[ " << v << " ] "; + } +}; + +struct increment +{ + template + void operator()(T& v) const + { + ++v; + } +}; + +int +main() +{ + using namespace boost::fusion; + using boost::mpl::vector_c; + namespace fusion = boost::fusion; + + { + typedef vector vector_type; + vector_type v(1, 'x', 3.3, "Ruby"); + for_each(v, print()); + std::cout << std::endl; + } + + { + typedef vector vector_type; + vector_type v(1, 'x', 3.3, "Ruby"); + for_each(v, increment()); + std::cout << v << std::endl; + } + + { + typedef vector_c mpl_vec; + fusion::for_each(mpl_vec(), print()); + std::cout << std::endl; + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/insert.cpp b/test/algorithm/insert.cpp new file mode 100644 index 00000000..acbcf9a3 --- /dev/null +++ b/test/algorithm/insert.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using boost::mpl::vector_c; + using boost::mpl::advance; + using boost::mpl::int_; + namespace fusion = boost::fusion; + namespace mpl = boost::mpl; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing insert + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 'x', 3.3, s); + vector_iterator pos(t1); + + std::cout << insert(t1, pos, 123456) << std::endl; + BOOST_TEST((insert(t1, pos, 123456) + == make_vector(1, 'x', 123456, 3.3, s))); + + std::cout << insert(t1, end(t1), 123456) << std::endl; + BOOST_TEST((insert(t1, end(t1), 123456) + == make_vector(1, 'x', 3.3, s, 123456))); + + std::cout << insert(t1, begin(t1), "glad") << std::endl; + BOOST_TEST((insert(t1, begin(t1), "glad") + == make_vector(std::string("glad"), 1, 'x', 3.3, s))); + } + + { + typedef vector_c mpl_vec; + typedef mpl::begin::type mpl_vec_begin; + typedef advance >::type mpl_vec_at3; + + std::cout << fusion::insert(mpl_vec(), mpl_vec_at3(), int_<66>()) << std::endl; + BOOST_TEST((fusion::insert(mpl_vec(), mpl_vec_at3(), int_<66>()) + == make_vector(1, 2, 3, 66, 4, 5))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/insert_range.cpp b/test/algorithm/insert_range.cpp new file mode 100644 index 00000000..4cd3ae41 --- /dev/null +++ b/test/algorithm/insert_range.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using boost::mpl::vector_c; + using boost::mpl::advance; + using boost::mpl::int_; + namespace fusion = boost::fusion; + namespace mpl = boost::mpl; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing insert_range + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 'x', 3.3, s); + vector_iterator pos(t1); + + typedef vector vector_type2; + vector_type2 t2(999, 'z'); + + std::cout << insert_range(t1, pos, t2) << std::endl; + BOOST_TEST((insert_range(t1, pos, t2) + == make_vector(1, 'x', 999, 'z', 3.3, s))); + + std::cout << insert_range(t1, end(t1), t2) << std::endl; + BOOST_TEST((insert_range(t1, end(t1), t2) + == make_vector(1, 'x', 3.3, s, 999, 'z'))); + + std::cout << insert_range(t1, begin(t1), t2) << std::endl; + BOOST_TEST((insert_range(t1, begin(t1), t2) + == make_vector(999, 'z', 1, 'x', 3.3, s))); + } + + { + typedef vector_c mpl_vec; + typedef mpl::begin::type mpl_vec_begin; + typedef advance >::type mpl_vec_at3; + typedef vector_c mpl_vec2; + + std::cout << fusion::insert_range(mpl_vec(), mpl_vec_at3(), mpl_vec2()) << std::endl; + BOOST_TEST((fusion::insert_range(mpl_vec(), mpl_vec_at3(), mpl_vec2()) + == make_vector(1, 2, 3, -1, -2, 4, 5))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/join.cpp b/test/algorithm/join.cpp new file mode 100644 index 00000000..04341160 --- /dev/null +++ b/test/algorithm/join.cpp @@ -0,0 +1,28 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +int main() +{ + using namespace boost::fusion; + { + BOOST_TEST(join(make_vector(1,2), make_vector('a','b')) == make_vector(1,2,'a','b')); + } + { + typedef boost::mpl::vector2_c vec1; + typedef boost::mpl::vector2_c vec2; + BOOST_TEST(join(vec1(), vec2()) == make_vector(1,2,3,4)); + + } + return boost::report_errors(); +} diff --git a/test/algorithm/none.cpp b/test/algorithm/none.cpp new file mode 100644 index 00000000..ec5676b6 --- /dev/null +++ b/test/algorithm/none.cpp @@ -0,0 +1,58 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +namespace +{ + struct search_for + { + explicit search_for(int search) + : search(search) + {} + + template + bool operator()(T const& v) const + { + return v == search; + } + + int search; + }; +} + +int +main() +{ + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST((boost::fusion::none(t, boost::lambda::_1 > 4))); + BOOST_TEST((boost::fusion::none(t, boost::lambda::_1 < 0))); + } + + { + boost::fusion::vector t(1, 2, 3.3); + BOOST_TEST((!boost::fusion::none(t, boost::lambda::_1 == 1))); + BOOST_TEST((!boost::fusion::none(t, boost::lambda::_1 < 3))); + } + + { + typedef boost::mpl::vector_c mpl_vec; + // We cannot use lambda here as mpl vec iterators return + // rvalues, and lambda needs lvalues. + BOOST_TEST(boost::fusion::none(mpl_vec(), search_for(4))); + BOOST_TEST(!boost::fusion::none(mpl_vec(), search_for(3))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/pop_back.cpp b/test/algorithm/pop_back.cpp new file mode 100644 index 00000000..55d4b7fe --- /dev/null +++ b/test/algorithm/pop_back.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing pop_back + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 'x', 3.3, s); + + { + std::cout << pop_back(t1) << std::endl; + BOOST_TEST((pop_back(t1) == make_vector(1, 'x', 3.3))); + } + } + + { + typedef boost::mpl::vector_c mpl_vec; + std::cout << boost::fusion::pop_back(mpl_vec()) << std::endl; + BOOST_TEST((boost::fusion::pop_back(mpl_vec()) == make_vector(1, 2, 3, 4))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/pop_front.cpp b/test/algorithm/pop_front.cpp new file mode 100644 index 00000000..c4b797ab --- /dev/null +++ b/test/algorithm/pop_front.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing pop_front + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 'x', 3.3, s); + + { + std::cout << pop_front(t1) << std::endl; + BOOST_TEST((pop_front(t1) == make_vector('x', 3.3, s))); + } + } + + { + typedef boost::mpl::vector_c mpl_vec; + std::cout << boost::fusion::pop_front(mpl_vec()) << std::endl; + BOOST_TEST((boost::fusion::pop_front(mpl_vec()) == make_vector(2, 3, 4, 5))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/push_back.cpp b/test/algorithm/push_back.cpp new file mode 100644 index 00000000..a15d4401 --- /dev/null +++ b/test/algorithm/push_back.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct plus_one +{ + template + void operator()(T& v) const + { + v += 1; + } +}; + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing push_back + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 'x', 3.3, s); + + { + std::cout << push_back(t1, 123456) << std::endl; + BOOST_TEST((push_back(t1, 123456) + == make_vector(1, 'x', 3.3, s, 123456))); + } + + { + std::cout << push_back(t1, "funny") << std::endl; + BOOST_TEST((push_back(t1, "funny") + == make_vector(1, 'x', 3.3, s, std::string("funny")))); + } + + { + std::cout << push_back(t1, t1) << std::endl; + BOOST_TEST((push_back(t1, t1) + == make_vector(1, 'x', 3.3, s, t1))); + } + } + + { + typedef boost::mpl::vector_c mpl_vec; + std::cout << boost::fusion::push_back(mpl_vec(), boost::mpl::int_<6>()) << std::endl; + BOOST_TEST((boost::fusion::push_back(mpl_vec(), boost::mpl::int_<6>()) + == make_vector(1, 2, 3, 4, 5, 6))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/push_front.cpp b/test/algorithm/push_front.cpp new file mode 100644 index 00000000..5c9e8fa8 --- /dev/null +++ b/test/algorithm/push_front.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing push_front + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 'x', 3.3, s); + + { + std::cout << push_front(t1, 123456) << std::endl; + BOOST_TEST((push_front(t1, 123456) + == make_vector(123456, 1, 'x', 3.3, s))); + } + + { + std::cout << push_front(t1, "lively") << std::endl; + BOOST_TEST((push_front(t1, "lively") + == make_vector(std::string("lively"), 1, 'x', 3.3, s))); + } + } + + { + typedef boost::mpl::vector_c mpl_vec; + std::cout << boost::fusion::push_front(mpl_vec(), boost::mpl::int_<1>()) << std::endl; + BOOST_TEST((boost::fusion::push_front(mpl_vec(), boost::mpl::int_<1>()) + == make_vector(1, 2, 3, 4, 5, 6))); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/remove.cpp b/test/algorithm/remove.cpp new file mode 100644 index 00000000..95f351ef --- /dev/null +++ b/test/algorithm/remove.cpp @@ -0,0 +1,80 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include + +struct X +{ + operator char const*() const + { + return ""; + } +}; + +struct Y +{ + operator char const*() const + { + return ""; + } +}; + +int +main() +{ + using namespace boost::fusion; + using boost::mpl::identity; + using boost::mpl::vector; + namespace fusion = boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing remove + + X x; Y y; + typedef fusion::vector vector_type; + vector_type t(y, '@', 987654, x, true, 6.6); + + { + std::cout << fusion::remove(t) << std::endl; + BOOST_TEST((fusion::remove(t) + == make_vector(y, '@', 987654, true, 6.6))); + } + + { + std::cout << fusion::remove(t) << std::endl; + BOOST_TEST((fusion::remove(t) + == make_vector('@', 987654, x, true, 6.6))); + } + + { + std::cout << fusion::remove(t) << std::endl; + BOOST_TEST((fusion::remove(t) + == make_vector(y, '@', x, true, 6.6))); + } + + { + typedef vector mpl_vec; + BOOST_TEST((fusion::remove(mpl_vec()) + == vector())); + BOOST_TEST((fusion::remove(mpl_vec()) + == vector())); + BOOST_TEST((fusion::remove(mpl_vec()) + == vector())); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/remove_if.cpp b/test/algorithm/remove_if.cpp new file mode 100644 index 00000000..9cef9a3d --- /dev/null +++ b/test/algorithm/remove_if.cpp @@ -0,0 +1,78 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct X +{ + operator char const*() const + { + return ""; + } +}; + +struct Y +{ + operator char const*() const + { + return ""; + } +}; + +int +main() +{ + using namespace boost::fusion; + using boost::mpl::vector; + using boost::mpl::_; + using boost::mpl::not_; + using boost::is_class; + using boost::is_same; + namespace fusion = boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing remove_if + + X x; Y y; + typedef fusion::vector vector_type; + vector_type t(y, '@', 987654, x, true, 6.6); + + { + std::cout << remove_if > >(t) << std::endl; + BOOST_TEST((remove_if > >(t) + == make_vector(y, x))); + } + + { + std::cout << remove_if >(t) << std::endl; + BOOST_TEST((remove_if >(t) + == make_vector('@', 987654, true, 6.6))); + } + + { + typedef vector mpl_vec; + BOOST_TEST((remove_if > >(mpl_vec()) + == vector())); + BOOST_TEST((remove_if >(mpl_vec()) + == vector())); + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/replace.cpp b/test/algorithm/replace.cpp new file mode 100644 index 00000000..acdb9761 --- /dev/null +++ b/test/algorithm/replace.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing replace + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 'x', 3, s); + + { + std::cout << replace(t1, 'x', 'y') << std::endl; + BOOST_TEST((replace(t1, 'x', 'y') + == make_vector(1, 'y', 3, s))); + } + + { + char const* s2 = "funny"; + std::cout << replace(t1, s, s2) << std::endl; + BOOST_TEST((replace(t1, s, s2) + == make_vector(1, 'x', 3, s2))); + } + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/replace_if.cpp b/test/algorithm/replace_if.cpp new file mode 100644 index 00000000..b885976c --- /dev/null +++ b/test/algorithm/replace_if.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct gt3 +{ + template + bool operator()(T x) const + { + return x > 3; + } +}; + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing replace + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type t1(1, 2, 3.3, 4, s, 5.5); + + { + std::cout << replace_if(t1, gt3(), -456) << std::endl; + BOOST_TEST((replace_if(t1, gt3(), -456) + == make_vector(1, 2, -456, -456, s, -456))); + } + } + + return boost::report_errors(); +} + diff --git a/test/algorithm/reverse.cpp b/test/algorithm/reverse.cpp new file mode 100644 index 00000000..4cae9b33 --- /dev/null +++ b/test/algorithm/reverse.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing the reverse_view + + { + typedef boost::mpl::range_c mpl_list1; + mpl_list1 sequence; + + std::cout << reverse(sequence) << std::endl; + BOOST_TEST((reverse(sequence) == make_vector(8, 7, 6, 5))); + } + + { + char const* s = "Hi Kim"; + typedef vector vector_type; + vector_type t(123, 'x', 3.36, s); + + std::cout << reverse(t) << std::endl; + BOOST_TEST((reverse(t) == make_vector(s, 3.36, 'x', 123))); + std::cout << reverse(reverse(t)) << std::endl; + BOOST_TEST((reverse(reverse(t)) == t)); + } + + return boost::report_errors(); +} + + diff --git a/test/algorithm/transform.cpp b/test/algorithm/transform.cpp new file mode 100644 index 00000000..1597dfd2 --- /dev/null +++ b/test/algorithm/transform.cpp @@ -0,0 +1,157 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct square +{ + template + struct result; + + template + struct result + { + typedef int type; + }; + + template + int operator()(T x) const + { + return x * x; + } +}; + +struct add +{ + template + struct result; + + template + struct result + { + typedef int type; + }; + + template + int operator()(A a, B b) const + { + return a + b; + } +}; + +struct unary_lvalue_transform +{ + template + struct result; + + template + struct result + { + typedef T* type; + }; + + template + T* operator()(T& t) const + { + return &t; + } +}; + +int twice(int v) +{ + return v*2; +} + +struct binary_lvalue_transform +{ + template + struct result; + + template + struct result + { + typedef T0* type; + }; + + template + T0* operator()(T0& t0, T1&) const + { + return &t0; + } +}; + +int +main() +{ + using namespace boost::fusion; + using boost::mpl::range_c; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing the transform + + { + typedef range_c sequence_type; + sequence_type sequence; + std::cout << transform(sequence, square()) << std::endl; + BOOST_TEST((transform(sequence, square()) == make_vector(25, 36, 49, 64))); + } + + { + typedef range_c mpl_list1; + std::cout << transform(mpl_list1(), square()) << std::endl; + BOOST_TEST((transform(mpl_list1(), square()) == make_vector(25, 36, 49, 64))); + } + + { + vector tup(1, 2, 3); + std::cout << transform(tup, square()) << std::endl; + BOOST_TEST((transform(tup, square()) == make_vector(1, 4, 9))); + } + + { + vector tup1(1, 2, 3); + vector tup2(4, 5, 6); + std::cout << transform(tup1, tup2, add()) << std::endl; + BOOST_TEST((transform(tup1, tup2, add()) == make_vector(5, 7, 9))); + } + + { + // Unary transform that requires lvalues, just check compilation + vector tup1(1, 2, 3); + BOOST_TEST(at_c<0>(transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(*begin(transform(tup1, unary_lvalue_transform())) == &at_c<0>(tup1)); + } + + { + vector tup1(1, 2, 3); + vector tup2(4, 5, 6); + BOOST_TEST(at_c<0>(transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); + BOOST_TEST(*begin(transform(tup1, tup2, binary_lvalue_transform())) == &at_c<0>(tup1)); + } + + { + vector tup1(1, 2, 3); + BOOST_TEST(transform(tup1, twice) == make_vector(2,4,6)); + } + + + return boost::report_errors(); +} + diff --git a/test/algorithm/zip.cpp b/test/algorithm/zip.cpp new file mode 100644 index 00000000..e4f9bedb --- /dev/null +++ b/test/algorithm/zip.cpp @@ -0,0 +1,30 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +int main() +{ + using namespace boost::fusion; + { + BOOST_TEST(zip(make_vector(1,2), make_vector('a','b')) == make_vector(make_vector(1,'a'), make_vector(2,'b'))); + BOOST_TEST( + zip( + make_vector(1,2), + make_vector('a','b'), + make_vector(-1,-2)) + == make_vector( + make_vector(1,'a',-1), + make_vector(2,'b',-2))); // Zip more than 2 sequences + } + return boost::report_errors(); +} diff --git a/test/algorithm/zip2.cpp b/test/algorithm/zip2.cpp new file mode 100644 index 00000000..c8007117 --- /dev/null +++ b/test/algorithm/zip2.cpp @@ -0,0 +1,30 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include + +int main() +{ + using namespace boost::fusion; + { + const vector2 shorter(1,2); + const vector3 longer('a', 'b', 'c'); + const vector2, vector2 > result(vector2(1,'a'), vector2(2,'b')); + BOOST_TEST(zip(shorter, longer) == result); + } + { + const vector3 longer(1,2,3); + const vector2 shorter('a', 'b'); + const vector2, vector2 > result(vector2(1,'a'), vector2(2,'b')); + BOOST_TEST(zip(longer, shorter) == result); + } + return boost::report_errors(); +} diff --git a/test/algorithm/zip_ignore.cpp b/test/algorithm/zip_ignore.cpp new file mode 100644 index 00000000..a12b5820 --- /dev/null +++ b/test/algorithm/zip_ignore.cpp @@ -0,0 +1,28 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +int main() +{ + using namespace boost::fusion; + { + vector iv(1,2); + vector cv('a', 'b'); + BOOST_TEST(at_c<0>(at_c<0>(zip(iv, unused, cv))) == 1); + BOOST_TEST(at_c<2>(at_c<0>(zip(iv, unused, cv))) == 'a'); + + BOOST_TEST(at_c<0>(at_c<1>(zip(iv, unused, cv))) == 2); + BOOST_TEST(at_c<2>(at_c<1>(zip(iv, unused, cv))) == 'b'); + } + return boost::report_errors(); +} diff --git a/test/functional/fused.cpp b/test/functional/fused.cpp new file mode 100644 index 00000000..de974cf8 --- /dev/null +++ b/test/functional/fused.cpp @@ -0,0 +1,97 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include +#include + +#include +#include + +namespace fusion = boost::fusion; +using boost::noncopyable; + +template +struct test_func + : Base +{ + typedef int result_type; + + template + int operator()(T0 const & x, T1 const & y) const + { + return 1+x-y; + } + + template + int operator()(T0 const & x, T1 const & y) + { + return 2+x-y; + } + + template + int operator()(T0 & x, T1 & y) const + { + return 3+x-y; + } + + template + int operator()(T0 & x, T1 & y) + { + return 4+x-y; + } +}; + +int main() +{ + test_func f; + + typedef fusion::fused< test_func<> > ff; + ff fused_func; + + typedef fusion::fused< test_func & > ffr; + ffr fused_func_ref(f); + + typedef fusion::fused< test_func<> const > ffc; + ffc fused_func_c; + + typedef fusion::fused< test_func<> > const ffc2; + ffc2 fused_func_c2; + + typedef fusion::fused< test_func const & > ffcr; + ffcr fused_func_c_ref(f); + + typedef fusion::vector vec; + vec lv_vec(1,'\004'); + + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_TEST(fused_func(lv_vec) == 1); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_TEST(fused_func_c(lv_vec) == 0); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_TEST(fused_func_c2(lv_vec) == 0); + BOOST_TEST(fused_func_ref(lv_vec) == 1); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_TEST(fused_func_c_ref(lv_vec) == 0); + + BOOST_TEST(fused_func(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(fused_func_c(fusion::make_vector(2,'\003')) == 0); + BOOST_TEST(fused_func_c2(fusion::make_vector(2,'\003')) == 0); + BOOST_TEST(fused_func_ref(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(fused_func_c_ref(fusion::make_vector(2,'\003')) == 0); + + return boost::report_errors(); +} + + + diff --git a/test/functional/fused_function_object.cpp b/test/functional/fused_function_object.cpp new file mode 100644 index 00000000..45fab30f --- /dev/null +++ b/test/functional/fused_function_object.cpp @@ -0,0 +1,83 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include +#include + +namespace fusion = boost::fusion; +using boost::noncopyable; + +template +struct test_func + : Base +{ + template + struct result; + + template + struct result< Self(T0, T1) > + { + typedef int type; + }; + + template + int operator()(T0 const & x, T1 const & y) const + { + return 1+x-y; + } + + template + int operator()(T0 const & x, T1 const & y) + { + return 2+x-y; + } + + template + int operator()(T0 & x, T1 & y) const + { + return 3+x-y; + } + + template + int operator()(T0 & x, T1 & y) + { + return 4+x-y; + } +}; + +int main() +{ + test_func f; + fusion::fused_function_object< test_func<> > fused_func; + fusion::fused_function_object< test_func & > fused_func_ref(f); + fusion::fused_function_object< test_func<> const > fused_func_c; + fusion::fused_function_object< test_func<> > const fused_func_c2; + fusion::fused_function_object< test_func const & > fused_func_c_ref(f); + + fusion::vector lv_vec(1,'\004'); + BOOST_TEST(fused_func(lv_vec) == 1); + BOOST_TEST(fused_func_c(lv_vec) == 0); + BOOST_TEST(fused_func_c2(lv_vec) == 0); + BOOST_TEST(fused_func_ref(lv_vec) == 1); + BOOST_TEST(fused_func_c_ref(lv_vec) == 0); + + BOOST_TEST(fused_func(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(fused_func_c(fusion::make_vector(2,'\003')) == 0); + BOOST_TEST(fused_func_c2(fusion::make_vector(2,'\003')) == 0); + BOOST_TEST(fused_func_ref(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(fused_func_c_ref(fusion::make_vector(2,'\003')) == 0); + + return boost::report_errors(); +} + diff --git a/test/functional/fused_procedure.cpp b/test/functional/fused_procedure.cpp new file mode 100644 index 00000000..34ba09d0 --- /dev/null +++ b/test/functional/fused_procedure.cpp @@ -0,0 +1,82 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include +#include + +namespace fusion = boost::fusion; +using boost::noncopyable; + +int effect; + +#define CHECK_EFFECT(t,e) \ + { \ + effect = 1234567; t; \ + BOOST_TEST(effect == e); \ + } + +template +struct test_func + : Base +{ + template + int operator()(T0 const & x, T1 const & y) const + { + return effect = 1+x-y; + } + + template + int operator()(T0 const & x, T1 const & y) + { + return effect = 2+x-y; + } + + template + int operator()(T0 & x, T1 & y) const + { + return effect = 3+x-y; + } + + template + int operator()(T0 & x, T1 & y) + { + return effect = 4+x-y; + } +}; + +int main() +{ + test_func f; + fusion::fused_procedure< test_func<> > fused_proc; + fusion::fused_procedure< test_func & > fused_proc_ref(f); + fusion::fused_procedure< test_func<> const > fused_proc_c; + fusion::fused_procedure< test_func<> > const fused_proc_c2; + fusion::fused_procedure< test_func const & > fused_proc_c_ref(f); + + fusion::vector lv_vec(1,'\004'); + CHECK_EFFECT(fused_proc(lv_vec), 1); + CHECK_EFFECT(fused_proc_c(lv_vec), 0); + CHECK_EFFECT(fused_proc_c2(lv_vec), 0); + CHECK_EFFECT(fused_proc_ref(lv_vec), 1); + CHECK_EFFECT(fused_proc_c_ref(lv_vec), 0); + + CHECK_EFFECT(fused_proc(fusion::make_vector(2,'\003')), 1); + CHECK_EFFECT(fused_proc_c(fusion::make_vector(2,'\003')), 0); + CHECK_EFFECT(fused_proc_c2(fusion::make_vector(2,'\003')), 0); + CHECK_EFFECT(fused_proc_ref(fusion::make_vector(2,'\003')), 1); + CHECK_EFFECT(fused_proc_c_ref(fusion::make_vector(2,'\003')), 0); + + return boost::report_errors(); +} + diff --git a/test/functional/invoke.cpp b/test/functional/invoke.cpp new file mode 100644 index 00000000..3960af17 --- /dev/null +++ b/test/functional/invoke.cpp @@ -0,0 +1,394 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +namespace fusion = boost::fusion; + +template +inline T const & const_(T const & t) +{ + return t; +} + +struct object {}; +struct object_nc : boost::noncopyable {}; + +struct fobj +{ + // Handle nullary separately to exercise result_of support + template + struct result; + + template + struct result< Self(T0) > + { + typedef int type; + }; + + template + struct result< Self(T0, T1) > + { + typedef int type; + }; + + template + struct result< Self(T0, T1, T2) > + { + typedef int type; + }; + + int operator()(int i) { return 2 + i; } + int operator()(int i) const { return 3 + i; } + + int operator()(int i, object &) { return 4 + i; } + int operator()(int i, object &) const { return 5 + i; } + int operator()(int i, object const &) { return 6 + i; } + int operator()(int i, object const &) const { return 7 + i; } + + int operator()(int i, object &, object_nc &) { return 10 + i; } + int operator()(int i, object &, object_nc &) const { return 11 + i; } +}; + +struct nullary_fobj +{ + typedef int result_type; + + int operator()() { return 0; } + int operator()() const { return 1; } +}; + +struct fobj_nc + : boost::noncopyable +{ + // Handle nullary separately to exercise result_of support + template + struct result; + + template + struct result< Self(T0)> + { + typedef int type; + }; + + int operator()(int i) { return 14 + i; } + int operator()(int i) const { return 15 + i; } +}; + +struct nullary_fobj_nc + : boost::noncopyable +{ + typedef int result_type; + + int operator()() { return 12; } + int operator()() const { return 13; } +}; + +int nullary() { return 16; } +int unary(int i) { return 17 + i; } +int binary1(int i, object &) { return 18 + i; } +int binary2(int i, object const &) { return 19 + i; } + +typedef int (* func_ptr)(int); +typedef int (* const c_func_ptr)(int); +typedef int (* volatile v_func_ptr)(int); +typedef int (* const volatile cv_func_ptr)(int); + + func_ptr func_ptr1 = &unary; + c_func_ptr func_ptr2 = &unary; + v_func_ptr func_ptr3 = &unary; +cv_func_ptr func_ptr4 = &unary; + +class members +{ + public: + int data; + + members() + : data(20) + { } + + int nullary() { return data + 1; } + int nullary_c() const { return data + 2; } + int unary(int i) { return data + 3 + i; } + int unary_c(int i) const { return data + 4 + i; } + int binary(int i, object) { return data + 5 + i; } + int binary_c(int i, object) const { return data + 6 + i; } +}; + +struct derived + : members +{ +}; + +typedef int element1_type; +typedef object element2_type; +typedef object_nc & element3_type; + +int element1 = 100; +object element2 = object(); +object_nc element3; + +members that; + +std::auto_ptr spt_that(new members); +std::auto_ptr spt_that_c(new members); + +fusion::single_view sv_obj_ctx( that); +fusion::single_view sv_ref_ctx( that); +fusion::single_view sv_ptr_ctx(& that); +fusion::single_view sv_obj_c_ctx( that); +fusion::single_view sv_ref_c_ctx( that); +fusion::single_view sv_ptr_c_ctx(& that); +fusion::single_view const &> sv_spt_ctx(spt_that); +fusion::single_view< std::auto_ptr const &> sv_spt_c_ctx(spt_that_c); + +derived derived_that; + +std::auto_ptr spt_derived_that(new derived); +std::auto_ptr spt_derived_that_c(new derived); + +fusion::single_view sv_obj_d_ctx( derived_that); +fusion::single_view sv_ref_d_ctx( derived_that); +fusion::single_view sv_ptr_d_ctx(& derived_that); +fusion::single_view sv_obj_c_d_ctx( derived_that); +fusion::single_view sv_ref_c_d_ctx( derived_that); +fusion::single_view sv_ptr_c_d_ctx(& derived_that); +fusion::single_view const &> sv_spt_d_ctx(spt_derived_that); +fusion::single_view< std::auto_ptr const &> sv_spt_c_d_ctx(spt_derived_that_c); + +template +void test_sequence_n(Sequence & seq, mpl::int_<0>) +{ + // Function Objects + + nullary_fobj f; + + BOOST_TEST(f () == fusion::invoke(f , seq )); + BOOST_TEST(f () == fusion::invoke(f , const_(seq))); + + // Note: The function object is taken by value, so we request the copy + // to be const with an explicit template argument. We can also request + // the function object to be pased by reference... + BOOST_TEST(const_(f)() == fusion::invoke(const_(f), seq )); + BOOST_TEST(const_(f)() == fusion::invoke(const_(f), const_(seq))); + + nullary_fobj_nc nc_f; + // ...and we further ensure there is no copying in this case, using a + // noncopyable function object. + BOOST_TEST(nc_f () == fusion::invoke(nc_f , seq )); + BOOST_TEST(nc_f () == fusion::invoke(nc_f , const_(seq))); + BOOST_TEST(const_(nc_f)() == fusion::invoke(const_(nc_f), seq )); + BOOST_TEST(const_(nc_f)() == fusion::invoke(const_(nc_f), const_(seq))); + + // Builtin Functions + + // Call through ref/ptr to function + BOOST_TEST(nullary() == fusion::invoke(nullary, seq)); + BOOST_TEST(nullary() == fusion::invoke(& nullary, seq)); + + // Call through ptr to member function + // Note: The non-const function members::nullary can't be invoked with + // fusion::join(sv_obj_ctx,seq)), which is const and so is its first element + BOOST_TEST(that.nullary() == fusion::invoke(& members::nullary, fusion::join(sv_ref_ctx,seq))); + BOOST_TEST(that.nullary() == fusion::invoke(& members::nullary, fusion::join(sv_ptr_ctx,seq))); + BOOST_TEST(that.nullary() == fusion::invoke(& members::nullary, fusion::join(sv_spt_ctx,seq))); + BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_obj_ctx,seq))); + BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_ref_ctx,seq))); + BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_ptr_ctx,seq))); + BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_spt_ctx,seq))); + BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_obj_c_ctx,seq))); + BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_ref_c_ctx,seq))); + BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_ptr_c_ctx,seq))); + BOOST_TEST(that.nullary_c() == fusion::invoke(& members::nullary_c, fusion::join(sv_spt_c_ctx,seq))); + + // Pointer to data member + + BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_obj_ctx,seq)) = that.data)); + BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_ref_ctx,seq)) = that.data)); + BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_ptr_ctx,seq)) = that.data)); + BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_spt_ctx,seq)) = that.data)); + BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_obj_c_ctx,seq))); + BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_ref_c_ctx,seq))); + BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_ptr_c_ctx,seq))); + BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_spt_c_ctx,seq))); + + BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_obj_d_ctx,seq)) = that.data)); + BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_ref_d_ctx,seq)) = that.data)); + BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_ptr_d_ctx,seq)) = that.data)); + BOOST_TEST(that.data == (fusion::invoke(& members::data, fusion::join(sv_spt_d_ctx,seq)) = that.data)); + BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_obj_c_d_ctx,seq))); + BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_ref_c_d_ctx,seq))); + BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_ptr_c_d_ctx,seq))); + BOOST_TEST(that.data == fusion::invoke(& members::data, fusion::join(sv_spt_c_d_ctx,seq))); +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<1>) +{ + fobj f; + BOOST_TEST(f(element1) == fusion::invoke(f , seq )); + BOOST_TEST(f(element1) == fusion::invoke(f , const_(seq))); + BOOST_TEST(const_(f)(element1) == fusion::invoke(const_(f), seq )); + BOOST_TEST(const_(f)(element1) == fusion::invoke(const_(f), const_(seq))); + + fobj_nc nc_f; + BOOST_TEST(nc_f(element1) == fusion::invoke(nc_f, seq )); + BOOST_TEST(nc_f(element1) == fusion::invoke(nc_f, const_(seq))); + BOOST_TEST(const_(nc_f)(element1) == fusion::invoke(const_(nc_f), seq )); + BOOST_TEST(const_(nc_f)(element1) == fusion::invoke(const_(nc_f), const_(seq))); + + BOOST_TEST(unary(element1) == fusion::invoke(unary, seq)); + BOOST_TEST(func_ptr1(element1) == fusion::invoke(func_ptr1, seq)); + BOOST_TEST(func_ptr2(element1) == fusion::invoke(func_ptr2, seq)); + BOOST_TEST(func_ptr3(element1) == fusion::invoke(func_ptr3, seq)); + BOOST_TEST(func_ptr4(element1) == fusion::invoke(func_ptr4, seq)); + + BOOST_TEST(that.unary(element1) == fusion::invoke(& members::unary, fusion::join(sv_ref_ctx,seq))); + BOOST_TEST(that.unary(element1) == fusion::invoke(& members::unary, fusion::join(sv_ptr_ctx,seq))); + BOOST_TEST(that.unary(element1) == fusion::invoke(& members::unary, fusion::join(sv_spt_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_obj_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_ref_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_ptr_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_spt_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_obj_c_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_ref_c_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_ptr_c_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_spt_c_ctx,seq))); + + BOOST_TEST(that.unary(element1) == fusion::invoke(& members::unary, fusion::join(sv_ref_d_ctx,seq))); + BOOST_TEST(that.unary(element1) == fusion::invoke(& members::unary, fusion::join(sv_ptr_d_ctx,seq))); + BOOST_TEST(that.unary(element1) == fusion::invoke(& members::unary, fusion::join(sv_spt_d_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_obj_d_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_ref_d_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_ptr_d_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_spt_d_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_obj_c_d_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_ref_c_d_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_ptr_c_d_ctx,seq))); + BOOST_TEST(that.unary_c(element1) == fusion::invoke(& members::unary_c, fusion::join(sv_spt_c_d_ctx,seq))); + +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<2>) +{ + fobj f; + BOOST_TEST(f (element1, element2) == fusion::invoke(f , seq)); + BOOST_TEST(f (element1, const_(element2)) == fusion::invoke(f , const_(seq))); + BOOST_TEST(const_(f)(element1, element2) == fusion::invoke(const_(f), seq)); + BOOST_TEST(const_(f)(element1, const_(element2)) == fusion::invoke(const_(f), const_(seq))); + + BOOST_TEST(binary1(element1, element2) == fusion::invoke(binary1, seq)); + BOOST_TEST(binary2(element1, element2) == fusion::invoke(binary2, seq)); + + BOOST_TEST(that.binary(element1,element2) == fusion::invoke(& members::binary, fusion::join(sv_ref_ctx,seq))); + BOOST_TEST(that.binary(element1,element2) == fusion::invoke(& members::binary, fusion::join(sv_ptr_ctx,seq))); + BOOST_TEST(that.binary(element1,element2) == fusion::invoke(& members::binary, fusion::join(sv_spt_ctx,seq))); + BOOST_TEST(that.binary_c(element1,element2) == fusion::invoke(& members::binary_c, fusion::join(sv_obj_ctx,seq))); + BOOST_TEST(that.binary_c(element1,element2) == fusion::invoke(& members::binary_c, fusion::join(sv_ref_ctx,seq))); + BOOST_TEST(that.binary_c(element1,element2) == fusion::invoke(& members::binary_c, fusion::join(sv_ptr_ctx,seq))); + BOOST_TEST(that.binary_c(element1,element2) == fusion::invoke(& members::binary_c, fusion::join(sv_spt_ctx,seq))); + BOOST_TEST(that.binary_c(element1,element2) == fusion::invoke(& members::binary_c, fusion::join(sv_obj_c_ctx,seq))); + BOOST_TEST(that.binary_c(element1,element2) == fusion::invoke(& members::binary_c, fusion::join(sv_ref_c_ctx,seq))); + BOOST_TEST(that.binary_c(element1,element2) == fusion::invoke(& members::binary_c, fusion::join(sv_ptr_c_ctx,seq))); + BOOST_TEST(that.binary_c(element1,element2) == fusion::invoke(& members::binary_c, fusion::join(sv_spt_c_ctx,seq))); +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<3>) +{ + fobj f; + + BOOST_TEST(f(element1, element2, element3) == fusion::invoke(f, seq)); + BOOST_TEST(const_(f)(element1, element2, element3) == fusion::invoke(const_(f), seq)); +} + +template +void test_sequence(Sequence & seq) +{ + test_sequence_n(seq, mpl::int_::value>()); +} + + +void result_type_tests() +{ + using boost::is_same; + + BOOST_TEST(( is_same< + fusion::result_of::invoke::type, int + >::value )); +// disabled until boost::result_of supports it +// BOOST_TEST(( is_same< +// fusion::result_of::invoke >::type, int +// >::value )); + BOOST_TEST(( is_same< + fusion::result_of::invoke >::type, int + >::value )); +// disabled until boost::result_of supports it +// BOOST_TEST(( is_same< +// fusion::result_of::invoke >::type, int +// >::value )); +} + +int main() +{ + result_type_tests(); + + typedef fusion::vector<> vector0; + typedef fusion::vector vector1; + typedef fusion::vector vector2; + typedef fusion::vector vector3; + + vector0 v0; + vector1 v1(element1); + vector2 v2(element1, element2); + vector3 v3(element1, element2, element3); + + test_sequence(v0); + test_sequence(v1); + test_sequence(v2); + test_sequence(v3); + + typedef fusion::list<> list0; + typedef fusion::list list1; + typedef fusion::list list2; + typedef fusion::list list3; + + list0 l0; + list1 l1(element1); + list2 l2(element1, element2); + list3 l3(element1, element2, element3); + + test_sequence(l0); + test_sequence(l1); + test_sequence(l2); + test_sequence(l3); + + return boost::report_errors(); +} + diff --git a/test/functional/invoke_function_object.cpp b/test/functional/invoke_function_object.cpp new file mode 100644 index 00000000..5f08f650 --- /dev/null +++ b/test/functional/invoke_function_object.cpp @@ -0,0 +1,234 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +namespace fusion = boost::fusion; + +template +inline T const & const_(T const & t) +{ + return t; +} + +struct object {}; +struct object_nc : boost::noncopyable {}; + +struct fobj +{ + // Handle nullary separately to exercise result_of support + template + struct result; + + template + struct result< Self(T0) > + { + typedef int type; + }; + + template + struct result< Self(T0, T1) > + { + typedef int type; + }; + + template + struct result< Self(T0, T1, T2) > + { + typedef int type; + }; + + int operator()() { return 0; } + int operator()() const { return 1; } + + int operator()(int i) { return 2 + i; } + int operator()(int i) const { return 3 + i; } + + int operator()(int i, object &) { return 4 + i; } + int operator()(int i, object &) const { return 5 + i; } + int operator()(int i, object const &) { return 6 + i; } + int operator()(int i, object const &) const { return 7 + i; } + + int operator()(int i, object &, object_nc &) { return 10 + i; } + int operator()(int i, object &, object_nc &) const { return 11 + i; } +}; + +struct nullary_fobj +{ + typedef int result_type; + + int operator()() { return 0; } + int operator()() const { return 1; } +}; + +struct fobj_nc + : boost::noncopyable +{ + // Handle nullary separately to exercise result_of support + template + struct result; + + template + struct result< Self(T0) > + { + typedef int type; + }; + + int operator()(int i) { return 14 + i; } + int operator()(int i) const { return 15 + i; } +}; + +struct nullary_fobj_nc + : boost::noncopyable +{ + typedef int result_type; + + int operator()() { return 12; } + int operator()() const { return 13; } +}; + + +typedef int element1_type; +typedef object element2_type; +typedef object_nc & element3_type; + +int element1 = 100; +object element2 = object(); +object_nc element3; + +template +void test_sequence_n(Sequence & seq, mpl::int_<0>) +{ + // Function Objects + + nullary_fobj f; + BOOST_TEST(f () == fusion::invoke_function_object(f , seq )); + BOOST_TEST(f () == fusion::invoke_function_object(f , const_(seq))); + + // Note: The function object is taken by value, so we request the copy + // to be const with an explicit template argument. We can also request + // the function object to be pased by reference... + BOOST_TEST(const_(f)() == fusion::invoke_function_object(const_(f), seq )); + BOOST_TEST(const_(f)() == fusion::invoke_function_object(const_(f), const_(seq))); + + nullary_fobj_nc nc_f; + // ...and we further ensure there is no copying in this case, using a + // noncopyable function object. + BOOST_TEST(nc_f () == fusion::invoke_function_object(nc_f , seq )); + BOOST_TEST(nc_f () == fusion::invoke_function_object(nc_f , const_(seq))); + BOOST_TEST(const_(nc_f)() == fusion::invoke_function_object(const_(nc_f), seq )); + BOOST_TEST(const_(nc_f)() == fusion::invoke_function_object(const_(nc_f), const_(seq))); +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<1>) +{ + fobj f; + BOOST_TEST(f(element1) == fusion::invoke_function_object(f , seq )); + BOOST_TEST(f(element1) == fusion::invoke_function_object(f , const_(seq))); + BOOST_TEST(const_(f)(element1) == fusion::invoke_function_object(const_(f), seq )); + BOOST_TEST(const_(f)(element1) == fusion::invoke_function_object(const_(f), const_(seq))); + + fobj_nc nc_f; + BOOST_TEST(nc_f(element1) == fusion::invoke_function_object(nc_f, seq )); + BOOST_TEST(nc_f(element1) == fusion::invoke_function_object(nc_f, const_(seq))); + BOOST_TEST(const_(nc_f)(element1) == fusion::invoke_function_object(const_(nc_f), seq )); + BOOST_TEST(const_(nc_f)(element1) == fusion::invoke_function_object(const_(nc_f), const_(seq))); +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<2>) +{ + fobj f; + BOOST_TEST(f (element1, element2) == fusion::invoke_function_object(f , seq)); + BOOST_TEST(f (element1, const_(element2)) == fusion::invoke_function_object(f , const_(seq))); + BOOST_TEST(const_(f)(element1, element2) == fusion::invoke_function_object(const_(f), seq)); + BOOST_TEST(const_(f)(element1, const_(element2)) == fusion::invoke_function_object(const_(f), const_(seq))); +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<3>) +{ + fobj f; + + BOOST_TEST(f(element1, element2, element3) == fusion::invoke_function_object(f, seq)); + BOOST_TEST(const_(f)(element1, element2, element3) == fusion::invoke_function_object(const_(f), seq)); +} + +template +void test_sequence(Sequence & seq) +{ + test_sequence_n(seq, mpl::int_::value>()); +} + +void result_type_tests() +{ + using boost::is_same; + + BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< nullary_fobj, fusion::vector<> >::type, int >::value )); + BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); + BOOST_TEST(( is_same< fusion::result_of::invoke_function_object< fobj, fusion::vector >::type, int >::value )); +} + + +int main() +{ + result_type_tests(); + + typedef fusion::vector<> vector0; + typedef fusion::vector vector1; + typedef fusion::vector vector2; + typedef fusion::vector vector3; + + vector0 v0; + vector1 v1(element1); + vector2 v2(element1, element2); + vector3 v3(element1, element2, element3); + + test_sequence(v0); + test_sequence(v1); + test_sequence(v2); + test_sequence(v3); + + typedef fusion::list<> list0; + typedef fusion::list list1; + typedef fusion::list list2; + typedef fusion::list list3; + + list0 l0; + list1 l1(element1); + list2 l2(element1, element2); + list3 l3(element1, element2, element3); + + test_sequence(l0); + test_sequence(l1); + test_sequence(l2); + test_sequence(l3); + + return boost::report_errors(); +} + diff --git a/test/functional/invoke_procedure.cpp b/test/functional/invoke_procedure.cpp new file mode 100644 index 00000000..810cb903 --- /dev/null +++ b/test/functional/invoke_procedure.cpp @@ -0,0 +1,284 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mpl = boost::mpl; +namespace fusion = boost::fusion; + +template +inline T const & const_(T const & t) +{ + return t; +} + +struct object {}; +struct object_nc : boost::noncopyable {}; + +typedef int element1_type; +typedef object element2_type; +typedef object_nc & element3_type; + +int element1 = 100; +object element2 = object(); +object_nc element3; + +class members +{ + public: + int data; + + members() + : data(20) + { } + + int nullary() { return element1 = data + 1; } + int nullary_c() const { return element1 = data + 2; } + int unary(int & i) { return i = data + 3; } + int unary_c(int & i) const { return i = data + 4; } + int binary(int & i, object) { return i = data + 5; } + int binary_c(int & i, object) const { return i = data + 6; } +}; + +members that; +std::auto_ptr spt_that(new members); +std::auto_ptr spt_that_c(new members); + +fusion::single_view sv_obj_ctx( that); +fusion::single_view sv_ref_ctx( that); +fusion::single_view sv_ptr_ctx(& that); +fusion::single_view sv_obj_c_ctx( that); +fusion::single_view sv_ref_c_ctx( that); +fusion::single_view sv_ptr_c_ctx(& that); +fusion::single_view const &> sv_spt_ctx(spt_that); +fusion::single_view< std::auto_ptr const &> sv_spt_c_ctx(spt_that_c); + +struct fobj +{ + int operator()() { return element1 = 0; } + int operator()() const { return element1 = 1; } + + int operator()(int & i) { return i = 2 ; } + int operator()(int & i) const { return i = 3; } + + int operator()(int & i, object &) { return i = 4; } + int operator()(int & i, object &) const { return i = 5; } + int operator()(int & i, object const &) { return i = 6; } + int operator()(int & i, object const &) const { return i = 7; } + + int operator()(int & i, object &, object_nc &) { return i = 10; } + int operator()(int & i, object &, object_nc &) const { return i = 11; } +}; + +struct fobj_nc + : boost::noncopyable +{ + int operator()() { return element1 = 12; } + int operator()() const { return element1 = 13; } + + int operator()(int & i) { return i = 14; } + int operator()(int & i) const { return i = 15; } +}; + +int nullary() { return element1 = 16; } +int unary(int & i) { return i = 17; } +int binary1(int & i, object &) { return i = 18; } +int binary2(int & i, object const &) { return i = 19; } + +typedef int (* func_ptr)(int &); +typedef int (* const c_func_ptr)(int &); +typedef int (* volatile v_func_ptr)(int &); +typedef int (* const volatile cv_func_ptr)(int &); + + func_ptr func_ptr1 = &unary; + c_func_ptr func_ptr2 = &unary; + v_func_ptr func_ptr3 = &unary; +cv_func_ptr func_ptr4 = &unary; + + + +#define COMPARE_EFFECT(e,t) \ + { \ + element1 = 1234567; e; \ + int expected = element1; \ + element1 = 1234567; t; \ + BOOST_TEST(expected == element1 ); \ + } + + +template +void test_sequence_n(Sequence & seq, mpl::int_<0>) +{ + // Function Objects + + fobj f; + + COMPARE_EFFECT(f (), fusion::invoke_procedure(f , seq )); + COMPARE_EFFECT(f (), fusion::invoke_procedure(f , const_(seq))); + + // Note: The function object is taken by value, so we request the copy + // to be const with an explicit template argument. We can also request + // the function object to be pased by reference... + COMPARE_EFFECT(const_(f)(), fusion::invoke_procedure(const_(f), seq )); + COMPARE_EFFECT(const_(f)(), fusion::invoke_procedure(const_(f), const_(seq))); + + fobj_nc nc_f; + // ...and we further ensure there is no copying in this case, using a + // noncopyable function object. + COMPARE_EFFECT(nc_f (), fusion::invoke_procedure(nc_f , seq )); + COMPARE_EFFECT(nc_f (), fusion::invoke_procedure(nc_f , const_(seq))); + COMPARE_EFFECT(const_(nc_f)(), fusion::invoke_procedure(const_(nc_f), seq )); + COMPARE_EFFECT(const_(nc_f)(), fusion::invoke_procedure(const_(nc_f), const_(seq))); + + // Builtin Functions + + // Call through ref/ptr to function + COMPARE_EFFECT(nullary(), fusion::invoke_procedure(nullary, seq)); + COMPARE_EFFECT(nullary(), fusion::invoke_procedure(& nullary, seq)); + + // Call through ptr to member function + // Note: The non-const function members::nullary can't be invoked with + // fusion::join(sv_obj_ctx,seq)), which is const and so is its first element + COMPARE_EFFECT(that.nullary(), fusion::invoke_procedure(& members::nullary, fusion::join(sv_ref_ctx,seq))); + COMPARE_EFFECT(that.nullary(), fusion::invoke_procedure(& members::nullary, fusion::join(sv_ptr_ctx,seq))); + COMPARE_EFFECT(that.nullary(), fusion::invoke_procedure(& members::nullary, fusion::join(sv_spt_ctx,seq))); + COMPARE_EFFECT(that.nullary_c(), fusion::invoke_procedure(& members::nullary_c, fusion::join(sv_obj_ctx,seq))); + COMPARE_EFFECT(that.nullary_c(), fusion::invoke_procedure(& members::nullary_c, fusion::join(sv_ref_ctx,seq))); + COMPARE_EFFECT(that.nullary_c(), fusion::invoke_procedure(& members::nullary_c, fusion::join(sv_ptr_ctx,seq))); + COMPARE_EFFECT(that.nullary_c(), fusion::invoke_procedure(& members::nullary_c, fusion::join(sv_spt_ctx,seq))); + COMPARE_EFFECT(that.nullary_c(), fusion::invoke_procedure(& members::nullary_c, fusion::join(sv_obj_c_ctx,seq))); + COMPARE_EFFECT(that.nullary_c(), fusion::invoke_procedure(& members::nullary_c, fusion::join(sv_ref_c_ctx,seq))); + COMPARE_EFFECT(that.nullary_c(), fusion::invoke_procedure(& members::nullary_c, fusion::join(sv_ptr_c_ctx,seq))); + COMPARE_EFFECT(that.nullary_c(), fusion::invoke_procedure(& members::nullary_c, fusion::join(sv_spt_c_ctx,seq))); +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<1>) +{ + fobj f; + COMPARE_EFFECT(f(element1), fusion::invoke_procedure(f , seq )); + COMPARE_EFFECT(f(element1), fusion::invoke_procedure(f , const_(seq))); + COMPARE_EFFECT(const_(f)(element1), fusion::invoke_procedure(const_(f), seq )); + COMPARE_EFFECT(const_(f)(element1), fusion::invoke_procedure(const_(f), const_(seq))); + + fobj_nc nc_f; + COMPARE_EFFECT(nc_f(element1), fusion::invoke_procedure(nc_f, seq )); + COMPARE_EFFECT(nc_f(element1), fusion::invoke_procedure(nc_f, const_(seq))); + COMPARE_EFFECT(const_(nc_f)(element1), fusion::invoke_procedure(const_(nc_f), seq )); + COMPARE_EFFECT(const_(nc_f)(element1), fusion::invoke_procedure(const_(nc_f), const_(seq))); + + COMPARE_EFFECT(unary(element1), fusion::invoke_procedure(unary, seq)); + COMPARE_EFFECT(func_ptr1(element1), fusion::invoke_procedure(func_ptr1, seq)); + COMPARE_EFFECT(func_ptr2(element1), fusion::invoke_procedure(func_ptr2, seq)); + COMPARE_EFFECT(func_ptr3(element1), fusion::invoke_procedure(func_ptr3, seq)); + COMPARE_EFFECT(func_ptr4(element1), fusion::invoke_procedure(func_ptr4, seq)); + + COMPARE_EFFECT(that.unary(element1), fusion::invoke_procedure(& members::unary, fusion::join(sv_ref_ctx,seq))); + COMPARE_EFFECT(that.unary(element1), fusion::invoke_procedure(& members::unary, fusion::join(sv_ptr_ctx,seq))); + COMPARE_EFFECT(that.unary(element1), fusion::invoke_procedure(& members::unary, fusion::join(sv_spt_ctx,seq))); + COMPARE_EFFECT(that.unary_c(element1), fusion::invoke_procedure(& members::unary_c, fusion::join(sv_obj_ctx,seq))); + COMPARE_EFFECT(that.unary_c(element1), fusion::invoke_procedure(& members::unary_c, fusion::join(sv_ref_ctx,seq))); + COMPARE_EFFECT(that.unary_c(element1), fusion::invoke_procedure(& members::unary_c, fusion::join(sv_ptr_ctx,seq))); + COMPARE_EFFECT(that.unary_c(element1), fusion::invoke_procedure(& members::unary_c, fusion::join(sv_spt_ctx,seq))); + COMPARE_EFFECT(that.unary_c(element1), fusion::invoke_procedure(& members::unary_c, fusion::join(sv_obj_c_ctx,seq))); + COMPARE_EFFECT(that.unary_c(element1), fusion::invoke_procedure(& members::unary_c, fusion::join(sv_ref_c_ctx,seq))); + COMPARE_EFFECT(that.unary_c(element1), fusion::invoke_procedure(& members::unary_c, fusion::join(sv_ptr_c_ctx,seq))); + COMPARE_EFFECT(that.unary_c(element1), fusion::invoke_procedure(& members::unary_c, fusion::join(sv_spt_c_ctx,seq))); +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<2>) +{ + fobj f; + COMPARE_EFFECT(f (element1, element2), fusion::invoke_procedure(f , seq)); + COMPARE_EFFECT(f (element1, const_(element2)), fusion::invoke_procedure(f , const_(seq))); + COMPARE_EFFECT(const_(f)(element1, element2), fusion::invoke_procedure(const_(f), seq)); + COMPARE_EFFECT(const_(f)(element1, const_(element2)), fusion::invoke_procedure(const_(f), const_(seq))); + + COMPARE_EFFECT(binary1(element1, element2), fusion::invoke_procedure(binary1, seq)); + COMPARE_EFFECT(binary2(element1, element2), fusion::invoke_procedure(binary2, seq)); + + COMPARE_EFFECT(that.binary(element1,element2), fusion::invoke_procedure(& members::binary, fusion::join(sv_ref_ctx,seq))); + COMPARE_EFFECT(that.binary(element1,element2), fusion::invoke_procedure(& members::binary, fusion::join(sv_ptr_ctx,seq))); + COMPARE_EFFECT(that.binary(element1,element2), fusion::invoke_procedure(& members::binary, fusion::join(sv_spt_ctx,seq))); + COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_obj_ctx,seq))); + COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_ref_ctx,seq))); + COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_ptr_ctx,seq))); + COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_spt_ctx,seq))); + COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_obj_c_ctx,seq))); + COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_ref_c_ctx,seq))); + COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_ptr_c_ctx,seq))); + COMPARE_EFFECT(that.binary_c(element1,element2), fusion::invoke_procedure(& members::binary_c, fusion::join(sv_spt_c_ctx,seq))); +} + +template +void test_sequence_n(Sequence & seq, mpl::int_<3>) +{ + fobj f; + + COMPARE_EFFECT(f(element1, element2, element3), fusion::invoke_procedure(f, seq)); + COMPARE_EFFECT(const_(f)(element1, element2, element3), fusion::invoke_procedure(const_(f), seq)); +} + +template +void test_sequence(Sequence & seq) +{ + test_sequence_n(seq, mpl::int_::value>()); +} + +int main() +{ + typedef fusion::vector<> vector0; + typedef fusion::vector vector1; + typedef fusion::vector vector2; + typedef fusion::vector vector3; + + vector0 v0; + vector1 v1(element1); + vector2 v2(element1, element2); + vector3 v3(element1, element2, element3); + + test_sequence(v0); + test_sequence(v1); + test_sequence(v2); + test_sequence(v3); + + typedef fusion::list<> list0; + typedef fusion::list list1; + typedef fusion::list list2; + typedef fusion::list list3; + + list0 l0; + list1 l1(element1); + list2 l2(element1, element2); + list3 l3(element1, element2, element3); + + test_sequence(l0); + test_sequence(l1); + test_sequence(l2); + test_sequence(l3); + + return boost::report_errors(); +} + diff --git a/test/functional/make_fused.cpp b/test/functional/make_fused.cpp new file mode 100644 index 00000000..ba5e604f --- /dev/null +++ b/test/functional/make_fused.cpp @@ -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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include +#include + +namespace fusion = boost::fusion; +using boost::noncopyable; +using boost::cref; +using boost::ref; + +template +struct test_func + : Base +{ + typedef int result_type; + + template + int operator()(T0 const & x, T1 const & y) const + { + return 1+x-y; + } + + template + int operator()(T0 const & x, T1 const & y) + { + return 2+x-y; + } + + template + int operator()(T0 & x, T1 & y) const + { + return 3+x-y; + } + + template + int operator()(T0 & x, T1 & y) + { + return 4+x-y; + } +}; + +template +inline T const & const_(T const & t) +{ + return t; +} + +int main() +{ + fusion::vector lv_vec(1,'\004'); + test_func<> f; + test_func f_nc; + + fusion::result_of::make_fused< test_func<> >::type fused_func + = fusion::make_fused(f); + + BOOST_TEST(fused_func(lv_vec) == 1); + BOOST_TEST(const_(fused_func)(lv_vec) == 0); + BOOST_TEST(fusion::make_fused(const_(f))(lv_vec) == 1); + BOOST_TEST(fusion::make_fused(ref(f_nc))(lv_vec) == 1); + BOOST_TEST(fusion::make_fused(cref(f_nc))(lv_vec) == 0); + + BOOST_TEST(fused_func(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(const_(fused_func)(fusion::make_vector(2,'\003')) == 0); + BOOST_TEST(fusion::make_fused(const_(f))(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(fusion::make_fused(ref(f_nc))(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(fusion::make_fused(cref(f_nc))(fusion::make_vector(2,'\003')) == 0); + + return boost::report_errors(); +} + + + diff --git a/test/functional/make_fused_function_object.cpp b/test/functional/make_fused_function_object.cpp new file mode 100644 index 00000000..f2463003 --- /dev/null +++ b/test/functional/make_fused_function_object.cpp @@ -0,0 +1,95 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include +#include + +namespace fusion = boost::fusion; +using boost::noncopyable; +using boost::cref; +using boost::ref; + +template +struct test_func + : Base +{ + template + struct result + { + }; + + + template + struct result< Self(T0, T1) > + { + typedef int type; + }; + + template + int operator()(T0 const & x, T1 const & y) const + { + return 1+x-y; + } + + template + int operator()(T0 const & x, T1 const & y) + { + return 2+x-y; + } + + template + int operator()(T0 & x, T1 & y) const + { + return 3+x-y; + } + + template + int operator()(T0 & x, T1 & y) + { + return 4+x-y; + } +}; + +template +inline T const & const_(T const & t) +{ + return t; +} + +int main() +{ + fusion::vector lv_vec(1,'\004'); + test_func<> f; + test_func f_nc; + + fusion::result_of::make_fused_function_object< test_func<> >::type fused_func + = fusion::make_fused_function_object(f); + + BOOST_TEST(fused_func(lv_vec) == 1); + BOOST_TEST(const_(fused_func)(lv_vec) == 0); + BOOST_TEST(fusion::make_fused_function_object(const_(f))(lv_vec) == 1); + BOOST_TEST(fusion::make_fused_function_object(ref(f_nc))(lv_vec) == 1); + BOOST_TEST(fusion::make_fused_function_object(cref(f_nc))(lv_vec) == 0); + + BOOST_TEST(fused_func(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(const_(fused_func)(fusion::make_vector(2,'\003')) == 0); + BOOST_TEST(fusion::make_fused_function_object(const_(f))(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(fusion::make_fused_function_object(ref(f_nc))(fusion::make_vector(2,'\003')) == 1); + BOOST_TEST(fusion::make_fused_function_object(cref(f_nc))(fusion::make_vector(2,'\003')) == 0); + + return boost::report_errors(); +} + + + diff --git a/test/functional/make_fused_procedure.cpp b/test/functional/make_fused_procedure.cpp new file mode 100644 index 00000000..6a4cf572 --- /dev/null +++ b/test/functional/make_fused_procedure.cpp @@ -0,0 +1,91 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include +#include + +namespace fusion = boost::fusion; +using boost::noncopyable; +using boost::cref; +using boost::ref; + +int effect; + +#define CHECK_EFFECT(t,e) \ + { \ + effect = 1234567; t; \ + BOOST_TEST(effect == e); \ + } + +template +struct test_func + : Base +{ + template + int operator()(T0 const & x, T1 const & y) const + { + return effect = 1+x-y; + } + + template + int operator()(T0 const & x, T1 const & y) + { + return effect = 2+x-y; + } + + template + int operator()(T0 & x, T1 & y) const + { + return effect = 3+x-y; + } + + template + int operator()(T0 & x, T1 & y) + { + return effect = 4+x-y; + } +}; + +template +inline T const & const_(T const & t) +{ + return t; +} + +int main() +{ + fusion::vector lv_vec(1,'\004'); + test_func<> f; + test_func f_nc; + + fusion::result_of::make_fused_procedure< test_func<> >::type fused_func + = fusion::make_fused_procedure(f); + + CHECK_EFFECT(fused_func(lv_vec), 1); + CHECK_EFFECT(const_(fused_func)(lv_vec), 0); + CHECK_EFFECT(fusion::make_fused_procedure(const_(f))(lv_vec), 1); + CHECK_EFFECT(fusion::make_fused_procedure(ref(f_nc))(lv_vec), 1); + CHECK_EFFECT(fusion::make_fused_procedure(cref(f_nc))(lv_vec), 0); + + CHECK_EFFECT(fused_func(fusion::make_vector(2,'\003')), 1); + CHECK_EFFECT(const_(fused_func)(fusion::make_vector(2,'\003')), 0); + CHECK_EFFECT(fusion::make_fused_procedure(const_(f))(fusion::make_vector(2,'\003')), 1); + CHECK_EFFECT(fusion::make_fused_procedure(ref(f_nc))(fusion::make_vector(2,'\003')), 1); + CHECK_EFFECT(fusion::make_fused_procedure(cref(f_nc))(fusion::make_vector(2,'\003')), 0); + + return boost::report_errors(); +} + + + diff --git a/test/functional/make_unfused_generic.cpp b/test/functional/make_unfused_generic.cpp new file mode 100644 index 00000000..4dcc7449 --- /dev/null +++ b/test/functional/make_unfused_generic.cpp @@ -0,0 +1,124 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +namespace fusion = boost::fusion; +namespace mpl = boost::mpl; + +using boost::noncopyable; +typedef mpl::true_ no_nullary_call; + +using boost::ref; +using boost::cref; + +template +struct test_func + : Base +{ + template + struct result; + + template + struct result< Self(Seq &) > + : mpl::if_< mpl::and_< fusion::result_of::empty, RemoveNullary >, + boost::blank, mpl::identity >::type + { }; + + template + long operator()(Seq const & seq) const + { + long state = 0; + return fusion::fold(seq, state, fold_op()); + } + + template < typename Seq > + long operator()(Seq const & seq) + { + long state = 100; + return fusion::fold(seq, state, fold_op()); + } + + private: + + struct fold_op + { + typedef long result_type; + + template + long operator()(T const & elem, long value) const + { + return value + sizeof(T) * elem; + } + + template + long operator()(T & elem, long value) const + { + elem += sizeof(T); + return value; + } + }; +}; + +template +inline T const & const_(T const & t) +{ + return t; +} + +int main() +{ + test_func<> f; + test_func f_nc; + + fusion::result_of::make_unfused_generic< test_func<> >::type unfused_func = + fusion::make_unfused_generic(f); + + fusion::result_of::make_unfused_generic< boost::reference_wrapper< + test_func > >::type unfused_func_ref = + fusion::make_unfused_generic(ref(f_nc)); + + fusion::result_of::make_unfused_generic< boost::reference_wrapper< + test_func const> >::type unfused_func_c_ref = + fusion::make_unfused_generic(cref(f_nc)); + + BOOST_TEST(unfused_func() == 100); + BOOST_TEST(const_(unfused_func)() == 0); + BOOST_TEST(unfused_func_ref() == 100); + BOOST_TEST(unfused_func_c_ref() == 0); + + long lvalue = 12; + static const long expected = 1*sizeof(int) + 2*sizeof(long) + 7*sizeof(char); + BOOST_TEST(unfused_func(lvalue,lvalue,1,2l,'\007') == 100 + expected); + BOOST_TEST(lvalue == 12 + 2*sizeof(long)); + BOOST_TEST(const_(unfused_func)(lvalue,lvalue,1,2l,'\007') == 0 + expected); + BOOST_TEST(lvalue == 12 + 4*sizeof(long)); + BOOST_TEST(unfused_func_ref(lvalue,lvalue,1,2l,'\007') == 100 + expected); + BOOST_TEST(lvalue == 12 + 6*sizeof(long)); + BOOST_TEST(unfused_func_c_ref(lvalue,lvalue,1,2l,'\007') == 0 + expected); + BOOST_TEST(lvalue == 12 + 8*sizeof(long)); + + return boost::report_errors(); +} + diff --git a/test/functional/make_unfused_lvalue_args.cpp b/test/functional/make_unfused_lvalue_args.cpp new file mode 100644 index 00000000..af94256c --- /dev/null +++ b/test/functional/make_unfused_lvalue_args.cpp @@ -0,0 +1,126 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include + +namespace fusion = boost::fusion; +namespace mpl = boost::mpl; + +using boost::noncopyable; +typedef mpl::true_ no_nullary_call; + +using boost::ref; +using boost::cref; + +template +struct test_func + : Base +{ + template + struct result; + + template + struct result< Self(Seq &) > + : mpl::if_< mpl::and_< fusion::result_of::empty, RemoveNullary >, + boost::blank, mpl::identity >::type + { }; + + template + long operator()(Seq const & seq) const + { + long state = 0; + return fusion::fold(seq, state, fold_op()); + } + + template < typename Seq > + long operator()(Seq const & seq) + { + long state = 100; + return fusion::fold(seq, state, fold_op()); + } + + private: + + struct fold_op + { + typedef long result_type; + + template + long operator()(T & elem, long value) const + { + elem += sizeof(T); + return value + elem; + } + }; +}; + +template +inline T const & const_(T const & t) +{ + return t; +} + +int main() +{ + test_func<> f; + test_func f_nc; + + fusion::result_of::make_unfused_lvalue_args< test_func<> >::type unfused_func = + fusion::make_unfused_lvalue_args(f); + + fusion::result_of::make_unfused_lvalue_args< boost::reference_wrapper< + test_func > >::type unfused_func_ref = + fusion::make_unfused_lvalue_args(ref(f_nc)); + + fusion::result_of::make_unfused_lvalue_args< boost::reference_wrapper< + test_func const> >::type unfused_func_c_ref = + fusion::make_unfused_lvalue_args(cref(f_nc)); + + BOOST_TEST(unfused_func() == 100); + BOOST_TEST(const_(unfused_func)() == 0); + BOOST_TEST(unfused_func_ref() == 100); + BOOST_TEST(unfused_func_c_ref() == 0); + + long lv1 = 2; int lv2 = 3l; char lv3 = '\007'; + long expected; + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(unfused_func(lv1,lv2,lv3) == 100 + expected); + BOOST_TEST(lv1 == 2+1*sizeof(lv1) && lv2 == 3+1*sizeof(lv2) && lv3 == 7+1*sizeof(lv3)); + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(const_(unfused_func)(lv1,lv2,lv3) == 0 + expected); + BOOST_TEST(lv1 == 2+2*sizeof(lv1) && lv2 == 3+2*sizeof(lv2) && lv3 == 7+2*sizeof(lv3)); + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(unfused_func_ref(lv1,lv2,lv3) == 100 + expected); + BOOST_TEST(lv1 == 2+3*sizeof(lv1) && lv2 == 3+3*sizeof(lv2) && lv3 == 7+3*sizeof(lv3)); + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(unfused_func_c_ref(lv1,lv2,lv3) == 0 + expected); + BOOST_TEST(lv1 == 2+4*sizeof(lv1) && lv2 == 3+4*sizeof(lv2) && lv3 == 7+4*sizeof(lv3)); + + return boost::report_errors(); +} + diff --git a/test/functional/make_unfused_rvalue_args.cpp b/test/functional/make_unfused_rvalue_args.cpp new file mode 100644 index 00000000..383fcc0b --- /dev/null +++ b/test/functional/make_unfused_rvalue_args.cpp @@ -0,0 +1,110 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include + +namespace fusion = boost::fusion; +namespace mpl = boost::mpl; + +using boost::noncopyable; +typedef mpl::true_ no_nullary_call; + +using boost::ref; +using boost::cref; + +template +struct test_func + : Base +{ + template + struct result; + + template + struct result< Self(Seq &) > + : mpl::if_< mpl::and_< fusion::result_of::empty, RemoveNullary >, + boost::blank, mpl::identity >::type + { }; + + template + long operator()(Seq const & seq) const + { + long state = 0; + return fusion::fold(seq, state, fold_op()); + } + + template < typename Seq > + long operator()(Seq const & seq) + { + long state = 100; + return fusion::fold(seq, state, fold_op()); + } + + private: + + struct fold_op + { + typedef long result_type; + + template + long operator()(T const & elem, long value) const + { + return value + sizeof(T) * elem; + } + }; +}; + +template +inline T const & const_(T const & t) +{ + return t; +} + +int main() +{ + test_func<> f; + test_func f_nc; + + fusion::result_of::make_unfused_rvalue_args< test_func<> >::type unfused_func = + fusion::make_unfused_rvalue_args(f); + + fusion::result_of::make_unfused_rvalue_args< boost::reference_wrapper< + test_func > >::type unfused_func_ref = + fusion::make_unfused_rvalue_args(ref(f_nc)); + + fusion::result_of::make_unfused_rvalue_args< boost::reference_wrapper< + test_func const> >::type unfused_func_c_ref = + fusion::make_unfused_rvalue_args(cref(f_nc)); + + BOOST_TEST(unfused_func() == 100); + BOOST_TEST(const_(unfused_func)() == 0); + BOOST_TEST(unfused_func_ref() == 100); + BOOST_TEST(unfused_func_c_ref() == 0); + + static const long expected = 1*sizeof(int) + 2*sizeof(long) + 7*sizeof(char); + BOOST_TEST(unfused_func(1,2l,'\007') == 100 + expected); + BOOST_TEST(const_(unfused_func)(1,2l,'\007') == 0 + expected); + BOOST_TEST(unfused_func_ref(1,2l,'\007') == 100 + expected); + BOOST_TEST(unfused_func_c_ref(1,2l,'\007') == 0 + expected); + + return boost::report_errors(); +} + diff --git a/test/functional/unfused_generic.cpp b/test/functional/unfused_generic.cpp new file mode 100644 index 00000000..f1f86515 --- /dev/null +++ b/test/functional/unfused_generic.cpp @@ -0,0 +1,126 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include + +#include +#include + +#include + +#include + +#include + +namespace fusion = boost::fusion; +namespace mpl = boost::mpl; + +using boost::noncopyable; +typedef mpl::true_ no_nullary_call; + +template +struct test_func + : Base +{ + template + struct result; + + template + struct result< Self (Seq) > + : mpl::identity + { }; + + template + long operator()(Seq const & seq) const + { + long state = 0; + return fusion::fold(seq, state, fold_op()); + } + + template + long operator()(Seq const & seq) + { + long state = 100; + return fusion::fold(seq, state, fold_op()); + } + + private: + + struct fold_op + { + template + long operator()(T const & elem, long value) const + { + return value + sizeof(T) * elem; + } + + template + long operator()(T & elem, long value) const + { + elem += sizeof(T); + return value; + } + + template + struct result; + + template struct result< Self(T0,T1) > + : mpl::identity + { }; + }; +}; + +void result_type_tests() +{ + using boost::is_same; + + typedef fusion::unfused_generic< test_func<> > t; + BOOST_TEST(( is_same< boost::result_of< t () >::type, long >::value )); + BOOST_TEST(( is_same< boost::result_of< t (int) >::type, long >::value )); +} + +int main() +{ + result_type_tests(); + + test_func f; + fusion::unfused_generic< test_func<> > unfused_func; + fusion::unfused_generic< test_func & > unfused_func_ref(f); + fusion::unfused_generic< test_func<> const > unfused_func_c; + fusion::unfused_generic< test_func<> > const unfused_func_c2; + fusion::unfused_generic< test_func const & > unfused_func_c_ref(f); + + BOOST_TEST(unfused_func() == 100); + BOOST_TEST(unfused_func_ref() == 100); + BOOST_TEST(unfused_func_c() == 0); + BOOST_TEST(unfused_func_c2() == 0); + BOOST_TEST(unfused_func_c_ref() == 0); + + long lvalue = 12; + // also test const lvalues to pick up compiler deficiencies in that area + int const clvalue_1 = 1; + long const clvalue_2 = 2; + + static const long expected = 1*sizeof(int) + 2*sizeof(long) + 7*sizeof(char); + BOOST_TEST(unfused_func(lvalue,lvalue,clvalue_1,clvalue_2,'\007') == 100 + expected); + BOOST_TEST(lvalue == 12 + 2*sizeof(long)); + BOOST_TEST(unfused_func_ref(lvalue,lvalue,1,2l,'\007') == 100 + expected); + BOOST_TEST(lvalue == 12 + 4*sizeof(long)); + BOOST_TEST(unfused_func_c(lvalue,lvalue,1,2l,'\007') == 0 + expected); + BOOST_TEST(lvalue == 12 + 6*sizeof(long)); + BOOST_TEST(unfused_func_c2(lvalue,lvalue,1,2l,'\007') == 0 + expected); + BOOST_TEST(lvalue == 12 + 8*sizeof(long)); + BOOST_TEST(unfused_func_c_ref(lvalue,lvalue,1,2l,'\007') == 0 + expected); + BOOST_TEST(lvalue == 12 + 10*sizeof(long)); + + return boost::report_errors(); +} + diff --git a/test/functional/unfused_lvalue_args.cpp b/test/functional/unfused_lvalue_args.cpp new file mode 100644 index 00000000..e7972499 --- /dev/null +++ b/test/functional/unfused_lvalue_args.cpp @@ -0,0 +1,119 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include + +#include + +#include +#include + +namespace fusion = boost::fusion; +namespace mpl = boost::mpl; + +using boost::noncopyable; + +template +struct test_func + : Base +{ + template + struct result; + + template + struct result< Self(Seq) > + : mpl::identity + { }; + + template + long operator()(Seq const & seq) const + { + long state = 0; + return fusion::fold(seq, state, fold_op()); + } + + template + long operator()(Seq const & seq) + { + long state = 100; + return fusion::fold(seq, state, fold_op()); + } + + private: + + struct fold_op + { + typedef long result_type; + + template + long operator()(T & elem, long value) const + { + elem += sizeof(T); + return value + elem; + } + }; +}; + +void result_type_tests() +{ + using boost::is_same; + + typedef fusion::unfused_lvalue_args< test_func<> > t; + BOOST_TEST(( is_same< boost::result_of< t () >::type, long >::value )); + BOOST_TEST(( is_same< boost::result_of< t (int) >::type, long >::value )); +} + +int main() +{ + result_type_tests(); + + test_func f; + fusion::unfused_lvalue_args< test_func<> > unfused_func; + fusion::unfused_lvalue_args< test_func & > unfused_func_ref(f); + fusion::unfused_lvalue_args< test_func<> const > unfused_func_c; + fusion::unfused_lvalue_args< test_func<> > const unfused_func_c2; + fusion::unfused_lvalue_args< test_func const & > unfused_func_c_ref(f); + + BOOST_TEST(unfused_func() == 100); + BOOST_TEST(unfused_func_ref() == 100); + BOOST_TEST(unfused_func_c() == 0); + BOOST_TEST(unfused_func_c2() == 0); + BOOST_TEST(unfused_func_c_ref() == 0); + + long lv1 = 2; int lv2 = 3l; char lv3 = '\007'; + long expected; + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(unfused_func(lv1,lv2,lv3) == 100 + expected); + BOOST_TEST(lv1 == 2+1*sizeof(lv1) && lv2 == 3+1*sizeof(lv2) && lv3 == 7+1*sizeof(lv3)); + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(unfused_func_ref(lv1,lv2,lv3) == 100 + expected); + BOOST_TEST(lv1 == 2+2*sizeof(lv1) && lv2 == 3+2*sizeof(lv2) && lv3 == 7+2*sizeof(lv3)); + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(unfused_func_c(lv1,lv2,lv3) == 0 + expected); + BOOST_TEST(lv1 == 2+3*sizeof(lv1) && lv2 == 3+3*sizeof(lv2) && lv3 == 7+3*sizeof(lv3)); + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(unfused_func_c2(lv1,lv2,lv3) == 0 + expected); + BOOST_TEST(lv1 == 2+4*sizeof(lv1) && lv2 == 3+4*sizeof(lv2) && lv3 == 7+4*sizeof(lv3)); + + expected = lv1+sizeof(lv1) + lv2+sizeof(lv2) + lv3+sizeof(lv3); + BOOST_TEST(unfused_func_c_ref(lv1,lv2,lv3) == 0 + expected); + BOOST_TEST(lv1 == 2+5*sizeof(lv1) && lv2 == 3+5*sizeof(lv2) && lv3 == 7+5*sizeof(lv3)); + + return boost::report_errors(); +} + diff --git a/test/functional/unfused_rvalue_args.cpp b/test/functional/unfused_rvalue_args.cpp new file mode 100644 index 00000000..349bf7fa --- /dev/null +++ b/test/functional/unfused_rvalue_args.cpp @@ -0,0 +1,102 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include + +#include + +#include + +namespace fusion = boost::fusion; +namespace mpl = boost::mpl; + +using boost::noncopyable; +typedef mpl::true_ no_nullary_call; + +template +struct test_func + : Base +{ + template + struct result; + + template + struct result< Self(Seq) > + : mpl::identity + { }; + + template + long operator()(Seq const & seq) const + { + long state = 0; + return fusion::fold(seq, state, fold_op()); + } + + template < typename Seq > + long operator()(Seq const & seq) + { + long state = 100; + return fusion::fold(seq, state, fold_op()); + } + + private: + + struct fold_op + { + typedef long result_type; + + template + long operator()(T const & elem, long value) const + { + return value + sizeof(T) * elem; + } + }; +}; + +void result_type_tests() +{ + using boost::is_same; + + typedef fusion::unfused_rvalue_args< test_func<> > t; + BOOST_TEST(( is_same< boost::result_of< t () >::type, long >::value )); + BOOST_TEST(( is_same< boost::result_of< t (int) >::type, long >::value )); +} + +int main() +{ + result_type_tests(); + + test_func f; + fusion::unfused_rvalue_args< test_func<> > unfused_func; + fusion::unfused_rvalue_args< test_func & > unfused_func_ref(f); + fusion::unfused_rvalue_args< test_func<> const > unfused_func_c; + fusion::unfused_rvalue_args< test_func<> > const unfused_func_c2; + fusion::unfused_rvalue_args< test_func const & > unfused_func_c_ref(f); + + BOOST_TEST(unfused_func() == 100); + BOOST_TEST(unfused_func_ref() == 100); + BOOST_TEST(unfused_func_c() == 0); + BOOST_TEST(unfused_func_c2() == 0); + BOOST_TEST(unfused_func_c_ref() == 0); + + static const long expected = 1*sizeof(int) + 2*sizeof(long) + 7*sizeof(char); + BOOST_TEST(unfused_func(1,2l,'\007') == 100 + expected); + BOOST_TEST(unfused_func_ref(1,2l,'\007') == 100 + expected); + BOOST_TEST(unfused_func_c(1,2l,'\007') == 0 + expected); + BOOST_TEST(unfused_func_c2(1,2l,'\007') == 0 + expected); + BOOST_TEST(unfused_func_c_ref(1,2l,'\007') == 0 + expected); + + return boost::report_errors(); +} + diff --git a/test/functional/unfused_typed.cpp b/test/functional/unfused_typed.cpp new file mode 100644 index 00000000..7c5fa856 --- /dev/null +++ b/test/functional/unfused_typed.cpp @@ -0,0 +1,166 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include + +#include + +#include + +#include + +#include + +namespace fusion = boost::fusion; +namespace mpl = boost::mpl; +using mpl::placeholders::_; + +using boost::noncopyable; + +typedef fusion::vector<> types0; +typedef fusion::vector types1; +typedef fusion::vector types3; + +template +struct test_func + : Base +{ + template + struct result; + + template + struct result< Self(Seq) > + : mpl::identity + { }; + + template + long operator()(Seq const & seq) const + { + long state = 0; + return fusion::fold(seq, state, fold_op()); + } + + template < typename Seq > + long operator()(Seq const & seq) + { + long state = 100; + return fusion::fold(seq, state, fold_op()); + } + + private: + + struct fold_op + { + typedef long result_type; + + template + long operator()(T const & elem, long value) const + { + return value + sizeof(T) * elem; + } + + template + long operator()(T & elem, long value) const + { + elem += sizeof(T); + return value; + } + }; +}; + +void result_type_tests() +{ + using boost::is_same; + + typedef fusion::unfused_typed< test_func<>, types0 > t0; + BOOST_TEST(( is_same< boost::result_of< t0 () >::type, long >::value )); + typedef fusion::unfused_typed< test_func<>, types1 > t1; + BOOST_TEST(( is_same< boost::result_of< t1 (int) >::type, long >::value )); +} + +#if defined(BOOST_MSVC) && BOOST_MSVC < 1400 +# define BOOST_TEST_NO_VC71(cond) (void)((cond)?0:1) +#else +# define BOOST_TEST_NO_VC71(cond) BOOST_TEST(cond) +#endif + +void nullary_tests() +{ + test_func f; + fusion::unfused_typed< test_func<>, types0 > unfused_func; + fusion::unfused_typed< test_func &, types0 > unfused_func_ref(f); + fusion::unfused_typed< test_func<> const, types0 > unfused_func_c; + fusion::unfused_typed< test_func<>, types0 > const unfused_func_c2; + fusion::unfused_typed< test_func const &, types0 > unfused_func_c_ref(f); + + BOOST_TEST(unfused_func() == 100); + BOOST_TEST(unfused_func_ref() == 100); + BOOST_TEST(unfused_func_c() == 0); + BOOST_TEST(unfused_func_c2() == 0); + BOOST_TEST(unfused_func_c_ref() == 0); +} + +void unary_tests() +{ + test_func f; + fusion::unfused_typed< test_func<>, types1 > unfused_func; + fusion::unfused_typed< test_func &, types1 > unfused_func_ref(f); + fusion::unfused_typed< test_func<> const, types1 > unfused_func_c; + fusion::unfused_typed< test_func<>, types1 > const unfused_func_c2; + fusion::unfused_typed< test_func const &, types1 > unfused_func_c_ref(f); + + long lvalue = 1; + BOOST_TEST_NO_VC71(unfused_func(lvalue) == 100); + BOOST_TEST(lvalue == 1 + 1*sizeof(lvalue)); + BOOST_TEST(unfused_func_ref(lvalue) == 100); + BOOST_TEST(lvalue == 1 + 2*sizeof(lvalue)); + BOOST_TEST(unfused_func_c(lvalue) == 0); + BOOST_TEST(lvalue == 1 + 3*sizeof(lvalue)); + BOOST_TEST(unfused_func_c2(lvalue) == 0); + BOOST_TEST(lvalue == 1 + 4*sizeof(lvalue)); + BOOST_TEST(unfused_func_c_ref(lvalue) == 0); + BOOST_TEST(lvalue == 1 + 5*sizeof(lvalue)); +} + +void ternary_tests() +{ + test_func f; + fusion::unfused_typed< test_func<>, types3 > unfused_func; + fusion::unfused_typed< test_func &, types3 > unfused_func_ref(f); + fusion::unfused_typed< test_func<> const, types3 > unfused_func_c; + fusion::unfused_typed< test_func<>, types3 > const unfused_func_c2; + fusion::unfused_typed< test_func const &, types3 > unfused_func_c_ref(f); + + long lvalue = 1; + static const long expected = 2*sizeof(int) + 7*sizeof(char); + BOOST_TEST_NO_VC71(unfused_func(lvalue,2,'\007') == 100 + expected); + BOOST_TEST(lvalue == 1 + 1*sizeof(lvalue)); + BOOST_TEST(unfused_func_ref(lvalue,2,'\007') == 100 + expected); + BOOST_TEST(lvalue == 1 + 2*sizeof(lvalue)); + BOOST_TEST(unfused_func_c(lvalue,2,'\007') == 0 + expected); + BOOST_TEST(lvalue == 1 + 3*sizeof(lvalue)); + BOOST_TEST(unfused_func_c2(lvalue,2,'\007') == 0 + expected); + BOOST_TEST(lvalue == 1 + 4*sizeof(lvalue)); + BOOST_TEST(unfused_func_c_ref(lvalue,2,'\007') == 0 + expected); + BOOST_TEST(lvalue == 1 + 5*sizeof(lvalue)); +} + +int main() +{ + result_type_tests(); + nullary_tests(); + unary_tests(); + ternary_tests(); + + return boost::report_errors(); +} + diff --git a/test/sequence/adapt_assoc_struct.cpp b/test/sequence/adapt_assoc_struct.cpp new file mode 100644 index 00000000..277433b3 --- /dev/null +++ b/test/sequence/adapt_assoc_struct.cpp @@ -0,0 +1,131 @@ +/*============================================================================= + 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) +==============================================================================*/ +#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 ns +{ + struct x_member; + struct y_member; + struct z_member; + + struct point + { + int x; + int y; + }; +} + +BOOST_FUSION_ADAPT_ASSOC_STRUCT( + ns::point, + (int, x, ns::x_member) + (int, y, ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using namespace std; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view)); + ns::point p = {123, 456}; + + std::cout << at_c<0>(p) << std::endl; + std::cout << at_c<1>(p) << std::endl; + std::cout << p << std::endl; + BOOST_TEST(p == make_vector(123, 456)); + + at_c<0>(p) = 6; + at_c<1>(p) = 9; + BOOST_TEST(p == make_vector(6, 9)); + + BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + fusion::vector v1(4, 2); + ns::point v2 = {5, 3}; + fusion::vector v3(5, 4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from ns::point to vector + ns::point p = {5, 3}; + fusion::vector v(p); + v = p; + } + + { + // conversion from ns::point to list + ns::point p = {5, 3}; + fusion::list l(p); + l = p; + } + + { + // assoc stuff + BOOST_MPL_ASSERT((fusion::result_of::has_key)); + BOOST_MPL_ASSERT((fusion::result_of::has_key)); + BOOST_MPL_ASSERT((mpl::not_ >)); + + BOOST_MPL_ASSERT((is_same::type, int>)); + BOOST_MPL_ASSERT((is_same::type, int>)); + + ns::point p = {5, 3}; + + BOOST_TEST(at_key(p) == 5); + BOOST_TEST(at_key(p) == 3); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/adapt_struct.cpp b/test/sequence/adapt_struct.cpp new file mode 100644 index 00000000..0f47c648 --- /dev/null +++ b/test/sequence/adapt_struct.cpp @@ -0,0 +1,106 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace ns +{ + struct point + { + int x; + int y; + }; +} + +BOOST_FUSION_ADAPT_STRUCT( + ns::point, + (int, x) + (int, y) +) + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using namespace std; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view)); + ns::point p = {123, 456}; + + std::cout << at_c<0>(p) << std::endl; + std::cout << at_c<1>(p) << std::endl; + std::cout << p << std::endl; + BOOST_TEST(p == make_vector(123, 456)); + + at_c<0>(p) = 6; + at_c<1>(p) = 9; + BOOST_TEST(p == make_vector(6, 9)); + + BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + fusion::vector v1(4, 2); + ns::point v2 = {5, 3}; + fusion::vector v3(5, 4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from ns::point to vector + ns::point p = {5, 3}; + fusion::vector v(p); + v = p; + } + + { + // conversion from ns::point to list + ns::point p = {5, 3}; + fusion::list l(p); + l = p; + } + + return boost::report_errors(); +} + diff --git a/test/sequence/array.cpp b/test/sequence/array.cpp new file mode 100644 index 00000000..0ca5255d --- /dev/null +++ b/test/sequence/array.cpp @@ -0,0 +1,41 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#include + +#include +#include + +#include +#include +#include +#include + +#include + +int main() +{ + using namespace boost::fusion; + typedef boost::array array_type; + + BOOST_MPL_ASSERT((traits::is_sequence)); + BOOST_MPL_ASSERT_NOT((traits::is_view)); + + array_type arr = {{1,2,3}}; + + BOOST_TEST(*begin(arr) == 1); + BOOST_TEST(*next(begin(arr)) == 2); + BOOST_TEST(*advance_c<2>(begin(arr)) == 3); + BOOST_TEST(prior(next(begin(arr))) == begin(arr)); + BOOST_TEST(*prior(end(arr)) == 3); + BOOST_TEST(at_c<2>(arr) == 3); + BOOST_TEST(size(arr) == 3); + BOOST_TEST(distance(begin(arr), end(arr)) == 3); + + return boost::report_errors(); +} diff --git a/test/sequence/as_list.cpp b/test/sequence/as_list.cpp new file mode 100644 index 00000000..72dc9aa4 --- /dev/null +++ b/test/sequence/as_list.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + vector0 empty; + std::cout << as_list(make_vector(1, 1.23, "harru")) << std::endl; + std::cout << as_list(push_back(empty, 999)) << std::endl; + + BOOST_TEST(as_list(make_vector(1, 1.23, "harru")) == make_vector(1, 1.23, std::string("harru"))); + BOOST_TEST(as_list(push_back(empty, 999)) == push_back(empty, 999)); + } + + { + std::cout << as_list(mpl::vector_c()) << std::endl; + BOOST_TEST((as_list(mpl::vector_c()) + == mpl::vector_c())); + } + + { + // test conversion + list l(make_vector(123, "harru")); + BOOST_TEST(l == make_vector(123, "harru")); + l = (make_vector(235, "hola")); // test assign + BOOST_TEST(l == make_vector(235, "hola")); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/as_map.cpp b/test/sequence/as_map.cpp new file mode 100644 index 00000000..a9364bc6 --- /dev/null +++ b/test/sequence/as_map.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + vector0 empty; + std::cout << as_map(make_list(make_pair('X'), make_pair("Men"))) << std::endl; + std::cout << as_map(push_back(empty, make_pair(999))) << std::endl; + } + + { + typedef pair p1; + typedef pair p2; + result_of::as_map >::type map(make_pair('X'), make_pair("Men")); + std::cout << at_key(map) << std::endl; + std::cout << at_key(map) << std::endl; + BOOST_TEST(at_key(map) == 'X'); + BOOST_TEST(at_key(map) == "Men"); + } + + { + // test conversion + typedef map< + pair + , pair > + map_type; + + map_type m(make_vector(make_pair('X'), make_pair("Men"))); + BOOST_TEST(as_vector(m) == make_vector(make_pair('X'), make_pair("Men"))); + m = (make_vector(make_pair('X'), make_pair("Men"))); // test assign + BOOST_TEST(as_vector(m) == make_vector(make_pair('X'), make_pair("Men"))); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/as_set.cpp b/test/sequence/as_set.cpp new file mode 100644 index 00000000..9bfd5869 --- /dev/null +++ b/test/sequence/as_set.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + vector0 empty; + std::cout << as_set(make_list(1, 1.23, "harru")) << std::endl; + std::cout << as_set(push_back(empty, 999)) << std::endl; + + BOOST_TEST(as_list(as_set(make_list(1, 1.23, "harru"))) + == make_list(1, 1.23, std::string("harru"))); + BOOST_TEST(as_list(as_set(push_back(empty, 999))) + == push_back(empty, 999)); + } + + { + result_of::as_set >::type set(1, 1.23, "harru"); + std::cout << at_key(set) << std::endl; + BOOST_TEST(at_key(set) == 1); + } + + { + std::cout << as_set(mpl::vector_c()) << std::endl; + BOOST_TEST((as_list(as_set(mpl::vector_c())) + == mpl::vector_c())); + } + + { + // test conversion + set s(make_vector(123, "harru")); + BOOST_TEST(as_vector(s) == make_vector(123, "harru")); + s = (make_vector(235, "hola")); // test assign + BOOST_TEST(as_vector(s) == make_vector(235, "hola")); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/as_vector.cpp b/test/sequence/as_vector.cpp new file mode 100644 index 00000000..d728c837 --- /dev/null +++ b/test/sequence/as_vector.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + vector0 empty; + std::cout << as_vector(make_list(1, 1.23, "harru")) << std::endl; + std::cout << as_vector(push_back(empty, 999)) << std::endl; + + BOOST_TEST(as_vector(make_list(1, 1.23, "harru")) == make_list(1, 1.23, std::string("harru"))); + BOOST_TEST(as_vector(push_back(empty, 999)) == push_back(empty, 999)); + } + + { + std::cout << as_vector(mpl::vector_c()) << std::endl; + BOOST_TEST((as_vector(mpl::vector_c()) + == mpl::vector_c())); + } + + { + // test conversion + vector v(make_list(123, "harru")); + BOOST_TEST(v == make_list(123, "harru")); + v = (make_list(235, "hola")); // test assign + BOOST_TEST(v == make_list(235, "hola")); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/back_extended_deque.cpp b/test/sequence/back_extended_deque.cpp new file mode 100644 index 00000000..a2daa4cf --- /dev/null +++ b/test/sequence/back_extended_deque.cpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +int main() +{ + using namespace boost::fusion; + { + typedef deque initial_deque_type; + initial_deque_type initial_deque(1, 'a'); + typedef back_extended_deque extended_type; + extended_type extended(initial_deque, 101L); + + BOOST_TEST(size(extended) == 3); + BOOST_TEST(extended == make_vector(1, 'a', 101L)); + BOOST_TEST(*begin(extended) == 1); + BOOST_TEST(*next(begin(extended)) == 'a'); + BOOST_TEST(*prior(end(extended)) == 101L); + BOOST_TEST(distance(begin(extended), end(extended)) == 3); + BOOST_TEST(*advance_c<2>(begin(extended)) == 101L); + } + { + namespace mpl = boost::mpl; + typedef deque initial_deque_type; + typedef back_extended_deque extended_type; + + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, char>)); + BOOST_MPL_ASSERT((boost::is_same::type, long>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, int>)); + BOOST_MPL_ASSERT((mpl::equal_to::type, mpl::int_<3> >)); + } + { + char ch('a'); + long l(101L); + int i(1); + typedef deque initial_deque_type; + initial_deque_type initial_deque(i, ch); + typedef back_extended_deque extended_type; + extended_type extended(initial_deque, l); + BOOST_TEST(extended == make_vector(1, 'a', 101L)); + + char ch2('b'); + long l2(202L); + int i2(2); + extended_type extended2(initial_deque_type(i2, ch2), l2); + + extended = extended2; + + BOOST_TEST(extended == make_vector(2, 'b', 202L)); + + BOOST_TEST(i == i2); + BOOST_TEST(ch == ch2); + BOOST_TEST(l == l2); + } + return boost::report_errors(); +} diff --git a/test/sequence/boost_tuple.cpp b/test/sequence/boost_tuple.cpp new file mode 100644 index 00000000..1e3d23b4 --- /dev/null +++ b/test/sequence/boost_tuple.cpp @@ -0,0 +1,90 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using namespace std; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + typedef boost::tuple tuple_type; + BOOST_MPL_ASSERT_NOT((traits::is_view)); + tuple_type t(123, "Hola!!!"); + + std::cout << at_c<0>(t) << std::endl; + std::cout << at_c<1>(t) << std::endl; + std::cout << t << std::endl; + BOOST_TEST(t == make_vector(123, "Hola!!!")); + + at_c<0>(t) = 6; + at_c<1>(t) = "mama mia"; + BOOST_TEST(t == make_vector(6, "mama mia")); + + BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty::value); + + BOOST_TEST(front(t) == 6); + } + + { + fusion::vector v1(4, 3.3f); + boost::tuple v2(5, 3.3f); + fusion::vector v3(5, 4.4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from boost tuple to vector + fusion::vector v(tuples::make_tuple(123, "Hola!!!")); + v = tuples::make_tuple(123, "Hola!!!"); + } + + { + // conversion from boost tuple to list + fusion::list l(tuples::make_tuple(123, "Hola!!!")); + l = tuples::make_tuple(123, "Hola!!!"); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/comparison.hpp b/test/sequence/comparison.hpp new file mode 100644 index 00000000..429c93c6 --- /dev/null +++ b/test/sequence/comparison.hpp @@ -0,0 +1,57 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +void +equality_test() +{ + using namespace boost::fusion; + + FUSION_SEQUENCE v1(5, 'a'); + FUSION_SEQUENCE v2(5, 'a'); + BOOST_TEST(v1 == v2); + + FUSION_SEQUENCE v3(5, 'b'); + FUSION_SEQUENCE t4(2, 'a'); + BOOST_TEST(v1 != v3); + BOOST_TEST(v1 != t4); + BOOST_TEST(!(v1 != v2)); + + FUSION_SEQUENCE v5(5, 'a', true); + BOOST_TEST(v1 != v5); + BOOST_TEST(!(v1 == v5)); + BOOST_TEST(v5 != v1); + BOOST_TEST(!(v5 == v1)); +} + +void +ordering_test() +{ + using namespace boost::fusion; + + FUSION_SEQUENCE v1(4, 3.3f); + FUSION_SEQUENCE v2(5, 3.3f); + FUSION_SEQUENCE v3(5, 4.4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + +#if defined(FUSION_TEST_FAIL) + FUSION_SEQUENCE v5(5, 'a', true); + v1 >= v5; +#endif +} + + + diff --git a/test/sequence/cons.cpp b/test/sequence/cons.cpp new file mode 100644 index 00000000..b27345e6 --- /dev/null +++ b/test/sequence/cons.cpp @@ -0,0 +1,87 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +int +main() +{ + using namespace boost::fusion; + using boost::is_same; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing cons + + { + std::string hello("hello"); + cons > ns = + make_cons(1, make_cons(hello)); + + BOOST_TEST((*begin(ns) == 1)); + BOOST_TEST((*next(begin(ns)) == hello)); + + *begin(ns) += 1; + *next(begin(ns)) += ' '; + + BOOST_TEST((*begin(ns) == 2)); + BOOST_TEST((*next(begin(ns)) == hello + ' ')); + + for_each(ns, boost::lambda::_1 += ' '); + + BOOST_TEST((*begin(ns) == 2 + ' ')); + BOOST_TEST((*next(begin(ns)) == hello + ' ' + ' ')); + } + + { + BOOST_TEST( + make_cons("hello") == make_vector(std::string("hello")) + ); + + BOOST_TEST( + make_cons(123, make_cons("hello")) == + make_vector(123, std::string("hello")) + ); + } + + { + vector t(1, 1.1f); + cons > nf = + make_cons(1, make_cons(1.1f)); + + BOOST_TEST((t == nf)); + BOOST_TEST((vector(1) == filter_if >(nf))); + + std::cout << nf << std::endl; + std::cout << filter_if >(nf) << std::endl; + } + + { + int i = 3; + cons tie(cons_tie(i)); + BOOST_TEST((*begin(tie) == 3)); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/construction.hpp b/test/sequence/construction.hpp new file mode 100644 index 00000000..d5c56664 --- /dev/null +++ b/test/sequence/construction.hpp @@ -0,0 +1,117 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include + +#if !defined(FUSION_AT) +#define FUSION_AT at_c +#endif + +namespace test_detail +{ + // something to prevent warnings for unused variables + template void dummy(const T&) {} + + // no public default constructor + class foo + { + public: + + explicit foo(int v) : val(v) {} + + bool operator==(const foo& other) const + { + return val == other.val; + } + + private: + + foo() {} + int val; + }; + + // another class without a public default constructor + class no_def_constructor + { + no_def_constructor() {} + + public: + + no_def_constructor(std::string) {} + }; +} + +inline void +test() +{ + using namespace boost::fusion; + using namespace test_detail; + + nil empty; + + FUSION_SEQUENCE<> empty0; + + FUSION_SEQUENCE<> empty1(empty); + + FUSION_SEQUENCE t1; + BOOST_TEST(FUSION_AT<0>(t1) == int()); + + FUSION_SEQUENCE t2(5.5f); + BOOST_TEST(FUSION_AT<0>(t2) > 5.4f && FUSION_AT<0>(t2) < 5.6f); + + FUSION_SEQUENCE t3(foo(12)); + BOOST_TEST(FUSION_AT<0>(t3) == foo(12)); + + FUSION_SEQUENCE t4(t2); + BOOST_TEST(FUSION_AT<0>(t4) > 5.4 && FUSION_AT<0>(t4) < 5.6); + + FUSION_SEQUENCE t5; + BOOST_TEST(FUSION_AT<0>(t5) == int()); + BOOST_TEST(FUSION_AT<1>(t5) == float()); + + FUSION_SEQUENCE t6(12, 5.5f); + BOOST_TEST(FUSION_AT<0>(t6) == 12); + BOOST_TEST(FUSION_AT<1>(t6) > 5.4f && FUSION_AT<1>(t6) < 5.6f); + + FUSION_SEQUENCE t7(t6); + BOOST_TEST(FUSION_AT<0>(t7) == 12); + BOOST_TEST(FUSION_AT<1>(t7) > 5.4f && FUSION_AT<1>(t7) < 5.6f); + + FUSION_SEQUENCE t8(t6); + BOOST_TEST(FUSION_AT<0>(t8) == 12); + BOOST_TEST(FUSION_AT<1>(t8) > 5.4f && FUSION_AT<1>(t8) < 5.6f); + + dummy + ( + FUSION_SEQUENCE( + std::string("Jaba"), // ok, since the default + std::string("Daba"), // constructor is not used + std::string("Doo") + ) + ); + + dummy(FUSION_SEQUENCE()); + dummy(FUSION_SEQUENCE(1,3.14)); + +#if defined(FUSION_TEST_FAIL) + dummy(FUSION_SEQUENCE()); // should fail, no defaults for references + dummy(FUSION_SEQUENCE()); // likewise +#endif + + { + double dd = 5; + dummy(FUSION_SEQUENCE(dd)); // ok + dummy(FUSION_SEQUENCE(dd+3.14)); // ok, but dangerous + } + +#if defined(FUSION_TEST_FAIL) + dummy(FUSION_SEQUENCE(dd+3.14)); // should fail, + // temporary to non-const reference +#endif +} diff --git a/test/sequence/copy.hpp b/test/sequence/copy.hpp new file mode 100644 index 00000000..96edbc45 --- /dev/null +++ b/test/sequence/copy.hpp @@ -0,0 +1,98 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(FUSION_AT) +#define FUSION_AT at_c +#endif + +#if !defined(FUSION_MAKE) +#define FUSION_MAKE BOOST_PP_CAT(make_, FUSION_SEQUENCE) +#endif + +#if !defined(FUSION_TIE) +#define FUSION_TIE BOOST_PP_CAT(FUSION_SEQUENCE, _tie) +#endif + +namespace test_detail +{ + // classes with different kinds of conversions + class AA {}; + class BB : public AA {}; + struct CC { CC() {} CC(const BB&) {} }; + struct DD { operator CC() const { return CC(); }; }; +} + +boost::fusion::FUSION_SEQUENCE +foo(int i) +{ + return boost::fusion::FUSION_MAKE(i, i+1, i+2, i+3); +} + +void test_mpl() +{ + using namespace boost::fusion; + + typedef FUSION_SEQUENCE seq; + + typedef + boost::mpl::insert_range< + boost::mpl::vector<> + , boost::mpl::end< boost::mpl::vector<> >::type + , seq + >::type + sequence; + + typedef boost::mpl::equal > equal; + BOOST_STATIC_ASSERT(equal::value); +} + +void +test() +{ + using namespace boost::fusion; + using namespace test_detail; + + FUSION_SEQUENCE t1(4, 'a'); + FUSION_SEQUENCE t2(5, 'b'); + t2 = t1; + BOOST_TEST(FUSION_AT<0>(t1) == FUSION_AT<0>(t2)); + BOOST_TEST(FUSION_AT<1>(t1) == FUSION_AT<1>(t2)); + + FUSION_SEQUENCE t3(2, "a"); + t3 = t1; + BOOST_TEST((double)FUSION_AT<0>(t1) == FUSION_AT<0>(t3)); + BOOST_TEST(FUSION_AT<1>(t1) == FUSION_AT<1>(t3)[0]); + + // testing copy and assignment with implicit conversions + // between elements testing tie + + FUSION_SEQUENCE t; + FUSION_SEQUENCE a(t); + a = t; + + int i; char c; double d; + FUSION_TIE(i, c, d) = FUSION_MAKE(1, 'a', 5.5); + + BOOST_TEST(i==1); + BOOST_TEST(c=='a'); + BOOST_TEST(d>5.4 && d<5.6); + + // returning a tuple with conversion + foo(2); + + test_mpl(); +} diff --git a/test/sequence/deduce_sequence.cpp b/test/sequence/deduce_sequence.cpp new file mode 100644 index 00000000..5b234781 --- /dev/null +++ b/test/sequence/deduce_sequence.cpp @@ -0,0 +1,80 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include +#include + +#include + +#include + +using boost::is_same; +using boost::reference_wrapper; +using boost::fusion::traits::deduce; +using boost::fusion::traits::deduce_sequence; + +namespace fusion = boost::fusion; + +template +struct test_seq_ctor +{ + typename deduce_sequence::type fsq_args; + + test_seq_ctor(Args const & args) + : fsq_args(args) + { } +}; + +#define TEST_SAME_TYPE(a,b) BOOST_TEST(( is_same< a, b >::value )) +#define TEST_SAME_ELEMENTS(a,b) BOOST_TEST(( boost::mpl::equal< a, b >::type::value )) + +typedef fusion::vector args1; +typedef fusion::vector storable1; +template struct test_seq_ctor; + +typedef fusion::vector< reference_wrapper &, reference_wrapper &, + reference_wrapper const &, reference_wrapper const & > args2; +typedef fusion::vector storable2; +template struct test_seq_ctor; + + +typedef fusion::vector args3; +typedef fusion::vector storable3; +template struct test_seq_ctor; + +typedef fusion::vector args4; +typedef args4 storable4; +template struct test_seq_ctor; + +int main() +{ + TEST_SAME_TYPE(deduce::type, int &); + TEST_SAME_TYPE(deduce::type, int volatile &); + + TEST_SAME_TYPE(deduce::type, int); + TEST_SAME_TYPE(deduce::type, int); + TEST_SAME_TYPE(deduce::type, int); + + TEST_SAME_TYPE(deduce< reference_wrapper & >::type, int &); + TEST_SAME_TYPE(deduce< reference_wrapper & >::type, int const &); + TEST_SAME_TYPE(deduce< reference_wrapper const & >::type, int &); + TEST_SAME_TYPE(deduce< reference_wrapper const & >::type, int const &); + + TEST_SAME_TYPE(deduce< int(&)[2] >::type, int(&)[2]); + TEST_SAME_TYPE(deduce< int const (&)[2] >::type, int const (&)[2]); + TEST_SAME_TYPE(deduce< int volatile (&)[2] >::type, int volatile (&)[2]); + TEST_SAME_TYPE(deduce< int const volatile (&)[2] >::type, int const volatile (&)[2]); + + TEST_SAME_ELEMENTS(deduce_sequence::type,storable1); + TEST_SAME_ELEMENTS(deduce_sequence::type,storable2); + TEST_SAME_ELEMENTS(deduce_sequence::type,storable3); + TEST_SAME_ELEMENTS(deduce_sequence::type,storable4); + + return boost::report_errors(); +} diff --git a/test/sequence/deque_comparison.cpp b/test/sequence/deque_comparison.cpp new file mode 100644 index 00000000..229fd0e6 --- /dev/null +++ b/test/sequence/deque_comparison.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE deque +#include "comparison.hpp" + +int +main() +{ + equality_test(); + ordering_test(); + return boost::report_errors(); +} diff --git a/test/sequence/deque_construction.cpp b/test/sequence/deque_construction.cpp new file mode 100644 index 00000000..bba8f09a --- /dev/null +++ b/test/sequence/deque_construction.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE deque +#include "construction.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} diff --git a/test/sequence/deque_copy.cpp b/test/sequence/deque_copy.cpp new file mode 100644 index 00000000..57e7334d --- /dev/null +++ b/test/sequence/deque_copy.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include +#include +#include + +#define FUSION_SEQUENCE deque +#include "copy.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/deque_iterator.cpp b/test/sequence/deque_iterator.cpp new file mode 100644 index 00000000..baf6f827 --- /dev/null +++ b/test/sequence/deque_iterator.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE deque +#define FUSION_TRAVERSAL_TAG bidirectional_traversal_tag +#include "./iterator.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} diff --git a/test/sequence/deque_make.cpp b/test/sequence/deque_make.cpp new file mode 100644 index 00000000..4dc7346b --- /dev/null +++ b/test/sequence/deque_make.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE deque +#include "make.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} diff --git a/test/sequence/deque_misc.cpp b/test/sequence/deque_misc.cpp new file mode 100644 index 00000000..53836bbc --- /dev/null +++ b/test/sequence/deque_misc.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include +#include +#include + +#define FUSION_SEQUENCE deque +#include "misc.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/deque_mutate.cpp b/test/sequence/deque_mutate.cpp new file mode 100644 index 00000000..66ab1478 --- /dev/null +++ b/test/sequence/deque_mutate.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2006 + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE deque +#include "mutate.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/deque_tie.cpp b/test/sequence/deque_tie.cpp new file mode 100644 index 00000000..e922335b --- /dev/null +++ b/test/sequence/deque_tie.cpp @@ -0,0 +1,23 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include +#include +#include +#include + +#define FUSION_SEQUENCE deque +#include "tie.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/deque_value_at.cpp b/test/sequence/deque_value_at.cpp new file mode 100644 index 00000000..c348d287 --- /dev/null +++ b/test/sequence/deque_value_at.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE deque +#include "value_at.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/ext_/iterator_range_s.cpp b/test/sequence/ext_/iterator_range_s.cpp new file mode 100755 index 00000000..1468f61b --- /dev/null +++ b/test/sequence/ext_/iterator_range_s.cpp @@ -0,0 +1,146 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct ostream_fun +{ + ostream_fun(std::ostream &sout) + : sout_(sout) + {} + template + void operator ()(T const &t) const + { + sout_ << t << ' '; + } +private: + std::ostream & sout_; +}; + +template +void +process_tree(Tree const &tree) +{ + using namespace boost; + using namespace fusion; + using mpl::_; + + typedef typename result_of::find_if_s >::type short_iter; + typedef typename result_of::find_if_s >::type float_iter; + + typedef iterator_range slice_t; + BOOST_STATIC_ASSERT(traits::is_segmented::value); + + // find_if_s of a segmented data structure returns generic + // segmented iterators + short_iter si = find_if_s >(tree); + float_iter fi = find_if_s >(tree); + + // If you put them in an iterator range, the range + // is automatically a segmented data structure. + slice_t slice(si, fi); + + std::stringstream sout; + fusion::for_each_s(slice, ostream_fun(sout)); + BOOST_TEST((sout.str() == "100 e f 0 B ")); +} + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type vec(1, 'x', 3.3, s); + + { + typedef vector_iterator i1t; + typedef vector_iterator i3t; + + i1t i1(vec); + i3t i3(vec); + + typedef iterator_range slice_t; + slice_t slice(i1, i3); + std::cout << slice << std::endl; + BOOST_TEST((slice == make_vector('x', 3.3))); + BOOST_STATIC_ASSERT(result_of::size::value == 2); + } + + { + typedef vector_iterator i1t; + typedef vector_iterator i3t; + + i1t i1(vec); + i3t i3(vec); + + typedef iterator_range slice_t; + slice_t slice(i1, i3); + std::cout << slice << std::endl; + BOOST_TEST(slice == make_vector()); + BOOST_STATIC_ASSERT(result_of::size::value == 0); + } + } + + { + typedef boost::mpl::vector_c mpl_vec; + typedef boost::mpl::begin::type it0; + typedef boost::mpl::next::type it1; + typedef boost::mpl::next::type it2; + typedef boost::mpl::next::type it3; + + it1 f; + it3 l; + + typedef iterator_range slice_t; + slice_t slice(f, l); + std::cout << slice << std::endl; + BOOST_TEST((slice == make_vector(3, 4))); + BOOST_STATIC_ASSERT(result_of::size::value == 2); + } + + { + process_tree( + make_tree( + make_vector(double(0),'B') + , make_tree( + make_vector(1,2,long(3)) + , make_tree(make_vector('a','b','c')) + , make_tree(make_vector(short('d'),'e','f')) + ) + , make_tree( + make_vector(4,5,6) + , make_tree(make_vector(float(1),'h','i')) + , make_tree(make_vector('j','k','l')) + ) + ) + ); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/filter_view.cpp b/test/sequence/filter_view.cpp new file mode 100644 index 00000000..eaefb35e --- /dev/null +++ b/test/sequence/filter_view.cpp @@ -0,0 +1,118 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct X +{ + operator char const*() const + { + return ""; + } +}; + +struct Y +{ + operator char const*() const + { + return ""; + } +}; + +struct reject_all +{ + template + struct apply : boost::mpl::false_ + {}; +}; + +int +main() +{ + using namespace boost::fusion; + + using boost::mpl::int_; + using boost::mpl::_; + using boost::mpl::not_; + using boost::mpl::less; + using boost::mpl::vector_c; + using boost::is_class; + using boost::is_same; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { // Testing the static find_if (internal function) + + typedef vector vector_type; + + vector_type v(1, 'x', 987654, X()); + typedef vector_iterator begin; + typedef vector_iterator end; + typedef detail::static_find_if > filter; + typedef filter::type type; + + BOOST_TEST(*type(v) == 987654); + std::cout << *type(v) << std::endl; + std::cout << *filter::call(begin(v)) << std::endl; + BOOST_TEST(*type(v) == *filter::call(begin(v))); + } + + { + typedef vector vector_type; + + X x; Y y; + vector_type v(y, '@', 987654, x, true, 6.6); + typedef filter_view > > filter_view_type; + filter_view_type view(v); + std::cout << view << std::endl; + BOOST_TEST((view == make_vector('@', 987654, true, 6.6))); + BOOST_STATIC_ASSERT(result_of::size::value == 4); + } + + { + // $$$ JDG $$$ For some obscure reason, EDG based compilers + // (e.g. comeau 4.3.3, intel) have problems with this. + // vc7.1 and g++ are ok. The errors from comeau are useless. + + typedef vector_c vector_type; + typedef filter_view > > filter_view_type; + vector_type v; + filter_view_type view(v); + std::cout << view << std::endl; + BOOST_TEST((view == make_vector(1, 2, 0, -1))); + BOOST_STATIC_ASSERT(result_of::size::value == 4); + } + + { + // Previous filtering out all values caused problems as begin was not equal to end + // Picked up by Andreas Pokorny + typedef vector vec; + typedef filter_view filter_view_type; + + BOOST_MPL_ASSERT((result_of::equal_to::type, result_of::end::type>)); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/front_extended_deque.cpp b/test/sequence/front_extended_deque.cpp new file mode 100644 index 00000000..40100c32 --- /dev/null +++ b/test/sequence/front_extended_deque.cpp @@ -0,0 +1,75 @@ +/*============================================================================= + Copyright (c) 1999-2003 Jaakko Järvi + 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) +==============================================================================*/ +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +int main() +{ + using namespace boost::fusion; + { + typedef deque initial_deque_type; + initial_deque_type initial_deque('a', 101L); + typedef front_extended_deque extended_type; + extended_type extended(initial_deque, 1); + + BOOST_TEST(size(extended) == 3); + BOOST_TEST(extended == make_vector(1, 'a', 101L)); + BOOST_TEST(*begin(extended) == 1); + BOOST_TEST(*next(begin(extended)) == 'a'); + BOOST_TEST(*prior(end(extended)) == 101L); + BOOST_TEST(distance(begin(extended), end(extended)) == 3); + BOOST_TEST(*advance_c<2>(begin(extended)) == 101L); + } + { + namespace mpl = boost::mpl; + typedef deque initial_deque_type; + typedef front_extended_deque extended_type; + + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + BOOST_MPL_ASSERT((boost::is_same::type, char>)); + BOOST_MPL_ASSERT((boost::is_same::type, long>)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, int>)); + BOOST_MPL_ASSERT((mpl::equal_to::type, mpl::int_<3> >)); + } + { + char ch('a'); + long l(101L); + int i(1); + typedef deque initial_deque_type; + initial_deque_type initial_deque(ch, l); + typedef front_extended_deque extended_type; + extended_type extended(initial_deque, i); + BOOST_TEST(extended == make_vector(1, 'a', 101L)); + + char ch2('b'); + long l2(202L); + int i2(2); + extended_type extended2(initial_deque_type(ch2, l2), i2); + + extended = extended2; + + BOOST_TEST(extended == make_vector(2, 'b', 202L)); + + BOOST_TEST(i == i2); + BOOST_TEST(ch == ch2); + BOOST_TEST(l == l2); + } + return boost::report_errors(); +} diff --git a/test/sequence/io.cpp b/test/sequence/io.cpp new file mode 100644 index 00000000..f7692163 --- /dev/null +++ b/test/sequence/io.cpp @@ -0,0 +1,116 @@ +/*============================================================================= + Copyright (C) 1999-2003 Jaakko Järvi + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#if defined BOOST_NO_STRINGSTREAM +# include +#else +# include +#endif + +using boost::fusion::vector; +using boost::fusion::make_vector; +using boost::fusion::tuple_close; +using boost::fusion::tuple_open; +using boost::fusion::tuple_delimiter; + +#if defined BOOST_NO_STRINGSTREAM + using std::ostrstream; + using std::istrstream; + typedef ostrstream useThisOStringStream; + typedef istrstream useThisIStringStream; +#else + using std::ostringstream; + using std::istringstream; + typedef ostringstream useThisOStringStream; + typedef istringstream useThisIStringStream; +#endif + +using std::endl; +using std::ofstream; +using std::ifstream; +using std::string; + +int +main() +{ + using boost::fusion::tuple_close; + using boost::fusion::tuple_open; + using boost::fusion::tuple_delimiter; + + useThisOStringStream os1; + + // Set format [a, b, c] for os1 + os1 << tuple_open('['); + os1 << tuple_close(']'); + os1 << tuple_delimiter(','); + os1 << make_vector(1, 2, 3); + + BOOST_TEST (os1.str() == std::string("[1,2,3]") ); + + { + useThisOStringStream os2; + // Set format (a:b:c) for os2; + os2 << tuple_open('('); + os2 << tuple_close(')'); + os2 << tuple_delimiter(':'); + + os2 << make_vector("TUPU", "HUPU", "LUPU", 4.5); + BOOST_TEST (os2.str() == std::string("(TUPU:HUPU:LUPU:4.5)") ); + } + + // The format is still [a, b, c] for os1 + os1 << make_vector(1, 2, 3); + BOOST_TEST (os1.str() == std::string("[1,2,3][1,2,3]") ); + + std::ofstream tmp("temp.tmp"); + + tmp << make_vector("One", "Two", 3); + tmp << tuple_delimiter(':'); + tmp << make_vector(1000, 2000, 3000) << endl; + + tmp.close(); + + // When reading tuples from a stream, manipulators must be set correctly: + ifstream tmp3("temp.tmp"); + vector j; + + tmp3 >> j; + BOOST_TEST (tmp3.good() ); + + tmp3 >> tuple_delimiter(':'); + vector i; + tmp3 >> i; + BOOST_TEST (tmp3.good() ); + + tmp3.close(); + + // reading vector in format (a b c); + useThisIStringStream is("(100 200 300)"); + + vector ti; + BOOST_TEST(bool((is >> ti) != 0)); + BOOST_TEST(ti == make_vector(100, 200, 300)); + + // Note that strings are problematic: + // writing a tuple on a stream and reading it back doesn't work in + // general. If this is wanted, some kind of a parseable string class + // should be used. + + return boost::report_errors(); +} + diff --git a/test/sequence/iterator.hpp b/test/sequence/iterator.hpp new file mode 100644 index 00000000..118bb347 --- /dev/null +++ b/test/sequence/iterator.hpp @@ -0,0 +1,197 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void test() +{ + using namespace boost::fusion; + using namespace boost; + + { // Testing deref, next, prior, begin, end + + char const* s = "Hello"; + typedef FUSION_SEQUENCE seq_type; + seq_type v(1, 'x', 3.3, s); + result_of::begin::type i(v); + + BOOST_TEST(*i == 1); + BOOST_TEST(*next(i) == 'x'); + BOOST_TEST(*next(next(i)) == 3.3); + BOOST_TEST(*next(next(next(i))) == s); + next(next(next(next(i)))); // end + +#if !defined(FUSION_NO_PRIOR) + BOOST_TEST(*prior(next(next(next(i)))) == 3.3); + BOOST_TEST(*prior(prior(next(next(next(i))))) == 'x'); + BOOST_TEST(*prior(prior(prior(next(next(next(i)))))) == 1); +#endif + BOOST_TEST(*begin(v) == 1); +#if !defined(FUSION_NO_PRIOR) + BOOST_TEST(*prior(end(v)) == s); +#endif + + *i = 3; + BOOST_TEST(*i == 3); + BOOST_TEST(&*i == &at_c<0>(v)); + + // prove that it is mutable + *i = 987; + BOOST_TEST(*i == 987); + } + + { // Testing const sequence and const iterator + + char const* s = "Hello"; + typedef FUSION_SEQUENCE const seq_type; + seq_type t(1, 'x', 3.3, s); + result_of::begin::type i(t); + + BOOST_TEST(*i == 1); + BOOST_TEST(*next(i) == 'x'); + BOOST_TEST(*begin(t) == 1); +#if !defined(FUSION_NO_PRIOR) + BOOST_TEST(*prior(end(t)) == s); +#endif + +#ifdef FUSION_TEST_FAIL + *i = 3; // must not compile +#endif + } + + { // Testing iterator equality + + typedef FUSION_SEQUENCE seq_type; + typedef FUSION_SEQUENCE const cseq_type; + typedef result_of::begin::type vi1; + typedef result_of::begin::type vi2; + BOOST_STATIC_ASSERT((result_of::equal_to::value)); + BOOST_STATIC_ASSERT((result_of::equal_to::value)); + BOOST_STATIC_ASSERT((result_of::equal_to::value)); + BOOST_STATIC_ASSERT((result_of::equal_to::value)); + BOOST_STATIC_ASSERT((result_of::equal_to::value)); + BOOST_STATIC_ASSERT((result_of::equal_to::value)); + } + + { + typedef FUSION_SEQUENCE seq_type; + typedef result_of::begin::type begin_type; + typedef result_of::end::type end_type; + typedef result_of::next::type i1; + typedef result_of::next::type i2; + + BOOST_STATIC_ASSERT((is_same::value)); + } + + { // testing deref, next, prior, begin, end + + char const* s = "Hello"; + typedef FUSION_SEQUENCE seq_type; + seq_type t(1, 'x', 3.3, s); + result_of::begin::type i(t); + + BOOST_TEST(*i == 1); + BOOST_TEST(*next(i) == 'x'); + BOOST_TEST(*next(next(i)) == 3.3); + BOOST_TEST(*next(next(next(i))) == s); + + next(next(next(next(i)))); // end + +#ifdef FUSION_TEST_FAIL + next(next(next(next(next(i))))); // past the end: must not compile +#endif + +#if !defined(FUSION_NO_PRIOR) + BOOST_TEST(*prior(next(next(next(i)))) == 3.3); + BOOST_TEST(*prior(prior(next(next(next(i))))) == 'x'); + BOOST_TEST(*prior(prior(prior(next(next(next(i)))))) == 1); +#endif + BOOST_TEST(*begin(t) == 1); +#if !defined(FUSION_NO_PRIOR) + BOOST_TEST(*prior(end(t)) == s); +#endif + + *i = 3; + BOOST_TEST(*i == 3); + BOOST_TEST(*i == at_c<0>(t)); + } + + { // Testing distance + + typedef FUSION_SEQUENCE seq_type; + seq_type t(1, 'x', 3.3, "Hello"); + + BOOST_STATIC_ASSERT((result_of::distance< + result_of::begin::type + , result_of::end::type >::value == 4)); + + BOOST_TEST(distance(begin(t), end(t)).value == 4); + } + + { // Testing tuple iterator result_of::value_of, result_of::deref, result_of::value_at + + typedef FUSION_SEQUENCE seq_type; + typedef result_of::begin::type i0; + typedef result_of::next::type i1; + typedef result_of::next::type>::type i2; + + BOOST_STATIC_ASSERT(( + is_same::type, int>::value)); + + BOOST_STATIC_ASSERT(( + is_same::type, char&>::value)); + + BOOST_STATIC_ASSERT(( + is_same::type, FUSION_TRAVERSAL_TAG>::value)); + + BOOST_STATIC_ASSERT((is_same::type, int&>::value)); + BOOST_STATIC_ASSERT((is_same::type, char&>::value)); + + BOOST_STATIC_ASSERT((is_same::type, int>::value)); + BOOST_STATIC_ASSERT((is_same::type, char&>::value)); + } + + { // Testing advance + + typedef FUSION_SEQUENCE seq_type; + seq_type t(1, 'x', 3.3, "Hello"); + + BOOST_TEST(*advance_c<0>(begin(t)) == at_c<0>(t)); + BOOST_TEST(*advance_c<1>(begin(t)) == at_c<1>(t)); + BOOST_TEST(*advance_c<2>(begin(t)) == at_c<2>(t)); + BOOST_TEST(*advance_c<3>(begin(t)) == at_c<3>(t)); + +#if !defined(FUSION_NO_PRIOR) + BOOST_TEST(*advance_c<-1>(end(t)) == at_c<3>(t)); + BOOST_TEST(*advance_c<-2>(end(t)) == at_c<2>(t)); + BOOST_TEST(*advance_c<-3>(end(t)) == at_c<1>(t)); + BOOST_TEST(*advance_c<-4>(end(t)) == at_c<0>(t)); +#endif + + BOOST_TEST(&*advance_c<0>(begin(t)) == &at_c<0>(t)); + BOOST_TEST(&*advance_c<1>(begin(t)) == &at_c<1>(t)); + BOOST_TEST(&*advance_c<2>(begin(t)) == &at_c<2>(t)); + BOOST_TEST(&*advance_c<3>(begin(t)) == &at_c<3>(t)); + } +} + + + + diff --git a/test/sequence/iterator_range.cpp b/test/sequence/iterator_range.cpp new file mode 100644 index 00000000..29993d8e --- /dev/null +++ b/test/sequence/iterator_range.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + char const* s = "Ruby"; + typedef vector vector_type; + vector_type vec(1, 'x', 3.3, s); + + { + typedef vector_iterator i1t; + typedef vector_iterator i3t; + + i1t i1(vec); + i3t i3(vec); + + typedef iterator_range slice_t; + slice_t slice(i1, i3); + std::cout << slice << std::endl; + BOOST_TEST((slice == make_vector('x', 3.3))); + BOOST_STATIC_ASSERT(result_of::size::value == 2); + } + + { + typedef vector_iterator i1t; + typedef vector_iterator i3t; + + i1t i1(vec); + i3t i3(vec); + + typedef iterator_range slice_t; + slice_t slice(i1, i3); + std::cout << slice << std::endl; + BOOST_TEST(slice == make_vector()); + BOOST_STATIC_ASSERT(result_of::size::value == 0); + } + } + + { + typedef boost::mpl::vector_c mpl_vec; + typedef boost::mpl::begin::type it0; + typedef boost::mpl::next::type it1; + typedef boost::mpl::next::type it2; + typedef boost::mpl::next::type it3; + + it1 f; + it3 l; + + typedef iterator_range slice_t; + slice_t slice(f, l); + std::cout << slice << std::endl; + BOOST_TEST((slice == make_vector(3, 4))); + BOOST_STATIC_ASSERT(result_of::size::value == 2); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/joint_view.cpp b/test/sequence/joint_view.cpp new file mode 100644 index 00000000..7ce135e7 --- /dev/null +++ b/test/sequence/joint_view.cpp @@ -0,0 +1,144 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include + +struct X +{ + operator char const*() const + { + return ""; + } +}; + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing joint_view + + { + vector t1(3); + vector t2; + typedef joint_view, vector > view_type; + view_type view(t1, t2); + + std::cout << view << std::endl; + BOOST_TEST((view == make_vector(3, X()))); + } + + { + vector t1(3, 'x'); + vector t2; + typedef joint_view, vector > view_type; + view_type view(t1, t2); + std::cout << view << std::endl; + BOOST_TEST((view == make_vector(3, 'x', X()))); + + *begin(view) = 4; + BOOST_TEST(at_c<0>(t1) == 4); + } + + { + vector t1(3, 'x'); + vector t2; + typedef joint_view, vector > view_type; + view_type view(t1, t2); + std::cout << view << std::endl; + BOOST_TEST((view == make_vector(3, 'x', X(), 0))); + } + + { + typedef vector t1_type; + t1_type t1(777); + typedef vector t2_type; + t2_type t2(1, 'x', 3.3); + + { + typedef joint_view view_type; + view_type view(t1, t2); + std::cout << view << std::endl; + BOOST_TEST((view == make_vector(777, 1, 'x', 3.3))); + } + + { + typedef joint_view view_type; + view_type view(t2, t1); + std::cout << view << std::endl; + BOOST_TEST((view == make_vector(1, 'x', 3.3, 777))); + } + + { + typedef joint_view jv_type; + typedef joint_view jv2_type; + + jv_type jv(t2, t1); + jv2_type jv2(jv, jv); + + std::cout << jv << std::endl; + std::cout << jv2 << std::endl; + + BOOST_TEST(jv2 + == make_vector(1, 'x', 3.3, 777, 1, 'x', 3.3, 777)); + } + + { + typedef joint_view jt_type; + typedef joint_view jv2_type; + typedef joint_view jv3_type; + + jt_type jt(t2, t1); + jv2_type jv2(t1, t2); + jv3_type jv3(jt, jv2); + + std::cout << jt << std::endl; + std::cout << jv2 << std::endl; + std::cout << jv3 << std::endl; + + BOOST_TEST(jv3 + == make_vector(1, 'x', 3.3, 777, 777, 1, 'x', 3.3)); + } + + { + typedef joint_view, t1_type> jt_type; + vector<> empty; + jt_type jt(empty, t1); + std::cout << jt << std::endl; + BOOST_TEST(jt == make_vector(777)); + } + + { + typedef joint_view > jt_type; + vector<> empty; + jt_type jt(t1, empty); + std::cout << jt << std::endl; + BOOST_TEST(jt == make_vector(777)); + } + + { + typedef joint_view, vector<> > jt_type; + vector<> empty; + jt_type jt(empty, empty); + std::cout << jt << std::endl; + BOOST_TEST(jt == make_vector()); + } + } + + return boost::report_errors(); +} + diff --git a/test/sequence/list_comparison.cpp b/test/sequence/list_comparison.cpp new file mode 100644 index 00000000..fcf213c5 --- /dev/null +++ b/test/sequence/list_comparison.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE list +#include "comparison.hpp" + +int +main() +{ + equality_test(); + ordering_test(); + return boost::report_errors(); +} diff --git a/test/sequence/list_construction.cpp b/test/sequence/list_construction.cpp new file mode 100644 index 00000000..26d648fd --- /dev/null +++ b/test/sequence/list_construction.cpp @@ -0,0 +1,18 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE list +#include "construction.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} diff --git a/test/sequence/list_copy.cpp b/test/sequence/list_copy.cpp new file mode 100644 index 00000000..561ab10d --- /dev/null +++ b/test/sequence/list_copy.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include + +#define FUSION_SEQUENCE list +#include "copy.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/list_iterator.cpp b/test/sequence/list_iterator.cpp new file mode 100644 index 00000000..f7cc6e1d --- /dev/null +++ b/test/sequence/list_iterator.cpp @@ -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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE list +#define FUSION_NO_PRIOR +#define FUSION_TRAVERSAL_TAG forward_traversal_tag +#include "./iterator.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + + + diff --git a/test/sequence/list_make.cpp b/test/sequence/list_make.cpp new file mode 100644 index 00000000..7e7120fe --- /dev/null +++ b/test/sequence/list_make.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE list +#include "make.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/list_misc.cpp b/test/sequence/list_misc.cpp new file mode 100644 index 00000000..2d8fe047 --- /dev/null +++ b/test/sequence/list_misc.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE list +#define FUSION_FORWARD_ONLY +#include "misc.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/list_mutate.cpp b/test/sequence/list_mutate.cpp new file mode 100644 index 00000000..f8802b27 --- /dev/null +++ b/test/sequence/list_mutate.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE list +#include "mutate.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/list_tie.cpp b/test/sequence/list_tie.cpp new file mode 100644 index 00000000..1a0e73b2 --- /dev/null +++ b/test/sequence/list_tie.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include + +#define FUSION_SEQUENCE list +#include "tie.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/list_value_at.cpp b/test/sequence/list_value_at.cpp new file mode 100644 index 00000000..763cf265 --- /dev/null +++ b/test/sequence/list_value_at.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE list +#include "value_at.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/make.hpp b/test/sequence/make.hpp new file mode 100644 index 00000000..c6494474 --- /dev/null +++ b/test/sequence/make.hpp @@ -0,0 +1,88 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include + +#if !defined(FUSION_AT) +#define FUSION_AT at_c +#endif + +#if !defined(FUSION_MAKE) +#define FUSION_MAKE BOOST_PP_CAT(make_, FUSION_SEQUENCE) +#endif + +namespace test_detail +{ + // something to prevent warnings for unused variables + template void dummy(const T&) {} + + class A {}; + class B {}; +} + +void make_tuple_test() {} + +void +test() +{ + using namespace boost::fusion; + using namespace test_detail; + + { + FUSION_SEQUENCE t1 = FUSION_MAKE(5, 'a'); + BOOST_TEST(FUSION_AT<0>(t1) == 5); + BOOST_TEST(FUSION_AT<1>(t1) == 'a'); + + FUSION_SEQUENCE t2; + t2 = FUSION_MAKE((short int)2, std::string("Hi")); + BOOST_TEST(FUSION_AT<0>(t2) == 2); + BOOST_TEST(FUSION_AT<1>(t2) == "Hi"); + } + + { // This test was previously disallowed for non-PTS compilers. + A a = A(); B b; + const A ca = a; + FUSION_MAKE(boost::cref(a), b); + FUSION_MAKE(boost::ref(a), b); + FUSION_MAKE(boost::ref(a), boost::cref(b)); + FUSION_MAKE(boost::ref(ca)); + } + + { // the result of make_xxx is assignable: + BOOST_TEST(FUSION_MAKE(2, 4, 6) == + (FUSION_MAKE(1, 2, 3) = FUSION_MAKE(2, 4, 6))); + } + + { // This test was previously disallowed for non-PTS compilers. + FUSION_MAKE("Donald", "Daisy"); // should work; + // std::make_pair("Doesn't","Work"); // fails + } + + { + // You can store a reference to a function in a sequence + FUSION_SEQUENCE adf(make_tuple_test); + dummy(adf); // avoid warning for unused variable + } + +#if defined(FUSION_TEST_FAIL) + { + // But make_xxx doesn't work + // with function references, since it creates a const + // qualified function type + + FUSION_MAKE(make_tuple_test); + } +#endif + + { + // With function pointers, make_xxx works just fine + FUSION_MAKE(&make_tuple_test); + } +} diff --git a/test/sequence/make_list.cpp b/test/sequence/make_list.cpp new file mode 100644 index 00000000..7e7120fe --- /dev/null +++ b/test/sequence/make_list.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE list +#include "make.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/make_vector.cpp b/test/sequence/make_vector.cpp new file mode 100644 index 00000000..228fbb77 --- /dev/null +++ b/test/sequence/make_vector.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE vector +#include "make.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/map.cpp b/test/sequence/map.cpp new file mode 100644 index 00000000..689e086d --- /dev/null +++ b/test/sequence/map.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using namespace std; + using boost::fusion::pair; + using boost::fusion::make_pair; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + typedef map< + pair + , pair > + map_type; + + BOOST_MPL_ASSERT((traits::is_associative)); + + map_type m( + make_pair('X') + , make_pair("Men")); + + std::cout << at_key(m) << std::endl; + std::cout << at_key(m) << std::endl; + + BOOST_TEST(at_key(m) == 'X'); + BOOST_TEST(at_key(m) == "Men"); + + BOOST_STATIC_ASSERT(( + boost::is_same::type, char>::value)); + BOOST_STATIC_ASSERT(( + boost::is_same::type, std::string>::value)); + + std::cout << m << std::endl; + + BOOST_STATIC_ASSERT((result_of::has_key::value)); + BOOST_STATIC_ASSERT((result_of::has_key::value)); + BOOST_STATIC_ASSERT((!result_of::has_key::value)); + } + + { + std::cout << make_map('X', 123) << std::endl; + BOOST_TEST(at_key(make_map('X', 123)) == 'X'); + BOOST_TEST(at_key(make_map('X', 123)) == 123); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/map_tie.cpp b/test/sequence/map_tie.cpp new file mode 100644 index 00000000..aef31c51 --- /dev/null +++ b/test/sequence/map_tie.cpp @@ -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) +==============================================================================*/ +#include + +#include +#include + +struct key_zero; +struct key_one; + +int main() +{ + using namespace boost::fusion; + { + int number = 101; + char letter = 'a'; + BOOST_TEST(at_key(map_tie(number, letter)) == 101); + BOOST_TEST(at_key(map_tie(number, letter)) == 'a'); + + BOOST_TEST(&at_key(map_tie(number, letter)) == &number); + BOOST_TEST(&at_key(map_tie(number, letter)) == &letter); + + at_key(map_tie(number, letter)) = 202; + at_key(map_tie(number, letter)) = 'b'; + + BOOST_TEST(number == 202); + BOOST_TEST(letter == 'b'); + } + return boost::report_errors(); +} diff --git a/test/sequence/misc.hpp b/test/sequence/misc.hpp new file mode 100644 index 00000000..d1fae03b --- /dev/null +++ b/test/sequence/misc.hpp @@ -0,0 +1,189 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(FUSION_AT) +#define FUSION_AT at_c +#endif + +#if !defined(FUSION_SIZE) +#define FUSION_SIZE result_of::size +#endif + +template +struct is_same +{ +}; + +struct test_intrinsics1 +{ + // test at, begin, end, next, prior, advance, size, deref, etc. + + typedef boost::fusion::FUSION_SEQUENCE sequence; + typedef boost::mpl::begin::type first; + typedef boost::mpl::next::type second; + typedef boost::mpl::next::type third; + typedef boost::mpl::next::type fourth; + typedef boost::mpl::end::type last; + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref::type, int>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref::type, float>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref::type, bool>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref::type, char>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::at_c::type, bool>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::front::type, int>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref< + boost::mpl::advance_c::type>::type, char>::value)); + + BOOST_STATIC_ASSERT((boost::mpl::size::value == 4)); + BOOST_STATIC_ASSERT(!(boost::mpl::empty::value)); + BOOST_STATIC_ASSERT((boost::mpl::distance::value == 2)); + +#if !defined(FUSION_FORWARD_ONLY) // list has no back/prev + + typedef boost::mpl::prior::type fourth_; + typedef boost::mpl::prior::type third_; + typedef boost::mpl::prior::type second_; + typedef boost::mpl::prior::type first_; + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref::type, int>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref::type, float>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref::type, bool>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::deref::type, char>::value)); + + BOOST_STATIC_ASSERT((boost::is_same< + boost::mpl::back::type, char>::value)); + +#endif +}; + +struct test_intrinsics2 +{ + typedef boost::fusion::FUSION_SEQUENCE<> seq0; + +#if !defined(FUSION_FORWARD_ONLY) // list has no back/prev + + typedef boost::fusion::FUSION_SEQUENCE target1; + typedef boost::mpl::push_back::type seq1; + BOOST_STATIC_ASSERT((boost::mpl::equal::value)); + + typedef boost::fusion::FUSION_SEQUENCE target2; + typedef boost::mpl::push_back::type seq2; + BOOST_STATIC_ASSERT((boost::mpl::equal::value)); + +#endif + + typedef boost::fusion::FUSION_SEQUENCE target3; + typedef boost::mpl::push_front::type seq3; + BOOST_STATIC_ASSERT((boost::mpl::equal::value)); + + typedef boost::fusion::FUSION_SEQUENCE target4; + typedef boost::mpl::push_front::type seq4; + BOOST_STATIC_ASSERT((boost::mpl::equal::value)); +}; + +void +test() +{ + using namespace boost::fusion; + + { // testing const sequences + + const FUSION_SEQUENCE t1(5, 3.3f); + BOOST_TEST(FUSION_AT<0>(t1) == 5); + BOOST_TEST(FUSION_AT<1>(t1) == 3.3f); + } + + { // testing at works with MPL integral constants + const FUSION_SEQUENCE t1(101, 'z'); + BOOST_TEST(boost::fusion::at >(t1) == 101); + BOOST_TEST(boost::fusion::at >(t1) == 'z'); + // explicitly try something other than mpl::int_ + BOOST_TEST((boost::fusion::at >(t1) == 101)); + BOOST_TEST((boost::fusion::at >(t1) == 'z')); + } + + { // testing size & empty + + typedef FUSION_SEQUENCE t1; + typedef FUSION_SEQUENCE<> t2; + + BOOST_STATIC_ASSERT(FUSION_SIZE::value == 3); + BOOST_STATIC_ASSERT(FUSION_SIZE::value == 0); + BOOST_STATIC_ASSERT(!result_of::empty::value); + BOOST_STATIC_ASSERT(result_of::empty::value); + } + + { // testing front & back + + typedef FUSION_SEQUENCE tup; + tup t(1, 2.2, "Kimpo"); + + BOOST_TEST(front(t) == 1); +#if !defined(FUSION_FORWARD_ONLY) // list has no back + BOOST_TEST(back(t) == "Kimpo"); +#endif + } + + { // testing is_sequence + + typedef FUSION_SEQUENCE t1; + typedef FUSION_SEQUENCE<> t2; + typedef FUSION_SEQUENCE t3; + + BOOST_STATIC_ASSERT(traits::is_sequence::value); + BOOST_STATIC_ASSERT(traits::is_sequence::value); + BOOST_STATIC_ASSERT(traits::is_sequence::value); + BOOST_STATIC_ASSERT(!traits::is_sequence::value); + BOOST_STATIC_ASSERT(!traits::is_sequence::value); + } + + { // testing mpl compatibility + + // test begin, end, next, prior, advance, size, deref, etc. + //~ typedef FUSION_SEQUENCE tuple_type; + //~ test_intrinsics1 test1; + //~ (void)test1; // prevent unused variable warning + + // test an algorithm + typedef FUSION_SEQUENCE t1; + typedef boost::mpl::find::type iter; + typedef boost::mpl::deref::type type; + BOOST_STATIC_ASSERT((boost::is_same::value)); + + } +} diff --git a/test/sequence/mutate.hpp b/test/sequence/mutate.hpp new file mode 100644 index 00000000..d50d84d0 --- /dev/null +++ b/test/sequence/mutate.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) +==============================================================================*/ +#include +#include + +#if !defined(FUSION_AT) +#define FUSION_AT at_c +#endif + +namespace test_detail +{ + // no public default constructor + class foo + { + public: + + explicit foo(int v) : val(v) {} + + bool operator==(const foo& other) const + { + return val == other.val; + } + + private: + + foo() {} + int val; + }; +} + +void +test() +{ + using namespace boost::fusion; + using namespace test_detail; + + FUSION_SEQUENCE t1(5, 12.2f, true, foo(4)); + FUSION_AT<0>(t1) = 6; + FUSION_AT<1>(t1) = 2.2f; + FUSION_AT<2>(t1) = false; + FUSION_AT<3>(t1) = foo(5); + + BOOST_TEST(FUSION_AT<0>(t1) == 6); + BOOST_TEST(FUSION_AT<1>(t1) > 2.1f && FUSION_AT<1>(t1) < 2.3f); + BOOST_TEST(FUSION_AT<2>(t1) == false); + BOOST_TEST(FUSION_AT<3>(t1) == foo(5)); +} diff --git a/test/sequence/repetitive_view.cpp b/test/sequence/repetitive_view.cpp new file mode 100644 index 00000000..54da37bc --- /dev/null +++ b/test/sequence/repetitive_view.cpp @@ -0,0 +1,53 @@ +/*============================================================================= + 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). +==============================================================================*/ + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#include + +struct check_equal +{ + template + void operator()(LHS const& lhs, RHS const& rhs) const + { + BOOST_TEST(( boost::is_same::value )); + BOOST_TEST(( lhs == rhs )); + } +}; + +int main() +{ + using namespace boost::fusion; + + typedef boost::fusion::vector seq_t; + seq_t seq(1,2l,3.0f,4.0); + + typedef repetitive_view view_t; + view_t view(seq); + + typedef joint_view seq_twice_t; + typedef joint_view seq_repeated_t; + seq_twice_t seq_twice(seq,seq); + seq_repeated_t seq_repeated(seq,seq_twice); + + for_each(zip(view,seq_repeated), make_fused_procedure(check_equal())); + + return boost::report_errors(); +} + diff --git a/test/sequence/reverse_view.cpp b/test/sequence/reverse_view.cpp new file mode 100644 index 00000000..03d0632f --- /dev/null +++ b/test/sequence/reverse_view.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing the reverse_view + + { + typedef boost::mpl::range_c mpl_list1; + mpl_list1 l; + reverse_view rev(l); + + std::cout << rev << std::endl; + BOOST_TEST((rev == make_vector(8, 7, 6, 5))); + } + + { + char const* s = "Hi Kim"; + typedef vector vector_type; + vector_type t(123, 'x', 123456789, s); + typedef reverse_view view_type; + view_type rev(t); + + std::cout << rev << std::endl; + BOOST_TEST((rev == make_vector(s, 123456789, 'x', 123))); + + typedef result_of::begin::type first_type; + first_type first_it(begin(rev)); + typedef result_of::next::type second_type; + second_type second_it(next(first_it)); + BOOST_TEST((*second_it == 123456789)); + BOOST_TEST((*prior(second_it) == s)); + BOOST_TEST((*advance_c<2>(first_it) == 'x')); + BOOST_TEST((distance(first_it, second_it) == 1)); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/set.cpp b/test/sequence/set.cpp new file mode 100644 index 00000000..0c376f3a --- /dev/null +++ b/test/sequence/set.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using namespace std; + using boost::fusion::pair; + using boost::fusion::make_pair; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + typedef set set_type; + + BOOST_MPL_ASSERT((traits::is_associative)); + + set_type m(123, "Hola"); + + std::cout << at_key(m) << std::endl; + std::cout << at_key(m) << std::endl; + + BOOST_TEST(at_key(m) == 123); + BOOST_TEST(at_key(m) == "Hola"); + + BOOST_STATIC_ASSERT(( + boost::is_same::type, int>::value)); + BOOST_STATIC_ASSERT(( + boost::is_same::type, std::string>::value)); + + std::cout << m << std::endl; + + BOOST_STATIC_ASSERT((result_of::has_key::value)); + BOOST_STATIC_ASSERT((result_of::has_key::value)); + BOOST_STATIC_ASSERT((!result_of::has_key::value)); + } + + { + std::cout << make_set('X', 123) << std::endl; + BOOST_TEST(at_key(make_set('X', 123)) == 'X'); + BOOST_TEST(at_key(make_set('X', 123)) == 123); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/single_view.cpp b/test/sequence/single_view.cpp new file mode 100644 index 00000000..e3faa26a --- /dev/null +++ b/test/sequence/single_view.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include + +struct X {}; + +template +OS& operator<<(OS& os, X const&) +{ + os << ""; + return os; +} + +void foo() {} + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + single_view view1(3); + std::cout << view1 << std::endl; + +#ifdef FUSION_TEST_FAIL + // single_view is immutable + *begin(view1) += 4; +#endif + std::cout << view1 << std::endl; + BOOST_TEST(*begin(view1) == 3); + BOOST_TEST(view1.val == 3); + + single_view view2; + std::cout << view2 << std::endl; + } + + { + std::cout << make_single_view(1) << std::endl; + std::cout << make_single_view("Hello, World") << std::endl; + std::cout << make_single_view(&foo) << std::endl; + } + + return boost::report_errors(); +} + diff --git a/test/sequence/std_pair.cpp b/test/sequence/std_pair.cpp new file mode 100644 index 00000000..127a1fbc --- /dev/null +++ b/test/sequence/std_pair.cpp @@ -0,0 +1,91 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using namespace std; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + typedef std::pair pair_type; + BOOST_MPL_ASSERT_NOT((traits::is_view)); + pair_type p(123, "Hola!!!"); + + std::cout << at_c<0>(p) << std::endl; + std::cout << at_c<1>(p) << std::endl; + std::cout << p << std::endl; + BOOST_TEST(p == make_vector(123, "Hola!!!")); + + at_c<0>(p) = 6; + at_c<1>(p) = "mama mia"; + BOOST_TEST(p == make_vector(6, "mama mia")); + + BOOST_STATIC_ASSERT(result_of::size::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == "mama mia"); + } + + { + fusion::vector v1(4, 3.3f); + std::pair v2(5, 3.3f); + fusion::vector v3(5, 4.4); + BOOST_TEST(v1 < v2); + BOOST_TEST(v1 <= v2); + BOOST_TEST(v2 > v1); + BOOST_TEST(v2 >= v1); + BOOST_TEST(v2 < v3); + BOOST_TEST(v2 <= v3); + BOOST_TEST(v3 > v2); + BOOST_TEST(v3 >= v2); + } + + { + // conversion from pair to vector + fusion::vector v(std::make_pair(123, "Hola!!!")); + v = std::make_pair(123, "Hola!!!"); + } + + { + // conversion from pair to list + fusion::list l(std::make_pair(123, "Hola!!!")); + l = std::make_pair(123, "Hola!!!"); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/swap.cpp b/test/sequence/swap.cpp new file mode 100644 index 00000000..e89542e0 --- /dev/null +++ b/test/sequence/swap.cpp @@ -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) +==============================================================================*/ +#include +#include +#include +#include +#include + +#include + +#include + +#include + +int main() +{ + namespace fusion = boost::fusion; + { + typedef fusion::vector, char> test_vector; + BOOST_MPL_ASSERT((boost::is_same::type>)); + + test_vector v1(std::vector(1, 101), 'a'), v2(std::vector(1, 202), 'b'); + + fusion::swap(v1, v2); + + BOOST_TEST(v1 == fusion::make_vector(std::vector(1, 202), 'b')); + BOOST_TEST(v2 == fusion::make_vector(std::vector(1, 101), 'a')); + } + return boost::report_errors(); +} diff --git a/test/sequence/tie.hpp b/test/sequence/tie.hpp new file mode 100644 index 00000000..6097ef8e --- /dev/null +++ b/test/sequence/tie.hpp @@ -0,0 +1,85 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#if !defined(FUSION_AT) +#define FUSION_AT at_c +#endif + +#if !defined(FUSION_MAKE) +#define FUSION_MAKE BOOST_PP_CAT(make_, FUSION_SEQUENCE) +#endif + +#if !defined(FUSION_TIE) +#define FUSION_TIE BOOST_PP_CAT(FUSION_SEQUENCE, _tie) +#endif + +namespace test_detail +{ + // something to prevent warnings for unused variables + template void dummy(const T&) {} + + // no public default constructor + class foo + { + public: + + explicit foo(int v) : val(v) {} + + bool operator==(const foo& other) const + { + return val == other.val; + } + + private: + + foo() {} + int val; + }; +} + +void +test() +{ + using namespace boost::fusion; + using namespace test_detail; + + int a; + char b; + foo c(5); + + FUSION_TIE(a, b, c) = FUSION_MAKE(2, 'a', foo(3)); + BOOST_TEST(a == 2); + BOOST_TEST(b == 'a'); + BOOST_TEST(c == foo(3)); + + FUSION_TIE(a, ignore, c) = FUSION_MAKE((short int)5, false, foo(5)); + BOOST_TEST(a == 5); + BOOST_TEST(b == 'a'); + BOOST_TEST(c == foo(5)); + + int i, j; + FUSION_TIE(i, j) = FUSION_MAKE(1, 2); + BOOST_TEST(i == 1 && j == 2); + + FUSION_SEQUENCE ta; + +#if defined(FUSION_TEST_FAIL) + ta = std::FUSION_MAKE(1, 2); // should fail, tuple is of length 3, not 2 +#endif + + dummy(ta); + + // ties cannot be rebound + int d = 3; + FUSION_SEQUENCE ti(a); + BOOST_TEST(&FUSION_AT<0>(ti) == &a); + ti = FUSION_SEQUENCE(d); + BOOST_TEST(&FUSION_AT<0>(ti) == &a); +} diff --git a/test/sequence/transform_view.cpp b/test/sequence/transform_view.cpp new file mode 100644 index 00000000..e811f5f7 --- /dev/null +++ b/test/sequence/transform_view.cpp @@ -0,0 +1,115 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +struct square +{ + template + struct result; + + template + struct result + { + typedef int type; + }; + + template + int operator()(T x) const + { + return x * x; + } +}; + +struct add +{ + template + struct result; + + template + struct result + { + typedef int type; + }; + + template + int operator()(A a, B b) const + { + return a + b; + } +}; + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + +/// Testing the transform_view + + { + typedef boost::mpl::range_c sequence_type; + sequence_type sequence; + square sq; + typedef transform_view xform_type; + xform_type xform(sequence, sq); + + std::cout << xform << std::endl; + BOOST_TEST((xform == make_vector(25, 36, 49, 64))); + + typedef boost::fusion::result_of::begin::type first_type; + first_type first_it(boost::fusion::begin(xform)); + + typedef boost::fusion::result_of::next::type next_type; + next_type next_it(boost::fusion::next(first_it)); + BOOST_TEST((*next_it == 36)); + BOOST_TEST((*boost::fusion::prior(next_it) == 25)); + BOOST_TEST((boost::fusion::distance(first_it, next_it) == 1)); + + BOOST_TEST((*boost::fusion::advance_c<3>(boost::fusion::begin(xform)) == 64)); + BOOST_TEST((boost::fusion::at_c<2>(xform) == 49)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + } + + { + typedef boost::mpl::range_c sequence1_type; + typedef boost::mpl::range_c sequence2_type; + sequence1_type sequence1; + sequence2_type sequence2; + add f; + typedef transform_view xform_type; + xform_type xform(sequence1, sequence2, f); + + std::cout << xform << std::endl; + BOOST_TEST((xform == make_vector(15, 17, 19, 21))); + BOOST_TEST((boost::fusion::at_c<2>(xform) == 19)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/tuple_comparison.cpp b/test/sequence/tuple_comparison.cpp new file mode 100644 index 00000000..8108256b --- /dev/null +++ b/test/sequence/tuple_comparison.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE tuple +#include "comparison.hpp" + +int +main() +{ + equality_test(); + ordering_test(); + return boost::report_errors(); +} diff --git a/test/sequence/tuple_construction.cpp b/test/sequence/tuple_construction.cpp new file mode 100644 index 00000000..323c72ed --- /dev/null +++ b/test/sequence/tuple_construction.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE tuple +#define FUSION_AT get +#include "construction.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} diff --git a/test/sequence/tuple_copy.cpp b/test/sequence/tuple_copy.cpp new file mode 100644 index 00000000..9a4d80e1 --- /dev/null +++ b/test/sequence/tuple_copy.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE tuple +#define FUSION_AT get +#define FUSION_MAKE make_tuple +#define FUSION_TIE tie +#include "copy.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/tuple_element.cpp b/test/sequence/tuple_element.cpp new file mode 100644 index 00000000..496fd6e1 --- /dev/null +++ b/test/sequence/tuple_element.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE tuple +#define FUSION_AT get +#define FUSION_VALUE_AT(S, N) tuple_element +#include "value_at.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/tuple_make.cpp b/test/sequence/tuple_make.cpp new file mode 100644 index 00000000..77ff412f --- /dev/null +++ b/test/sequence/tuple_make.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE tuple +#define FUSION_AT get +#define FUSION_MAKE make_tuple +#include "make.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/tuple_misc.cpp b/test/sequence/tuple_misc.cpp new file mode 100644 index 00000000..daef0322 --- /dev/null +++ b/test/sequence/tuple_misc.cpp @@ -0,0 +1,23 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include + +#define FUSION_SEQUENCE tuple +#define FUSION_AT get +#define FUSION_SIZE tuple_size +#include "misc.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/tuple_mutate.cpp b/test/sequence/tuple_mutate.cpp new file mode 100644 index 00000000..8770b520 --- /dev/null +++ b/test/sequence/tuple_mutate.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE tuple +#define FUSION_AT get +#include "mutate.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/tuple_tie.cpp b/test/sequence/tuple_tie.cpp new file mode 100644 index 00000000..e91c47a3 --- /dev/null +++ b/test/sequence/tuple_tie.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE tuple +#define FUSION_AT get +#define FUSION_MAKE make_tuple +#define FUSION_TIE tie +#include "tie.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/value_at.hpp b/test/sequence/value_at.hpp new file mode 100644 index 00000000..d655f13e --- /dev/null +++ b/test/sequence/value_at.hpp @@ -0,0 +1,87 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include + +#if !defined(FUSION_AT) +#define FUSION_AT at_c +#endif + +#if !defined(FUSION_VALUE_AT) +#define FUSION_VALUE_AT(S, N) result_of::value_at_c +#endif + +namespace test_detail +{ + // something to prevent warnings for unused variables + template void dummy(const T&) {} + + class A {}; +} + +void +test() +{ + using namespace boost::fusion; + using namespace test_detail; + + double d = 2.7; + A a; + FUSION_SEQUENCE t(1, d, a, 2); + const FUSION_SEQUENCE ct(t); + + int i = FUSION_AT<0>(t); + int i2 = FUSION_AT<3>(t); + + BOOST_TEST(i == 1 && i2 == 2); + + int j = FUSION_AT<0>(ct); + BOOST_TEST(j == 1); + + FUSION_AT<0>(t) = 5; + BOOST_TEST(FUSION_AT<0>(t) == 5); + +#if defined(FUSION_TEST_FAIL) + FUSION_AT<0>(ct) = 5; // can't assign to const +#endif + + double e = FUSION_AT<1>(t); + BOOST_TEST(e > 2.69 && e < 2.71); + + FUSION_AT<1>(t) = 3.14+i; + BOOST_TEST(FUSION_AT<1>(t) > 4.13 && FUSION_AT<1>(t) < 4.15); + +#if defined(FUSION_TEST_FAIL) + FUSION_AT<4>(t) = A(); // can't assign to const + dummy(FUSION_AT<5>(ct)); // illegal index +#endif + + ++FUSION_AT<0>(t); + BOOST_TEST(FUSION_AT<0>(t) == 6); + + typedef FUSION_SEQUENCE seq_type; + + BOOST_STATIC_ASSERT(!( + boost::is_const::value)); + + // constness should not affect + BOOST_STATIC_ASSERT(!( + boost::is_const::value)); + + BOOST_STATIC_ASSERT(!( + boost::is_const::value)); + + // constness should not affect + BOOST_STATIC_ASSERT(!( + boost::is_const::value)); + + dummy(i); dummy(i2); dummy(j); dummy(e); // avoid warns for unused variables +} diff --git a/test/sequence/variant.cpp b/test/sequence/variant.cpp new file mode 100644 index 00000000..bfbf6fd3 --- /dev/null +++ b/test/sequence/variant.cpp @@ -0,0 +1,56 @@ +/*============================================================================= + 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) +==============================================================================*/ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +#include + +int main() +{ + namespace fusion = boost::fusion; + typedef boost::variant var_type; + var_type var = "hello"; + + BOOST_MPL_ASSERT((fusion::traits::is_sequence)); + BOOST_MPL_ASSERT_NOT((fusion::traits::is_view)); + BOOST_MPL_ASSERT((boost::is_same< + fusion::traits::category_of::type, + fusion::forward_traversal_tag>)); + + BOOST_TEST(fusion::size(var) == 2); + BOOST_TEST(fusion::distance(fusion::begin(var), fusion::end(var)) == 2); + BOOST_TEST(*fusion::next(fusion::begin(var)) == "hello"); + BOOST_TEST(fusion::next(fusion::next(fusion::begin(var))) == fusion::end(var)); + BOOST_MPL_ASSERT((boost::is_same< + fusion::result_of::value_of::type>::type, + double>)); + BOOST_MPL_ASSERT((boost::is_same< + fusion::result_of::value_of::type>::type>::type, + std::string>)); + return boost::report_errors(); +} diff --git a/test/sequence/vector_comparison.cpp b/test/sequence/vector_comparison.cpp new file mode 100644 index 00000000..7321820e --- /dev/null +++ b/test/sequence/vector_comparison.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE vector +#include "comparison.hpp" + +int +main() +{ + equality_test(); + ordering_test(); + return boost::report_errors(); +} diff --git a/test/sequence/vector_construction.cpp b/test/sequence/vector_construction.cpp new file mode 100644 index 00000000..d279c232 --- /dev/null +++ b/test/sequence/vector_construction.cpp @@ -0,0 +1,18 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE vector +#include "construction.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} diff --git a/test/sequence/vector_copy.cpp b/test/sequence/vector_copy.cpp new file mode 100644 index 00000000..9b1e207d --- /dev/null +++ b/test/sequence/vector_copy.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include + +#define FUSION_SEQUENCE vector +#include "copy.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/vector_iterator.cpp b/test/sequence/vector_iterator.cpp new file mode 100644 index 00000000..bcf15c69 --- /dev/null +++ b/test/sequence/vector_iterator.cpp @@ -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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE vector +#define FUSION_TRAVERSAL_TAG random_access_traversal_tag +#include "./iterator.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + + + diff --git a/test/sequence/vector_make.cpp b/test/sequence/vector_make.cpp new file mode 100644 index 00000000..228fbb77 --- /dev/null +++ b/test/sequence/vector_make.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#define FUSION_SEQUENCE vector +#include "make.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/vector_misc.cpp b/test/sequence/vector_misc.cpp new file mode 100644 index 00000000..25d3ecfc --- /dev/null +++ b/test/sequence/vector_misc.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include + +#define FUSION_SEQUENCE vector +#include "misc.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/vector_mutate.cpp b/test/sequence/vector_mutate.cpp new file mode 100644 index 00000000..610c0c18 --- /dev/null +++ b/test/sequence/vector_mutate.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE vector +#include "mutate.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/vector_n.cpp b/test/sequence/vector_n.cpp new file mode 100644 index 00000000..b051ca89 --- /dev/null +++ b/test/sequence/vector_n.cpp @@ -0,0 +1,232 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + using namespace std; + + { + vector0 vec; + (void) vec; + cout << "(): " << sizeof(vec) << endl; + cout << (boost::is_empty::value ? "is empty" : "is not empty") << endl; + } + + { + typedef vector1 type; + type vec; + BOOST_STATIC_ASSERT(result_of::size::value == 1); + + BOOST_TEST(at_c<0>(vec) == 0); + BOOST_STATIC_ASSERT((is_same::type>::value)); + + // prove that it is mutable + at_c<0>(vec) = 987; + BOOST_TEST(at_c<0>(vec) == 987); + } + + { + typedef vector1 type; + type vec(123); + BOOST_TEST(at_c<0>(vec) == 123); + cout << "(int): " << sizeof(vec) << endl; + } + + { // testing const vector + vector1 const vec(999); + BOOST_TEST(at_c<0>(vec) == 999); + +#ifdef FUSION_TEST_COMPILE_FAIL + at_c<0>(vec) = 321; +#endif + } + + { + vector1 t1(123L); // try conversion from long to int + vector1 t2(t1); // try copy + (void)t2; + } + + { + typedef vector2 type; + type vec; + BOOST_STATIC_ASSERT(result_of::size::value == 2); + + BOOST_TEST(at_c<0>(vec) == 0); + BOOST_TEST(at_c<1>(vec) == char()); + + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + } + + { + typedef vector2 type; + type vec(123, 'x'); + BOOST_TEST(at_c<0>(vec) == 123); + BOOST_TEST(at_c<1>(vec) == 'x'); + cout << "(int, char): " << sizeof(vec) << endl; + } + + { + vector2 t1(123, 456); + vector2 t2(t1); + (void)t2; + } + + { + typedef vector3 type; + type vec; + BOOST_STATIC_ASSERT(result_of::size::value == 3); + + BOOST_TEST(at_c<0>(vec) == 0); + BOOST_TEST(at_c<1>(vec) == char()); + BOOST_TEST(at_c<2>(vec) == double()); + + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + } + + { + typedef vector3 type; + type vec(123, 'x', 123.456); + BOOST_TEST(at_c<0>(vec) == 123); + BOOST_TEST(at_c<1>(vec) == 'x'); + BOOST_TEST(at_c<2>(vec) >= 123.455 && at_c<2>(vec) <= 123.457); + cout << "(int, char, double): " << sizeof(vec) << endl; + } + + { + typedef vector4 type; + type vec(123, 'x', 123.456, true); + cout << "(int, char, double, bool): " << sizeof(vec) << endl; + } + + { + typedef vector4 type; + type vec(123, 'x', true, 123.456); + cout << "(int, char, bool, double): " << sizeof(vec) << endl; + } + + { + typedef vector7 type; + type vec(false, 'x', 3, 4, 5, 6.0, 7.0); + + BOOST_TEST(at_c<0>(vec) == false); + BOOST_TEST(at_c<1>(vec) == 'x'); + BOOST_TEST(at_c<2>(vec) == 3); + BOOST_TEST(at_c<3>(vec) == 4); + BOOST_TEST(at_c<4>(vec) == 5); + BOOST_TEST(at_c<5>(vec) >= 5.9 && at_c<5>(vec) <= 6.1); + BOOST_TEST(at_c<6>(vec) >= 6.9 && at_c<6>(vec) <= 7.1); + + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + BOOST_STATIC_ASSERT((is_same::type>::value)); + cout << "(bool, char, short, int, long, float, double): " << sizeof(vec) << endl; + } + + { + typedef vector10 type; + type vec; // compile check only + cout << "vector10 of int: " << sizeof(vec) << endl; + } + + { + typedef vector20< + int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int> type; + + type vec; // compile check only + cout << "vector20 of int: " << sizeof(vec) << endl; + } + + { + typedef vector30< + int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int> type; + + type vec; // compile check only + cout << "vector30 of int: " << sizeof(vec) << endl; + } + + { + typedef vector40< + int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int> type; + + type vec; // compile check only + cout << "vector40 of int: " << sizeof(vec) << endl; + } + + { + typedef vector50< + int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int> type; + + type vec; // compile check only + cout << "vector50 of int: " << sizeof(vec) << endl; + } + + { + // testing copy and assign from a view + vector0 empty; + fusion::vector2 v(fusion::push_back(fusion::push_back(empty, 123), 456)); + BOOST_TEST(at_c<0>(v) == 123); + BOOST_TEST(at_c<1>(v) == 456); + v = fusion::push_back(fusion::push_back(empty, 123), 456); // test assign + BOOST_TEST(at_c<0>(v) == 123); + BOOST_TEST(at_c<1>(v) == 456); + } + + { + // testing copy and assign from a vector_c + mpl::vector_c vec_c; + fusion::vector2 v(vec_c); + BOOST_TEST(at_c<0>(v) == 123); + BOOST_TEST(at_c<1>(v) == 456); + v = mpl::vector_c(); // test assign + BOOST_TEST(at_c<0>(v) == 123); + BOOST_TEST(at_c<1>(v) == 456); + } + + return boost::report_errors(); +} + diff --git a/test/sequence/vector_tie.cpp b/test/sequence/vector_tie.cpp new file mode 100644 index 00000000..08a82e3d --- /dev/null +++ b/test/sequence/vector_tie.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include + +#define FUSION_SEQUENCE vector +#include "tie.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/vector_value_at.cpp b/test/sequence/vector_value_at.cpp new file mode 100644 index 00000000..8a99da5b --- /dev/null +++ b/test/sequence/vector_value_at.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#define FUSION_SEQUENCE vector +#include "value_at.hpp" + +int +main() +{ + test(); + return boost::report_errors(); +} + diff --git a/test/sequence/zip_view.cpp b/test/sequence/zip_view.cpp new file mode 100644 index 00000000..0fcb438d --- /dev/null +++ b/test/sequence/zip_view.cpp @@ -0,0 +1,87 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +int main() +{ + using namespace boost::fusion; + { + typedef vector2 int_vector; + typedef vector2 char_vector; + typedef vector seqs_type; + typedef zip_view view; + + BOOST_MPL_ASSERT((boost::mpl::equal_to::type, boost::fusion::result_of::size::type>)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::size::value == 2)); + + int_vector iv(1,2); + char_vector cv('a', 'b'); + seqs_type seqs(iv, cv); + view v(seqs); + + BOOST_TEST(at_c<0>(v) == make_vector(1, 'a')); + BOOST_TEST(at_c<1>(v) == make_vector(2, 'b')); + BOOST_TEST(front(v) == make_vector(1, 'a')); + BOOST_TEST(back(v) == make_vector(2, 'b')); + BOOST_TEST(*next(begin(v)) == make_vector(2, 'b')); + BOOST_TEST(*prior(end(v)) == make_vector(2, 'b')); + BOOST_TEST(advance_c<2>(begin(v)) == end(v)); + BOOST_TEST(advance_c<-2>(end(v)) == begin(v)); + BOOST_TEST(distance(begin(v), end(v)) == 2); + + BOOST_STATIC_ASSERT((boost::fusion::result_of::distance::type, boost::fusion::result_of::end::type>::value == 2)); + + BOOST_MPL_ASSERT((boost::is_same::type, vector >)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, vector >)); + } + { + using namespace boost; + typedef mpl::vector2 v1_type; + typedef mpl::vector2 v2_type; + typedef fusion::vector seqs_type; + typedef fusion::zip_view view; + + v1_type v1; + v2_type v2; + seqs_type seqs(v1,v2); + view v(seqs); + BOOST_TEST((fusion::at_c<0>(v) == mpl::vector2())); + BOOST_TEST((fusion::at_c<1>(v) == mpl::vector2())); + BOOST_TEST((fusion::front(v) == mpl::vector2())); + BOOST_TEST((fusion::back(v) == mpl::vector2())); + BOOST_TEST((*fusion::next(fusion::begin(v)) == mpl::vector2())); + BOOST_TEST((*fusion::prior(fusion::end(v)) == mpl::vector2())); + BOOST_TEST(fusion::advance_c<2>(fusion::begin(v)) == fusion::end(v)); + BOOST_TEST(fusion::advance_c<-2>(fusion::end(v)) == fusion::begin(v)); + BOOST_TEST(fusion::distance(fusion::begin(v), fusion::end(v)) == 2); + } + return boost::report_errors(); +} + diff --git a/test/sequence/zip_view2.cpp b/test/sequence/zip_view2.cpp new file mode 100644 index 00000000..611c41cb --- /dev/null +++ b/test/sequence/zip_view2.cpp @@ -0,0 +1,64 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +int main() +{ + { + using namespace boost::fusion; + typedef vector2 int_vector; + typedef vector2 char_vector; + typedef list char_list; + typedef vector seqs_type; + typedef zip_view view; + + BOOST_MPL_ASSERT((boost::mpl::equal_to::type, boost::fusion::result_of::size::type>)); + BOOST_STATIC_ASSERT((boost::fusion::result_of::size::value == 2)); + + int_vector iv(1,2); + char_vector cv('a', 'b'); + char_list cl('y','z'); + seqs_type seqs(iv, cv, cl); + view v(seqs); + + BOOST_TEST(at_c<0>(v) == make_vector(1, 'a', 'y')); + BOOST_TEST(at_c<1>(v) == make_vector(2, 'b', 'z')); + BOOST_TEST(front(v) == make_vector(1, 'a', 'y')); + BOOST_TEST(*next(begin(v)) == make_vector(2, 'b', 'z')); + BOOST_TEST(advance_c<2>(begin(v)) == end(v)); + BOOST_TEST(distance(begin(v), end(v)) == 2); + BOOST_STATIC_ASSERT((boost::fusion::result_of::distance::type, boost::fusion::result_of::end::type>::value == 2)); + + BOOST_MPL_ASSERT((boost::is_same::type, vector >)); + BOOST_MPL_ASSERT((boost::is_same::type>::type, vector >)); + } + return boost::report_errors(); +} diff --git a/test/sequence/zip_view_ignore.cpp b/test/sequence/zip_view_ignore.cpp new file mode 100644 index 00000000..2a300809 --- /dev/null +++ b/test/sequence/zip_view_ignore.cpp @@ -0,0 +1,58 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include +#include +#include +#include +#include + +#include +#include + +int main() +{ + using namespace boost::fusion; + { + typedef vector2 int_vector; + typedef vector2 char_vector; + typedef vector seqs_type; + typedef zip_view view; + + int_vector iv(1,2); + char_vector cv('a','b'); + seqs_type seq(iv, unused, cv); + view v(seq); + + BOOST_TEST(at_c<0>(front(v)) == 1); + BOOST_TEST(at_c<2>(front(v)) == 'a'); + BOOST_TEST(at_c<0>(back(v)) == 2); + BOOST_TEST(at_c<2>(back(v)) == 'b'); + + typedef result_of::begin::type first_iterator; + typedef result_of::value_of::type first_element; + + typedef result_of::at_c::type e0; + typedef result_of::at_c::type e2; + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + + BOOST_TEST(size(front(v)) == 3); + + typedef result_of::value_at_c::type first_value_at; + typedef result_of::value_at_c::type v0; + typedef result_of::value_at_c::type v2; + + BOOST_MPL_ASSERT((boost::is_same)); + BOOST_MPL_ASSERT((boost::is_same)); + + BOOST_TEST(at_c<0>(at_c<0>(v)) == 1); + BOOST_TEST(at_c<2>(at_c<0>(v)) == 'a'); + } + return boost::report_errors(); +} diff --git a/todo.txt b/todo.txt new file mode 100644 index 00000000..c1e0df08 --- /dev/null +++ b/todo.txt @@ -0,0 +1,161 @@ +* Consider object equivalent of functions and algorithms (so you can do + transform(iterators, deref()) with needing to put together a wrapper for deref). + +* Make algorithms work with mutable data + +* Consider segmented sequence / algorithm support + +* Consider utility element_ref::type thats consts and refs as appropriate + +* Improved motivation section + +* Expand details of view concept + +* Examples, examples, examples + +* look at lambda stuff + +* Complete the fusion/include/ directory containing a flat list of + include files for all the modules and components. + +* The error messages when e.g. the function is not set as const are difficult + to decipher. e.g. transform(s, f) <<- where f has a non-const operator() + +* mpl, fusion, container type preserving operations incompatible + -- shall we consider container-type preserving variations of the + functions/algorithms? + + How about making joint_view Concept preserving? This way push/pop/front/back + will return a view of the same Concept. - tosh + +* map_tie is implemented. It seems not yet documented? - Dan: done now! + +* multi_set, multi_map? + +* why is insert_range not spelled insert_sequence ? + +* Document the new fusion extension mechanisms + ->iterator_facade + ->sequence_facade + +* David A: + Wouldn't extension be a lot easier if iterator_base and sequence_base + took (optional) 2nd arguments that specify the tag? Then you wouldn't + need that whole dance that enables tag dispatching (right?) + +* David A: is_iterator isn't documented? + JDG: There is no is_iterator ;) There is is_fusion_iterator, but it should + probably be placed in detail. + +* for_each takes the function object by reference to const, so you have to + const qualify operator() and make the data members mutable so you can change + them anyway. + Eric N: IMO, this is a bug in Fusion. There should be an overload of for_each + that takes a function object by non-const reference. Stateful predicates should + be supported, and Fusion should be explicit about where and when predicates + are copied, so that the state doesn't get messed up. + +* Make Boost.parameters library's ArgumentPacks a conforming fusion sequence + +* Optimize container performance with typeof / compiler defect typeof. In particular + improve the performance of the prototype deque implementation. + +* Deque docs if we decide we like it + +* Rewrite the whole extension docs section. More formal docs of extension point, + example to use the various facade types, rather than hand coding everything. + +* zip optimization - Zip is rather compiler heavy, try and reduce the likelihood + of compilers like msvc7 hitting internal compiler limits + +* Document the unused support added to zip for Hartmut. + +* Rationalize support/unused.hpp and the ignore stuff needed for tie etc. + +* Why do we need to set FUSION_MAX_VECTOR_SIZE when we set + FUSION_MAX_MAP_SIZE? Setting FUSION_MAX_MAP_SIZE should be enough. + +tosh: + +* Document Incrementable / Single Pass Concepts +* Provide infinity-aware default implementation for Incrementable Sequences + + Thoughts: It would probably be cleaner to have infinity conceptually + orthogonal so there can be infinite Bidi/RA/Assoc Sequences. + OTOH it complicates things in way that might not be worth it... + +* Implement always_view/always with repetitive_view > + semantics - using repetitive_view will for this purpose will be way + too much overhead. + +? Functional wrappers for intrinsics/algorithms. + +* Rewrite functional benchmark + +========================================================== + +From the fusion review (please mark all done items): + +The following comments refer to issues that the library authors should +address prior to merging the library into CVS: + +* Documentation: Many of the reviewers stated that they would like to + see more tutorial documentation that demonstrates not only what the + particular constructs in Fusion do, but also how they are expected + to be used. A reasonably concise motivating example has been + requested. It has already been pointed out that Fusion is used for + some other boost libraries. A well-developed and self-contained + case study of when and how to use Fusion would be greatly + appreciated. The relationship between this library and the current + Boost.Tuple library, as well as Boost.Mpl, should be discussed. The + reference documentation is quite thorough and detailed comments + regarding them have already been addressed by the authors. However + the notion of "views" requires greater documentation. The + examples in the algorithm sections currently do little more than + demonstrate the syntax by which they can be called. Examples that + more specifically express intent would be a notable + improvement. (see for example Matt Austern's "Generic Programming + and the STL"). In general the documentation would benefit from + copy-editing. + +* Several commented on the use of the name "pair" for the fusion type + that has typedefs for two types but only contains the second type. + Although the typedefs and member names are consistent with the + std::pair object, the name "pair" is confusing. The + compile-time/run-time hybrid nature of this library makes it + difficult to find perfect metaphors for constructs in the library. + In this case, it seems better to find a term for this template (and + the concept that it models) that more directly states its purpose. + The name "tag_of" would also benefit from renaming. + +* The behavior of Fusion functions in the face of argument-dependent + lookup (ADL) is not well specified. This should be made + explicit in the reference documentation. + +The following comments refer to issues that, while not mandatory, +deserve consideration: + +* The library name "Fusion", though not arbitrary, says little about + the library's purpose. There is precedent for this within boost, + however. A name change is not mandatory for the + library's acceptance, but it would be worth while for the authors to + consider a more telling name. + + Dan - I like the name Fusion, and there is precendent for less direct + library names like Spirit and Xpressive in Boost. (And Boost is not + exactly an explicit name either). + +* The mechanism for extending Fusion with new containers and iterators + is complex and involves implementing a number of components, + especially regarding iterators. An adaptation layer that is + analogous to the Boost.Iterator library would be a fine addition to + Fusion. + + Dan - Joel added iterator and container adapters, still to be documented + as part of the improved extension docs to be done by me. + +* It would be beneficial to supply Boost.Serialization support for the + Fusion container types. I am sure, as mentioned, that the authors + of this library would accept a volunteer to implement this + functionality. + From fc57a566cb8326278de633beba8d57bb3c5ab85a Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sat, 20 Oct 2007 23:59:59 +0000 Subject: [PATCH 04/14] creating branch for fusion 2.1 [SVN r40232] --- 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 From 7a6e82b7cfb711a9aff63b418972b993640328e0 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 00:47:59 +0000 Subject: [PATCH 05/14] Removed file/folder [SVN r40234] --- 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 deletions(-) delete mode 100644 include/boost/fusion/adapted.hpp delete mode 100644 include/boost/fusion/adapted/array.hpp delete mode 100644 include/boost/fusion/adapted/array/array_iterator.hpp delete mode 100644 include/boost/fusion/adapted/array/detail/at_impl.hpp delete mode 100644 include/boost/fusion/adapted/array/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/adapted/array/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/adapted/array/detail/end_impl.hpp delete mode 100644 include/boost/fusion/adapted/array/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/adapted/array/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/adapted/array/detail/size_impl.hpp delete mode 100644 include/boost/fusion/adapted/array/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/adapted/array/tag_of.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/adapted/boost_tuple/tag_of.hpp delete mode 100644 include/boost/fusion/adapted/mpl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/at_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/empty_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/end_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/size_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/adapted/mpl/mpl_iterator.hpp delete mode 100644 include/boost/fusion/adapted/std_pair.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/detail/at_impl.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/detail/end_impl.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/detail/size_impl.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/std_pair_iterator.hpp delete mode 100644 include/boost/fusion/adapted/std_pair/tag_of.hpp delete mode 100644 include/boost/fusion/adapted/struct.hpp delete mode 100644 include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp delete mode 100644 include/boost/fusion/adapted/struct/adapt_struct.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/at_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/at_key_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/end_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/has_key_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/size_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/detail/value_at_key_impl.hpp delete mode 100644 include/boost/fusion/adapted/struct/extension.hpp delete mode 100644 include/boost/fusion/adapted/struct/struct_iterator.hpp delete mode 100644 include/boost/fusion/adapted/variant.hpp delete mode 100644 include/boost/fusion/adapted/variant/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/adapted/variant/detail/category_of_impl.hpp delete mode 100644 include/boost/fusion/adapted/variant/detail/end_impl.hpp delete mode 100644 include/boost/fusion/adapted/variant/detail/is_sequence_impl.hpp delete mode 100644 include/boost/fusion/adapted/variant/detail/is_view_impl.hpp delete mode 100644 include/boost/fusion/adapted/variant/detail/size_impl.hpp delete mode 100644 include/boost/fusion/adapted/variant/tag_of.hpp delete mode 100644 include/boost/fusion/adapted/variant/variant_iterator.hpp delete mode 100644 include/boost/fusion/algorithm.hpp delete mode 100644 include/boost/fusion/algorithm/iteration.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/accumulate.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/detail/fold.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/detail/for_each.hpp delete mode 100755 include/boost/fusion/algorithm/iteration/ext_/for_each_s.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/fold.hpp delete mode 100644 include/boost/fusion/algorithm/iteration/for_each.hpp delete mode 100644 include/boost/fusion/algorithm/query.hpp delete mode 100644 include/boost/fusion/algorithm/query/all.hpp delete mode 100644 include/boost/fusion/algorithm/query/any.hpp delete mode 100644 include/boost/fusion/algorithm/query/count.hpp delete mode 100644 include/boost/fusion/algorithm/query/count_if.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/all.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/any.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/assoc_find.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/count.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/count_if.hpp delete mode 100644 include/boost/fusion/algorithm/query/detail/find_if.hpp delete mode 100755 include/boost/fusion/algorithm/query/ext_/find_if_s.hpp delete mode 100644 include/boost/fusion/algorithm/query/find.hpp delete mode 100644 include/boost/fusion/algorithm/query/find_if.hpp delete mode 100644 include/boost/fusion/algorithm/query/none.hpp delete mode 100644 include/boost/fusion/algorithm/transformation.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/clear.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/detail/replace.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/detail/replace_if.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/erase.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/erase_key.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/filter.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/filter_if.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/insert.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/insert_range.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/join.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/pop_back.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/pop_front.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/push_back.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/push_front.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/remove.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/remove_if.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/replace.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/replace_if.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/reverse.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/transform.hpp delete mode 100644 include/boost/fusion/algorithm/transformation/zip.hpp delete mode 100644 include/boost/fusion/container.hpp delete mode 100644 include/boost/fusion/container/deque.hpp delete mode 100644 include/boost/fusion/container/deque/back_extended_deque.hpp delete mode 100644 include/boost/fusion/container/deque/convert.hpp delete mode 100644 include/boost/fusion/container/deque/deque.hpp delete mode 100644 include/boost/fusion/container/deque/deque_fwd.hpp delete mode 100644 include/boost/fusion/container/deque/deque_iterator.hpp delete mode 100644 include/boost/fusion/container/deque/detail/as_deque.hpp delete mode 100644 include/boost/fusion/container/deque/detail/at_impl.hpp delete mode 100644 include/boost/fusion/container/deque/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/container/deque/detail/convert_impl.hpp delete mode 100644 include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp delete mode 100644 include/boost/fusion/container/deque/detail/deque_initial_size.hpp delete mode 100644 include/boost/fusion/container/deque/detail/deque_keyed_values.hpp delete mode 100644 include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp delete mode 100644 include/boost/fusion/container/deque/detail/end_impl.hpp delete mode 100644 include/boost/fusion/container/deque/detail/keyed_element.hpp delete mode 100644 include/boost/fusion/container/deque/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/container/deque/front_extended_deque.hpp delete mode 100644 include/boost/fusion/container/deque/limits.hpp delete mode 100755 include/boost/fusion/container/ext_/tree.hpp delete mode 100644 include/boost/fusion/container/list.hpp delete mode 100644 include/boost/fusion/container/list/cons.hpp delete mode 100644 include/boost/fusion/container/list/cons_iterator.hpp delete mode 100644 include/boost/fusion/container/list/convert.hpp delete mode 100644 include/boost/fusion/container/list/detail/at_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/build_cons.hpp delete mode 100644 include/boost/fusion/container/list/detail/convert_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/empty_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/end_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/list_forward_ctor.hpp delete mode 100644 include/boost/fusion/container/list/detail/list_to_cons.hpp delete mode 100644 include/boost/fusion/container/list/detail/list_to_cons_call.hpp delete mode 100644 include/boost/fusion/container/list/detail/next_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/container/list/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/container/list/limits.hpp delete mode 100644 include/boost/fusion/container/list/list.hpp delete mode 100644 include/boost/fusion/container/list/list_fwd.hpp delete mode 100644 include/boost/fusion/container/map.hpp delete mode 100644 include/boost/fusion/container/map/convert.hpp delete mode 100644 include/boost/fusion/container/map/detail/as_map.hpp delete mode 100644 include/boost/fusion/container/map/detail/at_key_impl.hpp delete mode 100644 include/boost/fusion/container/map/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/container/map/detail/convert_impl.hpp delete mode 100644 include/boost/fusion/container/map/detail/end_impl.hpp delete mode 100644 include/boost/fusion/container/map/detail/lookup_key.hpp delete mode 100644 include/boost/fusion/container/map/detail/map_forward_ctor.hpp delete mode 100644 include/boost/fusion/container/map/detail/map_lookup.hpp delete mode 100644 include/boost/fusion/container/map/detail/value_at_key_impl.hpp delete mode 100644 include/boost/fusion/container/map/limits.hpp delete mode 100644 include/boost/fusion/container/map/map.hpp delete mode 100644 include/boost/fusion/container/map/map_fwd.hpp delete mode 100644 include/boost/fusion/container/set.hpp delete mode 100644 include/boost/fusion/container/set/convert.hpp delete mode 100644 include/boost/fusion/container/set/detail/as_set.hpp delete mode 100644 include/boost/fusion/container/set/detail/at_key_impl.hpp delete mode 100644 include/boost/fusion/container/set/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/container/set/detail/convert_impl.hpp delete mode 100644 include/boost/fusion/container/set/detail/end_impl.hpp delete mode 100644 include/boost/fusion/container/set/detail/lookup_key.hpp delete mode 100644 include/boost/fusion/container/set/detail/set_forward_ctor.hpp delete mode 100644 include/boost/fusion/container/set/detail/set_lookup.hpp delete mode 100644 include/boost/fusion/container/set/detail/value_at_key_impl.hpp delete mode 100644 include/boost/fusion/container/set/limits.hpp delete mode 100644 include/boost/fusion/container/set/set.hpp delete mode 100644 include/boost/fusion/container/set/set_fwd.hpp delete mode 100644 include/boost/fusion/container/vector.hpp delete mode 100644 include/boost/fusion/container/vector/convert.hpp delete mode 100644 include/boost/fusion/container/vector/detail/advance_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/as_vector.hpp delete mode 100644 include/boost/fusion/container/vector/detail/at_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/convert_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/distance_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/end_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/next_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/prior_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp delete mode 100644 include/boost/fusion/container/vector/detail/vector_n.hpp delete mode 100644 include/boost/fusion/container/vector/detail/vector_n_chooser.hpp delete mode 100644 include/boost/fusion/container/vector/limits.hpp delete mode 100644 include/boost/fusion/container/vector/vector.hpp delete mode 100644 include/boost/fusion/container/vector/vector10.hpp delete mode 100644 include/boost/fusion/container/vector/vector20.hpp delete mode 100644 include/boost/fusion/container/vector/vector30.hpp delete mode 100644 include/boost/fusion/container/vector/vector40.hpp delete mode 100644 include/boost/fusion/container/vector/vector50.hpp delete mode 100644 include/boost/fusion/container/vector/vector_fwd.hpp delete mode 100644 include/boost/fusion/container/vector/vector_iterator.hpp delete mode 100644 include/boost/fusion/functional.hpp delete mode 100644 include/boost/fusion/functional/adapter.hpp delete mode 100644 include/boost/fusion/functional/adapter/detail/access.hpp delete mode 100644 include/boost/fusion/functional/adapter/detail/pow2_explode.hpp delete mode 100644 include/boost/fusion/functional/adapter/detail/pt_def.hpp delete mode 100644 include/boost/fusion/functional/adapter/detail/pt_undef.hpp delete mode 100644 include/boost/fusion/functional/adapter/fused.hpp delete mode 100644 include/boost/fusion/functional/adapter/fused_function_object.hpp delete mode 100644 include/boost/fusion/functional/adapter/fused_procedure.hpp delete mode 100644 include/boost/fusion/functional/adapter/limits.hpp delete mode 100644 include/boost/fusion/functional/adapter/unfused_generic.hpp delete mode 100644 include/boost/fusion/functional/adapter/unfused_lvalue_args.hpp delete mode 100644 include/boost/fusion/functional/adapter/unfused_rvalue_args.hpp delete mode 100644 include/boost/fusion/functional/adapter/unfused_typed.hpp delete mode 100644 include/boost/fusion/functional/generation.hpp delete mode 100644 include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp delete mode 100644 include/boost/fusion/functional/generation/make_fused.hpp delete mode 100644 include/boost/fusion/functional/generation/make_fused_function_object.hpp delete mode 100644 include/boost/fusion/functional/generation/make_fused_procedure.hpp delete mode 100644 include/boost/fusion/functional/generation/make_unfused_generic.hpp delete mode 100644 include/boost/fusion/functional/generation/make_unfused_lvalue_args.hpp delete mode 100644 include/boost/fusion/functional/generation/make_unfused_rvalue_args.hpp delete mode 100644 include/boost/fusion/functional/invocation.hpp delete mode 100644 include/boost/fusion/functional/invocation/detail/that_ptr.hpp delete mode 100644 include/boost/fusion/functional/invocation/invoke.hpp delete mode 100644 include/boost/fusion/functional/invocation/invoke_function_object.hpp delete mode 100644 include/boost/fusion/functional/invocation/invoke_procedure.hpp delete mode 100644 include/boost/fusion/functional/invocation/limits.hpp delete mode 100644 include/boost/fusion/include/adapt_struct.hpp delete mode 100644 include/boost/fusion/include/any.hpp delete mode 100644 include/boost/fusion/include/as_vector.hpp delete mode 100644 include/boost/fusion/include/at.hpp delete mode 100644 include/boost/fusion/include/begin.hpp delete mode 100644 include/boost/fusion/include/deref.hpp delete mode 100644 include/boost/fusion/include/end.hpp delete mode 100644 include/boost/fusion/include/equal_to.hpp delete mode 100644 include/boost/fusion/include/filter_if.hpp delete mode 100644 include/boost/fusion/include/for_each.hpp delete mode 100644 include/boost/fusion/include/io.hpp delete mode 100644 include/boost/fusion/include/is_sequence.hpp delete mode 100644 include/boost/fusion/include/join.hpp delete mode 100644 include/boost/fusion/include/joint_view.hpp delete mode 100644 include/boost/fusion/include/list.hpp delete mode 100644 include/boost/fusion/include/make_cons.hpp delete mode 100644 include/boost/fusion/include/make_vector.hpp delete mode 100644 include/boost/fusion/include/mpl.hpp delete mode 100644 include/boost/fusion/include/next.hpp delete mode 100644 include/boost/fusion/include/push_front.hpp delete mode 100644 include/boost/fusion/include/single_view.hpp delete mode 100644 include/boost/fusion/include/std_pair.hpp delete mode 100644 include/boost/fusion/include/swap.hpp delete mode 100644 include/boost/fusion/include/transform.hpp delete mode 100644 include/boost/fusion/include/transform_view.hpp delete mode 100644 include/boost/fusion/include/value_at.hpp delete mode 100644 include/boost/fusion/include/value_of.hpp delete mode 100644 include/boost/fusion/include/variant.hpp delete mode 100644 include/boost/fusion/include/vector.hpp delete mode 100644 include/boost/fusion/include/vector_tie.hpp delete mode 100644 include/boost/fusion/iterator.hpp delete mode 100644 include/boost/fusion/iterator/advance.hpp delete mode 100644 include/boost/fusion/iterator/deref.hpp delete mode 100644 include/boost/fusion/iterator/detail/adapt_deref_traits.hpp delete mode 100644 include/boost/fusion/iterator/detail/adapt_value_traits.hpp delete mode 100644 include/boost/fusion/iterator/detail/advance.hpp delete mode 100644 include/boost/fusion/iterator/detail/distance.hpp delete mode 100644 include/boost/fusion/iterator/distance.hpp delete mode 100644 include/boost/fusion/iterator/equal_to.hpp delete mode 100644 include/boost/fusion/iterator/iterator_facade.hpp delete mode 100644 include/boost/fusion/iterator/mpl.hpp delete mode 100644 include/boost/fusion/iterator/mpl/convert_iterator.hpp delete mode 100644 include/boost/fusion/iterator/mpl/fusion_iterator.hpp delete mode 100644 include/boost/fusion/iterator/next.hpp delete mode 100644 include/boost/fusion/iterator/prior.hpp delete mode 100644 include/boost/fusion/iterator/value_of.hpp delete mode 100644 include/boost/fusion/mpl.hpp delete mode 100644 include/boost/fusion/mpl/at.hpp delete mode 100644 include/boost/fusion/mpl/back.hpp delete mode 100644 include/boost/fusion/mpl/begin.hpp delete mode 100644 include/boost/fusion/mpl/clear.hpp delete mode 100644 include/boost/fusion/mpl/detail/clear.hpp delete mode 100644 include/boost/fusion/mpl/empty.hpp delete mode 100644 include/boost/fusion/mpl/end.hpp delete mode 100644 include/boost/fusion/mpl/erase.hpp delete mode 100644 include/boost/fusion/mpl/erase_key.hpp delete mode 100644 include/boost/fusion/mpl/front.hpp delete mode 100644 include/boost/fusion/mpl/has_key.hpp delete mode 100644 include/boost/fusion/mpl/insert.hpp delete mode 100644 include/boost/fusion/mpl/insert_range.hpp delete mode 100644 include/boost/fusion/mpl/pop_back.hpp delete mode 100644 include/boost/fusion/mpl/pop_front.hpp delete mode 100644 include/boost/fusion/mpl/push_back.hpp delete mode 100644 include/boost/fusion/mpl/push_front.hpp delete mode 100644 include/boost/fusion/mpl/size.hpp delete mode 100644 include/boost/fusion/sequence.hpp delete mode 100644 include/boost/fusion/sequence/comparison.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/enable_comparison.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/equal_to.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/greater.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/greater_equal.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/less.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/less_equal.hpp delete mode 100644 include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp delete mode 100644 include/boost/fusion/sequence/comparison/equal_to.hpp delete mode 100644 include/boost/fusion/sequence/comparison/greater.hpp delete mode 100644 include/boost/fusion/sequence/comparison/greater_equal.hpp delete mode 100644 include/boost/fusion/sequence/comparison/less.hpp delete mode 100644 include/boost/fusion/sequence/comparison/less_equal.hpp delete mode 100644 include/boost/fusion/sequence/comparison/not_equal_to.hpp delete mode 100644 include/boost/fusion/sequence/convert.hpp delete mode 100644 include/boost/fusion/sequence/generation.hpp delete mode 100644 include/boost/fusion/sequence/generation/cons_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/deque_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/ignore.hpp delete mode 100644 include/boost/fusion/sequence/generation/list_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_cons.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_deque.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_list.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_map.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_set.hpp delete mode 100644 include/boost/fusion/sequence/generation/make_vector.hpp delete mode 100644 include/boost/fusion/sequence/generation/map_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/pair_tie.hpp delete mode 100644 include/boost/fusion/sequence/generation/vector_tie.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/at.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/at_key.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/back.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/begin.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/empty.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/end.hpp delete mode 100755 include/boost/fusion/sequence/intrinsic/ext_/segments.hpp delete mode 100755 include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/front.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/has_key.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/size.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/swap.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/value_at.hpp delete mode 100644 include/boost/fusion/sequence/intrinsic/value_at_key.hpp delete mode 100644 include/boost/fusion/sequence/io.hpp delete mode 100644 include/boost/fusion/sequence/io/detail/in.hpp delete mode 100644 include/boost/fusion/sequence/io/detail/manip.hpp delete mode 100644 include/boost/fusion/sequence/io/detail/out.hpp delete mode 100644 include/boost/fusion/sequence/io/in.hpp delete mode 100644 include/boost/fusion/sequence/io/out.hpp delete mode 100644 include/boost/fusion/sequence/sequence_facade.hpp delete mode 100644 include/boost/fusion/sequence/utility.hpp delete mode 100644 include/boost/fusion/support.hpp delete mode 100644 include/boost/fusion/support/category_of.hpp delete mode 100644 include/boost/fusion/support/deduce.hpp delete mode 100644 include/boost/fusion/support/deduce_sequence.hpp delete mode 100644 include/boost/fusion/support/detail/access.hpp delete mode 100644 include/boost/fusion/support/detail/as_fusion_element.hpp delete mode 100644 include/boost/fusion/support/detail/category_of.hpp delete mode 100644 include/boost/fusion/support/detail/is_mpl_sequence.hpp delete mode 100644 include/boost/fusion/support/detail/is_view.hpp delete mode 100644 include/boost/fusion/support/detail/mpl_iterator_category.hpp delete mode 100644 include/boost/fusion/support/detail/unknown_key.hpp delete mode 100755 include/boost/fusion/support/ext_/is_segmented.hpp delete mode 100644 include/boost/fusion/support/is_iterator.hpp delete mode 100644 include/boost/fusion/support/is_sequence.hpp delete mode 100644 include/boost/fusion/support/is_view.hpp delete mode 100644 include/boost/fusion/support/iterator_base.hpp delete mode 100644 include/boost/fusion/support/pair.hpp delete mode 100644 include/boost/fusion/support/sequence_base.hpp delete mode 100644 include/boost/fusion/support/tag_of.hpp delete mode 100644 include/boost/fusion/support/tag_of_fwd.hpp delete mode 100644 include/boost/fusion/support/unused.hpp delete mode 100644 include/boost/fusion/support/void.hpp delete mode 100644 include/boost/fusion/tuple.hpp delete mode 100644 include/boost/fusion/tuple/detail/tuple_forward_ctor.hpp delete mode 100644 include/boost/fusion/tuple/make_tuple.hpp delete mode 100644 include/boost/fusion/tuple/tuple.hpp delete mode 100644 include/boost/fusion/tuple/tuple_fwd.hpp delete mode 100644 include/boost/fusion/tuple/tuple_tie.hpp delete mode 100644 include/boost/fusion/view.hpp delete mode 100755 include/boost/fusion/view/ext_/multiple_view.hpp delete mode 100755 include/boost/fusion/view/ext_/segmented_iterator.hpp delete mode 100755 include/boost/fusion/view/ext_/segmented_iterator_range.hpp delete mode 100644 include/boost/fusion/view/filter_view.hpp delete mode 100644 include/boost/fusion/view/filter_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/view/filter_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/view/filter_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/view/filter_view/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/view/filter_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/view/filter_view/detail/size_impl.hpp delete mode 100644 include/boost/fusion/view/filter_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/view/filter_view/filter_view.hpp delete mode 100644 include/boost/fusion/view/filter_view/filter_view_iterator.hpp delete mode 100644 include/boost/fusion/view/iterator_range.hpp delete mode 100644 include/boost/fusion/view/iterator_range/detail/at_impl.hpp delete mode 100644 include/boost/fusion/view/iterator_range/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/view/iterator_range/detail/end_impl.hpp delete mode 100644 include/boost/fusion/view/iterator_range/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/view/iterator_range/iterator_range.hpp delete mode 100644 include/boost/fusion/view/joint_view.hpp delete mode 100644 include/boost/fusion/view/joint_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/view/joint_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/view/joint_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/view/joint_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/view/joint_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/view/joint_view/joint_view.hpp delete mode 100644 include/boost/fusion/view/joint_view/joint_view_iterator.hpp delete mode 100644 include/boost/fusion/view/repetitive_view.hpp delete mode 100644 include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/view/repetitive_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/view/repetitive_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/view/repetitive_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/view/repetitive_view/repetitive_view.hpp delete mode 100644 include/boost/fusion/view/repetitive_view/repetitive_view_fwd.hpp delete mode 100644 include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp delete mode 100644 include/boost/fusion/view/reverse_view.hpp delete mode 100644 include/boost/fusion/view/reverse_view/detail/advance_impl.hpp delete mode 100644 include/boost/fusion/view/reverse_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/view/reverse_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/view/reverse_view/detail/distance_impl.hpp delete mode 100644 include/boost/fusion/view/reverse_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/view/reverse_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/view/reverse_view/detail/prior_impl.hpp delete mode 100644 include/boost/fusion/view/reverse_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/view/reverse_view/reverse_view.hpp delete mode 100644 include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp delete mode 100644 include/boost/fusion/view/single_view.hpp delete mode 100644 include/boost/fusion/view/single_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/view/single_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/view/single_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/view/single_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/view/single_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/view/single_view/single_view.hpp delete mode 100644 include/boost/fusion/view/single_view/single_view_iterator.hpp delete mode 100644 include/boost/fusion/view/transform_view.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/advance_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/apply_transform_result.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/at_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/distance_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/prior_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/view/transform_view/transform_view.hpp delete mode 100644 include/boost/fusion/view/transform_view/transform_view_fwd.hpp delete mode 100644 include/boost/fusion/view/transform_view/transform_view_iterator.hpp delete mode 100644 include/boost/fusion/view/zip_view.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/advance_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/at_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/begin_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/deref_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/distance_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/end_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/equal_to_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/next_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/prior_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/size_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/strictest_traversal.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/value_at_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/detail/value_of_impl.hpp delete mode 100644 include/boost/fusion/view/zip_view/zip_view.hpp delete mode 100644 include/boost/fusion/view/zip_view/zip_view_iterator.hpp delete 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 deleted file mode 100644 index 23693645..00000000 --- a/include/boost/fusion/adapted.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2be9d4ba..00000000 --- a/include/boost/fusion/adapted/array.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dbad7763..00000000 --- a/include/boost/fusion/adapted/array/array_iterator.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3c427059..00000000 --- a/include/boost/fusion/adapted/array/detail/at_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 06dc8c51..00000000 --- a/include/boost/fusion/adapted/array/detail/begin_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4c6b040e..00000000 --- a/include/boost/fusion/adapted/array/detail/category_of_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c9432c9b..00000000 --- a/include/boost/fusion/adapted/array/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a248c314..00000000 --- a/include/boost/fusion/adapted/array/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bc821fa6..00000000 --- a/include/boost/fusion/adapted/array/detail/is_view_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 63661573..00000000 --- a/include/boost/fusion/adapted/array/detail/size_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f465b1d6..00000000 --- a/include/boost/fusion/adapted/array/detail/value_at_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 96f6d35c..00000000 --- a/include/boost/fusion/adapted/array/tag_of.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2924df07..00000000 --- a/include/boost/fusion/adapted/boost_tuple.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index fca135e5..00000000 --- a/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp +++ /dev/null @@ -1,149 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b594dfd8..00000000 --- a/include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ee9a89eb..00000000 --- a/include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 34f48b1e..00000000 --- a/include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2fb27a7a..00000000 --- a/include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 43d73115..00000000 --- a/include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2927df7b..00000000 --- a/include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 167a5035..00000000 --- a/include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d46d51e5..00000000 --- a/include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a1a27aa7..00000000 --- a/include/boost/fusion/adapted/boost_tuple/tag_of.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f8257846..00000000 --- a/include/boost/fusion/adapted/mpl.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6f3be1c6..00000000 --- a/include/boost/fusion/adapted/mpl/detail/at_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1ec77d8b..00000000 --- a/include/boost/fusion/adapted/mpl/detail/begin_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ad68fcc9..00000000 --- a/include/boost/fusion/adapted/mpl/detail/category_of_impl.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 14e8dfa2..00000000 --- a/include/boost/fusion/adapted/mpl/detail/empty_impl.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e3466956..00000000 --- a/include/boost/fusion/adapted/mpl/detail/end_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bfecbc73..00000000 --- a/include/boost/fusion/adapted/mpl/detail/has_key_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bf9b349c..00000000 --- a/include/boost/fusion/adapted/mpl/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5ae48c90..00000000 --- a/include/boost/fusion/adapted/mpl/detail/is_view_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 62893517..00000000 --- a/include/boost/fusion/adapted/mpl/detail/size_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f39e4eb..00000000 --- a/include/boost/fusion/adapted/mpl/detail/value_at_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c99b5804..00000000 --- a/include/boost/fusion/adapted/mpl/mpl_iterator.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d13b810a..00000000 --- a/include/boost/fusion/adapted/std_pair.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2f26fa68..00000000 --- a/include/boost/fusion/adapted/std_pair/detail/at_impl.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1fd48f51..00000000 --- a/include/boost/fusion/adapted/std_pair/detail/begin_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f207c1c7..00000000 --- a/include/boost/fusion/adapted/std_pair/detail/category_of_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 747f2c6f..00000000 --- a/include/boost/fusion/adapted/std_pair/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1c669a68..00000000 --- a/include/boost/fusion/adapted/std_pair/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 94842bc0..00000000 --- a/include/boost/fusion/adapted/std_pair/detail/is_view_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f35bffd..00000000 --- a/include/boost/fusion/adapted/std_pair/detail/size_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 16047ec9..00000000 --- a/include/boost/fusion/adapted/std_pair/detail/value_at_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4aa2daa2..00000000 --- a/include/boost/fusion/adapted/std_pair/std_pair_iterator.hpp +++ /dev/null @@ -1,127 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3211efad..00000000 --- a/include/boost/fusion/adapted/std_pair/tag_of.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4b36f179..00000000 --- a/include/boost/fusion/adapted/struct.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e621187f..00000000 --- a/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e8eb6a67..00000000 --- a/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 809902ae..00000000 --- a/include/boost/fusion/adapted/struct/detail/at_impl.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4ce0fce9..00000000 --- a/include/boost/fusion/adapted/struct/detail/at_key_impl.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bf5a00bc..00000000 --- a/include/boost/fusion/adapted/struct/detail/begin_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9e7f9df4..00000000 --- a/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 42d7f394..00000000 --- a/include/boost/fusion/adapted/struct/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8972f5df..00000000 --- a/include/boost/fusion/adapted/struct/detail/has_key_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f81e9fb6..00000000 --- a/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index da6f380b..00000000 --- a/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 12ec14ba..00000000 --- a/include/boost/fusion/adapted/struct/detail/size_impl.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8f5d97a0..00000000 --- a/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b1b3dcfb..00000000 --- a/include/boost/fusion/adapted/struct/detail/value_at_key_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index da084498..00000000 --- a/include/boost/fusion/adapted/struct/extension.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index caea895b..00000000 --- a/include/boost/fusion/adapted/struct/struct_iterator.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5e711c17..00000000 --- a/include/boost/fusion/adapted/variant.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dc9e2e7f..00000000 --- a/include/boost/fusion/adapted/variant/detail/begin_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d81d9b3b..00000000 --- a/include/boost/fusion/adapted/variant/detail/category_of_impl.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 622df47f..00000000 --- a/include/boost/fusion/adapted/variant/detail/end_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 132f88a1..00000000 --- a/include/boost/fusion/adapted/variant/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d58dbd3c..00000000 --- a/include/boost/fusion/adapted/variant/detail/is_view_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 379bac32..00000000 --- a/include/boost/fusion/adapted/variant/detail/size_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3ec31460..00000000 --- a/include/boost/fusion/adapted/variant/tag_of.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9372002c..00000000 --- a/include/boost/fusion/adapted/variant/variant_iterator.hpp +++ /dev/null @@ -1,117 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 74e52723..00000000 --- a/include/boost/fusion/algorithm.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5d0fefa0..00000000 --- a/include/boost/fusion/algorithm/iteration.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3d0685f7..00000000 --- a/include/boost/fusion/algorithm/iteration/accumulate.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 542a8114..00000000 --- a/include/boost/fusion/algorithm/iteration/detail/fold.hpp +++ /dev/null @@ -1,271 +0,0 @@ -#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 deleted file mode 100644 index a23517c8..00000000 --- a/include/boost/fusion/algorithm/iteration/detail/for_each.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 9e571d0f..00000000 --- a/include/boost/fusion/algorithm/iteration/ext_/for_each_s.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 75c63b8f..00000000 --- a/include/boost/fusion/algorithm/iteration/fold.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index fffb0f00..00000000 --- a/include/boost/fusion/algorithm/iteration/for_each.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 488a62a8..00000000 --- a/include/boost/fusion/algorithm/query.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9d78867c..00000000 --- a/include/boost/fusion/algorithm/query/all.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index be4ef099..00000000 --- a/include/boost/fusion/algorithm/query/any.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 27e3370e..00000000 --- a/include/boost/fusion/algorithm/query/count.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a080b3b2..00000000 --- a/include/boost/fusion/algorithm/query/count_if.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 979cfb11..00000000 --- a/include/boost/fusion/algorithm/query/detail/all.hpp +++ /dev/null @@ -1,127 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 31bbaa58..00000000 --- a/include/boost/fusion/algorithm/query/detail/any.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7591405f..00000000 --- a/include/boost/fusion/algorithm/query/detail/assoc_find.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ff17adbd..00000000 --- a/include/boost/fusion/algorithm/query/detail/count.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d270b591..00000000 --- a/include/boost/fusion/algorithm/query/detail/count_if.hpp +++ /dev/null @@ -1,170 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cf0cc6b7..00000000 --- a/include/boost/fusion/algorithm/query/detail/find_if.hpp +++ /dev/null @@ -1,252 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 82c20b4c..00000000 --- a/include/boost/fusion/algorithm/query/ext_/find_if_s.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ece8cdd6..00000000 --- a/include/boost/fusion/algorithm/query/find.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4340d688..00000000 --- a/include/boost/fusion/algorithm/query/find_if.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f31f4c9c..00000000 --- a/include/boost/fusion/algorithm/query/none.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0757b5ee..00000000 --- a/include/boost/fusion/algorithm/transformation.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 75328232..00000000 --- a/include/boost/fusion/algorithm/transformation/clear.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9e20f79f..00000000 --- a/include/boost/fusion/algorithm/transformation/detail/replace.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index db0434c6..00000000 --- a/include/boost/fusion/algorithm/transformation/detail/replace_if.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d0405c30..00000000 --- a/include/boost/fusion/algorithm/transformation/erase.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dcdc6f09..00000000 --- a/include/boost/fusion/algorithm/transformation/erase_key.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 52bf6af3..00000000 --- a/include/boost/fusion/algorithm/transformation/filter.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d13113b1..00000000 --- a/include/boost/fusion/algorithm/transformation/filter_if.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1702bc19..00000000 --- a/include/boost/fusion/algorithm/transformation/insert.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1915c413..00000000 --- a/include/boost/fusion/algorithm/transformation/insert_range.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4ed78b5f..00000000 --- a/include/boost/fusion/algorithm/transformation/join.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6eb743fd..00000000 --- a/include/boost/fusion/algorithm/transformation/pop_back.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index aed524d3..00000000 --- a/include/boost/fusion/algorithm/transformation/pop_front.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4fadc79c..00000000 --- a/include/boost/fusion/algorithm/transformation/push_back.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 10f9fc10..00000000 --- a/include/boost/fusion/algorithm/transformation/push_front.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 01718d32..00000000 --- a/include/boost/fusion/algorithm/transformation/remove.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ab13694d..00000000 --- a/include/boost/fusion/algorithm/transformation/remove_if.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 780f1a45..00000000 --- a/include/boost/fusion/algorithm/transformation/replace.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 90db5683..00000000 --- a/include/boost/fusion/algorithm/transformation/replace_if.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b95461c8..00000000 --- a/include/boost/fusion/algorithm/transformation/reverse.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d9f06e7c..00000000 --- a/include/boost/fusion/algorithm/transformation/transform.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a2f66bfd..00000000 --- a/include/boost/fusion/algorithm/transformation/zip.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e41c9cb3..00000000 --- a/include/boost/fusion/container.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bb29ce2f..00000000 --- a/include/boost/fusion/container/deque.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 28d5ceca..00000000 --- a/include/boost/fusion/container/deque/back_extended_deque.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0f3a75e2..00000000 --- a/include/boost/fusion/container/deque/convert.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 27d9ce78..00000000 --- a/include/boost/fusion/container/deque/deque.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 415bb2f2..00000000 --- a/include/boost/fusion/container/deque/deque_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 90c68918..00000000 --- a/include/boost/fusion/container/deque/deque_iterator.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e48b7910..00000000 --- a/include/boost/fusion/container/deque/detail/as_deque.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3dc7cde9..00000000 --- a/include/boost/fusion/container/deque/detail/at_impl.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 13b50143..00000000 --- a/include/boost/fusion/container/deque/detail/begin_impl.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ac310a19..00000000 --- a/include/boost/fusion/container/deque/detail/convert_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 813c0491..00000000 --- a/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8fa56292..00000000 --- a/include/boost/fusion/container/deque/detail/deque_initial_size.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 11b229b2..00000000 --- a/include/boost/fusion/container/deque/detail/deque_keyed_values.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0a39add6..00000000 --- a/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 96a1b17d..00000000 --- a/include/boost/fusion/container/deque/detail/end_impl.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 177f68ac..00000000 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ /dev/null @@ -1,111 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ec0351de..00000000 --- a/include/boost/fusion/container/deque/detail/value_at_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 156e66a4..00000000 --- a/include/boost/fusion/container/deque/front_extended_deque.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2262f17c..00000000 --- a/include/boost/fusion/container/deque/limits.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index cd8c5dcd..00000000 --- a/include/boost/fusion/container/ext_/tree.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8a0d6456..00000000 --- a/include/boost/fusion/container/list.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8e500f66..00000000 --- a/include/boost/fusion/container/list/cons.hpp +++ /dev/null @@ -1,143 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7ef034e3..00000000 --- a/include/boost/fusion/container/list/cons_iterator.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 418158cf..00000000 --- a/include/boost/fusion/container/list/convert.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 54ba6bb8..00000000 --- a/include/boost/fusion/container/list/detail/at_impl.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a22c9a3d..00000000 --- a/include/boost/fusion/container/list/detail/begin_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index befbd4e9..00000000 --- a/include/boost/fusion/container/list/detail/build_cons.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cfe7a1df..00000000 --- a/include/boost/fusion/container/list/detail/convert_impl.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5292dced..00000000 --- a/include/boost/fusion/container/list/detail/deref_impl.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5c92c733..00000000 --- a/include/boost/fusion/container/list/detail/empty_impl.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 49dca855..00000000 --- a/include/boost/fusion/container/list/detail/end_impl.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 11925880..00000000 --- a/include/boost/fusion/container/list/detail/equal_to_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 39471809..00000000 --- a/include/boost/fusion/container/list/detail/list_forward_ctor.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8e6d6912..00000000 --- a/include/boost/fusion/container/list/detail/list_to_cons.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 069f0598..00000000 --- a/include/boost/fusion/container/list/detail/list_to_cons_call.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dafa83cc..00000000 --- a/include/boost/fusion/container/list/detail/next_impl.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f0ff166..00000000 --- a/include/boost/fusion/container/list/detail/value_at_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f8175c6d..00000000 --- a/include/boost/fusion/container/list/detail/value_of_impl.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 20ff6dd2..00000000 --- a/include/boost/fusion/container/list/limits.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7516df48..00000000 --- a/include/boost/fusion/container/list/list.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 90c088b4..00000000 --- a/include/boost/fusion/container/list/list_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 69518311..00000000 --- a/include/boost/fusion/container/map.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f174da58..00000000 --- a/include/boost/fusion/container/map/convert.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 326877f9..00000000 --- a/include/boost/fusion/container/map/detail/as_map.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8b0d70aa..00000000 --- a/include/boost/fusion/container/map/detail/at_key_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5fe25caf..00000000 --- a/include/boost/fusion/container/map/detail/begin_impl.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index aedd3e3d..00000000 --- a/include/boost/fusion/container/map/detail/convert_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0cafc92c..00000000 --- a/include/boost/fusion/container/map/detail/end_impl.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 17774362..00000000 --- a/include/boost/fusion/container/map/detail/lookup_key.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c35168ba..00000000 --- a/include/boost/fusion/container/map/detail/map_forward_ctor.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2f792cbd..00000000 --- a/include/boost/fusion/container/map/detail/map_lookup.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6c516462..00000000 --- a/include/boost/fusion/container/map/detail/value_at_key_impl.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 738abff4..00000000 --- a/include/boost/fusion/container/map/limits.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f5fb1cc..00000000 --- a/include/boost/fusion/container/map/map.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 660466bd..00000000 --- a/include/boost/fusion/container/map/map_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6b7674d6..00000000 --- a/include/boost/fusion/container/set.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1aaddf0c..00000000 --- a/include/boost/fusion/container/set/convert.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 33786338..00000000 --- a/include/boost/fusion/container/set/detail/as_set.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d0c1de00..00000000 --- a/include/boost/fusion/container/set/detail/at_key_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9b42df72..00000000 --- a/include/boost/fusion/container/set/detail/begin_impl.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1aa79fb1..00000000 --- a/include/boost/fusion/container/set/detail/convert_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4df78a3f..00000000 --- a/include/boost/fusion/container/set/detail/end_impl.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a1b9e8b9..00000000 --- a/include/boost/fusion/container/set/detail/lookup_key.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d105b150..00000000 --- a/include/boost/fusion/container/set/detail/set_forward_ctor.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6df4b401..00000000 --- a/include/boost/fusion/container/set/detail/set_lookup.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 40f68ba0..00000000 --- a/include/boost/fusion/container/set/detail/value_at_key_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 35eb0803..00000000 --- a/include/boost/fusion/container/set/limits.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 07580bb6..00000000 --- a/include/boost/fusion/container/set/set.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7facb513..00000000 --- a/include/boost/fusion/container/set/set_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 389a102e..00000000 --- a/include/boost/fusion/container/vector.hpp +++ /dev/null @@ -1,21 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a31578a2..00000000 --- a/include/boost/fusion/container/vector/convert.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c2c97b18..00000000 --- a/include/boost/fusion/container/vector/detail/advance_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index fa8dadcf..00000000 --- a/include/boost/fusion/container/vector/detail/as_vector.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1a00f428..00000000 --- a/include/boost/fusion/container/vector/detail/at_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d2d687be..00000000 --- a/include/boost/fusion/container/vector/detail/begin_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5e1d080f..00000000 --- a/include/boost/fusion/container/vector/detail/convert_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bd9f3d06..00000000 --- a/include/boost/fusion/container/vector/detail/deref_impl.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9664d5c2..00000000 --- a/include/boost/fusion/container/vector/detail/distance_impl.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f33282dc..00000000 --- a/include/boost/fusion/container/vector/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5ff81c61..00000000 --- a/include/boost/fusion/container/vector/detail/equal_to_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b11cfdb2..00000000 --- a/include/boost/fusion/container/vector/detail/next_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 610591b6..00000000 --- a/include/boost/fusion/container/vector/detail/prior_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0178054b..00000000 --- a/include/boost/fusion/container/vector/detail/value_at_impl.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3a775fbb..00000000 --- a/include/boost/fusion/container/vector/detail/value_of_impl.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e4680bb8..00000000 --- a/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 01981ab3..00000000 --- a/include/boost/fusion/container/vector/detail/vector_n.hpp +++ /dev/null @@ -1,150 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 29248907..00000000 --- a/include/boost/fusion/container/vector/detail/vector_n_chooser.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0e7e3a03..00000000 --- a/include/boost/fusion/container/vector/limits.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bd05badd..00000000 --- a/include/boost/fusion/container/vector/vector.hpp +++ /dev/null @@ -1,152 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 28531b6f..00000000 --- a/include/boost/fusion/container/vector/vector10.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index be711006..00000000 --- a/include/boost/fusion/container/vector/vector20.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index efbe9293..00000000 --- a/include/boost/fusion/container/vector/vector30.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b72a23c5..00000000 --- a/include/boost/fusion/container/vector/vector40.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ab8515d7..00000000 --- a/include/boost/fusion/container/vector/vector50.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a6b9cc66..00000000 --- a/include/boost/fusion/container/vector/vector_fwd.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9feeb520..00000000 --- a/include/boost/fusion/container/vector/vector_iterator.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 12662d97..00000000 --- a/include/boost/fusion/functional.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 734dac39..00000000 --- a/include/boost/fusion/functional/adapter.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ee03ffd0..00000000 --- a/include/boost/fusion/functional/adapter/detail/access.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2d14ad70..00000000 --- a/include/boost/fusion/functional/adapter/detail/pow2_explode.hpp +++ /dev/null @@ -1,118 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8f85cf44..00000000 --- a/include/boost/fusion/functional/adapter/detail/pt_def.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dca50043..00000000 --- a/include/boost/fusion/functional/adapter/detail/pt_undef.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 08e8897a..00000000 --- a/include/boost/fusion/functional/adapter/fused.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 12cd1e27..00000000 --- a/include/boost/fusion/functional/adapter/fused_function_object.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 78034b97..00000000 --- a/include/boost/fusion/functional/adapter/fused_procedure.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cf6701c4..00000000 --- a/include/boost/fusion/functional/adapter/limits.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 82b1e4b0..00000000 --- a/include/boost/fusion/functional/adapter/unfused_generic.hpp +++ /dev/null @@ -1,175 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ba2f31b6..00000000 --- a/include/boost/fusion/functional/adapter/unfused_lvalue_args.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3c80475e..00000000 --- a/include/boost/fusion/functional/adapter/unfused_rvalue_args.hpp +++ /dev/null @@ -1,137 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9ee3a7a6..00000000 --- a/include/boost/fusion/functional/adapter/unfused_typed.hpp +++ /dev/null @@ -1,155 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3dabd3ee..00000000 --- a/include/boost/fusion/functional/generation.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1c2c3e95..00000000 --- a/include/boost/fusion/functional/generation/detail/gen_make_adapter.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 12365824..00000000 --- a/include/boost/fusion/functional/generation/make_fused.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4146ddd6..00000000 --- a/include/boost/fusion/functional/generation/make_fused_function_object.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0687577c..00000000 --- a/include/boost/fusion/functional/generation/make_fused_procedure.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 87a99c59..00000000 --- a/include/boost/fusion/functional/generation/make_unfused_generic.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f3c49e45..00000000 --- a/include/boost/fusion/functional/generation/make_unfused_lvalue_args.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9322e1e0..00000000 --- a/include/boost/fusion/functional/generation/make_unfused_rvalue_args.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3ca68c34..00000000 --- a/include/boost/fusion/functional/invocation.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a92c436b..00000000 --- a/include/boost/fusion/functional/invocation/detail/that_ptr.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bac695cc..00000000 --- a/include/boost/fusion/functional/invocation/invoke.hpp +++ /dev/null @@ -1,306 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ad742265..00000000 --- a/include/boost/fusion/functional/invocation/invoke_function_object.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 31822ade..00000000 --- a/include/boost/fusion/functional/invocation/invoke_procedure.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9cb5a04a..00000000 --- a/include/boost/fusion/functional/invocation/limits.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index facc8970..00000000 --- a/include/boost/fusion/include/adapt_struct.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e5c73060..00000000 --- a/include/boost/fusion/include/any.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4c9b39d0..00000000 --- a/include/boost/fusion/include/as_vector.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index eacd7bbb..00000000 --- a/include/boost/fusion/include/at.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 53361fb2..00000000 --- a/include/boost/fusion/include/begin.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9c831f79..00000000 --- a/include/boost/fusion/include/deref.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 60be1a98..00000000 --- a/include/boost/fusion/include/end.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5607b8e2..00000000 --- a/include/boost/fusion/include/equal_to.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 31fdec5d..00000000 --- a/include/boost/fusion/include/filter_if.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b20578e5..00000000 --- a/include/boost/fusion/include/for_each.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d84fdf35..00000000 --- a/include/boost/fusion/include/io.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a7f2b4d8..00000000 --- a/include/boost/fusion/include/is_sequence.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f701ad3..00000000 --- a/include/boost/fusion/include/join.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e3d1e204..00000000 --- a/include/boost/fusion/include/joint_view.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4eb8e767..00000000 --- a/include/boost/fusion/include/list.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a0181953..00000000 --- a/include/boost/fusion/include/make_cons.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d2a90cb4..00000000 --- a/include/boost/fusion/include/make_vector.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8a1cbfd0..00000000 --- a/include/boost/fusion/include/mpl.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6188c65a..00000000 --- a/include/boost/fusion/include/next.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5a9cfa5e..00000000 --- a/include/boost/fusion/include/push_front.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a95d04a8..00000000 --- a/include/boost/fusion/include/single_view.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 98f37c86..00000000 --- a/include/boost/fusion/include/std_pair.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1f428aa1..00000000 --- a/include/boost/fusion/include/swap.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2b66c4f7..00000000 --- a/include/boost/fusion/include/transform.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3aceaaee..00000000 --- a/include/boost/fusion/include/transform_view.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index da5745d9..00000000 --- a/include/boost/fusion/include/value_at.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4f2bef95..00000000 --- a/include/boost/fusion/include/value_of.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3d013b8e..00000000 --- a/include/boost/fusion/include/variant.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d1495c0a..00000000 --- a/include/boost/fusion/include/vector.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 35f4abed..00000000 --- a/include/boost/fusion/include/vector_tie.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c7f8e1eb..00000000 --- a/include/boost/fusion/iterator.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2cbafede..00000000 --- a/include/boost/fusion/iterator/advance.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0e6f54d2..00000000 --- a/include/boost/fusion/iterator/deref.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d683c289..00000000 --- a/include/boost/fusion/iterator/detail/adapt_deref_traits.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a7d72f53..00000000 --- a/include/boost/fusion/iterator/detail/adapt_value_traits.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 900608fa..00000000 --- a/include/boost/fusion/iterator/detail/advance.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e4c0a5e7..00000000 --- a/include/boost/fusion/iterator/detail/distance.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 44fc4292..00000000 --- a/include/boost/fusion/iterator/distance.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2db27675..00000000 --- a/include/boost/fusion/iterator/equal_to.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f1720bdb..00000000 --- a/include/boost/fusion/iterator/iterator_facade.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2709bd29..00000000 --- a/include/boost/fusion/iterator/mpl.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5716ce4e..00000000 --- a/include/boost/fusion/iterator/mpl/convert_iterator.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 150db549..00000000 --- a/include/boost/fusion/iterator/mpl/fusion_iterator.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9070a9e2..00000000 --- a/include/boost/fusion/iterator/next.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9a261039..00000000 --- a/include/boost/fusion/iterator/prior.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 808c6593..00000000 --- a/include/boost/fusion/iterator/value_of.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e499df93..00000000 --- a/include/boost/fusion/mpl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a164bb32..00000000 --- a/include/boost/fusion/mpl/at.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1f5197e2..00000000 --- a/include/boost/fusion/mpl/back.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index be8b3142..00000000 --- a/include/boost/fusion/mpl/begin.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 14b3489e..00000000 --- a/include/boost/fusion/mpl/clear.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d8c32d5a..00000000 --- a/include/boost/fusion/mpl/detail/clear.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a0e27d66..00000000 --- a/include/boost/fusion/mpl/empty.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ed3320b2..00000000 --- a/include/boost/fusion/mpl/end.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a8b092ae..00000000 --- a/include/boost/fusion/mpl/erase.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3cda2686..00000000 --- a/include/boost/fusion/mpl/erase_key.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 97a26f73..00000000 --- a/include/boost/fusion/mpl/front.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index beac7c64..00000000 --- a/include/boost/fusion/mpl/has_key.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 76918ce9..00000000 --- a/include/boost/fusion/mpl/insert.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4da39365..00000000 --- a/include/boost/fusion/mpl/insert_range.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 84bd75a4..00000000 --- a/include/boost/fusion/mpl/pop_back.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index ffe6c302..00000000 --- a/include/boost/fusion/mpl/pop_front.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e96faa06..00000000 --- a/include/boost/fusion/mpl/push_back.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c508d652..00000000 --- a/include/boost/fusion/mpl/push_front.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2c724281..00000000 --- a/include/boost/fusion/mpl/size.hpp +++ /dev/null @@ -1,26 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e60fdd7d..00000000 --- a/include/boost/fusion/sequence.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 50e72cb3..00000000 --- a/include/boost/fusion/sequence/comparison.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3e79277e..00000000 --- a/include/boost/fusion/sequence/comparison/detail/enable_comparison.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c4f91238..00000000 --- a/include/boost/fusion/sequence/comparison/detail/equal_to.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 34cf1448..00000000 --- a/include/boost/fusion/sequence/comparison/detail/greater.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0cf4c388..00000000 --- a/include/boost/fusion/sequence/comparison/detail/greater_equal.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3fc6429f..00000000 --- a/include/boost/fusion/sequence/comparison/detail/less.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3d48ae5c..00000000 --- a/include/boost/fusion/sequence/comparison/detail/less_equal.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 87911b6d..00000000 --- a/include/boost/fusion/sequence/comparison/detail/not_equal_to.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cea3c9c1..00000000 --- a/include/boost/fusion/sequence/comparison/equal_to.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3ef215a1..00000000 --- a/include/boost/fusion/sequence/comparison/greater.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index df365c3a..00000000 --- a/include/boost/fusion/sequence/comparison/greater_equal.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4d3c086c..00000000 --- a/include/boost/fusion/sequence/comparison/less.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0f5a953c..00000000 --- a/include/boost/fusion/sequence/comparison/less_equal.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 34d2cab6..00000000 --- a/include/boost/fusion/sequence/comparison/not_equal_to.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a6e3ccca..00000000 --- a/include/boost/fusion/sequence/convert.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2afad632..00000000 --- a/include/boost/fusion/sequence/generation.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 88ce0aa4..00000000 --- a/include/boost/fusion/sequence/generation/cons_tie.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f8a2f08..00000000 --- a/include/boost/fusion/sequence/generation/deque_tie.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c363a203..00000000 --- a/include/boost/fusion/sequence/generation/ignore.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 946fdbc3..00000000 --- a/include/boost/fusion/sequence/generation/list_tie.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 47a2f461..00000000 --- a/include/boost/fusion/sequence/generation/make_cons.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5bcd4962..00000000 --- a/include/boost/fusion/sequence/generation/make_deque.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 122fe751..00000000 --- a/include/boost/fusion/sequence/generation/make_list.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5bc054e3..00000000 --- a/include/boost/fusion/sequence/generation/make_map.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b434923f..00000000 --- a/include/boost/fusion/sequence/generation/make_set.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b73598d6..00000000 --- a/include/boost/fusion/sequence/generation/make_vector.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a5cb08c9..00000000 --- a/include/boost/fusion/sequence/generation/map_tie.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 09437a26..00000000 --- a/include/boost/fusion/sequence/generation/pair_tie.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f70c4e89..00000000 --- a/include/boost/fusion/sequence/generation/vector_tie.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8c5f4abd..00000000 --- a/include/boost/fusion/sequence/intrinsic.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4524ace5..00000000 --- a/include/boost/fusion/sequence/intrinsic/at.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 849ff294..00000000 --- a/include/boost/fusion/sequence/intrinsic/at_key.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1f3567f9..00000000 --- a/include/boost/fusion/sequence/intrinsic/back.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 715ef9e1..00000000 --- a/include/boost/fusion/sequence/intrinsic/begin.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2390a49b..00000000 --- a/include/boost/fusion/sequence/intrinsic/empty.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 04232f12..00000000 --- a/include/boost/fusion/sequence/intrinsic/end.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 58f148f2..00000000 --- a/include/boost/fusion/sequence/intrinsic/ext_/segments.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index d3c31ccc..00000000 --- a/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bb79cfa9..00000000 --- a/include/boost/fusion/sequence/intrinsic/front.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4c6a3e07..00000000 --- a/include/boost/fusion/sequence/intrinsic/has_key.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 74e3f53a..00000000 --- a/include/boost/fusion/sequence/intrinsic/size.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7a385ae8..00000000 --- a/include/boost/fusion/sequence/intrinsic/swap.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d0868155..00000000 --- a/include/boost/fusion/sequence/intrinsic/value_at.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dbef3e89..00000000 --- a/include/boost/fusion/sequence/intrinsic/value_at_key.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 080bae38..00000000 --- a/include/boost/fusion/sequence/io.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 93d63791..00000000 --- a/include/boost/fusion/sequence/io/detail/in.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 382eb32f..00000000 --- a/include/boost/fusion/sequence/io/detail/manip.hpp +++ /dev/null @@ -1,316 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bd74e20a..00000000 --- a/include/boost/fusion/sequence/io/detail/out.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 039190eb..00000000 --- a/include/boost/fusion/sequence/io/in.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 48098e57..00000000 --- a/include/boost/fusion/sequence/io/out.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index af6faf56..00000000 --- a/include/boost/fusion/sequence/sequence_facade.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 35a17af9..00000000 --- a/include/boost/fusion/sequence/utility.hpp +++ /dev/null @@ -1,14 +0,0 @@ -// -// 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 deleted file mode 100644 index 012ee107..00000000 --- a/include/boost/fusion/support.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4d38fb64..00000000 --- a/include/boost/fusion/support/category_of.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 846fbc4d..00000000 --- a/include/boost/fusion/support/deduce.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9cf97922..00000000 --- a/include/boost/fusion/support/deduce_sequence.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0508e50f..00000000 --- a/include/boost/fusion/support/detail/access.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 78e4b631..00000000 --- a/include/boost/fusion/support/detail/as_fusion_element.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 04102cfd..00000000 --- a/include/boost/fusion/support/detail/category_of.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index eeb8f916..00000000 --- a/include/boost/fusion/support/detail/is_mpl_sequence.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5fa2f241..00000000 --- a/include/boost/fusion/support/detail/is_view.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 37a7fe94..00000000 --- a/include/boost/fusion/support/detail/mpl_iterator_category.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 48ffcc2b..00000000 --- a/include/boost/fusion/support/detail/unknown_key.hpp +++ /dev/null @@ -1,16 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 38def075..00000000 --- a/include/boost/fusion/support/ext_/is_segmented.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9e775f4e..00000000 --- a/include/boost/fusion/support/is_iterator.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 84dc2ec1..00000000 --- a/include/boost/fusion/support/is_sequence.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a89291d1..00000000 --- a/include/boost/fusion/support/is_view.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2f909b2e..00000000 --- a/include/boost/fusion/support/iterator_base.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cf285714..00000000 --- a/include/boost/fusion/support/pair.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1d436ef1..00000000 --- a/include/boost/fusion/support/sequence_base.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 209ceeff..00000000 --- a/include/boost/fusion/support/tag_of.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e6c883d5..00000000 --- a/include/boost/fusion/support/tag_of_fwd.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dc2014ec..00000000 --- a/include/boost/fusion/support/unused.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7dd11e5c..00000000 --- a/include/boost/fusion/support/void.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c4b56b9e..00000000 --- a/include/boost/fusion/tuple.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2ff20a2a..00000000 --- a/include/boost/fusion/tuple/detail/tuple_forward_ctor.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 32fd912e..00000000 --- a/include/boost/fusion/tuple/make_tuple.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d9860323..00000000 --- a/include/boost/fusion/tuple/tuple.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1a127cab..00000000 --- a/include/boost/fusion/tuple/tuple_fwd.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b6c21eff..00000000 --- a/include/boost/fusion/tuple/tuple_tie.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 12d5cc5d..00000000 --- a/include/boost/fusion/view.hpp +++ /dev/null @@ -1,17 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index e34b1d62..00000000 --- a/include/boost/fusion/view/ext_/multiple_view.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index 2216929b..00000000 --- a/include/boost/fusion/view/ext_/segmented_iterator.hpp +++ /dev/null @@ -1,425 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100755 index c4dcd01c..00000000 --- a/include/boost/fusion/view/ext_/segmented_iterator_range.hpp +++ /dev/null @@ -1,524 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c649407f..00000000 --- a/include/boost/fusion/view/filter_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2ffe7bd0..00000000 --- a/include/boost/fusion/view/filter_view/detail/begin_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3e6447c5..00000000 --- a/include/boost/fusion/view/filter_view/detail/deref_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 677004d4..00000000 --- a/include/boost/fusion/view/filter_view/detail/end_impl.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5d7b2932..00000000 --- a/include/boost/fusion/view/filter_view/detail/equal_to_impl.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8423dfe1..00000000 --- a/include/boost/fusion/view/filter_view/detail/next_impl.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1c5a0aca..00000000 --- a/include/boost/fusion/view/filter_view/detail/size_impl.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f9188f6f..00000000 --- a/include/boost/fusion/view/filter_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index a34747e6..00000000 --- a/include/boost/fusion/view/filter_view/filter_view.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index be93c657..00000000 --- a/include/boost/fusion/view/filter_view/filter_view_iterator.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f8d30221..00000000 --- a/include/boost/fusion/view/iterator_range.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f882aaa..00000000 --- a/include/boost/fusion/view/iterator_range/detail/at_impl.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 32341369..00000000 --- a/include/boost/fusion/view/iterator_range/detail/begin_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index dacbe191..00000000 --- a/include/boost/fusion/view/iterator_range/detail/end_impl.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b6fe8881..00000000 --- a/include/boost/fusion/view/iterator_range/detail/value_at_impl.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0036f0ae..00000000 --- a/include/boost/fusion/view/iterator_range/iterator_range.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cd1b8571..00000000 --- a/include/boost/fusion/view/joint_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e2b0281e..00000000 --- a/include/boost/fusion/view/joint_view/detail/begin_impl.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7eb47184..00000000 --- a/include/boost/fusion/view/joint_view/detail/deref_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5bdeb02e..00000000 --- a/include/boost/fusion/view/joint_view/detail/end_impl.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 80d3580d..00000000 --- a/include/boost/fusion/view/joint_view/detail/next_impl.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 53afe1c9..00000000 --- a/include/boost/fusion/view/joint_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9cc798d3..00000000 --- a/include/boost/fusion/view/joint_view/joint_view.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 18696d7e..00000000 --- a/include/boost/fusion/view/joint_view/joint_view_iterator.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index fef1462f..00000000 --- a/include/boost/fusion/view/repetitive_view.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 321d7b8d..00000000 --- a/include/boost/fusion/view/repetitive_view/detail/begin_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 2c0caf80..00000000 --- a/include/boost/fusion/view/repetitive_view/detail/deref_impl.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 52e36da5..00000000 --- a/include/boost/fusion/view/repetitive_view/detail/end_impl.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b629cb01..00000000 --- a/include/boost/fusion/view/repetitive_view/detail/next_impl.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bf5f2f06..00000000 --- a/include/boost/fusion/view/repetitive_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 050affb1..00000000 --- a/include/boost/fusion/view/repetitive_view/repetitive_view.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 24e146c0..00000000 --- a/include/boost/fusion/view/repetitive_view/repetitive_view_fwd.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9a7334de..00000000 --- a/include/boost/fusion/view/repetitive_view/repetitive_view_iterator.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 634b398c..00000000 --- a/include/boost/fusion/view/reverse_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 8785881e..00000000 --- a/include/boost/fusion/view/reverse_view/detail/advance_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b7968f56..00000000 --- a/include/boost/fusion/view/reverse_view/detail/begin_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 97cb8915..00000000 --- a/include/boost/fusion/view/reverse_view/detail/deref_impl.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5edc7499..00000000 --- a/include/boost/fusion/view/reverse_view/detail/distance_impl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 916e49d0..00000000 --- a/include/boost/fusion/view/reverse_view/detail/end_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c036510c..00000000 --- a/include/boost/fusion/view/reverse_view/detail/next_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 317054fc..00000000 --- a/include/boost/fusion/view/reverse_view/detail/prior_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bf9b2ade..00000000 --- a/include/boost/fusion/view/reverse_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c939f7ce..00000000 --- a/include/boost/fusion/view/reverse_view/reverse_view.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 0a890437..00000000 --- a/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3640fae8..00000000 --- a/include/boost/fusion/view/single_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 395992be..00000000 --- a/include/boost/fusion/view/single_view/detail/begin_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 355cf6ac..00000000 --- a/include/boost/fusion/view/single_view/detail/deref_impl.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d239c242..00000000 --- a/include/boost/fusion/view/single_view/detail/end_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c9cdafdf..00000000 --- a/include/boost/fusion/view/single_view/detail/next_impl.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f975eb14..00000000 --- a/include/boost/fusion/view/single_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7c10afe6..00000000 --- a/include/boost/fusion/view/single_view/single_view.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1a44bb15..00000000 --- a/include/boost/fusion/view/single_view/single_view_iterator.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 744d063c..00000000 --- a/include/boost/fusion/view/transform_view.hpp +++ /dev/null @@ -1,13 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6b323484..00000000 --- a/include/boost/fusion/view/transform_view/detail/advance_impl.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 73be3045..00000000 --- a/include/boost/fusion/view/transform_view/detail/apply_transform_result.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 620d96fe..00000000 --- a/include/boost/fusion/view/transform_view/detail/at_impl.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 75b04382..00000000 --- a/include/boost/fusion/view/transform_view/detail/begin_impl.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 3849f80a..00000000 --- a/include/boost/fusion/view/transform_view/detail/deref_impl.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index d5ae0adc..00000000 --- a/include/boost/fusion/view/transform_view/detail/distance_impl.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 465a2cbe..00000000 --- a/include/boost/fusion/view/transform_view/detail/end_impl.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 063a00ed..00000000 --- a/include/boost/fusion/view/transform_view/detail/equal_to_impl.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4d6ec743..00000000 --- a/include/boost/fusion/view/transform_view/detail/next_impl.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f7d49966..00000000 --- a/include/boost/fusion/view/transform_view/detail/prior_impl.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index cb581583..00000000 --- a/include/boost/fusion/view/transform_view/detail/value_at_impl.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 08bbf209..00000000 --- a/include/boost/fusion/view/transform_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 27ddc273..00000000 --- a/include/boost/fusion/view/transform_view/transform_view.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7dca304a..00000000 --- a/include/boost/fusion/view/transform_view/transform_view_fwd.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index bb4b6afd..00000000 --- a/include/boost/fusion/view/transform_view/transform_view_iterator.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index f7a16ea0..00000000 --- a/include/boost/fusion/view/zip_view.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 9aa00deb..00000000 --- a/include/boost/fusion/view/zip_view/detail/advance_impl.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index b01b8cfa..00000000 --- a/include/boost/fusion/view/zip_view/detail/at_impl.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 674dea38..00000000 --- a/include/boost/fusion/view/zip_view/detail/begin_impl.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 69cc8825..00000000 --- a/include/boost/fusion/view/zip_view/detail/deref_impl.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 61447278..00000000 --- a/include/boost/fusion/view/zip_view/detail/distance_impl.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index fa9c31db..00000000 --- a/include/boost/fusion/view/zip_view/detail/end_impl.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index c3962a63..00000000 --- a/include/boost/fusion/view/zip_view/detail/equal_to_impl.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 1c9c0245..00000000 --- a/include/boost/fusion/view/zip_view/detail/next_impl.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 49b99397..00000000 --- a/include/boost/fusion/view/zip_view/detail/prior_impl.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 70798d28..00000000 --- a/include/boost/fusion/view/zip_view/detail/size_impl.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index e74ffbfc..00000000 --- a/include/boost/fusion/view/zip_view/detail/strictest_traversal.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 7905b063..00000000 --- a/include/boost/fusion/view/zip_view/detail/value_at_impl.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 4ba4c3c5..00000000 --- a/include/boost/fusion/view/zip_view/detail/value_of_impl.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 5f152eb0..00000000 --- a/include/boost/fusion/view/zip_view/zip_view.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 66b514dc..00000000 --- a/include/boost/fusion/view/zip_view/zip_view_iterator.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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 deleted file mode 100644 index 6edf4d68..00000000 --- a/include/boost/fusion/view/zip_view/zip_view_iterator_fwd.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/*============================================================================= - 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 From 32f1c58ce72e17b78a8106488d2c447f1411f266 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 00:52:09 +0000 Subject: [PATCH 06/14] 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 From cb3bd83e2acd231b1fbfd7122412f87f13a8b9f6 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 03:01:13 +0000 Subject: [PATCH 07/14] more includes [SVN r40245] --- include/boost/fusion/include/category_of.hpp | 12 ++++++++++++ include/boost/fusion/include/cons.hpp | 12 ++++++++++++ include/boost/fusion/include/fold.hpp | 12 ++++++++++++ include/boost/fusion/include/intrinsic.hpp | 12 ++++++++++++ include/boost/fusion/include/invoke.hpp | 12 ++++++++++++ include/boost/fusion/include/is_view.hpp | 12 ++++++++++++ include/boost/fusion/include/iterator_base.hpp | 12 ++++++++++++ include/boost/fusion/include/pop_front.hpp | 12 ++++++++++++ include/boost/fusion/include/push_back.hpp | 12 ++++++++++++ include/boost/fusion/include/size.hpp | 12 ++++++++++++ include/boost/fusion/include/tag_of_fwd.hpp | 12 ++++++++++++ include/boost/fusion/include/tuple.hpp | 12 ++++++++++++ 12 files changed, 144 insertions(+) create mode 100644 include/boost/fusion/include/category_of.hpp create mode 100644 include/boost/fusion/include/cons.hpp create mode 100644 include/boost/fusion/include/fold.hpp create mode 100644 include/boost/fusion/include/intrinsic.hpp create mode 100644 include/boost/fusion/include/invoke.hpp create mode 100644 include/boost/fusion/include/is_view.hpp create mode 100644 include/boost/fusion/include/iterator_base.hpp create mode 100644 include/boost/fusion/include/pop_front.hpp create mode 100644 include/boost/fusion/include/push_back.hpp create mode 100644 include/boost/fusion/include/size.hpp create mode 100644 include/boost/fusion/include/tag_of_fwd.hpp create mode 100644 include/boost/fusion/include/tuple.hpp diff --git a/include/boost/fusion/include/category_of.hpp b/include/boost/fusion/include/category_of.hpp new file mode 100644 index 00000000..c390686c --- /dev/null +++ b/include/boost/fusion/include/category_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_CATEGORY_OF) +#define FUSION_INCLUDE_CATEGORY_OF + +#include + +#endif diff --git a/include/boost/fusion/include/cons.hpp b/include/boost/fusion/include/cons.hpp new file mode 100644 index 00000000..853eb6d2 --- /dev/null +++ b/include/boost/fusion/include/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_CONS) +#define FUSION_INCLUDE_CONS + +#include + +#endif diff --git a/include/boost/fusion/include/fold.hpp b/include/boost/fusion/include/fold.hpp new file mode 100644 index 00000000..40bf3a79 --- /dev/null +++ b/include/boost/fusion/include/fold.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_FOLD) +#define FUSION_INCLUDE_FOLD + +#include + +#endif diff --git a/include/boost/fusion/include/intrinsic.hpp b/include/boost/fusion/include/intrinsic.hpp new file mode 100644 index 00000000..c9d78711 --- /dev/null +++ b/include/boost/fusion/include/intrinsic.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_INTRINSIC) +#define FUSION_INCLUDE_INTRINSIC + +#include + +#endif diff --git a/include/boost/fusion/include/invoke.hpp b/include/boost/fusion/include/invoke.hpp new file mode 100644 index 00000000..45226425 --- /dev/null +++ b/include/boost/fusion/include/invoke.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_INVOKE) +#define FUSION_INCLUDE_INVOKE + +#include + +#endif diff --git a/include/boost/fusion/include/is_view.hpp b/include/boost/fusion/include/is_view.hpp new file mode 100644 index 00000000..5ebc3473 --- /dev/null +++ b/include/boost/fusion/include/is_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_IS_VIEW) +#define FUSION_INCLUDE_IS_VIEW + +#include + +#endif diff --git a/include/boost/fusion/include/iterator_base.hpp b/include/boost/fusion/include/iterator_base.hpp new file mode 100644 index 00000000..bbd35321 --- /dev/null +++ b/include/boost/fusion/include/iterator_base.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_ITERATOR_BASE) +#define FUSION_INCLUDE_ITERATOR_BASE + +#include + +#endif diff --git a/include/boost/fusion/include/pop_front.hpp b/include/boost/fusion/include/pop_front.hpp new file mode 100644 index 00000000..7df977e0 --- /dev/null +++ b/include/boost/fusion/include/pop_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_POP_FRONT) +#define FUSION_INCLUDE_POP_FRONT + +#include + +#endif diff --git a/include/boost/fusion/include/push_back.hpp b/include/boost/fusion/include/push_back.hpp new file mode 100644 index 00000000..4908e87c --- /dev/null +++ b/include/boost/fusion/include/push_back.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_BACK) +#define FUSION_INCLUDE_PUSH_BACK + +#include + +#endif diff --git a/include/boost/fusion/include/size.hpp b/include/boost/fusion/include/size.hpp new file mode 100644 index 00000000..02d2a00f --- /dev/null +++ b/include/boost/fusion/include/size.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_SIZE) +#define FUSION_INCLUDE_SIZE + +#include + +#endif diff --git a/include/boost/fusion/include/tag_of_fwd.hpp b/include/boost/fusion/include/tag_of_fwd.hpp new file mode 100644 index 00000000..fbc7ebe7 --- /dev/null +++ b/include/boost/fusion/include/tag_of_fwd.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_TAG_OF_FWD) +#define FUSION_INCLUDE_TAG_OF_FWD + +#include + +#endif diff --git a/include/boost/fusion/include/tuple.hpp b/include/boost/fusion/include/tuple.hpp new file mode 100644 index 00000000..52e53fb5 --- /dev/null +++ b/include/boost/fusion/include/tuple.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_TUPLE) +#define FUSION_INCLUDE_TUPLE + +#include + +#endif From 4be5caeff9f03e403fc8731fd5db0a43b963b36a Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 04:25:02 +0000 Subject: [PATCH 08/14] more flat includes [SVN r40250] --- include/boost/fusion/include/accumulate.hpp | 12 ++++++++++++ include/boost/fusion/include/adapted.hpp | 12 ++++++++++++ include/boost/fusion/include/adapter.hpp | 12 ++++++++++++ include/boost/fusion/include/advance.hpp | 12 ++++++++++++ include/boost/fusion/include/algorithm.hpp | 12 ++++++++++++ include/boost/fusion/include/all.hpp | 12 ++++++++++++ include/boost/fusion/include/array.hpp | 12 ++++++++++++ include/boost/fusion/include/boost_tuple.hpp | 12 ++++++++++++ include/boost/fusion/include/clear.hpp | 12 ++++++++++++ include/boost/fusion/include/comparison.hpp | 12 ++++++++++++ include/boost/fusion/include/container.hpp | 12 ++++++++++++ include/boost/fusion/include/convert.hpp | 12 ++++++++++++ include/boost/fusion/include/count.hpp | 12 ++++++++++++ include/boost/fusion/include/count_if.hpp | 12 ++++++++++++ include/boost/fusion/include/deduce.hpp | 12 ++++++++++++ include/boost/fusion/include/deduce_sequence.hpp | 12 ++++++++++++ include/boost/fusion/include/deque.hpp | 12 ++++++++++++ include/boost/fusion/include/deque_fwd.hpp | 12 ++++++++++++ include/boost/fusion/include/distance.hpp | 12 ++++++++++++ include/boost/fusion/include/erase.hpp | 12 ++++++++++++ include/boost/fusion/include/erase_key.hpp | 12 ++++++++++++ include/boost/fusion/include/filter.hpp | 12 ++++++++++++ include/boost/fusion/include/filter_view.hpp | 12 ++++++++++++ include/boost/fusion/include/find.hpp | 12 ++++++++++++ include/boost/fusion/include/find_if.hpp | 12 ++++++++++++ include/boost/fusion/include/functional.hpp | 12 ++++++++++++ include/boost/fusion/include/generation.hpp | 13 +++++++++++++ include/boost/fusion/include/insert.hpp | 12 ++++++++++++ include/boost/fusion/include/insert_range.hpp | 12 ++++++++++++ include/boost/fusion/include/invocation.hpp | 12 ++++++++++++ include/boost/fusion/include/is_iterator.hpp | 12 ++++++++++++ include/boost/fusion/include/iteration.hpp | 12 ++++++++++++ include/boost/fusion/include/iterator.hpp | 12 ++++++++++++ include/boost/fusion/include/iterator_facade.hpp | 12 ++++++++++++ include/boost/fusion/include/iterator_range.hpp | 12 ++++++++++++ include/boost/fusion/include/list.hpp | 2 +- include/boost/fusion/include/list_fwd.hpp | 12 ++++++++++++ include/boost/fusion/include/make_tuple.hpp | 12 ++++++++++++ include/boost/fusion/include/map.hpp | 12 ++++++++++++ include/boost/fusion/include/map_fwd.hpp | 12 ++++++++++++ include/boost/fusion/include/none.hpp | 12 ++++++++++++ include/boost/fusion/include/pair.hpp | 12 ++++++++++++ include/boost/fusion/include/pop_back.hpp | 12 ++++++++++++ include/boost/fusion/include/prior.hpp | 12 ++++++++++++ include/boost/fusion/include/query.hpp | 12 ++++++++++++ include/boost/fusion/include/remove.hpp | 12 ++++++++++++ include/boost/fusion/include/remove_if.hpp | 12 ++++++++++++ include/boost/fusion/include/repetetive_view.hpp | 12 ++++++++++++ include/boost/fusion/include/replace.hpp | 12 ++++++++++++ include/boost/fusion/include/replace_if.hpp | 12 ++++++++++++ include/boost/fusion/include/reverse.hpp | 12 ++++++++++++ include/boost/fusion/include/reverse_view.hpp | 12 ++++++++++++ include/boost/fusion/include/sequence.hpp | 12 ++++++++++++ include/boost/fusion/include/sequence_base.hpp | 12 ++++++++++++ include/boost/fusion/include/sequence_facade.hpp | 12 ++++++++++++ include/boost/fusion/include/set.hpp | 12 ++++++++++++ include/boost/fusion/include/set_fwd.hpp | 12 ++++++++++++ include/boost/fusion/include/struct.hpp | 12 ++++++++++++ include/boost/fusion/include/support.hpp | 12 ++++++++++++ include/boost/fusion/include/tag_of.hpp | 12 ++++++++++++ include/boost/fusion/include/transformation.hpp | 12 ++++++++++++ include/boost/fusion/include/tuple_fwd.hpp | 12 ++++++++++++ include/boost/fusion/include/tuple_tie.hpp | 12 ++++++++++++ include/boost/fusion/include/unused.hpp | 12 ++++++++++++ include/boost/fusion/include/utility.hpp | 12 ++++++++++++ include/boost/fusion/include/vector.hpp | 4 ++-- include/boost/fusion/include/vector10.hpp | 12 ++++++++++++ include/boost/fusion/include/vector20.hpp | 12 ++++++++++++ include/boost/fusion/include/vector30.hpp | 12 ++++++++++++ include/boost/fusion/include/vector40.hpp | 12 ++++++++++++ include/boost/fusion/include/vector50.hpp | 12 ++++++++++++ include/boost/fusion/include/vector_fwd.hpp | 12 ++++++++++++ include/boost/fusion/include/view.hpp | 12 ++++++++++++ include/boost/fusion/include/void.hpp | 12 ++++++++++++ include/boost/fusion/include/zip.hpp | 12 ++++++++++++ include/boost/fusion/include/zip_view.hpp | 12 ++++++++++++ 76 files changed, 892 insertions(+), 3 deletions(-) create mode 100644 include/boost/fusion/include/accumulate.hpp create mode 100644 include/boost/fusion/include/adapted.hpp create mode 100644 include/boost/fusion/include/adapter.hpp create mode 100644 include/boost/fusion/include/advance.hpp create mode 100644 include/boost/fusion/include/algorithm.hpp create mode 100644 include/boost/fusion/include/all.hpp create mode 100644 include/boost/fusion/include/array.hpp create mode 100644 include/boost/fusion/include/boost_tuple.hpp create mode 100644 include/boost/fusion/include/clear.hpp create mode 100644 include/boost/fusion/include/comparison.hpp create mode 100644 include/boost/fusion/include/container.hpp create mode 100644 include/boost/fusion/include/convert.hpp create mode 100644 include/boost/fusion/include/count.hpp create mode 100644 include/boost/fusion/include/count_if.hpp create mode 100644 include/boost/fusion/include/deduce.hpp create mode 100644 include/boost/fusion/include/deduce_sequence.hpp create mode 100644 include/boost/fusion/include/deque.hpp create mode 100644 include/boost/fusion/include/deque_fwd.hpp create mode 100644 include/boost/fusion/include/distance.hpp create mode 100644 include/boost/fusion/include/erase.hpp create mode 100644 include/boost/fusion/include/erase_key.hpp create mode 100644 include/boost/fusion/include/filter.hpp create mode 100644 include/boost/fusion/include/filter_view.hpp create mode 100644 include/boost/fusion/include/find.hpp create mode 100644 include/boost/fusion/include/find_if.hpp create mode 100644 include/boost/fusion/include/functional.hpp create mode 100644 include/boost/fusion/include/generation.hpp create mode 100644 include/boost/fusion/include/insert.hpp create mode 100644 include/boost/fusion/include/insert_range.hpp create mode 100644 include/boost/fusion/include/invocation.hpp create mode 100644 include/boost/fusion/include/is_iterator.hpp create mode 100644 include/boost/fusion/include/iteration.hpp create mode 100644 include/boost/fusion/include/iterator.hpp create mode 100644 include/boost/fusion/include/iterator_facade.hpp create mode 100644 include/boost/fusion/include/iterator_range.hpp create mode 100644 include/boost/fusion/include/list_fwd.hpp create mode 100644 include/boost/fusion/include/make_tuple.hpp create mode 100644 include/boost/fusion/include/map.hpp create mode 100644 include/boost/fusion/include/map_fwd.hpp create mode 100644 include/boost/fusion/include/none.hpp create mode 100644 include/boost/fusion/include/pair.hpp create mode 100644 include/boost/fusion/include/pop_back.hpp create mode 100644 include/boost/fusion/include/prior.hpp create mode 100644 include/boost/fusion/include/query.hpp create mode 100644 include/boost/fusion/include/remove.hpp create mode 100644 include/boost/fusion/include/remove_if.hpp create mode 100644 include/boost/fusion/include/repetetive_view.hpp create mode 100644 include/boost/fusion/include/replace.hpp create mode 100644 include/boost/fusion/include/replace_if.hpp create mode 100644 include/boost/fusion/include/reverse.hpp create mode 100644 include/boost/fusion/include/reverse_view.hpp create mode 100644 include/boost/fusion/include/sequence.hpp create mode 100644 include/boost/fusion/include/sequence_base.hpp create mode 100644 include/boost/fusion/include/sequence_facade.hpp create mode 100644 include/boost/fusion/include/set.hpp create mode 100644 include/boost/fusion/include/set_fwd.hpp create mode 100644 include/boost/fusion/include/struct.hpp create mode 100644 include/boost/fusion/include/support.hpp create mode 100644 include/boost/fusion/include/tag_of.hpp create mode 100644 include/boost/fusion/include/transformation.hpp create mode 100644 include/boost/fusion/include/tuple_fwd.hpp create mode 100644 include/boost/fusion/include/tuple_tie.hpp create mode 100644 include/boost/fusion/include/unused.hpp create mode 100644 include/boost/fusion/include/utility.hpp create mode 100644 include/boost/fusion/include/vector10.hpp create mode 100644 include/boost/fusion/include/vector20.hpp create mode 100644 include/boost/fusion/include/vector30.hpp create mode 100644 include/boost/fusion/include/vector40.hpp create mode 100644 include/boost/fusion/include/vector50.hpp create mode 100644 include/boost/fusion/include/vector_fwd.hpp create mode 100644 include/boost/fusion/include/view.hpp create mode 100644 include/boost/fusion/include/void.hpp create mode 100644 include/boost/fusion/include/zip.hpp create mode 100644 include/boost/fusion/include/zip_view.hpp diff --git a/include/boost/fusion/include/accumulate.hpp b/include/boost/fusion/include/accumulate.hpp new file mode 100644 index 00000000..e3532dc0 --- /dev/null +++ b/include/boost/fusion/include/accumulate.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_ACCUMULATE) +#define FUSION_INCLUDE_ACCUMULATE + +#include + +#endif diff --git a/include/boost/fusion/include/adapted.hpp b/include/boost/fusion/include/adapted.hpp new file mode 100644 index 00000000..1827267d --- /dev/null +++ b/include/boost/fusion/include/adapted.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_ADAPTED) +#define FUSION_INCLUDE_ADAPTED + +#include + +#endif diff --git a/include/boost/fusion/include/adapter.hpp b/include/boost/fusion/include/adapter.hpp new file mode 100644 index 00000000..2441d7ca --- /dev/null +++ b/include/boost/fusion/include/adapter.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_ADAPTER) +#define FUSION_INCLUDE_ADAPTER + +#include + +#endif diff --git a/include/boost/fusion/include/advance.hpp b/include/boost/fusion/include/advance.hpp new file mode 100644 index 00000000..cb9ed7a9 --- /dev/null +++ b/include/boost/fusion/include/advance.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_ADVANCE) +#define FUSION_INCLUDE_ADVANCE + +#include + +#endif diff --git a/include/boost/fusion/include/algorithm.hpp b/include/boost/fusion/include/algorithm.hpp new file mode 100644 index 00000000..1a362fd8 --- /dev/null +++ b/include/boost/fusion/include/algorithm.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_ALGORITHM) +#define FUSION_INCLUDE_ALGORITHM + +#include + +#endif diff --git a/include/boost/fusion/include/all.hpp b/include/boost/fusion/include/all.hpp new file mode 100644 index 00000000..58026268 --- /dev/null +++ b/include/boost/fusion/include/all.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_ALL) +#define FUSION_INCLUDE_ALL + +#include + +#endif diff --git a/include/boost/fusion/include/array.hpp b/include/boost/fusion/include/array.hpp new file mode 100644 index 00000000..b54cd70d --- /dev/null +++ b/include/boost/fusion/include/array.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_ARRAY) +#define FUSION_INCLUDE_ARRAY + +#include + +#endif diff --git a/include/boost/fusion/include/boost_tuple.hpp b/include/boost/fusion/include/boost_tuple.hpp new file mode 100644 index 00000000..1ccc94da --- /dev/null +++ b/include/boost/fusion/include/boost_tuple.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_BOOST_TUPLE) +#define FUSION_INCLUDE_BOOST_TUPLE + +#include + +#endif diff --git a/include/boost/fusion/include/clear.hpp b/include/boost/fusion/include/clear.hpp new file mode 100644 index 00000000..7fd86332 --- /dev/null +++ b/include/boost/fusion/include/clear.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_CLEAR) +#define FUSION_INCLUDE_CLEAR + +#include + +#endif diff --git a/include/boost/fusion/include/comparison.hpp b/include/boost/fusion/include/comparison.hpp new file mode 100644 index 00000000..e7790f28 --- /dev/null +++ b/include/boost/fusion/include/comparison.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_COMPARISON) +#define FUSION_INCLUDE_COMPARISON + +#include + +#endif diff --git a/include/boost/fusion/include/container.hpp b/include/boost/fusion/include/container.hpp new file mode 100644 index 00000000..657b4c30 --- /dev/null +++ b/include/boost/fusion/include/container.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_CONTAINER) +#define FUSION_INCLUDE_CONTAINER + +#include + +#endif diff --git a/include/boost/fusion/include/convert.hpp b/include/boost/fusion/include/convert.hpp new file mode 100644 index 00000000..1d64ea1b --- /dev/null +++ b/include/boost/fusion/include/convert.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_CONVERT) +#define FUSION_INCLUDE_CONVERT + +#include + +#endif diff --git a/include/boost/fusion/include/count.hpp b/include/boost/fusion/include/count.hpp new file mode 100644 index 00000000..750a0303 --- /dev/null +++ b/include/boost/fusion/include/count.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_COUNT) +#define FUSION_INCLUDE_COUNT + +#include + +#endif diff --git a/include/boost/fusion/include/count_if.hpp b/include/boost/fusion/include/count_if.hpp new file mode 100644 index 00000000..ff804ae9 --- /dev/null +++ b/include/boost/fusion/include/count_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_COUNT_IF) +#define FUSION_INCLUDE_COUNT_IF + +#include + +#endif diff --git a/include/boost/fusion/include/deduce.hpp b/include/boost/fusion/include/deduce.hpp new file mode 100644 index 00000000..43ec5c0f --- /dev/null +++ b/include/boost/fusion/include/deduce.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_DEDUCE) +#define FUSION_INCLUDE_DEDUCE + +#include + +#endif diff --git a/include/boost/fusion/include/deduce_sequence.hpp b/include/boost/fusion/include/deduce_sequence.hpp new file mode 100644 index 00000000..a8d36c08 --- /dev/null +++ b/include/boost/fusion/include/deduce_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_DEDUCE_SEQUENCE) +#define FUSION_INCLUDE_DEDUCE_SEQUENCE + +#include + +#endif diff --git a/include/boost/fusion/include/deque.hpp b/include/boost/fusion/include/deque.hpp new file mode 100644 index 00000000..17386a1d --- /dev/null +++ b/include/boost/fusion/include/deque.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_DEQUE) +#define FUSION_INCLUDE_DEQUE + +#include + +#endif diff --git a/include/boost/fusion/include/deque_fwd.hpp b/include/boost/fusion/include/deque_fwd.hpp new file mode 100644 index 00000000..915c3cbb --- /dev/null +++ b/include/boost/fusion/include/deque_fwd.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_DEQUE) +#define FUSION_INCLUDE_DEQUE + +#include + +#endif diff --git a/include/boost/fusion/include/distance.hpp b/include/boost/fusion/include/distance.hpp new file mode 100644 index 00000000..fac103a6 --- /dev/null +++ b/include/boost/fusion/include/distance.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_DISTANCE) +#define FUSION_INCLUDE_DISTANCE + +#include + +#endif diff --git a/include/boost/fusion/include/erase.hpp b/include/boost/fusion/include/erase.hpp new file mode 100644 index 00000000..b7e6fafb --- /dev/null +++ b/include/boost/fusion/include/erase.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_ERASE) +#define FUSION_INCLUDE_ERASE + +#include + +#endif diff --git a/include/boost/fusion/include/erase_key.hpp b/include/boost/fusion/include/erase_key.hpp new file mode 100644 index 00000000..e13c889f --- /dev/null +++ b/include/boost/fusion/include/erase_key.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_ERASE_KEY) +#define FUSION_INCLUDE_ERASE_KEY + +#include + +#endif diff --git a/include/boost/fusion/include/filter.hpp b/include/boost/fusion/include/filter.hpp new file mode 100644 index 00000000..234e4064 --- /dev/null +++ b/include/boost/fusion/include/filter.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) +#define FUSION_INCLUDE_FILTER + +#include + +#endif diff --git a/include/boost/fusion/include/filter_view.hpp b/include/boost/fusion/include/filter_view.hpp new file mode 100644 index 00000000..196df8a0 --- /dev/null +++ b/include/boost/fusion/include/filter_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_FILTER_VIEW) +#define FUSION_INCLUDE_FILTER_VIEW + +#include + +#endif diff --git a/include/boost/fusion/include/find.hpp b/include/boost/fusion/include/find.hpp new file mode 100644 index 00000000..cf50c412 --- /dev/null +++ b/include/boost/fusion/include/find.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_FIND) +#define FUSION_INCLUDE_FIND + +#include + +#endif diff --git a/include/boost/fusion/include/find_if.hpp b/include/boost/fusion/include/find_if.hpp new file mode 100644 index 00000000..aa1a4c7a --- /dev/null +++ b/include/boost/fusion/include/find_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_FIND_IF) +#define FUSION_INCLUDE_FIND_IF + +#include + +#endif diff --git a/include/boost/fusion/include/functional.hpp b/include/boost/fusion/include/functional.hpp new file mode 100644 index 00000000..ab38fe1f --- /dev/null +++ b/include/boost/fusion/include/functional.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_FUNCTIONAL) +#define FUSION_INCLUDE_FUNCTIONAL + +#include + +#endif diff --git a/include/boost/fusion/include/generation.hpp b/include/boost/fusion/include/generation.hpp new file mode 100644 index 00000000..20ab1958 --- /dev/null +++ b/include/boost/fusion/include/generation.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_GENERATION) +#define FUSION_INCLUDE_GENERATION + +#include +#include + +#endif diff --git a/include/boost/fusion/include/insert.hpp b/include/boost/fusion/include/insert.hpp new file mode 100644 index 00000000..53c0b05e --- /dev/null +++ b/include/boost/fusion/include/insert.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_INSERT) +#define FUSION_INCLUDE_INSERT + +#include + +#endif diff --git a/include/boost/fusion/include/insert_range.hpp b/include/boost/fusion/include/insert_range.hpp new file mode 100644 index 00000000..f7093ed9 --- /dev/null +++ b/include/boost/fusion/include/insert_range.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_INSERT_RANGE) +#define FUSION_INCLUDE_INSERT_RANGE + +#include + +#endif diff --git a/include/boost/fusion/include/invocation.hpp b/include/boost/fusion/include/invocation.hpp new file mode 100644 index 00000000..2a6f12a3 --- /dev/null +++ b/include/boost/fusion/include/invocation.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_INVOCATION) +#define FUSION_INCLUDE_INVOCATION + +#include + +#endif diff --git a/include/boost/fusion/include/is_iterator.hpp b/include/boost/fusion/include/is_iterator.hpp new file mode 100644 index 00000000..31348eb7 --- /dev/null +++ b/include/boost/fusion/include/is_iterator.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_ITERATOR) +#define FUSION_INCLUDE_IS_ITERATOR + +#include + +#endif diff --git a/include/boost/fusion/include/iteration.hpp b/include/boost/fusion/include/iteration.hpp new file mode 100644 index 00000000..372aa726 --- /dev/null +++ b/include/boost/fusion/include/iteration.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_ITERATION) +#define FUSION_INCLUDE_ITERATION + +#include + +#endif diff --git a/include/boost/fusion/include/iterator.hpp b/include/boost/fusion/include/iterator.hpp new file mode 100644 index 00000000..2ed8e838 --- /dev/null +++ b/include/boost/fusion/include/iterator.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_ITERATOR) +#define FUSION_INCLUDE_ITERATOR + +#include + +#endif diff --git a/include/boost/fusion/include/iterator_facade.hpp b/include/boost/fusion/include/iterator_facade.hpp new file mode 100644 index 00000000..a36f8b16 --- /dev/null +++ b/include/boost/fusion/include/iterator_facade.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_ITERATOR_FACADE) +#define FUSION_INCLUDE_ITERATOR_FACADE + +#include + +#endif diff --git a/include/boost/fusion/include/iterator_range.hpp b/include/boost/fusion/include/iterator_range.hpp new file mode 100644 index 00000000..54eba6dd --- /dev/null +++ b/include/boost/fusion/include/iterator_range.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_ITERATOR_RANGE) +#define FUSION_INCLUDE_ITERATOR_RANGE + +#include + +#endif diff --git a/include/boost/fusion/include/list.hpp b/include/boost/fusion/include/list.hpp index 4eb8e767..0a3a1a63 100644 --- a/include/boost/fusion/include/list.hpp +++ b/include/boost/fusion/include/list.hpp @@ -7,6 +7,6 @@ #if !defined(FUSION_INCLUDE_LIST) #define FUSION_INCLUDE_LIST -#include +#include #endif diff --git a/include/boost/fusion/include/list_fwd.hpp b/include/boost/fusion/include/list_fwd.hpp new file mode 100644 index 00000000..08823bf6 --- /dev/null +++ b/include/boost/fusion/include/list_fwd.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_FWD) +#define FUSION_INCLUDE_LIST_FWD + +#include + +#endif diff --git a/include/boost/fusion/include/make_tuple.hpp b/include/boost/fusion/include/make_tuple.hpp new file mode 100644 index 00000000..8cfbdc8e --- /dev/null +++ b/include/boost/fusion/include/make_tuple.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_TUPLE) +#define FUSION_INCLUDE_MAKE_TUPLE + +#include + +#endif diff --git a/include/boost/fusion/include/map.hpp b/include/boost/fusion/include/map.hpp new file mode 100644 index 00000000..07441b4a --- /dev/null +++ b/include/boost/fusion/include/map.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_MAP) +#define FUSION_INCLUDE_MAP + +#include + +#endif diff --git a/include/boost/fusion/include/map_fwd.hpp b/include/boost/fusion/include/map_fwd.hpp new file mode 100644 index 00000000..970c4132 --- /dev/null +++ b/include/boost/fusion/include/map_fwd.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_MAP_FWD) +#define FUSION_INCLUDE_MAP_FWD + +#include + +#endif diff --git a/include/boost/fusion/include/none.hpp b/include/boost/fusion/include/none.hpp new file mode 100644 index 00000000..19720ef8 --- /dev/null +++ b/include/boost/fusion/include/none.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_NONE) +#define FUSION_INCLUDE_NONE + +#include + +#endif diff --git a/include/boost/fusion/include/pair.hpp b/include/boost/fusion/include/pair.hpp new file mode 100644 index 00000000..97ebfcd8 --- /dev/null +++ b/include/boost/fusion/include/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_PAIR) +#define FUSION_INCLUDE_PAIR + +#include + +#endif diff --git a/include/boost/fusion/include/pop_back.hpp b/include/boost/fusion/include/pop_back.hpp new file mode 100644 index 00000000..b5a808cd --- /dev/null +++ b/include/boost/fusion/include/pop_back.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_POP_BACK) +#define FUSION_INCLUDE_POP_BACK + +#include + +#endif diff --git a/include/boost/fusion/include/prior.hpp b/include/boost/fusion/include/prior.hpp new file mode 100644 index 00000000..b18a55a3 --- /dev/null +++ b/include/boost/fusion/include/prior.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_PRIOR) +#define FUSION_INCLUDE_PRIOR + +#include + +#endif diff --git a/include/boost/fusion/include/query.hpp b/include/boost/fusion/include/query.hpp new file mode 100644 index 00000000..6e5144b5 --- /dev/null +++ b/include/boost/fusion/include/query.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_QUERY) +#define FUSION_INCLUDE_QUERY + +#include + +#endif diff --git a/include/boost/fusion/include/remove.hpp b/include/boost/fusion/include/remove.hpp new file mode 100644 index 00000000..7f0b4657 --- /dev/null +++ b/include/boost/fusion/include/remove.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_REMOVE_IF) +#define FUSION_INCLUDE_REMOVE_IF + +#include + +#endif diff --git a/include/boost/fusion/include/remove_if.hpp b/include/boost/fusion/include/remove_if.hpp new file mode 100644 index 00000000..7f0b4657 --- /dev/null +++ b/include/boost/fusion/include/remove_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_REMOVE_IF) +#define FUSION_INCLUDE_REMOVE_IF + +#include + +#endif diff --git a/include/boost/fusion/include/repetetive_view.hpp b/include/boost/fusion/include/repetetive_view.hpp new file mode 100644 index 00000000..f56bca88 --- /dev/null +++ b/include/boost/fusion/include/repetetive_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_REPETETIVE_VIEW) +#define FUSION_INCLUDE_REPETETIVE_VIEW + +#include + +#endif diff --git a/include/boost/fusion/include/replace.hpp b/include/boost/fusion/include/replace.hpp new file mode 100644 index 00000000..4d0b3af8 --- /dev/null +++ b/include/boost/fusion/include/replace.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_REPLACE) +#define FUSION_INCLUDE_REPLACE + +#include + +#endif diff --git a/include/boost/fusion/include/replace_if.hpp b/include/boost/fusion/include/replace_if.hpp new file mode 100644 index 00000000..354e13ab --- /dev/null +++ b/include/boost/fusion/include/replace_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_REPLACE_IF) +#define FUSION_INCLUDE_REPLACE_IF + +#include + +#endif diff --git a/include/boost/fusion/include/reverse.hpp b/include/boost/fusion/include/reverse.hpp new file mode 100644 index 00000000..3f9fd782 --- /dev/null +++ b/include/boost/fusion/include/reverse.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_REVERSE) +#define FUSION_INCLUDE_REVERSE + +#include + +#endif diff --git a/include/boost/fusion/include/reverse_view.hpp b/include/boost/fusion/include/reverse_view.hpp new file mode 100644 index 00000000..844532d6 --- /dev/null +++ b/include/boost/fusion/include/reverse_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_REVERSE_VIEW) +#define FUSION_INCLUDE_REVERSE_VIEW + +#include + +#endif diff --git a/include/boost/fusion/include/sequence.hpp b/include/boost/fusion/include/sequence.hpp new file mode 100644 index 00000000..09cded77 --- /dev/null +++ b/include/boost/fusion/include/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_SEQUENCE) +#define FUSION_INCLUDE_SEQUENCE + +#include + +#endif diff --git a/include/boost/fusion/include/sequence_base.hpp b/include/boost/fusion/include/sequence_base.hpp new file mode 100644 index 00000000..7e50a237 --- /dev/null +++ b/include/boost/fusion/include/sequence_base.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_SEQUENCE_BASE) +#define FUSION_INCLUDE_SEQUENCE_BASE + +#include + +#endif diff --git a/include/boost/fusion/include/sequence_facade.hpp b/include/boost/fusion/include/sequence_facade.hpp new file mode 100644 index 00000000..b8773e28 --- /dev/null +++ b/include/boost/fusion/include/sequence_facade.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_SEQUENCE_FACADE) +#define FUSION_INCLUDE_SEQUENCE_FACADE + +#include + +#endif diff --git a/include/boost/fusion/include/set.hpp b/include/boost/fusion/include/set.hpp new file mode 100644 index 00000000..90dd5004 --- /dev/null +++ b/include/boost/fusion/include/set.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_SET) +#define FUSION_INCLUDE_SET + +#include + +#endif diff --git a/include/boost/fusion/include/set_fwd.hpp b/include/boost/fusion/include/set_fwd.hpp new file mode 100644 index 00000000..9bc45ad5 --- /dev/null +++ b/include/boost/fusion/include/set_fwd.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_SET_FWD) +#define FUSION_INCLUDE_SET_FWD + +#include + +#endif diff --git a/include/boost/fusion/include/struct.hpp b/include/boost/fusion/include/struct.hpp new file mode 100644 index 00000000..f0886aab --- /dev/null +++ b/include/boost/fusion/include/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_STRUCT) +#define FUSION_INCLUDE_STRUCT + +#include + +#endif diff --git a/include/boost/fusion/include/support.hpp b/include/boost/fusion/include/support.hpp new file mode 100644 index 00000000..d57eafeb --- /dev/null +++ b/include/boost/fusion/include/support.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_SUPPORT) +#define FUSION_INCLUDE_SUPPORT + +#include + +#endif diff --git a/include/boost/fusion/include/tag_of.hpp b/include/boost/fusion/include/tag_of.hpp new file mode 100644 index 00000000..f15b41b5 --- /dev/null +++ b/include/boost/fusion/include/tag_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_TAG_OF) +#define FUSION_INCLUDE_TAG_OF + +#include + +#endif diff --git a/include/boost/fusion/include/transformation.hpp b/include/boost/fusion/include/transformation.hpp new file mode 100644 index 00000000..f14ab70c --- /dev/null +++ b/include/boost/fusion/include/transformation.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_TRANSFORMATION) +#define FUSION_INCLUDE_TRANSFORMATION + +#include + +#endif diff --git a/include/boost/fusion/include/tuple_fwd.hpp b/include/boost/fusion/include/tuple_fwd.hpp new file mode 100644 index 00000000..a66653a3 --- /dev/null +++ b/include/boost/fusion/include/tuple_fwd.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_TUPLE_FWD) +#define FUSION_INCLUDE_TUPLE_FWD + +#include + +#endif diff --git a/include/boost/fusion/include/tuple_tie.hpp b/include/boost/fusion/include/tuple_tie.hpp new file mode 100644 index 00000000..677976a6 --- /dev/null +++ b/include/boost/fusion/include/tuple_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_TUPLE_TIE) +#define FUSION_INCLUDE_TUPLE_TIE + +#include + +#endif diff --git a/include/boost/fusion/include/unused.hpp b/include/boost/fusion/include/unused.hpp new file mode 100644 index 00000000..f91ea8fe --- /dev/null +++ b/include/boost/fusion/include/unused.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_UNUSED) +#define FUSION_INCLUDE_UNUSED + +#include + +#endif diff --git a/include/boost/fusion/include/utility.hpp b/include/boost/fusion/include/utility.hpp new file mode 100644 index 00000000..915d8b16 --- /dev/null +++ b/include/boost/fusion/include/utility.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_UTILITY) +#define FUSION_INCLUDE_UTILITY + +#include + +#endif diff --git a/include/boost/fusion/include/vector.hpp b/include/boost/fusion/include/vector.hpp index d1495c0a..689c2f88 100644 --- a/include/boost/fusion/include/vector.hpp +++ b/include/boost/fusion/include/vector.hpp @@ -1,12 +1,12 @@ /*============================================================================= Copyright (c) 2001-2007 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, 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 +#include #endif diff --git a/include/boost/fusion/include/vector10.hpp b/include/boost/fusion/include/vector10.hpp new file mode 100644 index 00000000..d3e10ddc --- /dev/null +++ b/include/boost/fusion/include/vector10.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_VECTOR10) +#define FUSION_INCLUDE_VECTOR10 + +#include + +#endif diff --git a/include/boost/fusion/include/vector20.hpp b/include/boost/fusion/include/vector20.hpp new file mode 100644 index 00000000..accda290 --- /dev/null +++ b/include/boost/fusion/include/vector20.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_VECTOR20) +#define FUSION_INCLUDE_VECTOR20 + +#include + +#endif diff --git a/include/boost/fusion/include/vector30.hpp b/include/boost/fusion/include/vector30.hpp new file mode 100644 index 00000000..72a72a25 --- /dev/null +++ b/include/boost/fusion/include/vector30.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_VECTOR30) +#define FUSION_INCLUDE_VECTOR30 + +#include + +#endif diff --git a/include/boost/fusion/include/vector40.hpp b/include/boost/fusion/include/vector40.hpp new file mode 100644 index 00000000..427c5319 --- /dev/null +++ b/include/boost/fusion/include/vector40.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_VECTOR40) +#define FUSION_INCLUDE_VECTOR40 + +#include + +#endif diff --git a/include/boost/fusion/include/vector50.hpp b/include/boost/fusion/include/vector50.hpp new file mode 100644 index 00000000..5980373b --- /dev/null +++ b/include/boost/fusion/include/vector50.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_VECTOR50) +#define FUSION_INCLUDE_VECTOR50 + +#include + +#endif diff --git a/include/boost/fusion/include/vector_fwd.hpp b/include/boost/fusion/include/vector_fwd.hpp new file mode 100644 index 00000000..578754fb --- /dev/null +++ b/include/boost/fusion/include/vector_fwd.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_FWD) +#define FUSION_INCLUDE_VECTOR_FWD + +#include + +#endif diff --git a/include/boost/fusion/include/view.hpp b/include/boost/fusion/include/view.hpp new file mode 100644 index 00000000..48405df8 --- /dev/null +++ b/include/boost/fusion/include/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_VIEW) +#define FUSION_INCLUDE_VIEW + +#include + +#endif diff --git a/include/boost/fusion/include/void.hpp b/include/boost/fusion/include/void.hpp new file mode 100644 index 00000000..b3e9cf27 --- /dev/null +++ b/include/boost/fusion/include/void.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_VOID) +#define FUSION_INCLUDE_VOID + +#include + +#endif diff --git a/include/boost/fusion/include/zip.hpp b/include/boost/fusion/include/zip.hpp new file mode 100644 index 00000000..8a565610 --- /dev/null +++ b/include/boost/fusion/include/zip.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_ZIP) +#define FUSION_INCLUDE_ZIP + +#include + +#endif diff --git a/include/boost/fusion/include/zip_view.hpp b/include/boost/fusion/include/zip_view.hpp new file mode 100644 index 00000000..1aecfd4d --- /dev/null +++ b/include/boost/fusion/include/zip_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_ZIP_VIEW) +#define FUSION_INCLUDE_ZIP_VIEW + +#include + +#endif From 02c08d10c947ef7dd64642097909a4696058ea8e Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 05:13:03 +0000 Subject: [PATCH 09/14] updates for fusion 2.1 [SVN r40251] --- include/boost/fusion/include/as_deque.hpp | 12 ++++++++++++ include/boost/fusion/include/as_list.hpp | 12 ++++++++++++ include/boost/fusion/include/as_map.hpp | 12 ++++++++++++ include/boost/fusion/include/as_set.hpp | 12 ++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 include/boost/fusion/include/as_deque.hpp create mode 100644 include/boost/fusion/include/as_list.hpp create mode 100644 include/boost/fusion/include/as_map.hpp create mode 100644 include/boost/fusion/include/as_set.hpp diff --git a/include/boost/fusion/include/as_deque.hpp b/include/boost/fusion/include/as_deque.hpp new file mode 100644 index 00000000..8f1686f2 --- /dev/null +++ b/include/boost/fusion/include/as_deque.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_DEQUE) +#define FUSION_INCLUDE_AS_DEQUE + +#include + +#endif diff --git a/include/boost/fusion/include/as_list.hpp b/include/boost/fusion/include/as_list.hpp new file mode 100644 index 00000000..6c477d24 --- /dev/null +++ b/include/boost/fusion/include/as_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_AS_LIST) +#define FUSION_INCLUDE_AS_LIST + +#include + +#endif diff --git a/include/boost/fusion/include/as_map.hpp b/include/boost/fusion/include/as_map.hpp new file mode 100644 index 00000000..bdfd3f53 --- /dev/null +++ b/include/boost/fusion/include/as_map.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_MAP) +#define FUSION_INCLUDE_AS_MAP + +#include + +#endif diff --git a/include/boost/fusion/include/as_set.hpp b/include/boost/fusion/include/as_set.hpp new file mode 100644 index 00000000..c0d5a8b3 --- /dev/null +++ b/include/boost/fusion/include/as_set.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_SET) +#define FUSION_INCLUDE_AS_SET + +#include + +#endif From 4f92073a2eb0fe2e7d2c2b9de2295dec582503bb Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 05:23:50 +0000 Subject: [PATCH 10/14] more flat includes [SVN r40252] --- include/boost/fusion/include/fused.hpp | 12 ++++++++++++ .../boost/fusion/include/fused_function_object.hpp | 12 ++++++++++++ include/boost/fusion/include/fused_procedure.hpp | 12 ++++++++++++ .../boost/fusion/include/invoke_function_object.hpp | 12 ++++++++++++ include/boost/fusion/include/invoke_procedure.hpp | 12 ++++++++++++ include/boost/fusion/include/make_fused.hpp | 12 ++++++++++++ .../fusion/include/make_fused_function_object.hpp | 12 ++++++++++++ .../boost/fusion/include/make_fused_procedure.hpp | 12 ++++++++++++ .../boost/fusion/include/make_unfused_generic.hpp | 12 ++++++++++++ .../fusion/include/make_unfused_lvalue_args.hpp | 12 ++++++++++++ .../fusion/include/make_unfused_rvalue_args.hpp | 12 ++++++++++++ include/boost/fusion/include/unfused_generic.hpp | 12 ++++++++++++ include/boost/fusion/include/unfused_lvalue_args.hpp | 12 ++++++++++++ include/boost/fusion/include/unfused_rvalue_args.hpp | 12 ++++++++++++ include/boost/fusion/include/unfused_typed.hpp | 12 ++++++++++++ 15 files changed, 180 insertions(+) create mode 100644 include/boost/fusion/include/fused.hpp create mode 100644 include/boost/fusion/include/fused_function_object.hpp create mode 100644 include/boost/fusion/include/fused_procedure.hpp create mode 100644 include/boost/fusion/include/invoke_function_object.hpp create mode 100644 include/boost/fusion/include/invoke_procedure.hpp create mode 100644 include/boost/fusion/include/make_fused.hpp create mode 100644 include/boost/fusion/include/make_fused_function_object.hpp create mode 100644 include/boost/fusion/include/make_fused_procedure.hpp create mode 100644 include/boost/fusion/include/make_unfused_generic.hpp create mode 100644 include/boost/fusion/include/make_unfused_lvalue_args.hpp create mode 100644 include/boost/fusion/include/make_unfused_rvalue_args.hpp create mode 100644 include/boost/fusion/include/unfused_generic.hpp create mode 100644 include/boost/fusion/include/unfused_lvalue_args.hpp create mode 100644 include/boost/fusion/include/unfused_rvalue_args.hpp create mode 100644 include/boost/fusion/include/unfused_typed.hpp diff --git a/include/boost/fusion/include/fused.hpp b/include/boost/fusion/include/fused.hpp new file mode 100644 index 00000000..fa9dd464 --- /dev/null +++ b/include/boost/fusion/include/fused.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_FUSED) +#define FUSION_INCLUDE_FUSED + +#include + +#endif diff --git a/include/boost/fusion/include/fused_function_object.hpp b/include/boost/fusion/include/fused_function_object.hpp new file mode 100644 index 00000000..d35140c6 --- /dev/null +++ b/include/boost/fusion/include/fused_function_object.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_FUSED_FUNCTION_OBJECT) +#define FUSION_INCLUDE_FUSED_FUNCTION_OBJECT + +#include + +#endif diff --git a/include/boost/fusion/include/fused_procedure.hpp b/include/boost/fusion/include/fused_procedure.hpp new file mode 100644 index 00000000..9df4717b --- /dev/null +++ b/include/boost/fusion/include/fused_procedure.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_FUSED_PROCEDURE) +#define FUSION_INCLUDE_FUSED_PROCEDURE + +#include + +#endif diff --git a/include/boost/fusion/include/invoke_function_object.hpp b/include/boost/fusion/include/invoke_function_object.hpp new file mode 100644 index 00000000..4ffeb24d --- /dev/null +++ b/include/boost/fusion/include/invoke_function_object.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_INVOKE_FUNCTION_OBJECT) +#define FUSION_INCLUDE_INVOKE_FUNCTION_OBJECT + +#include + +#endif diff --git a/include/boost/fusion/include/invoke_procedure.hpp b/include/boost/fusion/include/invoke_procedure.hpp new file mode 100644 index 00000000..afd46259 --- /dev/null +++ b/include/boost/fusion/include/invoke_procedure.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_INVOKE_PROCEDURE) +#define FUSION_INCLUDE_INVOKE_PROCEDURE + +#include + +#endif diff --git a/include/boost/fusion/include/make_fused.hpp b/include/boost/fusion/include/make_fused.hpp new file mode 100644 index 00000000..6ed860ef --- /dev/null +++ b/include/boost/fusion/include/make_fused.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_FUSED) +#define FUSION_INCLUDE_MAKE_FUSED + +#include + +#endif diff --git a/include/boost/fusion/include/make_fused_function_object.hpp b/include/boost/fusion/include/make_fused_function_object.hpp new file mode 100644 index 00000000..dfc1295b --- /dev/null +++ b/include/boost/fusion/include/make_fused_function_object.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_FUSED_FUNCTION_OBJECT) +#define FUSION_INCLUDE_MAKE_FUSED_FUNCTION_OBJECT + +#include + +#endif diff --git a/include/boost/fusion/include/make_fused_procedure.hpp b/include/boost/fusion/include/make_fused_procedure.hpp new file mode 100644 index 00000000..94e44717 --- /dev/null +++ b/include/boost/fusion/include/make_fused_procedure.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_FUSED_PROCEDURE) +#define FUSION_INCLUDE_MAKE_FUSED_PROCEDURE + +#include + +#endif diff --git a/include/boost/fusion/include/make_unfused_generic.hpp b/include/boost/fusion/include/make_unfused_generic.hpp new file mode 100644 index 00000000..dcebceb1 --- /dev/null +++ b/include/boost/fusion/include/make_unfused_generic.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_UNFUSED_GENERIC) +#define FUSION_INCLUDE_MAKE_UNFUSED_GENERIC + +#include + +#endif diff --git a/include/boost/fusion/include/make_unfused_lvalue_args.hpp b/include/boost/fusion/include/make_unfused_lvalue_args.hpp new file mode 100644 index 00000000..1805bb18 --- /dev/null +++ b/include/boost/fusion/include/make_unfused_lvalue_args.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_UNFUSED_LVALUE_ARGS) +#define FUSION_INCLUDE_MAKE_UNFUSED_LVALUE_ARGS + +#include + +#endif diff --git a/include/boost/fusion/include/make_unfused_rvalue_args.hpp b/include/boost/fusion/include/make_unfused_rvalue_args.hpp new file mode 100644 index 00000000..0d546be7 --- /dev/null +++ b/include/boost/fusion/include/make_unfused_rvalue_args.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_UNFUSED_RVALUE_ARGS) +#define FUSION_INCLUDE_MAKE_UNFUSED_RVALUE_ARGS + +#include + +#endif diff --git a/include/boost/fusion/include/unfused_generic.hpp b/include/boost/fusion/include/unfused_generic.hpp new file mode 100644 index 00000000..d377900f --- /dev/null +++ b/include/boost/fusion/include/unfused_generic.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_UNFUSED_GENERIC) +#define FUSION_INCLUDE_UNFUSED_GENERIC + +#include + +#endif diff --git a/include/boost/fusion/include/unfused_lvalue_args.hpp b/include/boost/fusion/include/unfused_lvalue_args.hpp new file mode 100644 index 00000000..17acc261 --- /dev/null +++ b/include/boost/fusion/include/unfused_lvalue_args.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_UNFUSED_LVALUE_ARGS) +#define FUSION_INCLUDE_UNFUSED_LVALUE_ARGS + +#include + +#endif diff --git a/include/boost/fusion/include/unfused_rvalue_args.hpp b/include/boost/fusion/include/unfused_rvalue_args.hpp new file mode 100644 index 00000000..556b2dee --- /dev/null +++ b/include/boost/fusion/include/unfused_rvalue_args.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_UNFUSED_RVALUE_ARGS) +#define FUSION_INCLUDE_UNFUSED_RVALUE_ARGS + +#include + +#endif diff --git a/include/boost/fusion/include/unfused_typed.hpp b/include/boost/fusion/include/unfused_typed.hpp new file mode 100644 index 00000000..a118b306 --- /dev/null +++ b/include/boost/fusion/include/unfused_typed.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_UNFUSED_TYPED) +#define FUSION_INCLUDE_UNFUSED_TYPED + +#include + +#endif From 6c40cc9307294dc46f79ce2fc55c58a130c84b91 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 05:39:33 +0000 Subject: [PATCH 11/14] more flat includes [SVN r40253] --- include/boost/fusion/include/at_key.hpp | 12 ++++++++++++ include/boost/fusion/include/back.hpp | 12 ++++++++++++ include/boost/fusion/include/cons_tie.hpp | 12 ++++++++++++ include/boost/fusion/include/deque_tie.hpp | 13 +++++++++++++ include/boost/fusion/include/empty.hpp | 12 ++++++++++++ include/boost/fusion/include/front.hpp | 12 ++++++++++++ include/boost/fusion/include/greater.hpp | 12 ++++++++++++ include/boost/fusion/include/greater_equal.hpp | 12 ++++++++++++ include/boost/fusion/include/has_key.hpp | 12 ++++++++++++ include/boost/fusion/include/ignore.hpp | 13 +++++++++++++ include/boost/fusion/include/less.hpp | 12 ++++++++++++ include/boost/fusion/include/less_equal.hpp | 12 ++++++++++++ include/boost/fusion/include/list_tie.hpp | 13 +++++++++++++ include/boost/fusion/include/make_deque.hpp | 12 ++++++++++++ include/boost/fusion/include/make_list.hpp | 12 ++++++++++++ include/boost/fusion/include/make_map.hpp | 12 ++++++++++++ include/boost/fusion/include/make_set.hpp | 12 ++++++++++++ include/boost/fusion/include/map_tie.hpp | 12 ++++++++++++ include/boost/fusion/include/not_equal_to.hpp | 13 +++++++++++++ include/boost/fusion/include/pair_tie.hpp | 12 ++++++++++++ include/boost/fusion/include/value_at_key.hpp | 12 ++++++++++++ 21 files changed, 256 insertions(+) create mode 100644 include/boost/fusion/include/at_key.hpp create mode 100644 include/boost/fusion/include/back.hpp create mode 100644 include/boost/fusion/include/cons_tie.hpp create mode 100644 include/boost/fusion/include/deque_tie.hpp create mode 100644 include/boost/fusion/include/empty.hpp create mode 100644 include/boost/fusion/include/front.hpp create mode 100644 include/boost/fusion/include/greater.hpp create mode 100644 include/boost/fusion/include/greater_equal.hpp create mode 100644 include/boost/fusion/include/has_key.hpp create mode 100644 include/boost/fusion/include/ignore.hpp create mode 100644 include/boost/fusion/include/less.hpp create mode 100644 include/boost/fusion/include/less_equal.hpp create mode 100644 include/boost/fusion/include/list_tie.hpp create mode 100644 include/boost/fusion/include/make_deque.hpp create mode 100644 include/boost/fusion/include/make_list.hpp create mode 100644 include/boost/fusion/include/make_map.hpp create mode 100644 include/boost/fusion/include/make_set.hpp create mode 100644 include/boost/fusion/include/map_tie.hpp create mode 100644 include/boost/fusion/include/not_equal_to.hpp create mode 100644 include/boost/fusion/include/pair_tie.hpp create mode 100644 include/boost/fusion/include/value_at_key.hpp diff --git a/include/boost/fusion/include/at_key.hpp b/include/boost/fusion/include/at_key.hpp new file mode 100644 index 00000000..89a0aae2 --- /dev/null +++ b/include/boost/fusion/include/at_key.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_KEY) +#define FUSION_INCLUDE_AT_KEY + +#include + +#endif diff --git a/include/boost/fusion/include/back.hpp b/include/boost/fusion/include/back.hpp new file mode 100644 index 00000000..d5e77f0a --- /dev/null +++ b/include/boost/fusion/include/back.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_BACK) +#define FUSION_INCLUDE_BACK + +#include + +#endif diff --git a/include/boost/fusion/include/cons_tie.hpp b/include/boost/fusion/include/cons_tie.hpp new file mode 100644 index 00000000..0fa5a592 --- /dev/null +++ b/include/boost/fusion/include/cons_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_CONS_TIE) +#define FUSION_INCLUDE_CONS_TIE + +#include + +#endif diff --git a/include/boost/fusion/include/deque_tie.hpp b/include/boost/fusion/include/deque_tie.hpp new file mode 100644 index 00000000..20ab1958 --- /dev/null +++ b/include/boost/fusion/include/deque_tie.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_GENERATION) +#define FUSION_INCLUDE_GENERATION + +#include +#include + +#endif diff --git a/include/boost/fusion/include/empty.hpp b/include/boost/fusion/include/empty.hpp new file mode 100644 index 00000000..0a8af33c --- /dev/null +++ b/include/boost/fusion/include/empty.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_EMPTY) +#define FUSION_INCLUDE_EMPTY + +#include + +#endif diff --git a/include/boost/fusion/include/front.hpp b/include/boost/fusion/include/front.hpp new file mode 100644 index 00000000..495deaf7 --- /dev/null +++ b/include/boost/fusion/include/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_FRONT) +#define FUSION_INCLUDE_FRONT + +#include + +#endif diff --git a/include/boost/fusion/include/greater.hpp b/include/boost/fusion/include/greater.hpp new file mode 100644 index 00000000..a5ff306f --- /dev/null +++ b/include/boost/fusion/include/greater.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_NOT_GREATER) +#define FUSION_INCLUDE_NOT_GREATER + +#include + +#endif diff --git a/include/boost/fusion/include/greater_equal.hpp b/include/boost/fusion/include/greater_equal.hpp new file mode 100644 index 00000000..3a092551 --- /dev/null +++ b/include/boost/fusion/include/greater_equal.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_GREATER_EQUAL) +#define FUSION_INCLUDE_GREATER_EQUAL + +#include + +#endif diff --git a/include/boost/fusion/include/has_key.hpp b/include/boost/fusion/include/has_key.hpp new file mode 100644 index 00000000..4eef64a1 --- /dev/null +++ b/include/boost/fusion/include/has_key.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_HAS_KEY) +#define FUSION_INCLUDE_EMPTY + +#include + +#endif diff --git a/include/boost/fusion/include/ignore.hpp b/include/boost/fusion/include/ignore.hpp new file mode 100644 index 00000000..20ab1958 --- /dev/null +++ b/include/boost/fusion/include/ignore.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_GENERATION) +#define FUSION_INCLUDE_GENERATION + +#include +#include + +#endif diff --git a/include/boost/fusion/include/less.hpp b/include/boost/fusion/include/less.hpp new file mode 100644 index 00000000..bd4d2771 --- /dev/null +++ b/include/boost/fusion/include/less.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_LESS) +#define FUSION_INCLUDE_LESS + +#include + +#endif diff --git a/include/boost/fusion/include/less_equal.hpp b/include/boost/fusion/include/less_equal.hpp new file mode 100644 index 00000000..2ac1b72b --- /dev/null +++ b/include/boost/fusion/include/less_equal.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_LESS_EQUAL) +#define FUSION_INCLUDE_LESS_EQUAL + +#include + +#endif diff --git a/include/boost/fusion/include/list_tie.hpp b/include/boost/fusion/include/list_tie.hpp new file mode 100644 index 00000000..20ab1958 --- /dev/null +++ b/include/boost/fusion/include/list_tie.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_GENERATION) +#define FUSION_INCLUDE_GENERATION + +#include +#include + +#endif diff --git a/include/boost/fusion/include/make_deque.hpp b/include/boost/fusion/include/make_deque.hpp new file mode 100644 index 00000000..73ee13d5 --- /dev/null +++ b/include/boost/fusion/include/make_deque.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_DEQUE) +#define FUSION_INCLUDE_MAKE_DEQUE + +#include + +#endif diff --git a/include/boost/fusion/include/make_list.hpp b/include/boost/fusion/include/make_list.hpp new file mode 100644 index 00000000..2fb5d12e --- /dev/null +++ b/include/boost/fusion/include/make_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_MAKE_LIST) +#define FUSION_INCLUDE_MAKE_LIST + +#include + +#endif diff --git a/include/boost/fusion/include/make_map.hpp b/include/boost/fusion/include/make_map.hpp new file mode 100644 index 00000000..d5e05c94 --- /dev/null +++ b/include/boost/fusion/include/make_map.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_MAP) +#define FUSION_INCLUDE_MAKE_MAP + +#include + +#endif diff --git a/include/boost/fusion/include/make_set.hpp b/include/boost/fusion/include/make_set.hpp new file mode 100644 index 00000000..a2470ade --- /dev/null +++ b/include/boost/fusion/include/make_set.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_SET) +#define FUSION_INCLUDE_MAKE_SET + +#include + +#endif diff --git a/include/boost/fusion/include/map_tie.hpp b/include/boost/fusion/include/map_tie.hpp new file mode 100644 index 00000000..87e4130f --- /dev/null +++ b/include/boost/fusion/include/map_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_MAP_TIE) +#define FUSION_INCLUDE_MAP_TIE + +#include + +#endif diff --git a/include/boost/fusion/include/not_equal_to.hpp b/include/boost/fusion/include/not_equal_to.hpp new file mode 100644 index 00000000..9e23b899 --- /dev/null +++ b/include/boost/fusion/include/not_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_NOT_EQUAL_TO) +#define FUSION_INCLUDE_NOT_EQUAL_TO + +#include +#include + +#endif diff --git a/include/boost/fusion/include/pair_tie.hpp b/include/boost/fusion/include/pair_tie.hpp new file mode 100644 index 00000000..5096ef4f --- /dev/null +++ b/include/boost/fusion/include/pair_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_PAIR_TIE) +#define FUSION_INCLUDE_PAIR_TIE + +#include + +#endif diff --git a/include/boost/fusion/include/value_at_key.hpp b/include/boost/fusion/include/value_at_key.hpp new file mode 100644 index 00000000..4ab3dc14 --- /dev/null +++ b/include/boost/fusion/include/value_at_key.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_AT_KEY) +#define FUSION_INCLUDE_VALUE_AT_KEY + +#include + +#endif From db4f2ba8472573fcbb336f8ff61ab1f68af8447f Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 05:41:23 +0000 Subject: [PATCH 12/14] more flat includes [SVN r40254] --- include/boost/fusion/include/in.hpp | 12 ++++++++++++ include/boost/fusion/include/out.hpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 include/boost/fusion/include/in.hpp create mode 100644 include/boost/fusion/include/out.hpp diff --git a/include/boost/fusion/include/in.hpp b/include/boost/fusion/include/in.hpp new file mode 100644 index 00000000..ca285c0e --- /dev/null +++ b/include/boost/fusion/include/in.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_IN) +#define FUSION_INCLUDE_IN + +#include + +#endif diff --git a/include/boost/fusion/include/out.hpp b/include/boost/fusion/include/out.hpp new file mode 100644 index 00000000..9ecef3e7 --- /dev/null +++ b/include/boost/fusion/include/out.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_OUT) +#define FUSION_INCLUDE_OUT + +#include + +#endif From ea0da68ccdccd9ab97f9f56a4250295dcfe14c79 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sun, 21 Oct 2007 05:51:31 +0000 Subject: [PATCH 13/14] missing copyright [SVN r40257] --- .../fusion/algorithm/iteration/detail/fold.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/boost/fusion/algorithm/iteration/detail/fold.hpp b/include/boost/fusion/algorithm/iteration/detail/fold.hpp index 542a8114..390b188c 100644 --- a/include/boost/fusion/algorithm/iteration/detail/fold.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/fold.hpp @@ -1,3 +1,10 @@ +/*============================================================================= + 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_FOLD_HPP_20070528_1253) #define BOOST_FUSION_FOLD_HPP_20070528_1253 @@ -98,7 +105,7 @@ namespace detail struct unrolled_fold<3> { template - static typename result_of_unrolled_fold::type + static typename result_of_unrolled_fold::type call(I0 const& i0, State const& state, F f) { typedef typename result_of::next::type I1; @@ -113,7 +120,7 @@ namespace detail struct unrolled_fold<2> { template - static typename result_of_unrolled_fold::type + static typename result_of_unrolled_fold::type call(I0 const& i0, State const& state, F f) { typedef typename result_of::next::type I1; @@ -126,7 +133,7 @@ namespace detail struct unrolled_fold<1> { template - static typename result_of_unrolled_fold::type + static typename result_of_unrolled_fold::type call(I0 const& i0, State const& state, F f) { return f(*i0, state); From d10270f7554655ee26e57e03d1514e4dcfe3f779 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Tue, 23 Oct 2007 23:29:08 +0000 Subject: [PATCH 14/14] remove superfluous include [SVN r40383] --- .../boost/fusion/container/vector/vector.hpp | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index bd05badd..aef3134c 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -1,7 +1,7 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, 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) @@ -9,7 +9,6 @@ #include #include -#include #include #include #include @@ -24,11 +23,11 @@ namespace boost { namespace fusion struct fusion_sequence_tag; template - struct vector + struct vector : sequence_base > { private: - + typedef typename detail::vector_n_chooser< BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>::type vector_n; @@ -37,7 +36,7 @@ namespace boost { namespace fusion friend struct vector; public: - + typedef typename vector_n::types types; typedef typename vector_n::fusion_tag fusion_tag; typedef typename vector_n::tag tag; @@ -93,10 +92,10 @@ namespace boost { namespace fusion typename mpl::at_c::type >::type at_impl(mpl::int_ index) - { - return vec.at_impl(index); + { + return vec.at_impl(index); } - + template typename add_reference< typename add_const< @@ -104,8 +103,8 @@ namespace boost { namespace fusion >::type >::type at_impl(mpl::int_ index) const - { - return vec.at_impl(index); + { + return vec.at_impl(index); } template @@ -113,8 +112,8 @@ namespace boost { namespace fusion typename mpl::at::type >::type at_impl(I index) - { - return vec.at_impl(mpl::int_()); + { + return vec.at_impl(mpl::int_()); } template @@ -124,21 +123,21 @@ namespace boost { namespace fusion >::type >::type at_impl(I index) const - { + { return vec.at_impl(mpl::int_()); - } + } private: - + #if BOOST_WORKAROUND(BOOST_MSVC, <= 1400) - static vector_n const& + static vector_n const& ctor_helper(vector const& rhs, mpl::true_) { return rhs.vec; } template - static T const& + static T const& ctor_helper(T const& rhs, mpl::false_) { return rhs;

::type`. ]] + [[`P()`] [Default construction.]] + [[`P(s)`] [Construct a pair given value for the second type, `s`.]] + [[`P(p2)`] [Copy constructs a pair from another pair, `p2`.]] + [[`p = p2`] [Assigns a pair, p1, from another pair, `p2`.]] + [[make_pair(s)] [Make a pair given the first type, `F`, and a value for + the second type, `s`. The second type assumes the type of `s`]] + [[`o << p`] [Output `p` to output stream, `o`.]] + [[`i >> p`] [Input `p` from input stream, `i`.]] + [[`p == p2`] [Tests two pairs for equality.]] + [[`p != p2`] [Tests two pairs for inequality.]] +] + +[heading Header] + + #include + +[heading Example] + + pair p('X'); + std::cout << p << std::endl; + std::cout << make_pair('X') << std::endl; + assert((p == make_pair('X'))); + +[endsect] + +[endsect] + diff --git a/doc/tuples.qbk b/doc/tuples.qbk new file mode 100644 index 00000000..038c8180 --- /dev/null +++ b/doc/tuples.qbk @@ -0,0 +1,264 @@ +[section Tuples] +The TR1 technical report describes extensions to the C++ standard library. +Many of these extensions will be considered for the next +iteration of the C++ standard. TR1 describes a tuple type, and +support for treating `std::pair` as a type of tuple. + +Fusion provides full support for the __tr1__tuple__ interface, and the extended +uses of `std::pair` described in the TR1 document. + +[section Class template tuple] +Fusion's implementation of the __tr1__tuple__ is also a fusion __forward_sequence__. +As such the fusion tuple type provides a lot of functionality beyond that required by TR1. + +Currently tuple is basically a synonym for __vector__, although this may be changed +in future releases of fusion. + +[heading Synopsis] + template< + typename T1 = __unspecified__, + typename T2 = __unspecified__, + ... + typename TN = __unspecified__> + class tuple; + +[heading Header] + #include + +[section Construction] + +[heading Description] +The __tr1__tuple__ type provides a default constructor, a constructor that takes initializers for all of its elements, a copy constructor, and a converting copy constructor. The details of the various constructors are described in this section. + +[heading Specification] + +[variablelist Notation + [[`T1 ... TN`, `U1 ... UN`][Tuple element types]] + [[`P1 ... PN`] [Parameter types]] + [[`Ti`, `Ui`] [The type of the `i`th element of a tuple]] + [[`Pi`] [The type of the `i`th parameter]] +] + + tuple(); + +[*Requirements]: Each `Ti` is default constructable. + +[*Semantics]: Default initializes each element of the tuple. + + tuple(P1,P2,...,PN); + +[*Requirements]: Each `Pi` is `Ti` if `Ti` is a reference type, `const Ti&` otherwise. + +[*Semantics]: Copy initializes each element with the corresponding parameter. + + tuple(const tuple& t); + +[*Requirements]: Each `Ti` should be copy constructable. + +[*Semantics]: Copy constructs each element of `*this` with the corresponding element of `t`. + + template + tuple(const tuple& t); + +[*Requirements]: Each `Ti` shall be constructible from the corresponding `Ui`. + +[*Semantics]: Constructs each element of `*this` with the corresponding element of `t`. + +[endsect] + +[section Tuple creation functions] + +[heading Description] +TR1 describes 2 utility functions for creating __tr1__tuple__s. `make_tuple` builds a tuple out of it's argument list, and `tie` builds a tuple of references to it's arguments. The details of these creation functions are described in this section. + +[heading Specification] + + template + tuple make_tuple(const T1& t1, const T2& t2, ..., const TN& tn); + +Where `Vi` is `X&` if the cv-unqualified type `Ti` is `reference_wrapper`, otherwise `Vi` is `Ti`. + +[*Returns]: `tuple(t1, t2, ..., tN)` + + template + tuple tie(T1& t1, T2& t2, ..., TN& tn); + +[*Returns]: tuple(t1, t2, ..., tN). When argument `ti` is `ignore`, assigning any value to the corresponding tuple element has has no effect. + +[endsect] + +[section Tuple helper classes] + +[heading Description] +The __tr1__tuple__ provides 2 helper traits, for compile time access to the tuple size, and the element types. + +[heading Specification] + + tuple_size::value + +[*Requires]: `T` is any fusion sequence type, including `tuple`. + +[*Type]: __mpl_integral_constant__ + +[*Value]: The number of elements in the sequence. Equivalent to `__result_of_size__::type`. + + tuple_element::type + +[*Requires]: `T` is any fusion sequence type, including `tuple`. `0 <= I < N` or the program is ill formed. + +[*Value]: The type of the `I`th element of `T`. Equivalent to `__result_of_value_at__::type`. + +[endsect] + +[section Element access] + +[heading Description] +The __tr1__tuple__ provides the `get` function to provide access to it's elements by zero based numeric index. + +[heading Specification] + template + RJ get(T& t); + +[*Requires]: `0 < I <= N`. The program is ill formed if `I` is out of bounds. +`T` is any fusion sequence type, including `tuple`. + +[*Return type]: `RJ` is equivalent to `__result_of_at_c__::type`. + +[*Returns]: A reference to the `I`th element of `T`. + + template + PJ get(T const& t); + +[*Requires]: `0 < I <= N`. The program is ill formed if `I` is out of bounds. +`T` is any fusion sequence type, including `tuple`. + +[*Return type]: `PJ` is equivalent to `__result_of_at_c__::type`. + +[*Returns]: A const reference to the `I`th element of `T`. + +[endsect] + +[section Relational operators] + +[heading Description] +The __tr1__tuple__ provides the standard boolean relational operators. + +[heading Specification] + +[variablelist Notation + [[`T1 ... TN`, `U1 ... UN`][Tuple element types]] + [[`P1 ... PN`] [Parameter types]] + [[`Ti`, `Ui`] [The type of the `i`th element of a tuple]] + [[`Pi`] [The type of the `i`th parameter]] +] + + template + bool operator==( + const tuple& lhs, + const tuple& rhs); + +[*Requirements]: For all `i`, `1 <= i < N`, `__tuple_get__(lhs) == __tuple_get__(rhs)` is a valid +expression returning a type that is convertible to `bool`. + +[*Semantics]: Returns `true` if and only if `__tuple_get__(lhs) == __tuple_get__(rhs)` for all `i`. +For any 2 zero length tuples `e` and `f`, `e == f` returns `true`. + + template + bool operator<( + const tuple& lhs, + const tuple& rhs); + +[*Requirements]: For all `i`, `1 <= i < N`, `__tuple_get__(lhs) < __tuple_get__(rhs)` is a valid +expression returning a type that is convertible to `bool`. + +[*Semantics]: Returns the lexicographical comparison of between `lhs` and `rhs`. + + template + bool operator!=( + const tuple& lhs, + const tuple& rhs); + +[*Requirements]: For all `i`, `1 <= i < N`, `__tuple_get__(lhs) == __tuple_get__(rhs)` is a valid +expression returning a type that is convertible to `bool`. + +[*Semantics]: Returns `!(lhs == rhs)`. + + template + bool operator<=( + const tuple& lhs, + const tuple& rhs); + +[*Requirements]: For all `i`, `1 <= i < N`, `__tuple_get__(rhs) < __tuple_get__(lhs)` is a valid +expression returning a type that is convertible to `bool`. + +[*Semantics]: Returns `!(rhs < lhs)` + + template + bool operator>( + const tuple& lhs, + const tuple& rhs); + +[*Requirements]: For all `i`, `1 <= i < N`, `__tuple_get__(rhs) < __tuple_get__(lhs)` is a valid +expression returning a type that is convertible to `bool`. + +[*Semantics]: Returns `rhs < lhs`. + + template + bool operator>=( + const tuple& lhs, + const tuple& rhs); + +[*Requirements]: For all `i`, `1 <= i < N`, `__tuple_get__(lhs) < __tuple_get__(rhs)` is a valid +expression returning a type that is convertible to `bool`. + +[*Semantics]: Returns `!(lhs < rhs)`. + +[endsect] + +[endsect] + +[section Pairs] + +[heading Description] +The __tr1__tuple__ interface is specified to provide uniform access to `std::pair` as if it were a 2 element tuple. + +[heading Specification] + + tuple_size >::value + +[*Type]: An __mpl_integral_constant__ + +[*Value]: Returns 2, the number of elements in a pair. + + tuple_element<0, std::pair >::type + +[*Type]: `T1` + +[*Value]: Returns the type of the first element of the pair + + tuple_element<1, std::pair >::type + +[*Type]: `T2` + +[*Value]: Returns thetype of the second element of the pair + + template + P& get(std::pair& pr); + + template + const P& get(const std::pair& pr); + +[*Type]: If `I == 0` `P` is `T1`, else if `I == 1` `P` is `T2` else the program is ill-formed. + +[*Returns: `pr.first` if `I == 0` else `pr.second`. + +[endsect] + +[endsect] + diff --git a/example/cookbook/do_the_bind.cpp b/example/cookbook/do_the_bind.cpp new file mode 100644 index 00000000..33772383 --- /dev/null +++ b/example/cookbook/do_the_bind.cpp @@ -0,0 +1,237 @@ +/*============================================================================= + 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). + + Problem: + + How to "do the Bind?" + + This recipe shows how to implement a function binder, similar to + Boost.Bind based on the Functional module of Fusion. + + It works as follows: + + 'bind' is a global, stateless function object. It is implemented in + fused form (fused_binder) and transformed into a variadic function + object. When called, 'bind' returns another function object, which + holds the arguments of the call to 'bind'. It is, again, implemented + in fused form (fused_bound_function) and transformed into unfused + form. +==============================================================================*/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include + +namespace impl +{ + namespace fusion = boost::fusion; + namespace traits = boost::fusion::traits; + namespace result_of = boost::fusion::result_of; + namespace mpl = boost::mpl; + using mpl::placeholders::_; + + // Placeholders (we inherit from mpl::int_, so we can use placeholders + // as indices for fusion::at, later) + template struct placeholder : mpl::int_ { }; + + // A traits class to find out whether T is a placeholeder + template struct is_placeholder : mpl::false_ { }; + template struct is_placeholder< placeholder > : mpl::true_ { }; + template struct is_placeholder< placeholder & > : mpl::true_ { }; + template struct is_placeholder< placeholder const > : mpl::true_ { }; + template struct is_placeholder< placeholder const & > : mpl::true_ { }; + + // This class template provides a Polymorphic Function Object to be used + // with fusion::transform. It is applied to the sequence of arguments that + // describes the binding and holds a reference to the sequence of arguments + // from the final call. + template struct argument_transform + { + FinalArgs const & ref_final_args; + public: + + explicit argument_transform(FinalArgs const & final_args) + : ref_final_args(final_args) + { } + + // A placeholder? Replace it with an argument from the final call... + template + inline typename result_of::at_c::type + operator()(placeholder const &) const + { + return fusion::at_c(this->ref_final_args); + } + // ...just return the bound argument, otherwise. + template inline T & operator()(T & bound) const + { + return bound; + } + + template + struct result; + + template + struct result< Self (T) > + : mpl::eval_if< is_placeholder, + result_of::at::type>, + mpl::identity + > + { }; + }; + + // Fused implementation of the bound function, the function object + // returned by bind + template class fused_bound_function + { + typedef typename traits::deduce_sequence::type bound_args; + + bound_args fsq_bind_args; + public: + + fused_bound_function(BindArgs const & bind_args) + : fsq_bind_args(bind_args) + { } + + template + struct result; + + template + struct result_impl + : result_of::invoke< typename result_of::front::type, + typename result_of::transform< + typename result_of::pop_front::type, + argument_transform const + >::type + > + { }; + + template + struct result< Self (FinalArgs) > + : result_impl< typename boost::remove_reference::type > + { }; + + template + inline typename result_impl::type + operator()(FinalArgs const & final_args) const + { + return fusion::invoke( fusion::front(this->fsq_bind_args), + fusion::transform( fusion::pop_front(this->fsq_bind_args), + argument_transform(final_args) ) ); + } + // Could add a non-const variant - omitted for readability + + }; + + // Fused implementation of the 'bind' function + struct fused_binder + { + template + struct result; + + template + struct result_impl + { + // We have to transform the arguments so they are held by-value + // in the returned function. + typedef fusion::unfused_generic< + fused_bound_function > type; + }; + + template + struct result< Self (BindArgs) > + : result_impl< typename boost::remove_reference::type > + { }; + + template + inline typename result_impl< BindArgs >::type + operator()(BindArgs & bind_args) const + { + return typename result< void(BindArgs) >::type(bind_args); + } + }; + + // The binder's unfused type. We use unfused_rvalue_args to make that + // thing more similar to Boost.Bind. Because of that we have to use + // Boost.Ref (below in the sample code) + typedef fusion::unfused_rvalue_args binder; +} + +// Placeholder globals +impl::placeholder<0> const _1_ = impl::placeholder<0>(); +impl::placeholder<1> const _2_ = impl::placeholder<1>(); +impl::placeholder<2> const _3_ = impl::placeholder<2>(); +impl::placeholder<3> const _4_ = impl::placeholder<3>(); + +// The bind function is a global, too +impl::binder const bind = impl::binder(); + + +// OK, let's try it out: + +struct func +{ + typedef int result_type; + + inline int operator()() const + { + std::cout << "operator()" << std::endl; + return 0; + } + + template + inline int operator()(A const & a) const + { + std::cout << "operator()(A const & a)" << std::endl; + std::cout << " a = " << a << " A = " << typeid(A).name() << std::endl; + return 1; + } + + template + inline int operator()(A const & a, B & b) const + { + std::cout << "operator()(A const & a, B & b)" << std::endl; + std::cout << " a = " << a << " A = " << typeid(A).name() << std::endl; + std::cout << " b = " << b << " B = " << typeid(B).name() << std::endl; + return 2; + } +}; + +int main() +{ + func f; + int value = 42; + using boost::ref; + + int errors = 0; + errors += !( bind(f)() == 0); + errors += !( bind(f,"Hi")() == 1); + errors += !( bind(f,_1_)("there.") == 1); + errors += !( bind(f,"The answer is",_1_)(value) == 2); + errors += !( bind(f,_1_,ref(value))("Really?") == 2); + errors += !( bind(f,_1_,_2_)("Dunno. If there is an answer, it's",value) == 2); + + return !! errors; +} + diff --git a/example/cookbook/fill_em_up.cpp b/example/cookbook/fill_em_up.cpp new file mode 100644 index 00000000..69576612 --- /dev/null +++ b/example/cookbook/fill_em_up.cpp @@ -0,0 +1,105 @@ +/*============================================================================= + Copyright (c) 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) + + Problem: + + So... you have an input sequence I and a target vector R. You want to + copy I into R. But, I may have less elements than the result vector R. + For those elements not in R, you want them to be default constructed. + + Here's a case: + + I: list + R: vector + + You want the elements at the right of I not in R (i.e. int, short) + default constructed. Those at the left, found in both I and R, you want + to simply copy from I. + + Of course you want to be able to handle any type of I and R. + +==============================================================================*/ + +// We'll use these containers as examples +#include +#include + +// For doing I/O +#include + +// We'll use join and advance for processing +#include +#include + +// The fusion <--> MPL link header +#include + +// Same-o same-o +#include +#include + +int +main() +{ + using namespace boost::fusion; + using namespace boost; + + // Let's specify our own tuple delimeters for nicer printing + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + // Here's your input sequence + typedef list I; + I i(123.456, "Hello"); + + // Here's your output sequence. For now, it is just a typedef + typedef vector R; + + // Let's get the sizes of the sequences. Yeah, you already know that. + // But with templates, you are simply given, say, R and I, corresponding + // to the types of the sequences. You'll have to deal with it generically. + static int const r_size = result_of::size::value; + static int const i_size = result_of::size::value; + + // Make sure that I has no more elements than R + // Be nice and catch obvious errors earlier rather than later. + // Without this assert, the mistake will still be caught by Fusion, + // but the error will point to somewhere really obscure. + BOOST_STATIC_ASSERT(i_size <= r_size); + + // Let's get the begin and end iterator types of the output sequence + // There's no actual vector yet. We just want to know the types. + typedef result_of::begin::type r_begin; + typedef result_of::end::type r_end; + + // Let's skip i_size elements from r_begin. Again, we just want to know the type. + typedef result_of::advance_c::type r_advance; + + // Now, make MPL iterators from r_advance and r_end. Ditto, just types. + typedef mpl::fusion_iterator mpl_r_advance; + typedef mpl::fusion_iterator mpl_r_end; + + // Make an mpl::iterator_range from the MPL iterators we just created + // You guessed it! --just a type. + typedef mpl::iterator_range tail; + + // Use join to join the input sequence and our mpl::iterator_range + // Our mpl::iterator_range is 'tail'. Here, we'll actually instantiate + // 'tail'. Notice that this is a flyweight object, typically just 1 byte + // in size -- it doesn't really hold any data, but is a fully conforming + // sequence nonetheless. When asked to return its elements, 'tail' returns + // each element default constructed. Breeds like a rabbit! + + // Construct R from the joined sequences: + R r(join(i, tail())); + + // Then finally, print the result: + std::cout << r << std::endl; + + return 0; +} + diff --git a/example/extension/Jamfile b/example/extension/Jamfile new file mode 100644 index 00000000..cf062603 --- /dev/null +++ b/example/extension/Jamfile @@ -0,0 +1,18 @@ +#============================================================================== +# Copyright (c) 2003-2006 Joel de Guzman +# Copyright (c) 2006 Dan Marsden +# +# 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) +#============================================================================== + +# bring in rules for testing +import testing ; + +{ + test-suite example : + + [ run test_example.cpp : : : : ] ; +} + diff --git a/example/extension/detail/advance_impl.hpp b/example/extension/detail/advance_impl.hpp new file mode 100644 index 00000000..3d3691b2 --- /dev/null +++ b/example/extension/detail/advance_impl.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(BOOST_FUSION_ADVANCE_IMPL_20060222_2150) +#define BOOST_FUSION_ADVANCE_IMPL_20060222_2150 + +namespace example +{ + struct example_struct_iterator_tag; + + template + struct example_struct_iterator; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct advance_impl; + + template<> + struct advance_impl + { + template + struct apply + { + typedef typename Iterator::struct_type struct_type; + typedef typename Iterator::index index; + typedef example::example_struct_iterator< + struct_type, index::value + N::value> type; + + static type + call(Iterator const& it) + { + return type(it.struct_); + } + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/at_impl.hpp b/example/extension/detail/at_impl.hpp new file mode 100644 index 00000000..c65650d1 --- /dev/null +++ b/example/extension/detail/at_impl.hpp @@ -0,0 +1,67 @@ +/*============================================================================= + 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_20060223_2017) +#define BOOST_FUSION_AT_IMPL_20060223_2017 + +#include +#include +#include +#include + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply; + + template + struct apply > + { + typedef typename mpl::if_< + is_const, + std::string const&, + std::string&>::type type; + + static type + call(Sequence& seq) + { + return seq.name; + }; + }; + + template + struct apply > + { + typedef typename mpl::if_< + is_const, + int const&, + int&>::type type; + + static type + call(Sequence& seq) + { + return seq.age; + }; + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/at_key_impl.hpp b/example/extension/detail/at_key_impl.hpp new file mode 100644 index 00000000..0af810e1 --- /dev/null +++ b/example/extension/detail/at_key_impl.hpp @@ -0,0 +1,72 @@ +/*============================================================================= + 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_KEY_IMPL_20060223_2017) +#define BOOST_FUSION_AT_KEY_IMPL_20060223_2017 + +#include +#include +#include + +namespace fields +{ + struct name; + struct age; +} + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct at_key_impl; + + template<> + struct at_key_impl + { + template + struct apply; + + template + struct apply + { + typedef typename mpl::if_< + is_const, + std::string const&, + std::string&>::type type; + + static type + call(Sequence& seq) + { + return seq.name; + }; + }; + + template + struct apply + { + typedef typename mpl::if_< + is_const, + int const&, + int&>::type type; + + static type + call(Sequence& seq) + { + return seq.age; + }; + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/begin_impl.hpp b/example/extension/detail/begin_impl.hpp new file mode 100644 index 00000000..3e1f0802 --- /dev/null +++ b/example/extension/detail/begin_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_BEGIN_IMPL_20060222_2042) +#define BOOST_FUSION_BEGIN_IMPL_20060222_2042 + +#include "../example_struct_iterator.hpp" + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct begin_impl; + + template<> + struct begin_impl + { + template + struct apply + { + typedef example::example_struct_iterator type; + + static type + call(Sequence& seq) + { + return type(seq); + } + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/category_of_impl.hpp b/example/extension/detail/category_of_impl.hpp new file mode 100644 index 00000000..bbc8fe64 --- /dev/null +++ b/example/extension/detail/category_of_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_CATEGORY_OF_IMPL_20060223_2037) +#define BOOST_FUSION_CATEGORY_OF_IMPL_20060223_2037 + +#include + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template<> + struct category_of_impl + { + template + struct apply + { + struct type : random_access_traversal_tag, associative_sequence_tag {}; + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/deref_impl.hpp b/example/extension/detail/deref_impl.hpp new file mode 100644 index 00000000..a65a7fae --- /dev/null +++ b/example/extension/detail/deref_impl.hpp @@ -0,0 +1,67 @@ +/*============================================================================= + 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_DEREF_IMPL_20060222_1952) +#define BOOST_FUSION_DEREF_IMPL_20060222_1952 + +#include +#include +#include + +#include + +namespace example +{ + struct example_struct_iterator_tag; + + template + struct example_struct_iterator; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct deref_impl; + + template<> + struct deref_impl + { + template + struct apply; + + template + struct apply > + { + typedef typename mpl::if_< + is_const, std::string const&, std::string&>::type type; + + static type + call(example::example_struct_iterator const& it) + { + return it.struct_.name; + } + }; + + template + struct apply > + { + typedef typename mpl::if_< + is_const, int const&, int&>::type type; + + static type + call(example::example_struct_iterator const& it) + { + return it.struct_.age; + } + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/distance_impl.hpp b/example/extension/detail/distance_impl.hpp new file mode 100644 index 00000000..5768ec5e --- /dev/null +++ b/example/extension/detail/distance_impl.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + 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_DISTANCE_IMPL_20060223_0814) +#define BOOST_FUSION_DISTANCE_IMPL_20060223_0814 + +#include + +namespace example +{ + struct example_struct_iterator_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct distance_impl; + + template<> + struct distance_impl + { + template + struct apply + : mpl::minus + { + typedef apply self; + + static typename self::type + call(First const& first, Last const& last) + { + return typename self::type(); + } + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/end_impl.hpp b/example/extension/detail/end_impl.hpp new file mode 100644 index 00000000..789e7c1b --- /dev/null +++ b/example/extension/detail/end_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_END_IMPL_20060222_2042) +#define BOOST_FUSION_END_IMPL_20060222_2042 + +#include "../example_struct_iterator.hpp" + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct end_impl; + + template<> + struct end_impl + { + template + struct apply + { + typedef example::example_struct_iterator type; + + static type + call(Sequence& seq) + { + return type(seq); + } + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/equal_to_impl.hpp b/example/extension/detail/equal_to_impl.hpp new file mode 100644 index 00000000..d5decf35 --- /dev/null +++ b/example/extension/detail/equal_to_impl.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + 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_EQUAL_TO_IMPL_20060223_1941) +#define BOOST_FUSION_EQUAL_TO_IMPL_20060223_1941 + +#include + +namespace example +{ + struct example_struct_iterator_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct equal_to_impl; + + template<> + struct equal_to_impl + { + template + struct apply + : mpl::equal_to< + typename It1::index, + typename It2::index> + {}; + }; + } +}} + +#endif diff --git a/example/extension/detail/has_key_impl.hpp b/example/extension/detail/has_key_impl.hpp new file mode 100644 index 00000000..20c663d7 --- /dev/null +++ b/example/extension/detail/has_key_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_HAS_KEY_IMPL_20060223_2156) +#define BOOST_FUSION_HAS_KEY_IMPL_20060223_2156 + +#include +#include + +namespace fields +{ + struct name; + struct age; +} + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct has_key_impl; + + template<> + struct has_key_impl + { + template + struct apply + : mpl::or_< + is_same, + is_same > + {}; + }; + } +}} + +#endif diff --git a/example/extension/detail/is_sequence_impl.hpp b/example/extension/detail/is_sequence_impl.hpp new file mode 100644 index 00000000..e15c08a0 --- /dev/null +++ b/example/extension/detail/is_sequence_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_IS_SEQUENCE_IMPL_20060228_1946) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_20060228_1946 + +#include + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion +{ + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/example/extension/detail/is_view_impl.hpp b/example/extension/detail/is_view_impl.hpp new file mode 100644 index 00000000..a9b05657 --- /dev/null +++ b/example/extension/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_200604227_2150) +#define BOOST_FUSION_IS_VIEW_IMPL_200604227_2150 + +#include + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion +{ + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + : boost::mpl::false_ + {}; + } +}} + +#endif diff --git a/example/extension/detail/next_impl.hpp b/example/extension/detail/next_impl.hpp new file mode 100644 index 00000000..b8aa3f0d --- /dev/null +++ b/example/extension/detail/next_impl.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + 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_NEXT_IMPL_20060222_1859) +#define BOOST_FUSION_NEXT_IMPL_20060222_1859 + +namespace example +{ + struct example_struct_iterator_tag; + + template + struct example_struct_iterator; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct next_impl; + + template<> + struct next_impl + { + template + struct apply + { + typedef typename Iterator::struct_type struct_type; + typedef typename Iterator::index index; + typedef example::example_struct_iterator type; + + static type + call(Iterator const& i) + { + return type(i.struct_); + } + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/prior_impl.hpp b/example/extension/detail/prior_impl.hpp new file mode 100644 index 00000000..3577485a --- /dev/null +++ b/example/extension/detail/prior_impl.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + 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_PRIOR_IMPL_20060222_1944) +#define BOOST_FUSION_PRIOR_IMPL_20060222_1944 + +namespace example +{ + struct example_struct_iterator_tag; + + template + struct example_struct_iterator; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct prior_impl; + + template<> + struct prior_impl + { + template + struct apply + { + typedef typename Iterator::struct_type struct_type; + typedef typename Iterator::index index; + typedef example::example_struct_iterator type; + + static type + call(Iterator const& i) + { + return type(i.struct_); + } + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/size_impl.hpp b/example/extension/detail/size_impl.hpp new file mode 100644 index 00000000..877b4847 --- /dev/null +++ b/example/extension/detail/size_impl.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + 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_20060223_2033) +#define BOOST_FUSION_SIZE_IMPL_20060223_2033 + +#include + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct size_impl; + + template<> + struct size_impl + { + template + struct apply + : mpl::int_<2> + {}; + }; + } +}} + +#endif diff --git a/example/extension/detail/value_at_impl.hpp b/example/extension/detail/value_at_impl.hpp new file mode 100644 index 00000000..f2599dfd --- /dev/null +++ b/example/extension/detail/value_at_impl.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + 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_20060223_2025) +#define BOOST_FUSION_VALUE_AT_IMPL_20060223_2025 + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct value_at_impl; + + template<> + struct value_at_impl + { + template + struct apply; + + template + struct apply > + { + typedef std::string type; + }; + + template + struct apply > + { + typedef int type; + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/value_at_key_impl.hpp b/example/extension/detail/value_at_key_impl.hpp new file mode 100644 index 00000000..e30ba9ba --- /dev/null +++ b/example/extension/detail/value_at_key_impl.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + 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_KEY_IMPL_20060223_2025) +#define BOOST_FUSION_VALUE_AT_KEY_IMPL_20060223_2025 + +namespace fields +{ + struct name; + struct age; +} + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct value_at_key_impl; + + template<> + struct value_at_key_impl + { + template + struct apply; + + template + struct apply + { + typedef std::string type; + }; + + template + struct apply + { + typedef int type; + }; + }; + } +}} + +#endif diff --git a/example/extension/detail/value_of_impl.hpp b/example/extension/detail/value_of_impl.hpp new file mode 100644 index 00000000..2d0b78aa --- /dev/null +++ b/example/extension/detail/value_of_impl.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + 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_VALUE_OF_IMPL_20060223_1905) +#define BOOST_FUSION_VALUE_OF_IMPL_20060223_1905 + +#include + +namespace example +{ + struct example_struct_iterator_tag; + + template + struct example_struct_iterator; +} + +namespace boost { namespace fusion { + + namespace extension + { + template + struct value_of_impl; + + template<> + struct value_of_impl + { + template + struct apply; + + template + struct apply > + { + typedef std::string type; + }; + + template + struct apply > + { + typedef int type; + }; + }; + } +}} + +#endif diff --git a/example/extension/example_struct.hpp b/example/extension/example_struct.hpp new file mode 100644 index 00000000..73e52d39 --- /dev/null +++ b/example/extension/example_struct.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + 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_EXAMPLE_STRUCT) +#define BOOST_FUSION_EXAMPLE_STRUCT + +#include "./tag_of.hpp" +#include "./example_struct_iterator.hpp" +#include "./detail/begin_impl.hpp" +#include "./detail/end_impl.hpp" +#include "./detail/at_impl.hpp" +#include "./detail/value_at_impl.hpp" +#include "./detail/size_impl.hpp" +#include "./detail/category_of_impl.hpp" +#include "./detail/at_key_impl.hpp" +#include "./detail/value_at_key_impl.hpp" +#include "./detail/has_key_impl.hpp" +#include "./detail/is_sequence_impl.hpp" +#include "./detail/is_view_impl.hpp" + +#endif diff --git a/example/extension/example_struct_iterator.hpp b/example/extension/example_struct_iterator.hpp new file mode 100644 index 00000000..064c0d74 --- /dev/null +++ b/example/extension/example_struct_iterator.hpp @@ -0,0 +1,64 @@ +/*============================================================================= + 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_EXAMPLE_STRUCT_ITERATOR) +#define BOOST_FUSION_EXAMPLE_STRUCT_ITERATOR + +#include +#include +#include +#include +#include + +#include "./detail/next_impl.hpp" +#include "./detail/prior_impl.hpp" +#include "./detail/deref_impl.hpp" +#include "./detail/advance_impl.hpp" +#include "./detail/distance_impl.hpp" +#include "./detail/value_of_impl.hpp" +#include "./detail/equal_to_impl.hpp" + +namespace example +{ + struct example_struct_iterator_tag; + + template + struct example_struct_iterator; +} + +namespace boost { namespace fusion { + + struct random_access_traversal_tag; + + namespace traits + { + template + struct tag_of > + { + typedef example::example_struct_iterator_tag type; + }; + } +}} + +namespace example { + template + struct example_struct_iterator + : boost::fusion::iterator_base > + { + BOOST_STATIC_ASSERT(Pos >=0 && Pos < 3); + typedef Struct struct_type; + typedef boost::mpl::int_ index; + typedef boost::fusion::random_access_traversal_tag category; + + example_struct_iterator(Struct& str) + : struct_(str) {} + + Struct& struct_; + }; +} + +#endif diff --git a/example/extension/example_struct_type.hpp b/example/extension/example_struct_type.hpp new file mode 100644 index 00000000..0e8abdfb --- /dev/null +++ b/example/extension/example_struct_type.hpp @@ -0,0 +1,27 @@ +/*============================================================================= + 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_EXAMPLE_STRUCT_TYPE) +#define BOOST_FUSION_EXAMPLE_STRUCT_TYPE + +#include + +namespace example +{ + struct example_struct + { + std::string name; + int age; + example_struct( + const std::string& n, + int a) + : name(n), age(a) + {} + }; +} + +#endif diff --git a/example/extension/tag_of.hpp b/example/extension/tag_of.hpp new file mode 100644 index 00000000..55777bab --- /dev/null +++ b/example/extension/tag_of.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + 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_20060222_2052) +#define BOOST_FUSION_TAG_OF_20060222_2052 + +#include +#include "./example_struct_type.hpp" + +namespace example +{ + struct example_sequence_tag; +} + +namespace boost { namespace fusion { + +namespace traits { + + template<> + struct tag_of + { + typedef example::example_sequence_tag type; + }; +}}} + +#endif diff --git a/example/extension/test_example.cpp b/example/extension/test_example.cpp new file mode 100644 index 00000000..264d1854 --- /dev/null +++ b/example/extension/test_example.cpp @@ -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) +==============================================================================*/ +#include "./example_struct.hpp" +#include "./example_struct_type.hpp" +#include + +#include +#include +#include +#include +#include +#include + +int main() +{ + example::example_struct bert("bert", 99); + using namespace boost::fusion; + + BOOST_MPL_ASSERT((traits::is_associative)); + BOOST_MPL_ASSERT((traits::is_random_access)); + BOOST_MPL_ASSERT((traits::is_sequence)); + + BOOST_TEST(deref(begin(bert)) == "bert"); + BOOST_TEST(*next(begin(bert)) == 99); + BOOST_TEST(*prior(end(bert)) == 99); + BOOST_TEST(*advance_c<1>(begin(bert)) == 99); + BOOST_TEST(*advance_c<-1>(end(bert)) == 99); + BOOST_TEST(distance(begin(bert), end(bert)) == 2); + + typedef result_of::begin::type first; + typedef result_of::next::type second; + BOOST_MPL_ASSERT((boost::is_same::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + + BOOST_TEST(begin(bert) != end(bert)); + BOOST_TEST(advance_c<2>(begin(bert)) == end(const_cast(bert))); + + BOOST_TEST(at_c<0>(bert) == "bert"); + BOOST_TEST(at_c<1>(bert) == 99); + + BOOST_TEST(at_key(bert) == "bert"); + BOOST_TEST(at_key(bert) == 99); + + BOOST_TEST(has_key(bert)); + BOOST_TEST(has_key(bert)); + BOOST_TEST(!has_key(bert)); + + BOOST_MPL_ASSERT((boost::is_same::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + + BOOST_MPL_ASSERT((boost::is_same::type, std::string>)); + BOOST_MPL_ASSERT((boost::is_same::type, int>)); + + BOOST_TEST(size(bert) == 2); + + return boost::report_errors(); +} diff --git a/example/performance/Jamfile b/example/performance/Jamfile new file mode 100644 index 00000000..3b8c8ffc --- /dev/null +++ b/example/performance/Jamfile @@ -0,0 +1,20 @@ +#============================================================================== +# Copyright (c) 2003-2006 Joel de Guzman +# Copyright (c) 2006 Dan Marsden +# +# 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) +#============================================================================== +project fusion-performance ; + +exe accumulate : accumulate.cpp ; + +exe inner_product : inner_product.cpp ; + +exe inner_product2 : inner_product2.cpp ; + +exe sequence_efficiency : sequence_efficiency.cpp ; + +exe functional : functional.cpp ; + diff --git a/example/performance/accumulate.cpp b/example/performance/accumulate.cpp new file mode 100644 index 00000000..6e3d9f80 --- /dev/null +++ b/example/performance/accumulate.cpp @@ -0,0 +1,352 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +// inline aggressively +# pragma inline_recursion(on) // turn on inline recursion +# pragma inline_depth(255) // max inline depth +#endif + +int const REPEAT_COUNT = 10; + +double const duration = 0.5; + +namespace +{ + template + double time_for_std_accumulate(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr; + std::generate(arr.begin(), arr.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = std::accumulate(arr.begin(), arr.end(), 0); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = std::accumulate(arr.begin(), arr.end(), 0); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + std::cout << i << std::endl; + return result / iter; + } + + + struct poly_add + { + template + struct result + { + typedef Lhs type; + }; + + template + Lhs operator()(const Lhs& lhs, const Rhs& rhs) const + { + return lhs + rhs; + } + }; + + struct poly_mult + { + template + struct result + { + typedef Lhs type; + }; + + template + Lhs operator()(const Lhs& lhs, const Rhs& rhs) const + { + return lhs * rhs; + } + }; + + template + double time_for_fusion_accumulate(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr; + std::generate(arr.begin(), arr.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate(arr, 0, poly_add()); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + std::cout << iter << " iterations" << std::endl; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate(arr, 0, poly_add()); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + std::cout << "."; + std::cout.flush(); + } + std::cout << i << std::endl; + return result / iter; + } + +#if 0 + template + double time_for_std_inner_product(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr1; + boost::array arr2; + std::generate(arr1.begin(), arr1.end(), rand); + std::generate(arr2.begin(), arr2.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = std::inner_product(arr1.begin(), arr1.end(), arr2.begin(), 0); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = std::inner_product(arr1.begin(), arr1.end(), arr2.begin(), 0); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + std::cout << i << std::endl; + return result / iter; + } + + template + double time_for_fusion_inner_product(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr1; + boost::array arr2; + std::generate(arr1.begin(), arr1.end(), rand); + std::generate(arr2.begin(), arr2.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate( + boost::fusion::transform(arr1, arr2, poly_mult()), 0, poly_add()); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate( + boost::fusion::transform(arr1, arr2, poly_mult()), 0, poly_add()); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + std::cout << i << std::endl; + return result / iter; + } + + struct poly_combine + { + template + struct result + { + typedef Rhs type; + }; + + template + typename result::type + operator()(const Lhs& lhs, const Rhs& rhs) const + { + return rhs + boost::fusion::at_c<0>(lhs) * boost::fusion::at_c<1>(lhs); + } + }; + + template + double time_for_fusion_inner_product2(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr1; + boost::array arr2; + std::generate(arr1.begin(), arr1.end(), rand); + std::generate(arr2.begin(), arr2.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate( + boost::fusion::zip(arr1, arr2), 0, poly_combine()); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + std::cout << iter << " iterations" << std::endl; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate( + boost::fusion::zip(arr1, arr2), 0, poly_combine()); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + std::cout << i << std::endl; + return result / iter; + } +#endif +} + +int main() +{ + int total = 0; + int res; + std::cout << "short accumulate std test " << time_for_std_accumulate<8>(res) << std::endl; + total += res; + std::cout << "short accumulate fusion test " << time_for_fusion_accumulate<8>(res) << std::endl; + total += res; + + std::cout << "medium accumulate std test " << time_for_std_accumulate<64>(res) << std::endl; + total += res; + std::cout << "medium accumulate fusion test " << time_for_fusion_accumulate<64>(res) << std::endl; + total += res; + + std::cout << "long accumulate std test " << time_for_std_accumulate<128>(res) << std::endl; + total += res; + std::cout << "long accumulate fusion test " << time_for_fusion_accumulate<128>(res) << std::endl; + total += res; + +#if 0 + std::cout << "short inner_product std test " << time_for_std_inner_product<8>(res) << std::endl; + total += res; + std::cout << "short inner_product fusion test " << time_for_fusion_inner_product<8>(res) << std::endl; + total += res; + std::cout << "short inner_product fusion 2 test " << time_for_fusion_inner_product2<8>(res) << std::endl; + total += res; + + std::cout << "medium inner_product std test " << time_for_std_inner_product<64>(res) << std::endl; + total += res; + std::cout << "medium inner_product fusion test " << time_for_fusion_inner_product<64>(res) << std::endl; + total += res; + std::cout << "medium inner_product fusion 2 test " << time_for_fusion_inner_product2<64>(res) << std::endl; + total += res; + + + std::cout << "long inner_product std test " << time_for_std_inner_product<128>(res) << std::endl; + total += res; + std::cout << "long inner_product fusion test " << time_for_fusion_inner_product<128>(res) << std::endl; + total += res; + std::cout << "long inner_product fusion 2 test " << time_for_fusion_inner_product2<128>(res) << std::endl; + total += res; +#endif + + return total; +} diff --git a/example/performance/functional.cpp b/example/performance/functional.cpp new file mode 100644 index 00000000..cb4c2ab9 --- /dev/null +++ b/example/performance/functional.cpp @@ -0,0 +1,318 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + 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). +==============================================================================*/ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef _MSC_VER +// inline aggressively +# pragma inline_recursion(on) // turn on inline recursion +# pragma inline_depth(255) // max inline depth +#endif + +int const REPEAT_COUNT = 3; + +double const duration = 0.125; + + +namespace +{ + struct fused_sum + { + template + int operator()(Seq const & seq) const + { + int state = 0; + return boost::fusion::fold(seq, state, sum_op()); + } + + typedef int result_type; + + private: + + struct sum_op + { + template + int operator()(T const & elem, int value) const + { + return value + sizeof(T) * elem; + } + + template + int operator()(T & elem, int value) const + { + elem += sizeof(T); + return value; + } + + typedef int result_type; + }; + }; + + struct unfused_sum + { + inline int operator()() const + { + return 0; + } + template + inline int operator()(T0 const & a0) const + { + return a0; + } + template + inline int operator()(T0 const & a0, T1 const & a1) const + { + return a0 + a1; + } + template + inline int operator()(T0 const & a0, T1 const & a1, T2 a2) const + { + return a0 + a1 + a2; + } + template + inline int operator()(T0 const & a0, T1 const & a1, T2 const & a2, T3 const & a3) const + { + return a0 + a1 + a2 + a3; + } + + typedef int result_type; + }; + + template + double call_unfused(F const & func, int & j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i += func(); + i += func(0); + i += func(0,1); + i += func(0,1,2); + i += func(0,1,2,3); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = func(); j += i; + i = func(0); j += i; + i = func(0,1); j += i; + i = func(0,1,2); j += i; + i = func(0,1,2,3); j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + return result / iter; + } + + template + double call_fused_ra(F const & func, int & j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + do + { + boost::fusion::vector<> v0; + boost::fusion::vector v1(0); + boost::fusion::vector v2(0,1); + boost::fusion::vector v3(0,1,2); + boost::fusion::vector v4(0,1,2,3); + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i += func(v0); + i += func(v1); + i += func(v2); + i += func(v3); + i += func(v4); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + boost::fusion::vector<> v0; + boost::fusion::vector v1(0); + boost::fusion::vector v2(0,1); + boost::fusion::vector v3(0,1,2); + boost::fusion::vector v4(0,1,2,3); + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = func(v0); j += i; + i = func(v1); j += i; + i = func(v2); j += i; + i = func(v3); j += i; + i = func(v4); j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + return result / iter; + } + + template + double call_fused(F const & func, int & j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + do + { + boost::fusion::list<> l0; + boost::fusion::list l1(0); + boost::fusion::list l2(0,1); + boost::fusion::list l3(0,1,2); + boost::fusion::list l4(0,1,2,3); + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i += func(l0); + i += func(l1); + i += func(l2); + i += func(l3); + i += func(l4); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + boost::fusion::list<> l0; + boost::fusion::list l1(0); + boost::fusion::list l2(0,1); + boost::fusion::list l3(0,1,2); + boost::fusion::list l4(0,1,2,3); + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = func(l0); j += i; + i = func(l1); j += i; + i = func(l2); j += i; + i = func(l3); j += i; + i = func(l4); j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + return result / iter; + } +} + +int main() +{ + int total = 0; + int res; + typedef fused_sum F; + typedef unfused_sum U; + + std::cout << "Compiler: " << BOOST_COMPILER << std::endl; + std::cout << std::endl << "Unfused adapters:" << std::endl; + { + F f; + std::cout << "F /* a fused function object */ " << call_fused_ra(f,res) << std::endl; + total += res; + } + { + F f; + std::cout << "without random access " << call_fused(f,res) << std::endl; + total += res; + } + { + typedef boost::fusion::vector s; + boost::fusion::unfused_typed f; + std::cout << "unfused_typed " << call_unfused(f,res) << std::endl; + total += res; + } + { + boost::fusion::unfused_rvalue_args f; + std::cout << "unfused_rvalue_args " << call_unfused(f,res) << std::endl; + total += res; + } + { + boost::fusion::unfused_generic f; + std::cout << "unfused_generic " << call_unfused(f,res) << std::endl; + total += res; + } + std::cout << std::endl << "Fused adapters:" << std::endl; + { + unfused_sum f; + std::cout << "U /* an unfused function object */ " << call_unfused(f,res) << std::endl; + total += res; + } + { + boost::fusion::fused_function_object f; + std::cout << "fused_function_object " << call_fused_ra(f,res) << std::endl; + total += res; + } + { + boost::fusion::fused_function_object f; + std::cout << "without random access " << call_fused(f,res) << std::endl; + total += res; + } + std::cout << std::endl << "Loopback:" << std::endl; + { + typedef boost::fusion::vector s; + boost::fusion::unfused_typed< boost::fusion::fused_function_object, s > f; + std::cout << "unfused_typed,s > " << call_unfused(f,res) << std::endl; + total += res; + } + { + boost::fusion::unfused_rvalue_args< boost::fusion::fused_function_object > f; + std::cout << "unfused_rvalue_args > " << call_unfused(f,res) << std::endl; + total += res; + } + { + boost::fusion::unfused_generic< boost::fusion::fused_function_object > f; + std::cout << "unfused_generic > " << call_unfused(f,res) << std::endl; + total += res; + } + + return total; +} diff --git a/example/performance/inner_product.cpp b/example/performance/inner_product.cpp new file mode 100644 index 00000000..b84eabde --- /dev/null +++ b/example/performance/inner_product.cpp @@ -0,0 +1,178 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +// inline aggressively +# pragma inline_recursion(on) // turn on inline recursion +# pragma inline_depth(255) // max inline depth +#endif + +int const REPEAT_COUNT = 10; + +double const duration = 0.5; + +namespace +{ + struct poly_add + { + template + struct result + { + typedef Lhs type; + }; + + template + Lhs operator()(const Lhs& lhs, const Rhs& rhs) const + { + return lhs + rhs; + } + }; + + struct poly_mult + { + template + struct result + { + typedef Lhs type; + }; + + template + Lhs operator()(const Lhs& lhs, const Rhs& rhs) const + { + return lhs * rhs; + } + }; + + template + double time_for_std_inner_product(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr1; + boost::array arr2; + std::generate(arr1.begin(), arr1.end(), rand); + std::generate(arr2.begin(), arr2.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = std::inner_product(arr1.begin(), arr1.end(), arr2.begin(), 0); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = std::inner_product(arr1.begin(), arr1.end(), arr2.begin(), 0); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + std::cout << i << std::endl; + return result / iter; + } + + template + double time_for_fusion_inner_product(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr1; + boost::array arr2; + std::generate(arr1.begin(), arr1.end(), rand); + std::generate(arr2.begin(), arr2.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate( + boost::fusion::transform(arr1, arr2, poly_mult()), 0, poly_add()); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate( + boost::fusion::transform(arr1, arr2, poly_mult()), 0, poly_add()); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + std::cout << i << std::endl; + return result / iter; + } +} + +int main() +{ + int total = 0; + int res; + + std::cout << "short inner_product std test " << time_for_std_inner_product<8>(res) << std::endl; + total += res; + std::cout << "short inner_product fusion test " << time_for_fusion_inner_product<8>(res) << std::endl; + total += res; + + std::cout << "medium inner_product std test " << time_for_std_inner_product<64>(res) << std::endl; + total += res; + std::cout << "medium inner_product fusion test " << time_for_fusion_inner_product<64>(res) << std::endl; + total += res; + + std::cout << "long inner_product std test " << time_for_std_inner_product<128>(res) << std::endl; + total += res; + std::cout << "long inner_product fusion test " << time_for_fusion_inner_product<128>(res) << std::endl; + total += res; + + return total; +} diff --git a/example/performance/inner_product2.cpp b/example/performance/inner_product2.cpp new file mode 100644 index 00000000..9bab438e --- /dev/null +++ b/example/performance/inner_product2.cpp @@ -0,0 +1,198 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +// inline aggressively +# pragma inline_recursion(on) // turn on inline recursion +# pragma inline_depth(255) // max inline depth +#endif + +int const REPEAT_COUNT = 10; + +double const duration = 0.5; + +namespace +{ + struct poly_add + { + template + struct result + { + typedef Lhs type; + }; + + template + Lhs operator()(const Lhs& lhs, const Rhs& rhs) const + { + return lhs + rhs; + } + }; + + struct poly_mult + { + template + struct result + { + typedef Lhs type; + }; + + template + Lhs operator()(const Lhs& lhs, const Rhs& rhs) const + { + return lhs * rhs; + } + }; + + template + double time_for_std_inner_product(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr1; + boost::array arr2; + std::generate(arr1.begin(), arr1.end(), rand); + std::generate(arr2.begin(), arr2.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = std::inner_product(arr1.begin(), arr1.end(), arr2.begin(), 0); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = std::inner_product(arr1.begin(), arr1.end(), arr2.begin(), 0); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + std::cout << i << std::endl; + return result / iter; + } + + struct poly_combine + { + template + struct result + { + typedef Rhs type; + }; + + template + typename result::type + operator()(const Lhs& lhs, const Rhs& rhs) const + { + return rhs + boost::fusion::at_c<0>(lhs) * boost::fusion::at_c<1>(lhs); + } + }; + + template + double time_for_fusion_inner_product2(int& j) + { + boost::timer tim; + int i = 0; + long long iter = 65536; + long long counter, repeats; + double result = (std::numeric_limits::max)(); + double runtime = 0; + double run; + boost::array arr1; + boost::array arr2; + std::generate(arr1.begin(), arr1.end(), rand); + std::generate(arr2.begin(), arr2.end(), rand); + do + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate( + boost::fusion::zip(arr1, arr2), 0, poly_combine()); + static_cast(i); + } + runtime = tim.elapsed(); + iter *= 2; + } while(runtime < duration); + iter /= 2; + + std::cout << iter << " iterations" << std::endl; + + // repeat test and report least value for consistency: + for(repeats = 0; repeats < REPEAT_COUNT; ++repeats) + { + tim.restart(); + for(counter = 0; counter < iter; ++counter) + { + i = boost::fusion::accumulate( + boost::fusion::zip(arr1, arr2), 0, poly_combine()); + j += i; + } + run = tim.elapsed(); + result = (std::min)(run, result); + } + std::cout << i << std::endl; + return result / iter; + } +} + +int main() +{ + int total = 0; + int res; + + std::cout << "short inner_product std test " << time_for_std_inner_product<8>(res) << std::endl; + total += res; + std::cout << "short inner_product fusion 2 test " << time_for_fusion_inner_product2<8>(res) << std::endl; + total += res; + + std::cout << "medium inner_product std test " << time_for_std_inner_product<64>(res) << std::endl; + total += res; + std::cout << "medium inner_product fusion 2 test " << time_for_fusion_inner_product2<64>(res) << std::endl; + total += res; + +#if 0 // Leads to ICE with MSVC 8.0 + std::cout << "long inner_product std test " << time_for_std_inner_product<128>(res) << std::endl; + total += res; + std::cout << "long inner_product fusion 2 test " << time_for_fusion_inner_product2<128>(res) << std::endl; + total += res; +#endif + + return total; +} diff --git a/example/performance/measure.hpp b/example/performance/measure.hpp new file mode 100644 index 00000000..72cd71ba --- /dev/null +++ b/example/performance/measure.hpp @@ -0,0 +1,85 @@ +// Copyright David Abrahams, Matthias Troyer, Michael Gauckler +// 2005. Distributed under the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(LIVE_CODE_TYPE) +# define LIVE_CODE_TYPE int +#endif + +#include + +namespace test +{ + // This value is required to ensure that a smart compiler's dead + // code elimination doesn't optimize away anything we're testing. + // We'll use it to compute the return code of the executable to make + // sure it's needed. + LIVE_CODE_TYPE live_code; + + // Call objects of the given Accumulator type repeatedly with x as + // an argument. + template + void hammer(Arg const& x, long const repeats) + { + // Strategy: because the sum in an accumulator after each call + // depends on the previous value of the sum, the CPU's pipeline + // might be stalled while waiting for the previous addition to + // complete. Therefore, we allocate an array of accumulators, + // and update them in sequence, so that there's no dependency + // between adjacent addition operations. + // + // Additionally, if there were only one accumulator, the + // compiler or CPU might decide to update the value in a + // register rather that writing it back to memory. we want each + // operation to at least update the L1 cache. *** Note: This + // concern is specific to the particular application at which + // we're targeting the test. *** + + // This has to be at least as large as the number of + // simultaneous accumulations that can be executing in the + // compiler pipeline. A safe number here is larger than the + // machine's maximum pipeline depth. If you want to test the L2 + // or L3 cache, or main memory, you can increase the size of + // this array. 1024 is an upper limit on the pipeline depth of + // current vector machines. + const std::size_t number_of_accumulators = 1024; + live_code = 0; // reset to zero + + Accumulator a[number_of_accumulators]; + + for (long iteration = 0; iteration < repeats; ++iteration) + { + for (Accumulator* ap = a; ap < a + number_of_accumulators; ++ap) + { + (*ap)(x); + } + } + + // Accumulate all the partial sums to avoid dead code + // elimination. + for (Accumulator* ap = a; ap < a + number_of_accumulators; ++ap) + { + live_code += ap->sum; + } + } + + // Measure the time required to hammer accumulators of the given + // type with the argument x. + template + double measure(T const& x, long const repeats) + { + // Hammer accumulators a couple of times to ensure the + // instruction cache is full of our test code, and that we don't + // measure the cost of a page fault for accessing the data page + // containing the memory where the accumulators will be + // allocated + hammer(x, repeats); + hammer(x, repeats); + + // Now start a timer + boost::timer time; + hammer(x, repeats); // This time, we'll measure + return time.elapsed() / repeats; // return the time of one iteration + } +} diff --git a/example/performance/sequence_efficiency.cpp b/example/performance/sequence_efficiency.cpp new file mode 100644 index 00000000..9e1d34c8 --- /dev/null +++ b/example/performance/sequence_efficiency.cpp @@ -0,0 +1,244 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include "measure.hpp" + +#define FUSION_MAX_LIST_SIZE 30 +#define FUSION_MAX_VECTOR_SIZE 30 + +#include +#include +#include + +#include +#include +#include + +#include + +#ifdef _MSC_VER +// inline aggressively +# pragma inline_recursion(on) // turn on inline recursion +# pragma inline_depth(255) // max inline depth +#endif + +// About the tests: +// +// The tests below compare various fusion sequences to see how abstraction +// affects prformance. +// +// We have 3 sequence sizes for each fusion sequence we're going to test. +// +// small = 3 elements +// medium = 10 elements +// big = 30 elements +// +// The sequences are initialized with values 0..N-1 from numeric strings +// parsed by boost::lexical_cast to make sure that the compiler is not +// optimizing by replacing the computation with constant results computed +// at compile time. +// +// These sequences will be subjected to our accumulator which calls +// fusion::accumulate: +// +// this->sum += boost::fusion::accumulate(seq, 0, poly_add()); +// +// where poly_add simply sums the current value with the content of +// the sequence element. This accumulator will be called many times +// through the "hammer" test (see measure.hpp). +// +// The tests are compared against a base using a plain_accumulator +// which does a simple addition: +// +// this->sum += x; + +namespace +{ + struct poly_add + { + template + struct result + { + typedef Lhs type; + }; + + template + Lhs operator()(const Lhs& lhs, const Rhs& rhs) const + { + return lhs + rhs; + } + }; + + // Our Accumulator function + template + struct accumulator + { + accumulator() + : sum() + {} + + template + void operator()(Sequence const& seq) + { + this->sum += boost::fusion::accumulate(seq, 0, poly_add()); + } + + T sum; + }; + + // Plain Accumulator function + template + struct plain_accumulator + { + plain_accumulator() + : sum() + {} + + template + void operator()(X const& x) + { + this->sum += x; + } + + T sum; + }; + + template + void check(T const& seq, char const* info) + { + test::measure >(seq, 1); + std::cout << info << test::live_code << std::endl; + } + + template + void measure(T const& seq, char const* info, long const repeats, double base) + { + double t = test::measure >(seq, repeats); + std::cout + << info + << t + << " (" << int((t/base)*100) << "%)" + << std::endl; + } + + template + void test_assembler(T const& seq) + { + test::live_code = boost::fusion::accumulate(seq, 0, poly_add()); + } +} + +// We'll initialize the sequences from numeric strings that +// pass through boost::lexical_cast to make sure that the +// compiler is not optimizing by replacing the computation +// with constant results computed at compile time. +#define INIT(z, n, text) boost::lexical_cast(BOOST_PP_STRINGIZE(n)) + +int main() +{ + using namespace boost::fusion; + std::cout.setf(std::ios::scientific); + + vector< + int, int, int + > + vsmall(BOOST_PP_ENUM(3, INIT, _)); + + list< + int, int, int + > + lsmall(BOOST_PP_ENUM(3, INIT, _)); + + vector< + int, int, int, int, int, int, int, int, int, int + > + vmedium(BOOST_PP_ENUM(10, INIT, _)); + + list< + int, int, int, int, int, int, int, int, int, int + > + lmedium(BOOST_PP_ENUM(10, INIT, _)); + + vector< + int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + > + vbig(BOOST_PP_ENUM(30, INIT, _)); + + list< + int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + , int, int, int, int, int, int, int, int, int, int + > + lbig(BOOST_PP_ENUM(30, INIT, _)); + + // first decide how many repetitions to measure + long repeats = 100; + double measured = 0; + while (measured < 2.0 && repeats <= 10000000) + { + repeats *= 10; + + boost::timer time; + + test::hammer >(0, repeats); + test::hammer >(vsmall, repeats); + test::hammer >(lsmall, repeats); + test::hammer >(vmedium, repeats); + test::hammer >(lmedium, repeats); + test::hammer >(vbig, repeats); + test::hammer >(lbig, repeats); + + measured = time.elapsed(); + } + + test::measure >(1, 1); + std::cout + << "base accumulated result: " + << test::live_code + << std::endl; + + double base_time = test::measure >(1, repeats); + std::cout + << "base time: " + << base_time; + + std::cout + << std::endl + << "-------------------------------------------------------------------" + << std::endl; + + check(vsmall, "small vector accumulated result: "); + check(lsmall, "small list accumulated result: "); + check(vmedium, "medium vector accumulated result: "); + check(lmedium, "medium list accumulated result: "); + check(vbig, "big vector accumulated result: "); + check(lbig, "big list accumulated result: "); + + std::cout + << "-------------------------------------------------------------------" + << std::endl; + + measure(vsmall, "small vector time: ", repeats, base_time); + measure(lsmall, "small list time: ", repeats, base_time); + measure(vmedium, "medium vector time: ", repeats, base_time); + measure(lmedium, "medium list time: ", repeats, base_time); + measure(vbig, "big vector time: ", repeats, base_time); + measure(lbig, "big list time: ", repeats, base_time); + + std::cout + << "-------------------------------------------------------------------" + << std::endl; + + // Let's see how this looks in assembler + test_assembler(vmedium); + + // This is ultimately responsible for preventing all the test code + // from being optimized away. Change this to return 0 and you + // unplug the whole test's life support system. + return test::live_code != 0; +} diff --git a/example/performance/timings.txt b/example/performance/timings.txt new file mode 100644 index 00000000..0ab51e55 --- /dev/null +++ b/example/performance/timings.txt @@ -0,0 +1,49 @@ +Timing result for sequence_efficiency.cpp comparing the speed of various +fusion sequences. The test involves accumulating the elements of the +sequence which is primed to have values 0..N (N=size of sequence). Small, +medium and big sequences are tested where: + + small = 3 elements + medium = 10 elements + big = 30 elements + +Tester: Joel de Guzman. WinXP, P4-3.0GHZ, 2GB RAM + +VC7.1 (flags = /MD /O2 /EHsc /GS) + + small vector time: 1.870000e-006 + small list time: 1.870000e-006 + medium vector time: 1.880000e-006 + medium list time: 3.600000e-006 + big vector time: 2.030000e-006 + big list time: 8.910000e-006 + +VC8.0 (flags = /MD /O2 /EHsc /GS) + + small vector time: 2.500000e-05 + small list time: 2.500000e-05 + medium vector time: 7.810000e-05 + medium list time: 7.810000e-05 + big vector time: 2.469000e-04 + big list time: 2.453000e-04 + +G++ 3.4 (flags = -ftemplate-depth-128 -funroll-loops -O3 -finline-functions -Wno-inline -Wall) + + small vector time: 2.500000e-05 + small list time: 2.500000e-05 + medium vector time: 7.970000e-05 + medium list time: 7.970000e-05 + big vector time: 2.516000e-04 + big list time: 2.485000e-04 + +Intel 9.1 (flags = /MD /O2 /EHsc /GS) + + small vector time: 1.125000e-006 + small list time: 1.125000e-006 + medium vector time: 1.125000e-006 + medium list time: 1.141000e-006 + big vector time: 1.140000e-006 + big list time: 1.141000e-006 + + + diff --git a/example/performance/zip_efficiency.cpp b/example/performance/zip_efficiency.cpp new file mode 100644 index 00000000..36ded283 --- /dev/null +++ b/example/performance/zip_efficiency.cpp @@ -0,0 +1,155 @@ +/*============================================================================= + 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) +==============================================================================*/ +#include "measure.hpp" + +//~ #define FUSION_MAX_VECTOR_SIZE 30 + +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +// inline aggressively +# pragma inline_recursion(on) // turn on inline recursion +# pragma inline_depth(255) // max inline depth +#endif + +namespace +{ + struct zip_add + { + template + struct result + { + typedef typename + boost::remove_reference< + typename boost::fusion::result_of::value_at_c::type + >::type + type; + }; + + template + typename result::type + operator()(const Lhs& lhs, const Rhs& rhs) const + { + return boost::fusion::at_c<0>(lhs) + boost::fusion::at_c<1>(lhs) + rhs; + } + }; + + // Our Accumulator function + template + struct zip_accumulator + { + zip_accumulator() + : sum() + {} + + template + void operator()(Sequence const& seq) + { + this->sum += boost::fusion::accumulate(seq, 0, zip_add()); + } + + T sum; + }; + + template + void check(T const& seq, char const* info) + { + test::measure >(seq, 1); + std::cout << info << test::live_code << std::endl; + } + + template + void measure(T const& seq, char const* info, long const repeats) + { + std::cout + << info + << test::measure >(seq, repeats) + << std::endl; + } +} + +int main() +{ + using namespace boost::fusion; + + std::cout.setf(std::ios::scientific); + + vector< + int, int, int + > + vsmall_1(BOOST_PP_ENUM_PARAMS(3,)); + + vector< + int, int, int + > + vsmall_2(BOOST_PP_ENUM_PARAMS(3,)); + + vector< + int, int, int, int, int, int, int, int, int, int + > + vmedium_1(BOOST_PP_ENUM_PARAMS(10,)); + + vector< + int, int, int, int, int, int, int, int, int, int + > + vmedium_2(BOOST_PP_ENUM_PARAMS(10,)); + + //~ vector< + //~ int, int, int, int, int, int, int, int, int, int + //~ , int, int, int, int, int, int, int, int, int, int + //~ , int, int, int, int, int, int, int, int, int, int + //~ > + //~ vbig_1(BOOST_PP_ENUM_PARAMS(30,)); + + //~ vector< + //~ int, int, int, int, int, int, int, int, int, int + //~ , int, int, int, int, int, int, int, int, int, int + //~ , int, int, int, int, int, int, int, int, int, int + //~ > + //~ vbig_2(BOOST_PP_ENUM_PARAMS(30,)); + + // first decide how many repetitions to measure + long repeats = 100; + double measured = 0; + while (measured < 2.0 && repeats <= 10000000) + { + repeats *= 10; + + boost::timer time; + + test::hammer >(zip(vsmall_1, vsmall_2), repeats); + test::hammer >(zip(vmedium_1, vmedium_2), repeats); + //~ test::hammer >(zip(vbig_1, vbig_2), repeats); + + measured = time.elapsed(); + } + + check(zip(vsmall_1, vsmall_2), + "small zip accumulated result: "); + check(zip(vmedium_1, vmedium_2), + "medium zip accumulated result: "); + //~ check(zip(vbig_1, vbig_2), + //~ "big zip accumulated result: "); + + measure(zip(vsmall_1, vsmall_2), + "small zip time: ", repeats); + measure(zip(vmedium_1, vmedium_2), + "medium zip time: ", repeats); + //~ measure(zip(vbig_1, vbig_2), + //~ "big zip time: ", repeats); + + // This is ultimately responsible for preventing all the test code + // from being optimized away. Change this to return 0 and you + // unplug the whole test's life support system. + return test::live_code != 0; +} diff --git a/index.html b/index.html new file mode 100644 index 00000000..1eb81150 --- /dev/null +++ b/index.html @@ -0,0 +1,15 @@ + + + + + + + Automatic redirection failed, click this + link