Revision: 399 Author: alai04 Date: Fri May 28 01:35:26 2010 Log: 升级至1.43.0,第二批,libs/目录f-g子目录 http://code.google.com/p/boost-doc-zh/source/detail?r=399 Added: /trunk/libs/foreach/test /trunk/libs/foreach/test/Jamfile.v2 /trunk/libs/foreach/test/array_byref.cpp /trunk/libs/foreach/test/array_byref_r.cpp /trunk/libs/foreach/test/array_byval.cpp /trunk/libs/foreach/test/array_byval_r.cpp /trunk/libs/foreach/test/call_once.cpp /trunk/libs/foreach/test/cstr_byref.cpp /trunk/libs/foreach/test/cstr_byref_r.cpp /trunk/libs/foreach/test/cstr_byval.cpp /trunk/libs/foreach/test/cstr_byval_r.cpp /trunk/libs/foreach/test/dependent_type.cpp /trunk/libs/foreach/test/misc.cpp /trunk/libs/foreach/test/noncopyable.cpp /trunk/libs/foreach/test/pair_byref.cpp /trunk/libs/foreach/test/pair_byref_r.cpp /trunk/libs/foreach/test/pair_byval.cpp /trunk/libs/foreach/test/pair_byval_r.cpp /trunk/libs/foreach/test/rvalue_const.cpp /trunk/libs/foreach/test/rvalue_const_r.cpp /trunk/libs/foreach/test/rvalue_nonconst.cpp /trunk/libs/foreach/test/rvalue_nonconst_r.cpp /trunk/libs/foreach/test/stl_byref.cpp /trunk/libs/foreach/test/stl_byref_r.cpp /trunk/libs/foreach/test/stl_byval.cpp /trunk/libs/foreach/test/stl_byval_r.cpp /trunk/libs/foreach/test/user_defined.cpp /trunk/libs/foreach/test/utility.hpp /trunk/libs/functional/hash/test/container_no_fwd_test.cpp /trunk/libs/fusion/doc/html/fusion/adapted/adapt_assoc_struct_named.html /trunk/libs/fusion/doc/html/fusion/adapted/adapt_assoc_tpl_struct.html /trunk/libs/fusion/doc/html/fusion/adapted/adapt_struct_named.html /trunk/libs/fusion/doc/html/fusion/adapted/adapt_tpl_struct.html /trunk/libs/fusion/doc/html/fusion/adapted/array.html /trunk/libs/fusion/doc/html/fusion/adapted/define_assoc_struct.html /trunk/libs/fusion/doc/html/fusion/adapted/define_assoc_tpl_struct.html /trunk/libs/fusion/doc/html/fusion/adapted/define_struct.html /trunk/libs/fusion/doc/html/fusion/adapted/define_tpl_struct.html /trunk/libs/fusion/test/sequence/adapt_assoc_class.cpp /trunk/libs/fusion/test/sequence/adapt_assoc_class_named.cpp /trunk/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp /trunk/libs/fusion/test/sequence/adapt_assoc_tpl_class.cpp /trunk/libs/fusion/test/sequence/adapt_assoc_tpl_struct.cpp /trunk/libs/fusion/test/sequence/adapt_class.cpp /trunk/libs/fusion/test/sequence/adapt_class_named.cpp /trunk/libs/fusion/test/sequence/adapt_struct_named.cpp /trunk/libs/fusion/test/sequence/adapt_tpl_class.cpp /trunk/libs/fusion/test/sequence/adapt_tpl_struct.cpp /trunk/libs/fusion/test/sequence/boost_array.cpp /trunk/libs/fusion/test/sequence/define_assoc_struct.cpp /trunk/libs/fusion/test/sequence/define_assoc_tpl_struct.cpp /trunk/libs/fusion/test/sequence/define_struct.cpp /trunk/libs/fusion/test/sequence/define_tpl_struct.cpp /trunk/libs/gil/test/test.jpg /trunk/libs/graph/doc/BUILD_DOCS.sh /trunk/libs/graph/doc/Makefile /trunk/libs/graph/doc/awpaper.sty /trunk/libs/graph/doc/biconnected_components.w /trunk/libs/graph/doc/cochet-terrasson98numerical.pdf /trunk/libs/graph/doc/dasdan-dac99.pdf /trunk/libs/graph/doc/eg1-iso.cpp /trunk/libs/graph/doc/figs/Makefile /trunk/libs/graph/doc/figs/adj_list.fig /trunk/libs/graph/doc/figs/adj_matrix.fig /trunk/libs/graph/doc/figs/analogy.fig /trunk/libs/graph/doc/figs/back_edges.fig /trunk/libs/graph/doc/figs/bfs_example.fig /trunk/libs/graph/doc/figs/bfs_family.fig /trunk/libs/graph/doc/figs/bfs_visitor.fig /trunk/libs/graph/doc/figs/biconnected.dot /trunk/libs/graph/doc/figs/concepts.fig /trunk/libs/graph/doc/figs/dfs.fig /trunk/libs/graph/doc/figs/dfs_example.fig /trunk/libs/graph/doc/figs/dfs_family.fig /trunk/libs/graph/doc/figs/dfs_visitor.fig /trunk/libs/graph/doc/figs/digraph.fig /trunk/libs/graph/doc/figs/disjoint_set_family.fig /trunk/libs/graph/doc/figs/edge_list.fig /trunk/libs/graph/doc/figs/file_dep.fig /trunk/libs/graph/doc/figs/forward_or_cross_edges.fig /trunk/libs/graph/doc/figs/graph_search.fig /trunk/libs/graph/doc/figs/grid_graph_indexed.svg /trunk/libs/graph/doc/figs/grid_graph_unindexed.svg /trunk/libs/graph/doc/figs/knights_tour.fig /trunk/libs/graph/doc/figs/quick_start.fig /trunk/libs/graph/doc/figs/search_states.fig /trunk/libs/graph/doc/figs/seq_vertex_coloring.graffle /trunk/libs/graph/doc/figs/stl_iter.fig /trunk/libs/graph/doc/figs/tree_edges.fig /trunk/libs/graph/doc/figs/undigraph.fig /trunk/libs/graph/doc/figs/visitor.fig /trunk/libs/graph/doc/find_odd_cycle.html /trunk/libs/graph/doc/grid_graph_export_svg.sh /trunk/libs/graph/doc/is_bipartite.html /trunk/libs/graph/doc/iscope99.pdf /trunk/libs/graph/doc/iso-eg.dot /trunk/libs/graph/doc/isomorphism-impl-v2.w /trunk/libs/graph/doc/isomorphism-impl-v3.w /trunk/libs/graph/doc/isomorphism-impl.pdf /trunk/libs/graph/doc/isomorphism-impl.w /trunk/libs/graph/doc/jwebfrob.pl /trunk/libs/graph/doc/lgrind.sty /trunk/libs/graph/doc/math.sty /trunk/libs/graph/doc/minimum_degree_ordering.w /trunk/libs/graph/doc/mungeaux.csh /trunk/libs/graph/doc/property_put.html /trunk/libs/graph/doc/read_graphml.rst /trunk/libs/graph/doc/read_graphviz.rst /trunk/libs/graph/doc/strong_components.w /trunk/libs/graph/doc/topology.html /trunk/libs/graph/doc/transitive_closure.w /trunk/libs/graph/doc/write_graphml.rst /trunk/libs/graph/example/bipartite_example.cpp /trunk/libs/graph/src /trunk/libs/graph/src/graphml.cpp /trunk/libs/graph/src/read_graphviz_new.cpp /trunk/libs/graph/test/bipartite_test.cpp /trunk/libs/graph/test/grid_graph_cc.cpp /trunk/libs/graph/test/grid_graph_test.cpp /trunk/libs/graph/test/incremental_components_test.cpp Modified: /trunk/libs/flyweight/doc/reference/locking.html /trunk/libs/foreach/doc/foreach.qbk /trunk/libs/functional/hash/doc/Jamfile.v2 /trunk/libs/functional/hash/doc/changes.qbk /trunk/libs/functional/hash/test/Jamfile.v2 /trunk/libs/functional/hash/test/hash_float_test.hpp /trunk/libs/functional/hash/test/hash_number_test.cpp /trunk/libs/fusion/doc/adapted.qbk /trunk/libs/fusion/doc/changelog.qbk /trunk/libs/fusion/doc/fusion.qbk /trunk/libs/fusion/doc/html/fusion/adapted/adapt_assoc.html /trunk/libs/fusion/doc/html/fusion/adapted/adapt_struct.html /trunk/libs/fusion/doc/html/fusion/adapted/boost__array.html /trunk/libs/fusion/doc/html/fusion/adapted/boost__tuple.html /trunk/libs/fusion/doc/html/fusion/adapted/mpl_sequence.html /trunk/libs/fusion/doc/html/fusion/adapted/std__pair.html /trunk/libs/fusion/doc/html/fusion/adapted.html/trunk/libs/fusion/doc/html/fusion/algorithm/iteration/functions/accumulate.html
/trunk/libs/fusion/doc/html/fusion/algorithm/iteration/functions/fold.html/trunk/libs/fusion/doc/html/fusion/algorithm/iteration/functions/for_each.html /trunk/libs/fusion/doc/html/fusion/algorithm/iteration/metafunctions/accumulate.html /trunk/libs/fusion/doc/html/fusion/algorithm/iteration/metafunctions/fold.html /trunk/libs/fusion/doc/html/fusion/algorithm/iteration/metafunctions/for_each.html
/trunk/libs/fusion/doc/html/fusion/algorithm/iteration.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/functions/all.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/functions/any.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/functions/count.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/functions/count_if.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/functions/find.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/functions/find_if.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/functions/none.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/metafunctions/all.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/metafunctions/any.html /trunk/libs/fusion/doc/html/fusion/algorithm/query/metafunctions/count.html/trunk/libs/fusion/doc/html/fusion/algorithm/query/metafunctions/count_if.html
/trunk/libs/fusion/doc/html/fusion/algorithm/query/metafunctions/find.html/trunk/libs/fusion/doc/html/fusion/algorithm/query/metafunctions/find_if.html
/trunk/libs/fusion/doc/html/fusion/algorithm/query/metafunctions/none.html /trunk/libs/fusion/doc/html/fusion/algorithm/query.html/trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/clear.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/erase.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/erase_key.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/filter.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/filter_if.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/insert.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/insert_range.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/join.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/pop_back.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/pop_front.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/push_back.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/push_front.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/remove.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/remove_if.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/replace.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/replace_if.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/reverse.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/transform.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/functions/zip.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/clear.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/erase.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/erase_key.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/filter.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/filter_if.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/insert.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/insert_range.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/join.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/pop_back.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/pop_front.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/push_back.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/push_front.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/remove.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/remove_if.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/replace.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/replace_if.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/reverse.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/transform.html /trunk/libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/zip.html
/trunk/libs/fusion/doc/html/fusion/algorithm/transformation.html /trunk/libs/fusion/doc/html/fusion/algorithm.html /trunk/libs/fusion/doc/html/fusion/change_log.html /trunk/libs/fusion/doc/html/fusion/container/cons.html/trunk/libs/fusion/doc/html/fusion/container/conversion/functions/as_list.html /trunk/libs/fusion/doc/html/fusion/container/conversion/functions/as_map.html /trunk/libs/fusion/doc/html/fusion/container/conversion/functions/as_set.html /trunk/libs/fusion/doc/html/fusion/container/conversion/functions/as_vector.html /trunk/libs/fusion/doc/html/fusion/container/conversion/metafunctions/as_list.html /trunk/libs/fusion/doc/html/fusion/container/conversion/metafunctions/as_map.html /trunk/libs/fusion/doc/html/fusion/container/conversion/metafunctions/as_set.html /trunk/libs/fusion/doc/html/fusion/container/conversion/metafunctions/as_vector.html
/trunk/libs/fusion/doc/html/fusion/container/conversion.html/trunk/libs/fusion/doc/html/fusion/container/generation/functions/list_tie.html /trunk/libs/fusion/doc/html/fusion/container/generation/functions/make_cons.html /trunk/libs/fusion/doc/html/fusion/container/generation/functions/make_list.html /trunk/libs/fusion/doc/html/fusion/container/generation/functions/make_map.html /trunk/libs/fusion/doc/html/fusion/container/generation/functions/make_set.html /trunk/libs/fusion/doc/html/fusion/container/generation/functions/make_vector.html /trunk/libs/fusion/doc/html/fusion/container/generation/functions/map_tie.html /trunk/libs/fusion/doc/html/fusion/container/generation/functions/tiers.html /trunk/libs/fusion/doc/html/fusion/container/generation/functions/vector_tie.html /trunk/libs/fusion/doc/html/fusion/container/generation/metafunctions/list_tie.html /trunk/libs/fusion/doc/html/fusion/container/generation/metafunctions/make_cons.html /trunk/libs/fusion/doc/html/fusion/container/generation/metafunctions/make_list.html /trunk/libs/fusion/doc/html/fusion/container/generation/metafunctions/make_map.html /trunk/libs/fusion/doc/html/fusion/container/generation/metafunctions/make_set.html /trunk/libs/fusion/doc/html/fusion/container/generation/metafunctions/make_vector.html /trunk/libs/fusion/doc/html/fusion/container/generation/metafunctions/map_tie.html /trunk/libs/fusion/doc/html/fusion/container/generation/metafunctions/vector_tie.html
/trunk/libs/fusion/doc/html/fusion/container/generation.html /trunk/libs/fusion/doc/html/fusion/container/list.html /trunk/libs/fusion/doc/html/fusion/container/map.html /trunk/libs/fusion/doc/html/fusion/container/set.html /trunk/libs/fusion/doc/html/fusion/container/vector.html /trunk/libs/fusion/doc/html/fusion/container.html /trunk/libs/fusion/doc/html/fusion/extension/ext_full.html /trunk/libs/fusion/doc/html/fusion/extension/iterator_facade.html /trunk/libs/fusion/doc/html/fusion/extension/sequence_facade.html /trunk/libs/fusion/doc/html/fusion/functional/adapters/fused.html/trunk/libs/fusion/doc/html/fusion/functional/adapters/fused_function_object.html
/trunk/libs/fusion/doc/html/fusion/functional/adapters/fused_procedure.html /trunk/libs/fusion/doc/html/fusion/functional/adapters/limits.html /trunk/libs/fusion/doc/html/fusion/functional/adapters/unfused.html /trunk/libs/fusion/doc/html/fusion/functional/adapters/unfused_typed.html /trunk/libs/fusion/doc/html/fusion/functional/concepts/callable.html /trunk/libs/fusion/doc/html/fusion/functional/concepts/def_callable.html /trunk/libs/fusion/doc/html/fusion/functional/concepts/poly.html /trunk/libs/fusion/doc/html/fusion/functional/concepts/reg_callable.html/trunk/libs/fusion/doc/html/fusion/functional/generation/functions/mk_fused.html /trunk/libs/fusion/doc/html/fusion/functional/generation/functions/mk_fused_fobj.html /trunk/libs/fusion/doc/html/fusion/functional/generation/functions/mk_fused_proc.html /trunk/libs/fusion/doc/html/fusion/functional/generation/functions/mk_unfused.html /trunk/libs/fusion/doc/html/fusion/functional/generation/metafunctions/mk_fused.html /trunk/libs/fusion/doc/html/fusion/functional/generation/metafunctions/mk_fused_fobj.html /trunk/libs/fusion/doc/html/fusion/functional/generation/metafunctions/mk_fused_proc.html /trunk/libs/fusion/doc/html/fusion/functional/generation/metafunctions/mk_unfused.html /trunk/libs/fusion/doc/html/fusion/functional/invocation/functions/invoke.html /trunk/libs/fusion/doc/html/fusion/functional/invocation/functions/invoke_fobj.html /trunk/libs/fusion/doc/html/fusion/functional/invocation/functions/invoke_proc.html
/trunk/libs/fusion/doc/html/fusion/functional/invocation/limits.html/trunk/libs/fusion/doc/html/fusion/functional/invocation/metafunctions/invoke.html /trunk/libs/fusion/doc/html/fusion/functional/invocation/metafunctions/invoke_fobj.html /trunk/libs/fusion/doc/html/fusion/functional/invocation/metafunctions/invoke_proc.html
/trunk/libs/fusion/doc/html/fusion/functional.html /trunk/libs/fusion/doc/html/fusion/introduction.html/trunk/libs/fusion/doc/html/fusion/iterator/concepts/associative_iterator.html /trunk/libs/fusion/doc/html/fusion/iterator/concepts/bidirectional_iterator.html
/trunk/libs/fusion/doc/html/fusion/iterator/concepts/forward_iterator.html/trunk/libs/fusion/doc/html/fusion/iterator/concepts/random_access_iterator.html
/trunk/libs/fusion/doc/html/fusion/iterator/functions/advance.html /trunk/libs/fusion/doc/html/fusion/iterator/functions/advance_c.html /trunk/libs/fusion/doc/html/fusion/iterator/functions/deref.html /trunk/libs/fusion/doc/html/fusion/iterator/functions/deref_data.html /trunk/libs/fusion/doc/html/fusion/iterator/functions/distance.html /trunk/libs/fusion/doc/html/fusion/iterator/functions/next.html /trunk/libs/fusion/doc/html/fusion/iterator/functions/prior.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/advance.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/advance_c.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/deref.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/deref_data.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/distance.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/equal_to.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/key_of.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/next.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/prior.html /trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/value_of.html/trunk/libs/fusion/doc/html/fusion/iterator/metafunctions/value_of_data.html
/trunk/libs/fusion/doc/html/fusion/iterator/operator/operator_equality.html/trunk/libs/fusion/doc/html/fusion/iterator/operator/operator_inequality.html /trunk/libs/fusion/doc/html/fusion/iterator/operator/operator_unary_star.html
/trunk/libs/fusion/doc/html/fusion/iterator.html /trunk/libs/fusion/doc/html/fusion/notes.html /trunk/libs/fusion/doc/html/fusion/organization.html /trunk/libs/fusion/doc/html/fusion/preface.html /trunk/libs/fusion/doc/html/fusion/quick_start.html/trunk/libs/fusion/doc/html/fusion/sequence/concepts/associative_sequence.html /trunk/libs/fusion/doc/html/fusion/sequence/concepts/bidirectional_sequence.html
/trunk/libs/fusion/doc/html/fusion/sequence/concepts/forward_sequence.html/trunk/libs/fusion/doc/html/fusion/sequence/concepts/random_access_sequence.html
/trunk/libs/fusion/doc/html/fusion/sequence/concepts.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/at.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/at_c.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/at_key.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/back.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/begin.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/empty.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/end.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/front.html/trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/has_key.html
/trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/size.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/functions/swap.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/at.html/trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/at_c.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/at_key.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/back.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/begin.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/empty.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/end.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/front.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/has_key.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/size.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/swap.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/value_at.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/value_at_c.html /trunk/libs/fusion/doc/html/fusion/sequence/intrinsic/metafunctions/value_at_key.html
/trunk/libs/fusion/doc/html/fusion/sequence/intrinsic.html /trunk/libs/fusion/doc/html/fusion/sequence/operator/comparison/equal.html/trunk/libs/fusion/doc/html/fusion/sequence/operator/comparison/greater_than.html /trunk/libs/fusion/doc/html/fusion/sequence/operator/comparison/greater_than_equal.html /trunk/libs/fusion/doc/html/fusion/sequence/operator/comparison/less_than.html /trunk/libs/fusion/doc/html/fusion/sequence/operator/comparison/less_than_equal.html /trunk/libs/fusion/doc/html/fusion/sequence/operator/comparison/not_equal.html
/trunk/libs/fusion/doc/html/fusion/sequence/operator/comparison.html /trunk/libs/fusion/doc/html/fusion/sequence/operator/i_o/in.html /trunk/libs/fusion/doc/html/fusion/sequence/operator/i_o/out.html /trunk/libs/fusion/doc/html/fusion/sequence/operator/i_o.html /trunk/libs/fusion/doc/html/fusion/sequence.html /trunk/libs/fusion/doc/html/fusion/support/category_of.html /trunk/libs/fusion/doc/html/fusion/support/deduce.html /trunk/libs/fusion/doc/html/fusion/support/deduce_sequence.html /trunk/libs/fusion/doc/html/fusion/support/is_sequence.html /trunk/libs/fusion/doc/html/fusion/support/is_view.html /trunk/libs/fusion/doc/html/fusion/support/pair.html /trunk/libs/fusion/doc/html/fusion/support/tag_of.html/trunk/libs/fusion/doc/html/fusion/tuple/class_template_tuple/construction.html /trunk/libs/fusion/doc/html/fusion/tuple/class_template_tuple/element_access.html /trunk/libs/fusion/doc/html/fusion/tuple/class_template_tuple/relational_operators.html /trunk/libs/fusion/doc/html/fusion/tuple/class_template_tuple/tuple_creation_functions.html /trunk/libs/fusion/doc/html/fusion/tuple/class_template_tuple/tuple_helper_classes.html
/trunk/libs/fusion/doc/html/fusion/tuple/class_template_tuple.html /trunk/libs/fusion/doc/html/fusion/tuple/pairs.html /trunk/libs/fusion/doc/html/fusion/view/filter_view.html /trunk/libs/fusion/doc/html/fusion/view/iterator_range.html /trunk/libs/fusion/doc/html/fusion/view/joint_view.html /trunk/libs/fusion/doc/html/fusion/view/nview.html /trunk/libs/fusion/doc/html/fusion/view/reverse_view.html /trunk/libs/fusion/doc/html/fusion/view/single_view.html /trunk/libs/fusion/doc/html/fusion/view/transform_view.html /trunk/libs/fusion/doc/html/fusion/view/zip_view.html /trunk/libs/fusion/doc/html/fusion/view.html /trunk/libs/fusion/doc/html/index.html /trunk/libs/fusion/test/Jamfile /trunk/libs/fusion/test/sequence/adapt_assoc_struct.cpp /trunk/libs/fusion/test/sequence/array.cpp /trunk/libs/fusion/test/sequence/vector_n.cpp /trunk/libs/graph/doc/EventVisitorList.html /trunk/libs/graph/doc/biconnected_components.html /trunk/libs/graph/doc/compressed_sparse_row.html /trunk/libs/graph/doc/fruchterman_reingold.html /trunk/libs/graph/doc/gursoy_atun_layout.html /trunk/libs/graph/doc/history.html /trunk/libs/graph/doc/kamada_kawai_spring_layout.html /trunk/libs/graph/doc/maximum_matching.html /trunk/libs/graph/doc/planar_canonical_ordering.html /trunk/libs/graph/doc/planar_graphs.html /trunk/libs/graph/doc/random_layout.html /trunk/libs/graph/doc/table_of_contents.html /trunk/libs/graph/doc/visitor_concepts.html /trunk/libs/graph/example/Jamfile.v2 /trunk/libs/graph/example/fr_layout.cpp /trunk/libs/graph/test/Jamfile.v2 /trunk/libs/graph/test/adj_list_loops.cpp /trunk/libs/graph/test/astar_search_test.cpp /trunk/libs/graph/test/basic_planarity_test.cpp /trunk/libs/graph/test/bron_kerbosch_all_cliques.cpp /trunk/libs/graph/test/closeness_centrality.cpp /trunk/libs/graph/test/clustering_coefficient.cpp /trunk/libs/graph/test/core_numbers_test.cpp /trunk/libs/graph/test/csr_graph_test.cpp /trunk/libs/graph/test/degree_centrality.cpp /trunk/libs/graph/test/dfs.cpp /trunk/libs/graph/test/dominator_tree_test.cpp /trunk/libs/graph/test/eccentricity.cpp /trunk/libs/graph/test/graphviz_test.cpp /trunk/libs/graph/test/is_straight_line_draw_test.cpp /trunk/libs/graph/test/labeled_graph.cpp /trunk/libs/graph/test/layout_test.cpp /trunk/libs/graph/test/make_bicon_planar_test.cpp /trunk/libs/graph/test/make_maximal_planar_test.cpp /trunk/libs/graph/test/matching_test.cpp /trunk/libs/graph/test/mcgregor_subgraphs_test.cpp /trunk/libs/graph/test/mean_geodesic.cpp /trunk/libs/graph/test/metric_tsp_approx.cpp /trunk/libs/graph/test/named_vertices_test.cpp /trunk/libs/graph/test/r_c_shortest_paths_test.cpp /trunk/libs/graph/test/serialize.cpp /trunk/libs/graph/test/subgraph.cpp /trunk/libs/graph/test/subgraph_bundled.cpp /trunk/libs/graph/test/subgraph_props.cpp /trunk/libs/graph/test/test_construction.hpp /trunk/libs/graph/test/test_destruction.hpp /trunk/libs/graph/test/test_direction.hpp /trunk/libs/graph/test/test_graphs.cpp /trunk/libs/graph/test/tiernan_all_cycles.cpp /trunk/libs/graph_parallel/test/distributed_connected_components_test.cpp /trunk/libs/graph_parallel/test/distributed_csr_algorithm_test.cpp ======================================= --- /dev/null +++ /trunk/libs/foreach/test/Jamfile.v2 Fri May 28 01:35:26 2010 @@ -0,0 +1,34 @@ +# (C) Copyright 2004: 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)
+ +# bring in rules for testing +import testing ; + +test-suite "foreach" + : [ run stl_byval.cpp ] + [ run stl_byref.cpp ] + [ run stl_byval_r.cpp ] + [ run stl_byref_r.cpp ] + [ run array_byval.cpp ] + [ run array_byref.cpp ] + [ run array_byval_r.cpp ] + [ run array_byref_r.cpp ] + [ run cstr_byval.cpp ] + [ run cstr_byref.cpp ] + [ run cstr_byval_r.cpp ] + [ run cstr_byref_r.cpp ] + [ run pair_byval.cpp ] + [ run pair_byref.cpp ] + [ run pair_byval_r.cpp ] + [ run pair_byref_r.cpp ] + [ run user_defined.cpp ] + [ run call_once.cpp ] + [ run rvalue_const.cpp ] + [ run rvalue_nonconst.cpp ] + [ run rvalue_const_r.cpp ] + [ run rvalue_nonconst_r.cpp ] + [ run dependent_type.cpp ] + [ run misc.cpp ] + [ compile noncopyable.cpp ] + ; ======================================= --- /dev/null +++ /trunk/libs/foreach/test/array_byref.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,48 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef int foreach_container_type[5]; +typedef int const foreach_const_container_type[5]; +typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +int my_array[5] = { 1,2,3,4,5 }; +int const (&my_const_array)[5] = my_array; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // non-const containers by reference + BOOST_CHECK(sequence_equal_byref_n(my_array, "\1\2\3\4\5")); + + // const containers by reference + BOOST_CHECK(sequence_equal_byref_c(my_const_array, "\1\2\3\4\5")); + + // mutate the mutable collections + mutate_foreach_byref(my_array); + + // compare the mutated collections to the actual results + BOOST_CHECK(sequence_equal_byref_n(my_array, "\2\3\4\5\6")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/array_byref_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,48 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef int foreach_container_type[5]; +typedef int const foreach_const_container_type[5]; +typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +int my_array[5] = { 1,2,3,4,5 }; +int const (&my_const_array)[5] = my_array; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // non-const containers by reference + BOOST_CHECK(sequence_equal_byref_n_r(my_array, "\5\4\3\2\1")); + + // const containers by reference + BOOST_CHECK(sequence_equal_byref_c_r(my_const_array, "\5\4\3\2\1")); + + // mutate the mutable collections + mutate_foreach_byref_r(my_array); + + // compare the mutated collections to the actual results + BOOST_CHECK(sequence_equal_byref_n_r(my_array, "\6\5\4\3\2")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/array_byval.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,44 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef int foreach_container_type[5]; +typedef int const foreach_const_container_type[5]; +typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +int my_array[5] = { 1,2,3,4,5 }; +int const (&my_const_array)[5] = my_array; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + boost::mpl::false_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_array); + + // non-const containers by value + BOOST_CHECK(sequence_equal_byval_n(my_array, "\1\2\3\4\5")); + + // const containers by value + BOOST_CHECK(sequence_equal_byval_c(my_const_array, "\1\2\3\4\5")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/array_byval_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,44 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef int foreach_container_type[5]; +typedef int const foreach_const_container_type[5]; +typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +int my_array[5] = { 1,2,3,4,5 }; +int const (&my_const_array)[5] = my_array; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + boost::mpl::false_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_array); + + // non-const containers by value + BOOST_CHECK(sequence_equal_byval_n_r(my_array, "\5\4\3\2\1")); + + // const containers by value + BOOST_CHECK(sequence_equal_byval_c_r(my_const_array, "\5\4\3\2\1")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/call_once.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,40 @@ +// (C) Copyright Eric Niebler 2005. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <vector> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +// counter +int counter = 0; + +std::vector<int> my_vector(4,4); + +std::vector<int> const &get_vector() +{ + ++counter; + return my_vector; +} + + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + BOOST_FOREACH(int i, get_vector()) + { + ((void)i); // no-op + } + + BOOST_CHECK(1 == counter); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/cstr_byref.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,49 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef char *foreach_container_type; +typedef char const *foreach_const_container_type; +typedef char foreach_value_type; +typedef char &foreach_reference_type; +typedef char const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +char my_ntcs_buffer[] = "\1\2\3\4\5"; +char *my_ntcs = my_ntcs_buffer; +char const *my_const_ntcs = my_ntcs; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // non-const containers by reference + BOOST_CHECK(sequence_equal_byref_n(my_ntcs, "\1\2\3\4\5")); + + // const containers by reference + BOOST_CHECK(sequence_equal_byref_c(my_const_ntcs, "\1\2\3\4\5")); + + // mutate the mutable collections + mutate_foreach_byref(my_ntcs); + + // compare the mutated collections to the actual results + BOOST_CHECK(sequence_equal_byref_n(my_ntcs, "\2\3\4\5\6")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/cstr_byref_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,49 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef char *foreach_container_type; +typedef char const *foreach_const_container_type; +typedef char foreach_value_type; +typedef char &foreach_reference_type; +typedef char const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +char my_ntcs_buffer[] = "\1\2\3\4\5"; +char *my_ntcs = my_ntcs_buffer; +char const *my_const_ntcs = my_ntcs; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // non-const containers by reference + BOOST_CHECK(sequence_equal_byref_n_r(my_ntcs, "\5\4\3\2\1")); + + // const containers by reference + BOOST_CHECK(sequence_equal_byref_c_r(my_const_ntcs, "\5\4\3\2\1")); + + // mutate the mutable collections + mutate_foreach_byref_r(my_ntcs); + + // compare the mutated collections to the actual results + BOOST_CHECK(sequence_equal_byref_n_r(my_ntcs, "\6\5\4\3\2")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/cstr_byval.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,45 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef char *foreach_container_type; +typedef char const *foreach_const_container_type; +typedef char foreach_value_type; +typedef char &foreach_reference_type; +typedef char const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +char my_ntcs_buffer[] = "\1\2\3\4\5"; +char *my_ntcs = my_ntcs_buffer; +char const *my_const_ntcs = my_ntcs; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + boost::mpl::true_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_ntcs); + + // non-const containers by value + BOOST_CHECK(sequence_equal_byval_n(my_ntcs, "\1\2\3\4\5")); + + // const containers by value + BOOST_CHECK(sequence_equal_byval_c(my_const_ntcs, "\1\2\3\4\5")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/cstr_byval_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,45 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef char *foreach_container_type; +typedef char const *foreach_const_container_type; +typedef char foreach_value_type; +typedef char &foreach_reference_type; +typedef char const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +char my_ntcs_buffer[] = "\1\2\3\4\5"; +char *my_ntcs = my_ntcs_buffer; +char const *my_const_ntcs = my_ntcs; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + boost::mpl::true_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_ntcs); + + // non-const containers by value + BOOST_CHECK(sequence_equal_byval_n_r(my_ntcs, "\5\4\3\2\1")); + + // const containers by value + BOOST_CHECK(sequence_equal_byval_c_r(my_const_ntcs, "\5\4\3\2\1")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/dependent_type.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,37 @@ +// (C) Copyright Eric Niebler 2005. +// 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) + +/* + Revision history: + 26 August 2005 : Initial version. +*/ + +#include <vector> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// use FOREACH to iterate over a sequence with a dependent type +template<typename Vector> +void do_test(Vector const & vect) +{ + typedef BOOST_DEDUCED_TYPENAME Vector::value_type value_type; + BOOST_FOREACH(value_type i, vect) + { + // no-op, just make sure this compiles + ((void)i); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + std::vector<int> vect; + do_test(vect); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/misc.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,47 @@ +// misc.cpp +// +// (C) Copyright Eric Niebler 2008. +// 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) + +/* + Revision history: + 4 March 2008 : Initial version. +*/ + +#include <vector> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +struct xxx : std::vector<int> +{ + virtual ~xxx() = 0; +}; + +void test_abstract(xxx& rng) +{ + BOOST_FOREACH (int x, rng) + { + (void)x; + } +} + +struct yyy : std::vector<int> +{ + void test() + { + BOOST_FOREACH(int x, *this) + { + (void)x; + } + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/noncopyable.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,72 @@ +// noncopyable.cpp +/// +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 21 December 2005 : Initial version. +*/ + +#include <vector> +#include <boost/foreach.hpp> +#include <boost/noncopyable.hpp> +#include <boost/range/iterator_range.hpp> + +struct noncopy_vector + : std::vector<int> + , private boost::noncopyable +{ + noncopy_vector() { } +}; + +struct noncopy_range + : boost::iterator_range<noncopy_vector::iterator> + , private boost::noncopyable +{ + noncopy_range() { } +}; + +// Tell FOREACH that noncopy_vector and noncopy_range are non-copyable. +// NOTE: this is only necessary if +// a) your type does not inherit from boost::noncopyable, OR+// b) Boost.Config defines BOOST_BROKEN_IS_BASE_AND_DERIVED for your compiler
+#ifdef BOOST_BROKEN_IS_BASE_AND_DERIVED+inline boost::mpl::true_ *boost_foreach_is_noncopyable(noncopy_vector *&, boost::foreach::tag)
+{ + return 0; +} ++inline boost::mpl::true_ *boost_foreach_is_noncopyable(noncopy_range *&, boost::foreach::tag)
+{ + return 0; +} +#endif + +// tell FOREACH that noncopy_range is a lightweight proxy object+inline boost::mpl::true_ *boost_foreach_is_lightweight_proxy(noncopy_range *&, boost::foreach::tag)
+{ + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// main +// +int main( int, char*[] ) +{ + noncopy_vector v1; + BOOST_FOREACH( int & i, v1 ) { (void)i; } + + noncopy_vector const v2; + BOOST_FOREACH( int const & j, v2 ) { (void)j; } + + noncopy_range rng1; + BOOST_FOREACH( int & k, rng1 ) { (void)k; } + + noncopy_range const rng2; + BOOST_FOREACH( int & l, rng2 ) { (void)l; } + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/pair_byref.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,50 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 13 December 2004 : Initial version. + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef std::pair<int*,int*> foreach_container_type;+typedef std::pair<int const*,int const*> const foreach_const_container_type;
+typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +int my_array[] = { 1,2,3,4,5 }; +std::pair<int*,int*> my_pair(my_array,my_array+5); +std::pair<int const*,int const*> const my_const_pair(my_array,my_array+5); + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // non-const containers by reference + BOOST_CHECK(sequence_equal_byref_n(my_pair, "\1\2\3\4\5")); + + // const containers by reference + BOOST_CHECK(sequence_equal_byref_c(my_const_pair, "\1\2\3\4\5")); + + // mutate the mutable collections + mutate_foreach_byref(my_pair); + + // compare the mutated collections to the actual results + BOOST_CHECK(sequence_equal_byref_n(my_pair, "\2\3\4\5\6")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/pair_byref_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,50 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 13 December 2004 : Initial version. + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef std::pair<int*,int*> foreach_container_type;+typedef std::pair<int const*,int const*> const foreach_const_container_type;
+typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +int my_array[] = { 1,2,3,4,5 }; +std::pair<int*,int*> my_pair(my_array,my_array+5); +std::pair<int const*,int const*> const my_const_pair(my_array,my_array+5); + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // non-const containers by reference + BOOST_CHECK(sequence_equal_byref_n_r(my_pair, "\5\4\3\2\1")); + + // const containers by reference + BOOST_CHECK(sequence_equal_byref_c_r(my_const_pair, "\5\4\3\2\1")); + + // mutate the mutable collections + mutate_foreach_byref_r(my_pair); + + // compare the mutated collections to the actual results + BOOST_CHECK(sequence_equal_byref_n_r(my_pair, "\6\5\4\3\2")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/pair_byval.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,45 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef std::pair<int*,int*> foreach_container_type;+typedef std::pair<int const*,int const*> const foreach_const_container_type;
+typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +int my_array[] = { 1,2,3,4,5 }; +std::pair<int*,int*> my_pair(my_array,my_array+5); +std::pair<int const*,int const*> const my_const_pair(my_array,my_array+5); + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + boost::mpl::true_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_pair); + + // non-const containers by value + BOOST_CHECK(sequence_equal_byval_n(my_pair, "\1\2\3\4\5")); + + // const containers by value + BOOST_CHECK(sequence_equal_byval_c(my_const_pair, "\1\2\3\4\5")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/pair_byval_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,45 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef std::pair<int*,int*> foreach_container_type;+typedef std::pair<int const*,int const*> const foreach_const_container_type;
+typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +int my_array[] = { 1,2,3,4,5 }; +std::pair<int*,int*> my_pair(my_array,my_array+5); +std::pair<int const*,int const*> const my_const_pair(my_array,my_array+5); + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + boost::mpl::true_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_pair); + + // non-const containers by value + BOOST_CHECK(sequence_equal_byval_n_r(my_pair, "\5\4\3\2\1")); + + // const containers by value + BOOST_CHECK(sequence_equal_byval_c_r(my_const_pair, "\5\4\3\2\1")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/rvalue_const.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,44 @@ +// (C) Copyright Eric Niebler 2005. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <vector> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +#ifdef BOOST_FOREACH_NO_CONST_RVALUE_DETECTION +// ignore error during Microsoft Code Analysis +#if !defined(_PREFAST_) +# error Expected failure : const rvalues disallowed +#endif +#else + +std::vector<int> const get_vector() +{ + return std::vector<int>(4, 4); +} + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + int counter = 0; + + BOOST_FOREACH(int i, get_vector()) + { + counter += i; + } + + BOOST_CHECK(16 == counter); + + return 0; +} + +#endif ======================================= --- /dev/null +++ /trunk/libs/foreach/test/rvalue_const_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,44 @@ +// (C) Copyright Eric Niebler 2005. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <vector> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +#ifdef BOOST_FOREACH_NO_CONST_RVALUE_DETECTION +// ignore error during Microsoft Code Analysis +#if !defined(_PREFAST_) +# error Expected failure : const rvalues disallowed +#endif +#else + +std::vector<int> const get_vector() +{ + return std::vector<int>(4, 4); +} + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + int counter = 0; + + BOOST_REVERSE_FOREACH(int i, get_vector()) + { + counter += i; + } + + BOOST_CHECK(16 == counter); + + return 0; +} + +#endif ======================================= --- /dev/null +++ /trunk/libs/foreach/test/rvalue_nonconst.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,41 @@ +// (C) Copyright Eric Niebler 2005. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <vector> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +#ifdef BOOST_FOREACH_NO_RVALUE_DETECTION +# error Expected failure : rvalues disallowed +#else + +std::vector<int> get_vector() +{ + return std::vector<int>(4, 4); +} + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + int counter = 0; + + BOOST_FOREACH(int i, get_vector()) + { + counter += i; + } + + BOOST_CHECK(16 == counter); + + return 0; +} + +#endif ======================================= --- /dev/null +++ /trunk/libs/foreach/test/rvalue_nonconst_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,41 @@ +// (C) Copyright Eric Niebler 2005. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <vector> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +#ifdef BOOST_FOREACH_NO_RVALUE_DETECTION +# error Expected failure : rvalues disallowed +#else + +std::vector<int> get_vector() +{ + return std::vector<int>(4, 4); +} + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + int counter = 0; + + BOOST_REVERSE_FOREACH(int i, get_vector()) + { + counter += i; + } + + BOOST_CHECK(16 == counter); + + return 0; +} + +#endif ======================================= --- /dev/null +++ /trunk/libs/foreach/test/stl_byref.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,62 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005: Initial version. +*/ + +#include <list> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef std::list<int> foreach_container_type; +typedef std::list<int> const foreach_const_container_type; +typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// initialize a std::list<int> +std::list<int> make_list() +{ + std::list<int> l; + l.push_back(1); + l.push_back(2); + l.push_back(3); + l.push_back(4); + l.push_back(5); + return l; +} + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +std::list<int> my_list = make_list(); +std::list<int> const &my_const_list = my_list; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // non-const containers by reference + BOOST_CHECK(sequence_equal_byref_n(my_list, "\1\2\3\4\5")); + + // const containers by reference + BOOST_CHECK(sequence_equal_byref_c(my_const_list, "\1\2\3\4\5")); + + // mutate the mutable collections + mutate_foreach_byref(my_list); + + // compare the mutated collections to the actual results + BOOST_CHECK(sequence_equal_byref_n(my_list, "\2\3\4\5\6")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/stl_byref_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,62 @@ +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005: Initial version. +*/ + +#include <list> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef std::list<int> foreach_container_type; +typedef std::list<int> const foreach_const_container_type; +typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// initialize a std::list<int> +std::list<int> make_list() +{ + std::list<int> l; + l.push_back(1); + l.push_back(2); + l.push_back(3); + l.push_back(4); + l.push_back(5); + return l; +} + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +std::list<int> my_list = make_list(); +std::list<int> const &my_const_list = my_list; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // non-const containers by reference + BOOST_CHECK(sequence_equal_byref_n_r(my_list, "\5\4\3\2\1")); + + // const containers by reference + BOOST_CHECK(sequence_equal_byref_c_r(my_const_list, "\5\4\3\2\1")); + + // mutate the mutable collections + mutate_foreach_byref_r(my_list); + + // compare the mutated collections to the actual results + BOOST_CHECK(sequence_equal_byref_n_r(my_list, "\6\5\4\3\2")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/stl_byval.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,60 @@ +// stl_byval.cpp +/// +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <list> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef std::list<int> foreach_container_type; +typedef std::list<int> const foreach_const_container_type; +typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// initialize a std::list<int> +std::list<int> make_list() +{ + std::list<int> l; + l.push_back(1); + l.push_back(2); + l.push_back(3); + l.push_back(4); + l.push_back(5); + return l; +} + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +std::list<int> my_list = make_list(); +std::list<int> const &my_const_list = my_list; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + boost::mpl::false_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_list); + + // non-const containers by value + BOOST_CHECK(sequence_equal_byval_n(my_list, "\1\2\3\4\5")); + + // const containers by value + BOOST_CHECK(sequence_equal_byval_c(my_const_list, "\1\2\3\4\5")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/stl_byval_r.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,60 @@ +// stl_byval.cpp +/// +// (C) Copyright Eric Niebler 2004. +// 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) + +/* + Revision history: + 25 August 2005 : Initial version. +*/ + +#include <list> +#include <boost/test/minimal.hpp> +#include <boost/foreach.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define the container types, used by utility.hpp to generate the helper functions
+typedef std::list<int> foreach_container_type; +typedef std::list<int> const foreach_const_container_type; +typedef int foreach_value_type; +typedef int &foreach_reference_type; +typedef int const &foreach_const_reference_type; + +#include "./utility.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// initialize a std::list<int> +std::list<int> make_list() +{ + std::list<int> l; + l.push_back(1); + l.push_back(2); + l.push_back(3); + l.push_back(4); + l.push_back(5); + return l; +} + +/////////////////////////////////////////////////////////////////////////////// +// define some containers +// +std::list<int> my_list = make_list(); +std::list<int> const &my_const_list = my_list; + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + boost::mpl::false_ *p = BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(my_list); + + // non-const containers by value + BOOST_CHECK(sequence_equal_byval_n_r(my_list, "\5\4\3\2\1")); + + // const containers by value + BOOST_CHECK(sequence_equal_byval_c_r(my_const_list, "\5\4\3\2\1")); + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/user_defined.cpp Fri May 28 01:35:26 2010 @@ -0,0 +1,54 @@ +// (C) Copyright Eric Niebler 2005. +// 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) + +/* +Revision history: +25 August 2005 : Initial version. +*/ + +#include <boost/test/minimal.hpp> + +///////////////////////////////////////////////////////////////////////////////+// define a user-defined collection type and teach BOOST_FOREACH how to enumerate it
+// +namespace mine +{ + struct dummy {}; + char * range_begin(mine::dummy&) {return 0;} + char const * range_begin(mine::dummy const&) {return 0;} + char * range_end(mine::dummy&) {return 0;} + char const * range_end(mine::dummy const&) {return 0;} +} + +#include <boost/foreach.hpp> + +namespace boost +{ + template<> + struct range_mutable_iterator<mine::dummy> + { + typedef char * type; + }; + template<> + struct range_const_iterator<mine::dummy> + { + typedef char const * type; + }; +} + +/////////////////////////////////////////////////////////////////////////////// +// test_main +// +int test_main( int, char*[] ) +{ + // loop over a user-defined type (just make sure this compiles) + mine::dummy d; + BOOST_FOREACH( char c, d ) + { + ((void)c); // no-op + } + + return 0; +} ======================================= --- /dev/null +++ /trunk/libs/foreach/test/utility.hpp Fri May 28 01:35:26 2010 @@ -0,0 +1,143 @@ +/////////////////////////////////////////////////////////////////////////////// +// utility.hpp header file +// +// Copyright 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) +// + +#ifndef BOOST_FOREACH_TEST_UTILITY_HPP +#define BOOST_FOREACH_TEST_UTILITY_HPP + +#include <boost/config.hpp> +#include <boost/foreach.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// sequence_equal_byval_n+inline bool sequence_equal_byval_n( foreach_container_type & rng, char const * result )
+{ + BOOST_FOREACH( foreach_value_type i, rng ) + { + if(0 == *result || i != *result) + return false; + ++result; + } + return 0 == *result; +} + +/////////////////////////////////////////////////////////////////////////////// +// sequence_equal_byval_c+inline bool sequence_equal_byval_c( foreach_const_container_type & rng, char const * result )
+{ + BOOST_FOREACH( foreach_value_type i, rng ) + { + if(0 == *result || i != *result) + return false; + ++result; + } + return 0 == *result; +} + +/////////////////////////////////////////////////////////////////////////////// +// sequence_equal_byref_n+inline bool sequence_equal_byref_n( foreach_container_type & rng, char const * result )
+{ + BOOST_FOREACH( foreach_reference_type i, rng ) + { + if(0 == *result || i != *result) + return false; + ++result; + } + return 0 == *result; +} + +/////////////////////////////////////////////////////////////////////////////// +// sequence_equal_byref_c+inline bool sequence_equal_byref_c( foreach_const_container_type & rng, char const * result )
+{ + BOOST_FOREACH( foreach_const_reference_type i, rng ) + { + if(0 == *result || i != *result) + return false; + ++result; + } + return 0 == *result; +} + +/////////////////////////////////////////////////////////////////////////////// +// mutate_foreach_byref +// +inline void mutate_foreach_byref( foreach_container_type & rng ) +{ + BOOST_FOREACH( foreach_reference_type i, rng ) + { + ++i; + } +} + + +/////////////////////////////////////////////////////////////////////////////// +// sequence_equal_byval_n_r+inline bool sequence_equal_byval_n_r( foreach_container_type & rng, char const * result )
+{ + BOOST_REVERSE_FOREACH( foreach_value_type i, rng ) + { + if(0 == *result || i != *result) + return false; + ++result; + } + return 0 == *result; +} + +/////////////////////////////////////////////////////////////////////////////// +// sequence_equal_byval_c_r+inline bool sequence_equal_byval_c_r( foreach_const_container_type & rng, char const * result )
+{ + BOOST_REVERSE_FOREACH( foreach_value_type i, rng ) + { + if(0 == *result || i != *result) + return false; + ++result; + } + return 0 == *result; +} + +/////////////////////////////////////////////////////////////////////////////// +// sequence_equal_byref_n_r+inline bool sequence_equal_byref_n_r( foreach_container_type & rng, char const * result )
+{ + BOOST_REVERSE_FOREACH( foreach_reference_type i, rng ) + { + if(0 == *result || i != *result) + return false; + ++result; + } + return 0 == *result; +} + +/////////////////////////////////////////////////////////////////////////////// +// sequence_equal_byref_c_r+inline bool sequence_equal_byref_c_r( foreach_const_container_type & rng, char const * result )
+{ + BOOST_REVERSE_FOREACH( foreach_const_reference_type i, rng ) + { + if(0 == *result || i != *result) + return false; + ++result; + } + return 0 == *result; +} + +/////////////////////////////////////////////////////////////////////////////// +// mutate_foreach_byref +// +inline void mutate_foreach_byref_r( foreach_container_type & rng ) +{ + BOOST_REVERSE_FOREACH( foreach_reference_type i, rng ) + { + ++i; + } +} + +#endif ======================================= --- /dev/null+++ /trunk/libs/functional/hash/test/container_no_fwd_test.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,14 @@ + +// Copyright 2010 Daniel James.+// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_DETAIL_NO_CONTAINER_FWD + +#include <boost/detail/container_fwd.hpp> + +int main() +{ + std::set<int> x; + std::vector<std::string> y; +} ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/adapt_assoc_struct_named.html Fri May 28 01:35:26 2010
@@ -0,0 +1,132 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted">+<link rel="prev" href="adapt_assoc_tpl_struct.html" title="BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT"> +<link rel="next" href="define_struct.html" title="BOOST_FUSION_DEFINE_STRUCT">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_assoc_tpl_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="define_struct.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.adapt_assoc_struct_named"></a><a class="link" href="adapt_assoc_struct_named.html" title="BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED"> BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED</a>
+</h3></div></div></div> +<a name="fusion.adapted.adapt_assoc_struct_named.description"></a><h5> +<a name="id764450"></a>+ <a class="link" href="adapt_assoc_struct_named.html#fusion.adapted.adapt_assoc_struct_named.description">Description</a>
+ </h5> +<p>+ BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED and BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS + are macros that can be used to generate all the necessary boilerplate to + make an arbitrary struct a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative
+ Sequence</a>. The given struct is adapted using the given name. + </p> +<a name="fusion.adapted.adapt_assoc_struct_named.synopsis"></a><h5> +<a name="id764478"></a>+ <a class="link" href="adapt_assoc_struct_named.html#fusion.adapted.adapt_assoc_struct_named.synopsis">Synopsis</a>
+ </h5>+<pre class="programlisting"><span class="identifier">BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED</span><span class="special">(</span> + <span class="identifier">struct_name</span><span class="special">,</span> <span class="identifier">adapted_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">,</span> <span class="identifier">key_type0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">,</span> <span class="identifier">key_type1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> ++<span class="identifier">BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS</span><span class="special">(</span> + <span class="identifier">struct_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...,</span> + <span class="identifier">adapted_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">,</span> <span class="identifier">key_type0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">,</span> <span class="identifier">key_type1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> +</pre> +<a name="fusion.adapted.adapt_assoc_struct_named.semantics"></a><h5> +<a name="id766338"></a>+ <a class="link" href="adapt_assoc_struct_named.html#fusion.adapted.adapt_assoc_struct_named.semantics">Semantics</a>
+ </h5> +<p>+ The above macros generate the necessary code to adapt <code class="computeroutput"><span class="identifier">struct_name</span></code> + as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative + Sequence</a> while using <code class="computeroutput"><span class="identifier">adapted_name</span></code> + as the name of the adapted struct. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...</span></code> + declares the namespace for <code class="computeroutput"><span class="identifier">adapted_name</span></code>. + It yields to a fully qualified name for <code class="computeroutput"><span class="identifier">adapted_name</span></code> + of <code class="computeroutput"><span class="identifier">namespace0</span><span class="special">::</span><span class="identifier">namespace1</span><span class="special">::...</span> + <span class="identifier">adapted_name</span></code>. If an empty namespace + sequence is given, the adapted view is placed in the global namespace. If + no namespace sequence is given (i.e. <code class="computeroutput"><span class="identifier">BOOST_FUSION_ADAPT_STRUCT_ASSOC_NAMED</span></code>), + the adapted view is placed in the namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">fusion</span><span class="special">::</span><span class="identifier">adapted</span></code>. + The sequence of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span> <span class="identifier">member_nameN</span><span class="special">,</span> <span class="identifier">key_typeN</span><span class="special">)</span></code> triples declares the type, name and key
+ type of each of the struct members that are part of the sequence. + </p> +<p>+ The macros should be used at global scope, and <code class="computeroutput"><span class="identifier">struct_name</span></code> + should be the fully namespace qualified name of the struct to be converted.
+ </p> +<a name="fusion.adapted.adapt_assoc_struct_named.header"></a><h5> +<a name="id766512"></a>+ <a class="link" href="adapt_assoc_struct_named.html#fusion.adapted.adapt_assoc_struct_named.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">adapt_assoc_struct_named</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">adapt_assoc_struct_named</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.adapt_assoc_struct_named.example"></a><h5> +<a name="id766627"></a>+ <a class="link" href="adapt_assoc_struct_named.html#fusion.adapted.adapt_assoc_struct_named.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">demo</span>
+<span class="special">{</span>+ <span class="keyword">struct</span> <span class="identifier">employee</span>
+ <span class="special">{</span>+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">name</span><span class="special">;</span> + <span class="keyword">int</span> <span class="identifier">age</span><span class="special">;</span>
+ <span class="special">};</span> +<span class="special">}</span> + +<span class="keyword">namespace</span> <span class="identifier">keys</span> +<span class="special">{</span>+ <span class="keyword">struct</span> <span class="identifier">name</span><span class="special">;</span> + <span class="keyword">struct</span> <span class="identifier">age</span><span class="special">;</span>
+<span class="special">}</span> ++<span class="comment">// boost::fusion::adapted::adapted_employee is now a Fusion sequence
+</span><span class="comment">// referring to demo::employee+</span><span class="identifier">BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED</span><span class="special">(</span> + <span class="identifier">demo</span><span class="special">::</span><span class="identifier">employee</span><span class="special">,</span> <span class="identifier">adapted_employee</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">name</span><span class="special">,</span> <span class="identifier">keys</span><span class="special">::</span><span class="identifier">name</span><span class="special">)</span> + <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">age</span><span class="special">,</span> <span class="identifier">keys</span><span class="special">::</span><span class="identifier">age</span><span class="special">))</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_assoc_tpl_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="define_struct.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/adapt_assoc_tpl_struct.html Fri May 28 01:35:26 2010
@@ -0,0 +1,125 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted">+<link rel="prev" href="adapt_assoc.html" title="BOOST_FUSION_ADAPT_ASSOC_STRUCT"> +<link rel="next" href="adapt_assoc_struct_named.html" title="BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_assoc.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="adapt_assoc_struct_named.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.adapt_assoc_tpl_struct"></a><a class="link" href="adapt_assoc_tpl_struct.html" title="BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT"> BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT</a>
+</h3></div></div></div> +<a name="fusion.adapted.adapt_assoc_tpl_struct.description"></a><h5> +<a name="id763709"></a>+ <a class="link" href="adapt_assoc_tpl_struct.html#fusion.adapted.adapt_assoc_tpl_struct.description">Description</a>
+ </h5> +<p>+ BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT is a macro that can be used to generate + all the necessary boilerplate to make an arbitrary template struct a model + of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative
+ Sequence</a>. + </p> +<a name="fusion.adapted.adapt_assoc_tpl_struct.synopsis"></a><h5> +<a name="id763735"></a>+ <a class="link" href="adapt_assoc_tpl_struct.html#fusion.adapted.adapt_assoc_tpl_struct.synopsis">Synopsis</a>
+ </h5>+<pre class="programlisting"><span class="identifier">BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...,</span> + <span class="special">(</span><span class="identifier">struct_name</span><span class="special">)</span> <span class="special">(</span><span class="identifier">specialization_param0</span><span class="special">)(</span><span class="identifier">specialization_param1</span><span class="special">)...,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">,</span> <span class="identifier">key_type0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">,</span> <span class="identifier">key_type1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> +</pre> +<a name="fusion.adapted.adapt_assoc_tpl_struct.semantics"></a><h5> +<a name="id763878"></a>+ <a class="link" href="adapt_assoc_tpl_struct.html#fusion.adapted.adapt_assoc_tpl_struct.semantics">Semantics</a>
+ </h5> +<p>+ The above macro generates the necessary code to adapt <code class="computeroutput"><span class="identifier">struct_name</span></code> + or an arbitrary specialization of <code class="computeroutput"><span class="identifier">struct_name</span></code> + as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative + Sequence</a>. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...</span></code> + declares the names of the template type parameters used. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">specialization_param0</span><span class="special">)(</span><span class="identifier">specialization_param1</span><span class="special">)...</span></code> declares the template parameters of the + actual specialization of <code class="computeroutput"><span class="identifier">struct_name</span></code> + that is adapted as a fusion sequence. The sequence of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span> + <span class="identifier">member_nameN</span><span class="special">,</span> + <span class="identifier">key_typeN</span><span class="special">)</span></code> + triples declares the type, name and key type of each of the struct members
+ that are part of the sequence. + </p> +<p>+ The macro should be used at global scope, and <code class="computeroutput"><span class="identifier">struct_name</span></code> + should be the fully namespace qualified name of the struct to be adapted.
+ </p> +<a name="fusion.adapted.adapt_assoc_tpl_struct.header"></a><h5> +<a name="id764014"></a>+ <a class="link" href="adapt_assoc_tpl_struct.html#fusion.adapted.adapt_assoc_tpl_struct.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">adapt_assoc_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">adapt_assoc_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.adapt_assoc_tpl_struct.example"></a><h5> +<a name="id764129"></a>+ <a class="link" href="adapt_assoc_tpl_struct.html#fusion.adapted.adapt_assoc_tpl_struct.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">demo</span>
+<span class="special">{</span>+ <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Name</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Age</span><span class="special">></span> + <span class="keyword">struct</span> <span class="identifier">employee</span>
+ <span class="special">{</span>+ <span class="identifier">Name</span> <span class="identifier">name</span><span class="special">;</span> + <span class="identifier">Age</span> <span class="identifier">age</span><span class="special">;</span>
+ <span class="special">};</span> +<span class="special">}</span> + +<span class="keyword">namespace</span> <span class="identifier">keys</span> +<span class="special">{</span>+ <span class="keyword">struct</span> <span class="identifier">name</span><span class="special">;</span> + <span class="keyword">struct</span> <span class="identifier">age</span><span class="special">;</span>
+<span class="special">}</span> ++<span class="comment">// Any instantiated demo::employee is now a Fusion sequence.
+</span><span class="comment">// It is also an associative sequence with +</span><span class="comment">// keys keys::name and keys::age present.+</span><span class="identifier">BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">Name</span><span class="special">)(</span><span class="identifier">Age</span><span class="special">),</span> + <span class="special">(</span><span class="identifier">demo</span><span class="special">::</span><span class="identifier">employee</span><span class="special">)</span> <span class="special">(</span><span class="identifier">Name</span><span class="special">)(</span><span class="identifier">Age</span><span class="special">),</span> + <span class="special">(</span><span class="identifier">Name</span><span class="special">,</span> <span class="identifier">name</span><span class="special">,</span> <span class="identifier">keys</span><span class="special">::</span><span class="identifier">name</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">Age</span><span class="special">,</span> <span class="identifier">age</span><span class="special">,</span> <span class="identifier">keys</span><span class="special">::</span><span class="identifier">age</span><span class="special">))</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_assoc.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="adapt_assoc_struct_named.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/adapt_struct_named.html Fri May 28 01:35:26 2010
@@ -0,0 +1,124 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>BOOST_FUSION_ADAPT_STRUCT_NAMED</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted">+<link rel="prev" href="adapt_tpl_struct.html" title="BOOST_FUSION_ADAPT_TPL_STRUCT"> +<link rel="next" href="adapt_assoc.html" title="BOOST_FUSION_ADAPT_ASSOC_STRUCT">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_tpl_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="adapt_assoc.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="BOOST_FUSION_ADAPT_STRUCT_NAMED"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.adapt_struct_named"></a><a class="link" href="adapt_struct_named.html" title="BOOST_FUSION_ADAPT_STRUCT_NAMED"> BOOST_FUSION_ADAPT_STRUCT_NAMED</a>
+</h3></div></div></div> +<a name="fusion.adapted.adapt_struct_named.description"></a><h5> +<a name="id762457"></a>+ <a class="link" href="adapt_struct_named.html#fusion.adapted.adapt_struct_named.description">Description</a>
+ </h5> +<p>+ BOOST_FUSION_ADAPT_STRUCT_NAMED and BOOST_FUSION_ADAPT_STRUCT_NAMED_NS are + macros that can be used to generate all the necessary boilerplate to make + an arbitrary struct a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a>. The given struct is adapted using the given name.
+ </p> +<a name="fusion.adapted.adapt_struct_named.synopsis"></a><h5> +<a name="id762480"></a>+ <a class="link" href="adapt_struct_named.html#fusion.adapted.adapt_struct_named.synopsis">Synopsis</a>
+ </h5>+<pre class="programlisting"><span class="identifier">BOOST_FUSION_ADAPT_STRUCT_NAMED</span><span class="special">(</span> + <span class="identifier">struct_name</span><span class="special">,</span> <span class="identifier">adapted_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> ++<span class="identifier">BOOST_FUSION_ADAPT_STRUCT_NAMED_NS</span><span class="special">(</span> + <span class="identifier">struct_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...,</span> + <span class="identifier">adapted_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> +</pre> +<a name="fusion.adapted.adapt_struct_named.semantics"></a><h5> +<a name="id762667"></a>+ <a class="link" href="adapt_struct_named.html#fusion.adapted.adapt_struct_named.semantics">Semantics</a>
+ </h5> +<p>+ The above macros generate the necessary code to adapt <code class="computeroutput"><span class="identifier">struct_name</span></code> + as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> while using <code class="computeroutput"><span class="identifier">adapted_name</span></code> + as the name of the adapted struct. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...</span></code> + declares the namespace for <code class="computeroutput"><span class="identifier">adapted_name</span></code>. + It yields to a fully qualified name for <code class="computeroutput"><span class="identifier">adapted_name</span></code> + of <code class="computeroutput"><span class="identifier">namespace0</span><span class="special">::</span><span class="identifier">namespace1</span><span class="special">::...</span> + <span class="identifier">adapted_name</span></code>. If an empty namespace + sequence is given, the adapted view is placed in the global namespace. If + no namespace sequence is given (i.e. <code class="computeroutput"><span class="identifier">BOOST_FUSION_ADAPT_STRUCT_NAMED</span></code>), + the adapted view is placed in the namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">fusion</span><span class="special">::</span><span class="identifier">adapted</span></code>. + The sequence of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span> <span class="identifier">member_nameN</span><span class="special">)</span></code> pairs declares the type and names of each
+ of the struct members that are part of the sequence. + </p> +<p>+ The macros should be used at global scope, and <code class="computeroutput"><span class="identifier">struct_name</span></code> + should be the fully namespace qualified name of the struct to be converted.
+ </p> +<a name="fusion.adapted.adapt_struct_named.header"></a><h5> +<a name="id762828"></a>+ <a class="link" href="adapt_struct_named.html#fusion.adapted.adapt_struct_named.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">adapt_struct_named</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">adapt_struct_named</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.adapt_struct_named.example"></a><h5> +<a name="id762943"></a>+ <a class="link" href="adapt_struct_named.html#fusion.adapted.adapt_struct_named.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">demo</span>
+<span class="special">{</span>+ <span class="keyword">struct</span> <span class="identifier">employee</span>
+ <span class="special">{</span>+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">name</span><span class="special">;</span> + <span class="keyword">int</span> <span class="identifier">age</span><span class="special">;</span>
+ <span class="special">};</span> +<span class="special">}</span> ++<span class="comment">// boost::fusion::adapted::adapted_employee is now a Fusion sequence
+</span><span class="comment">// referring to demo::employee+</span><span class="identifier">BOOST_FUSION_ADAPT_STRUCT_NAMED</span><span class="special">(</span> + <span class="identifier">demo</span><span class="special">::</span><span class="identifier">employee</span><span class="special">,</span> <span class="identifier">adapted_employee</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">name</span><span class="special">)</span> + <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">age</span><span class="special">))</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_tpl_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="adapt_assoc.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/adapt_tpl_struct.html Fri May 28 01:35:26 2010
@@ -0,0 +1,114 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>BOOST_FUSION_ADAPT_TPL_STRUCT</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted">+<link rel="prev" href="adapt_struct.html" title="BOOST_FUSION_ADAPT_STRUCT"> +<link rel="next" href="adapt_struct_named.html" title="BOOST_FUSION_ADAPT_STRUCT_NAMED">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="adapt_struct_named.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="BOOST_FUSION_ADAPT_TPL_STRUCT"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.adapt_tpl_struct"></a><a class="link" href="adapt_tpl_struct.html" title="BOOST_FUSION_ADAPT_TPL_STRUCT"> BOOST_FUSION_ADAPT_TPL_STRUCT</a>
+</h3></div></div></div> +<a name="fusion.adapted.adapt_tpl_struct.description"></a><h5> +<a name="id760196"></a>+ <a class="link" href="adapt_tpl_struct.html#fusion.adapted.adapt_tpl_struct.description">Description</a>
+ </h5> +<p>+ BOOST_FUSION_ADAPT_TPL_STRUCT is a macro that can be used to generate all + the necessary boilerplate to make an arbitrary template struct a model of + <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random Access
+ Sequence</a>. + </p> +<a name="fusion.adapted.adapt_tpl_struct.synopsis"></a><h5> +<a name="id760217"></a>+ <a class="link" href="adapt_tpl_struct.html#fusion.adapted.adapt_tpl_struct.synopsis">Synopsis</a>
+ </h5>+<pre class="programlisting"><span class="identifier">BOOST_FUSION_ADAPT_TPL_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...,</span> + <span class="special">(</span><span class="identifier">struct_name</span><span class="special">)</span> <span class="special">(</span><span class="identifier">specialization_param0</span><span class="special">)(</span><span class="identifier">specialization_param1</span><span class="special">)...,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> +</pre> +<a name="fusion.adapted.adapt_tpl_struct.semantics"></a><h5> +<a name="id760343"></a>+ <a class="link" href="adapt_tpl_struct.html#fusion.adapted.adapt_tpl_struct.semantics">Semantics</a>
+ </h5> +<p>+ The above macro generates the necessary code to adapt <code class="computeroutput"><span class="identifier">struct_name</span></code> + or an arbitrary specialization of <code class="computeroutput"><span class="identifier">struct_name</span></code> + as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a>. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...</span></code> + declares the names of the template type parameters used. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">specialization_param0</span><span class="special">)(</span><span class="identifier">specialization_param1</span><span class="special">)...</span></code> declares the template parameters of the + actual specialization of <code class="computeroutput"><span class="identifier">struct_name</span></code> + that is adapted as a fusion sequence. The sequence of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span> + <span class="identifier">member_nameN</span><span class="special">)</span></code> + pairs declares the type and names of each of the struct members that are
+ part of the sequence. + </p> +<p>+ The macro should be used at global scope, and <code class="computeroutput"><span class="identifier">struct_name</span></code> + should be the fully namespace qualified name of the struct to be adapted.
+ </p> +<a name="fusion.adapted.adapt_tpl_struct.header"></a><h5> +<a name="id760466"></a>+ <a class="link" href="adapt_tpl_struct.html#fusion.adapted.adapt_tpl_struct.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">adapt_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">adapt_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.adapt_tpl_struct.example"></a><h5> +<a name="id760581"></a>+ <a class="link" href="adapt_tpl_struct.html#fusion.adapted.adapt_tpl_struct.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">demo</span>
+<span class="special">{</span>+ <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Name</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Age</span><span class="special">></span> + <span class="keyword">struct</span> <span class="identifier">employee</span>
+ <span class="special">{</span>+ <span class="identifier">Name</span> <span class="identifier">name</span><span class="special">;</span> + <span class="identifier">Age</span> <span class="identifier">age</span><span class="special">;</span>
+ <span class="special">};</span> +<span class="special">}</span> ++<span class="comment">// Any instantiated demo::employee is now a Fusion sequence +</span><span class="identifier">BOOST_FUSION_ADAPT_TPL_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">Name</span><span class="special">)(</span><span class="identifier">Age</span><span class="special">),</span> + <span class="special">(</span><span class="identifier">demo</span><span class="special">::</span><span class="identifier">employee</span><span class="special">)</span> <span class="special">(</span><span class="identifier">Name</span><span class="special">)(</span><span class="identifier">Age</span><span class="special">),</span> + <span class="special">(</span><span class="identifier">Name</span><span class="special">,</span> <span class="identifier">name</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">Age</span><span class="special">,</span> <span class="identifier">age</span><span class="special">))</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="adapt_struct_named.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/array.html Fri May 28 01:35:26 2010
@@ -0,0 +1,74 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>Array</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted"> +<link rel="prev" href="../adapted.html" title="Adapted"> +<link rel="next" href="std__pair.html" title="std::pair"> +</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="../adapted.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="std__pair.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="Array"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.array"></a><a class="link" href="array.html" title="Array"> Array</a>
+</h3></div></div></div> +<p>+ This module provides adapters for arrays. Including the module header makes + any array a fully conforming <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random
+ Access Sequence</a>. + </p> +<a name="fusion.adapted.array.header"></a><h5> +<a name="id756428"></a>+ <a class="link" href="array.html#fusion.adapted.array.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="identifier">array</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">array</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.array.model_of"></a><h5> +<a name="id756536"></a>+ <a class="link" href="array.html#fusion.adapted.array.model_of">Model of</a>
+ </h5>+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random
+ Access Sequence</a></li></ul></div> +<a name="fusion.adapted.array.example"></a><h5> +<a name="id756561"></a>+ <a class="link" href="array.html#fusion.adapted.array.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">arr</span><span class="special">[</span><span class="number">3</span><span class="special">]</span> <span class="special">=</span> <span class="special">{</span><span class="number">1</span><span class="special">,</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">};</span>
++<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="special">*</span><a class="link" href="../sequence/intrinsic/functions/begin.html" title="begin"><code class="computeroutput"><span class="identifier">begin</span></code></a><span class="special">(</span><span class="identifier">arr</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> +<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="special">*</span><a class="link" href="../iterator/functions/next.html" title="next"><code class="computeroutput"><span class="identifier">next</span></code></a><span class="special">(</span><a class="link" href="../sequence/intrinsic/functions/begin.html" title="begin"><code class="computeroutput"><span class="identifier">begin</span></code></a><span class="special">(</span><span class="identifier">arr</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> +<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="special">*</span><a class="link" href="../iterator/functions/advance_c.html" title="advance_c"><code class="computeroutput"><span class="identifier">advance_c</span></code></a><span class="special"><</span><span class="number">2</span><span class="special">>(</span><a class="link" href="../sequence/intrinsic/functions/begin.html" title="begin"><code class="computeroutput"><span class="identifier">begin</span></code></a><span class="special">(</span><span class="identifier">arr</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> +<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="special">*</span><a class="link" href="../iterator/functions/prior.html" title="prior"><code class="computeroutput"><span class="identifier">prior</span></code></a><span class="special">(</span><a class="link" href="../sequence/intrinsic/functions/end.html" title="end"><code class="computeroutput"><span class="identifier">end</span></code></a><span class="special">(</span><span class="identifier">arr</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> +<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <a class="link" href="../sequence/intrinsic/functions/at_c.html" title="at_c"><code class="computeroutput"><span class="identifier">at_c</span></code></a><span class="special"><</span><span class="number">2</span><span class="special">>(</span><span class="identifier">arr</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="../adapted.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="std__pair.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/define_assoc_struct.html Fri May 28 01:35:26 2010
@@ -0,0 +1,219 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>BOOST_FUSION_DEFINE_ASSOC_STRUCT</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted">+<link rel="prev" href="define_tpl_struct.html" title="BOOST_FUSION_DEFINE_TPL_STRUCT"> +<link rel="next" href="define_assoc_tpl_struct.html" title="BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="define_tpl_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="define_assoc_tpl_struct.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="BOOST_FUSION_DEFINE_ASSOC_STRUCT"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.define_assoc_struct"></a><a class="link" href="define_assoc_struct.html" title="BOOST_FUSION_DEFINE_ASSOC_STRUCT"> BOOST_FUSION_DEFINE_ASSOC_STRUCT</a>
+</h3></div></div></div> +<a name="fusion.adapted.define_assoc_struct.description"></a><h5> +<a name="id769808"></a>+ <a class="link" href="define_assoc_struct.html#fusion.adapted.define_assoc_struct.description">Description</a>
+ </h5> +<p>+ BOOST_FUSION_DEFINE_ASSOC_STRUCT is a macro that can be used to generate + all the necessary boilerplate to define and adapt an arbitrary struct as + a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative
+ Sequence</a>. + </p> +<a name="fusion.adapted.define_assoc_struct.synopsis"></a><h5> +<a name="id769834"></a>+ <a class="link" href="define_assoc_struct.html#fusion.adapted.define_assoc_struct.synopsis">Synopsis</a>
+ </h5>+<pre class="programlisting"><span class="identifier">BOOST_FUSION_DEFINE_ASSOC_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...,</span> + <span class="identifier">struct_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">,</span> <span class="identifier">key_type0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">,</span> <span class="identifier">key_type1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> +</pre> +<div class="variablelist" title="Notation"> +<p class="title"><b>Notation</b></p> +<dl>+<dt><span class="term"><code class="computeroutput"><span class="identifier">str</span></code></span></dt>
+<dd><p>+ An instance of <code class="computeroutput"><span class="identifier">struct_name</span></code>
+ </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">e0</span></code>...<code class="computeroutput"><span class="identifier">en</span></code></span></dt>
+<dd><p> + Heterogeneous values + </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">fs</span></code></span></dt>
+<dd><p>+ A <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward
+ Sequence</a> + </p></dd> +</dl> +</div> +<a name="fusion.adapted.define_assoc_struct.expression_semantics"></a><h5> +<a name="id770038"></a>+ <a class="link" href="define_assoc_struct.html#fusion.adapted.define_assoc_struct.expression_semantics">Expression
+ Semantics</a> + </h5> +<p>+ The above macro generates the necessary code that defines and adapts <code class="computeroutput"><span class="identifier">struct_name</span></code> as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative + Sequence</a>. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...</span></code> + declares the namespace for <code class="computeroutput"><span class="identifier">struct_name</span></code>. + It yields to a fully qualified name for <code class="computeroutput"><span class="identifier">struct_name</span></code> + of <code class="computeroutput"><span class="identifier">namespace0</span><span class="special">::</span><span class="identifier">namespace1</span><span class="special">::...</span> + <span class="identifier">struct_name</span></code>. If an empty namespace + sequence is given, the struct is placed in the global namespace. The sequence + of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span> <span class="identifier">member_nameN</span><span class="special">,</span> <span class="identifier">key_typeN</span><span class="special">)</span></code> triples declares the type, name and key
+ type of each of the struct members that are part of the sequence. + </p> +<p>+ The macro should be used at global scope. Semantics of an expression is defined + only where it differs from, or is not defined in <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative
+ Sequence</a>. + </p> +<div class="informaltable"><table class="table"> +<colgroup> +<col> +<col> +</colgroup> +<thead><tr> +<th> + <p> + Expression + </p> + </th> +<th> + <p> + Semantics + </p> + </th> +</tr></thead> +<tbody> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">struct_name</span><span class="special">()</span></code>
+ </p> + </td> +<td> + <p>+ Creates an instance of <code class="computeroutput"><span class="identifier">struct_name</span></code>
+ with default constructed elements. + </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">struct_name</span><span class="special">(</span><span class="identifier">e0</span><span class="special">,</span> + <span class="identifier">e1</span><span class="special">,...</span> + <span class="identifier">en</span><span class="special">)</span></code>
+ </p> + </td> +<td> + <p>+ Creates an instance of <code class="computeroutput"><span class="identifier">struct_name</span></code> + with elements <code class="computeroutput"><span class="identifier">e0</span></code>...<code class="computeroutput"><span class="identifier">en</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">struct_name</span><span class="special">(</span><span class="identifier">fs</span><span class="special">)</span></code>
+ </p> + </td> +<td> + <p>+ Copy constructs an instance of <code class="computeroutput"><span class="identifier">struct_name</span></code> + from a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward + Sequence</a> <code class="computeroutput"><span class="identifier">fs</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">str</span> <span class="special">=</span>
+ <span class="identifier">fs</span></code> + </p> + </td> +<td> + <p>+ Assigns from a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward + Sequence</a> <code class="computeroutput"><span class="identifier">fs</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">str</span><span class="special">.</span><span class="identifier">member_nameN</span></code>
+ </p> + </td> +<td> + <p>+ Access of struct member <code class="computeroutput"><span class="identifier">member_nameN</span></code>
+ </p> + </td> +</tr> +</tbody> +</table></div> +<a name="fusion.adapted.define_assoc_struct.header"></a><h5> +<a name="id770462"></a>+ <a class="link" href="define_assoc_struct.html#fusion.adapted.define_assoc_struct.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">define_assoc_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">define_assoc_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.define_assoc_struct.example"></a><h5> +<a name="id770577"></a>+ <a class="link" href="define_assoc_struct.html#fusion.adapted.define_assoc_struct.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">keys</span>
+<span class="special">{</span>+ <span class="keyword">struct</span> <span class="identifier">name</span><span class="special">;</span> + <span class="keyword">struct</span> <span class="identifier">age</span><span class="special">;</span>
+<span class="special">}</span> + +<span class="comment">// demo::employee is a Fusion sequence+</span><span class="identifier">BOOST_FUSION_DEFINE_ASSOC_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">demo</span><span class="special">),</span> <span class="identifier">employee</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">name</span><span class="special">,</span> <span class="identifier">keys</span><span class="special">::</span><span class="identifier">name</span><span class="special">)</span> + <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">age</span><span class="special">,</span> <span class="identifier">keys</span><span class="special">::</span><span class="identifier">age</span><span class="special">))</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="define_tpl_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="define_assoc_tpl_struct.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/define_assoc_tpl_struct.html Fri May 28 01:35:26 2010
@@ -0,0 +1,228 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted">+<link rel="prev" href="define_assoc_struct.html" title="BOOST_FUSION_DEFINE_ASSOC_STRUCT">
+<link rel="next" href="../algorithm.html" title="Algorithm"> +</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="define_assoc_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../algorithm.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.define_assoc_tpl_struct"></a><a class="link" href="define_assoc_tpl_struct.html" title="BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT"> BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT</a>
+</h3></div></div></div> +<a name="fusion.adapted.define_assoc_tpl_struct.description"></a><h5> +<a name="id770762"></a>+ <a class="link" href="define_assoc_tpl_struct.html#fusion.adapted.define_assoc_tpl_struct.description">Description</a>
+ </h5> +<p>+ BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT is a macro that can be used to generate + all the necessary boilerplate to define and adapt an arbitrary template struct + as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative
+ Sequence</a>. + </p> +<a name="fusion.adapted.define_assoc_tpl_struct.synopsis"></a><h5> +<a name="id770788"></a>+ <a class="link" href="define_assoc_tpl_struct.html#fusion.adapted.define_assoc_tpl_struct.synopsis">Synopsis</a>
+ </h5>+<pre class="programlisting"><span class="identifier">BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...,</span> + <span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...,</span> + <span class="identifier">struct_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">,</span> <span class="identifier">key_type0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">,</span> <span class="identifier">key_type1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> +</pre> +<div class="variablelist" title="Notation"> +<p class="title"><b>Notation</b></p> +<dl>+<dt><span class="term"><code class="computeroutput"><span class="identifier">Str</span></code></span></dt>
+<dd><p>+ An instantiated <code class="computeroutput"><span class="identifier">struct_name</span></code>
+ </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">str</span></code></span></dt>
+<dd><p>+ An instance of <code class="computeroutput"><span class="identifier">Str</span></code>
+ </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">e0</span></code>...<code class="computeroutput"><span class="identifier">en</span></code></span></dt>
+<dd><p> + Heterogeneous values + </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">fs</span></code></span></dt>
+<dd><p>+ A <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward
+ Sequence</a> + </p></dd> +</dl> +</div>+<a name="fusion.adapted.define_assoc_tpl_struct.expression_semantics"></a><h5>
+<a name="id771040"></a>+ <a class="link" href="define_assoc_tpl_struct.html#fusion.adapted.define_assoc_tpl_struct.expression_semantics">Expression
+ Semantics</a> + </h5> +<p>+ The above macro generates the necessary code that defines and adapts <code class="computeroutput"><span class="identifier">struct_name</span></code> as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative + Sequence</a>. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...</span></code> + declares the namespace for <code class="computeroutput"><span class="identifier">struct_name</span></code>. + It yields to a fully qualified name for <code class="computeroutput"><span class="identifier">struct_name</span></code> + of <code class="computeroutput"><span class="identifier">namespace0</span><span class="special">::</span><span class="identifier">namespace1</span><span class="special">::...</span> + <span class="identifier">struct_name</span></code>. If an empty namespace + sequence is given, the struct is placed in the global namespace. The sequence + <code class="computeroutput"><span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...</span></code> declares the names of the template type + parameters used. The sequence of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span> + <span class="identifier">member_nameN</span><span class="special">,</span> + <span class="identifier">key_typeN</span><span class="special">)</span></code> + triples declares the type, name and key type of each of the struct members
+ that are part of the sequence. + </p> +<p>+ The macro should be used at global scope. Semantics of an expression is defined + only where it differs from, or is not defined in <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a> and <a class="link" href="../sequence/concepts/associative_sequence.html" title="Associative Sequence">Associative
+ Sequence</a>. + </p> +<div class="informaltable"><table class="table"> +<colgroup> +<col> +<col> +</colgroup> +<thead><tr> +<th> + <p> + Expression + </p> + </th> +<th> + <p> + Semantics + </p> + </th> +</tr></thead> +<tbody> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">Str</span><span class="special">()</span></code>
+ </p> + </td> +<td> + <p>+ Creates an instance of <code class="computeroutput"><span class="identifier">Str</span></code>
+ with default constructed elements. + </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">Str</span><span class="special">(</span><span class="identifier">e0</span><span class="special">,</span> + <span class="identifier">e1</span><span class="special">,...</span> + <span class="identifier">en</span><span class="special">)</span></code>
+ </p> + </td> +<td> + <p>+ Creates an instance of <code class="computeroutput"><span class="identifier">Str</span></code> + with elements <code class="computeroutput"><span class="identifier">e0</span></code>...<code class="computeroutput"><span class="identifier">en</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">Str</span><span class="special">(</span><span class="identifier">fs</span><span class="special">)</span></code>
+ </p> + </td> +<td> + <p>+ Copy constructs an instance of <code class="computeroutput"><span class="identifier">Str</span></code> + from a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward + Sequence</a> <code class="computeroutput"><span class="identifier">fs</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">str</span> <span class="special">=</span>
+ <span class="identifier">fs</span></code> + </p> + </td> +<td> + <p>+ Assigns from a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward + Sequence</a> <code class="computeroutput"><span class="identifier">fs</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">str</span><span class="special">.</span><span class="identifier">member_nameN</span></code>
+ </p> + </td> +<td> + <p>+ Access of struct member <code class="computeroutput"><span class="identifier">member_nameN</span></code>
+ </p> + </td> +</tr> +</tbody> +</table></div> +<a name="fusion.adapted.define_assoc_tpl_struct.header"></a><h5> +<a name="id771488"></a>+ <a class="link" href="define_assoc_tpl_struct.html#fusion.adapted.define_assoc_tpl_struct.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">define_assoc_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">define_assoc_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.define_assoc_tpl_struct.example"></a><h5> +<a name="id771603"></a>+ <a class="link" href="define_assoc_tpl_struct.html#fusion.adapted.define_assoc_tpl_struct.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">keys</span>
+<span class="special">{</span>+ <span class="keyword">struct</span> <span class="identifier">name</span><span class="special">;</span> + <span class="keyword">struct</span> <span class="identifier">age</span><span class="special">;</span>
+<span class="special">}</span> ++<span class="comment">// Any instantiated demo::employee is a Fusion sequence +</span><span class="identifier">BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">demo</span><span class="special">),</span> <span class="special">(</span><span class="identifier">Name</span><span class="special">)(</span><span class="identifier">Age</span><span class="special">),</span> <span class="identifier">employee</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">Name</span><span class="special">,</span> <span class="identifier">name</span><span class="special">,</span> <span class="identifier">keys</span><span class="special">::</span><span class="identifier">name</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">Age</span><span class="special">,</span> <span class="identifier">age</span><span class="special">,</span> <span class="identifier">keys</span><span class="special">::</span><span class="identifier">age</span><span class="special">))</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="define_assoc_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../algorithm.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/define_struct.html Fri May 28 01:35:26 2010
@@ -0,0 +1,210 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>BOOST_FUSION_DEFINE_STRUCT</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted">+<link rel="prev" href="adapt_assoc_struct_named.html" title="BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED"> +<link rel="next" href="define_tpl_struct.html" title="BOOST_FUSION_DEFINE_TPL_STRUCT">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_assoc_struct_named.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="define_tpl_struct.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="BOOST_FUSION_DEFINE_STRUCT"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.define_struct"></a><a class="link" href="define_struct.html" title="BOOST_FUSION_DEFINE_STRUCT"> BOOST_FUSION_DEFINE_STRUCT</a>
+</h3></div></div></div> +<a name="fusion.adapted.define_struct.description"></a><h5> +<a name="id766891"></a>+ <a class="link" href="define_struct.html#fusion.adapted.define_struct.description">Description</a>
+ </h5> +<p>+ BOOST_FUSION_DEFINE_STRUCT is a macro that can be used to generate all the + necessary boilerplate to define and adapt an arbitrary struct as a model + of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random
+ Access Sequence</a>. + </p> +<a name="fusion.adapted.define_struct.synopsis"></a><h5> +<a name="id766913"></a>+ <a class="link" href="define_struct.html#fusion.adapted.define_struct.synopsis">Synopsis</a>
+ </h5>+<pre class="programlisting"><span class="identifier">BOOST_FUSION_DEFINE_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...,</span> + <span class="identifier">struct_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> +</pre> +<div class="variablelist" title="Notation"> +<p class="title"><b>Notation</b></p> +<dl>+<dt><span class="term"><code class="computeroutput"><span class="identifier">str</span></code></span></dt>
+<dd><p>+ An instance of <code class="computeroutput"><span class="identifier">struct_name</span></code>
+ </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">e0</span></code>...<code class="computeroutput"><span class="identifier">en</span></code></span></dt>
+<dd><p> + Heterogeneous values + </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">fs</span></code></span></dt>
+<dd><p>+ A <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward
+ Sequence</a> + </p></dd> +</dl> +</div> +<a name="fusion.adapted.define_struct.expression_semantics"></a><h5> +<a name="id767100"></a>+ <a class="link" href="define_struct.html#fusion.adapted.define_struct.expression_semantics">Expression
+ Semantics</a> + </h5> +<p>+ The above macro generates the necessary code that defines and adapts <code class="computeroutput"><span class="identifier">struct_name</span></code> as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a>. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...</span></code> + declares the namespace for <code class="computeroutput"><span class="identifier">struct_name</span></code>. + It yields to a fully qualified name for <code class="computeroutput"><span class="identifier">struct_name</span></code> + of <code class="computeroutput"><span class="identifier">namespace0</span><span class="special">::</span><span class="identifier">namespace1</span><span class="special">::...</span> + <span class="identifier">struct_name</span></code>. If an empty namespace + sequence is given, the struct is placed in the global namespace. The sequence + of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span> <span class="identifier">member_nameN</span><span class="special">)</span></code> pairs declares the type and names of each
+ of the struct members that are part of the sequence. + </p> +<p>+ The macro should be used at global scope. Semantics of an expression is defined + only where it differs from, or is not defined in <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random
+ Access Sequence</a>. + </p> +<div class="informaltable"><table class="table"> +<colgroup> +<col> +<col> +</colgroup> +<thead><tr> +<th> + <p> + Expression + </p> + </th> +<th> + <p> + Semantics + </p> + </th> +</tr></thead> +<tbody> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">struct_name</span><span class="special">()</span></code>
+ </p> + </td> +<td> + <p>+ Creates an instance of <code class="computeroutput"><span class="identifier">struct_name</span></code>
+ with default constructed elements. + </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">struct_name</span><span class="special">(</span><span class="identifier">e0</span><span class="special">,</span> + <span class="identifier">e1</span><span class="special">,...</span> + <span class="identifier">en</span><span class="special">)</span></code>
+ </p> + </td> +<td> + <p>+ Creates an instance of <code class="computeroutput"><span class="identifier">struct_name</span></code> + with elements <code class="computeroutput"><span class="identifier">e0</span></code>...<code class="computeroutput"><span class="identifier">en</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">struct_name</span><span class="special">(</span><span class="identifier">fs</span><span class="special">)</span></code>
+ </p> + </td> +<td> + <p>+ Copy constructs an instance of <code class="computeroutput"><span class="identifier">struct_name</span></code> + from a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward + Sequence</a> <code class="computeroutput"><span class="identifier">fs</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">str</span> <span class="special">=</span>
+ <span class="identifier">fs</span></code> + </p> + </td> +<td> + <p>+ Assigns from a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward + Sequence</a> <code class="computeroutput"><span class="identifier">fs</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">str</span><span class="special">.</span><span class="identifier">member_nameN</span></code>
+ </p> + </td> +<td> + <p>+ Access of struct member <code class="computeroutput"><span class="identifier">member_nameN</span></code>
+ </p> + </td> +</tr> +</tbody> +</table></div> +<a name="fusion.adapted.define_struct.header"></a><h5> +<a name="id767506"></a>+ <a class="link" href="define_struct.html#fusion.adapted.define_struct.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">define_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">define_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.define_struct.example"></a><h5> +<a name="id767621"></a>+ <a class="link" href="define_struct.html#fusion.adapted.define_struct.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="comment">// demo::employee is a Fusion sequence +</span><span class="identifier">BOOST_FUSION_DEFINE_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">demo</span><span class="special">),</span> <span class="identifier">employee</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">,</span> <span class="identifier">name</span><span class="special">)</span> + <span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">age</span><span class="special">))</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="adapt_assoc_struct_named.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="define_tpl_struct.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/doc/html/fusion/adapted/define_tpl_struct.html Fri May 28 01:35:26 2010
@@ -0,0 +1,218 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<title>BOOST_FUSION_DEFINE_TPL_STRUCT</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.1">+<link rel="home" href="../../index.html" title="Chapter 1. Fusion 2.0">
+<link rel="up" href="../adapted.html" title="Adapted">+<link rel="prev" href="define_struct.html" title="BOOST_FUSION_DEFINE_STRUCT"> +<link rel="next" href="define_assoc_struct.html" title="BOOST_FUSION_DEFINE_ASSOC_STRUCT">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="define_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="define_assoc_struct.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" title="BOOST_FUSION_DEFINE_TPL_STRUCT"> +<div class="titlepage"><div><div><h3 class="title">+<a name="fusion.adapted.define_tpl_struct"></a><a class="link" href="define_tpl_struct.html" title="BOOST_FUSION_DEFINE_TPL_STRUCT"> BOOST_FUSION_DEFINE_TPL_STRUCT</a>
+</h3></div></div></div> +<a name="fusion.adapted.define_tpl_struct.description"></a><h5> +<a name="id767729"></a>+ <a class="link" href="define_tpl_struct.html#fusion.adapted.define_tpl_struct.description">Description</a>
+ </h5> +<p>+ BOOST_FUSION_DEFINE_TPL_STRUCT is a macro that can be used to generate all + the necessary boilerplate to define and adapt an arbitrary template struct + as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random
+ Access Sequence</a>. + </p> +<a name="fusion.adapted.define_tpl_struct.synopsis"></a><h5> +<a name="id767750"></a>+ <a class="link" href="define_tpl_struct.html#fusion.adapted.define_tpl_struct.synopsis">Synopsis</a>
+ </h5>+<pre class="programlisting"><span class="identifier">BOOST_FUSION_DEFINE_TPL_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...,</span> + <span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...,</span> + <span class="identifier">struct_name</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">member_type0</span><span class="special">,</span> <span class="identifier">member_name0</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">member_type1</span><span class="special">,</span> <span class="identifier">member_name1</span><span class="special">)</span>
+ <span class="special">...</span> + <span class="special">)</span> +</pre> +<div class="variablelist" title="Notation"> +<p class="title"><b>Notation</b></p> +<dl>+<dt><span class="term"><code class="computeroutput"><span class="identifier">Str</span></code></span></dt>
+<dd><p>+ An instantiated <code class="computeroutput"><span class="identifier">struct_name</span></code>
+ </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">str</span></code></span></dt>
+<dd><p>+ An instance of <code class="computeroutput"><span class="identifier">Str</span></code>
+ </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">e0</span></code>...<code class="computeroutput"><span class="identifier">en</span></code></span></dt>
+<dd><p> + Heterogeneous values + </p></dd>+<dt><span class="term"><code class="computeroutput"><span class="identifier">fs</span></code></span></dt>
+<dd><p>+ A <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward
+ Sequence</a> + </p></dd> +</dl> +</div> +<a name="fusion.adapted.define_tpl_struct.expression_semantics"></a><h5> +<a name="id767983"></a>+ <a class="link" href="define_tpl_struct.html#fusion.adapted.define_tpl_struct.expression_semantics">Expression
+ Semantics</a> + </h5> +<p>+ The above macro generates the necessary code that defines and adapts <code class="computeroutput"><span class="identifier">struct_name</span></code> as a model of <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random + Access Sequence</a>. The sequence <code class="computeroutput"><span class="special">(</span><span class="identifier">namespace0</span><span class="special">)(</span><span class="identifier">namespace1</span><span class="special">)...</span></code> + declares the namespace for <code class="computeroutput"><span class="identifier">struct_name</span></code>. + It yields to a fully qualified name for <code class="computeroutput"><span class="identifier">struct_name</span></code> + of <code class="computeroutput"><span class="identifier">namespace0</span><span class="special">::</span><span class="identifier">namespace1</span><span class="special">::...</span> + <span class="identifier">struct_name</span></code>. If an empty namespace + sequence is given, the struct is placed in the global namespace. The sequence + <code class="computeroutput"><span class="special">(</span><span class="identifier">template_param0</span><span class="special">)(</span><span class="identifier">template_param1</span><span class="special">)...</span></code> declares the names of the template type + parameters used. The sequence of <code class="computeroutput"><span class="special">(</span><span class="identifier">member_typeN</span><span class="special">,</span> + <span class="identifier">member_nameN</span><span class="special">)</span></code> + pairs declares the type and names of each of the struct members that are
+ part of the sequence. + </p> +<p>+ The macro should be used at global scope. Semantics of an expression is defined + only where it differs from, or is not defined in <a class="link" href="../sequence/concepts/random_access_sequence.html" title="Random Access Sequence">Random
+ Access Sequence</a>. + </p> +<div class="informaltable"><table class="table"> +<colgroup> +<col> +<col> +</colgroup> +<thead><tr> +<th> + <p> + Expression + </p> + </th> +<th> + <p> + Semantics + </p> + </th> +</tr></thead> +<tbody> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">Str</span><span class="special">()</span></code>
+ </p> + </td> +<td> + <p>+ Creates an instance of <code class="computeroutput"><span class="identifier">Str</span></code>
+ with default constructed elements. + </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">Str</span><span class="special">(</span><span class="identifier">e0</span><span class="special">,</span> + <span class="identifier">e1</span><span class="special">,...</span> + <span class="identifier">en</span><span class="special">)</span></code>
+ </p> + </td> +<td> + <p>+ Creates an instance of <code class="computeroutput"><span class="identifier">Str</span></code> + with elements <code class="computeroutput"><span class="identifier">e0</span></code>...<code class="computeroutput"><span class="identifier">en</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">Str</span><span class="special">(</span><span class="identifier">fs</span><span class="special">)</span></code>
+ </p> + </td> +<td> + <p>+ Copy constructs an instance of <code class="computeroutput"><span class="identifier">Str</span></code> + from a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward + Sequence</a> <code class="computeroutput"><span class="identifier">fs</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">str</span> <span class="special">=</span>
+ <span class="identifier">fs</span></code> + </p> + </td> +<td> + <p>+ Assigns from a <a class="link" href="../sequence/concepts/forward_sequence.html" title="Forward Sequence">Forward + Sequence</a> <code class="computeroutput"><span class="identifier">fs</span></code>.
+ </p> + </td> +</tr> +<tr> +<td> + <p>+ <code class="computeroutput"><span class="identifier">str</span><span class="special">.</span><span class="identifier">member_nameN</span></code>
+ </p> + </td> +<td> + <p>+ Access of struct member <code class="computeroutput"><span class="identifier">member_nameN</span></code>
+ </p> + </td> +</tr> +</tbody> +</table></div> +<a name="fusion.adapted.define_tpl_struct.header"></a><h5> +<a name="id769572"></a>+ <a class="link" href="define_tpl_struct.html#fusion.adapted.define_tpl_struct.header">Header</a>
+ </h5>+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="keyword">struct</span><span class="special">/</span><span class="identifier">define_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">define_struct</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<a name="fusion.adapted.define_tpl_struct.example"></a><h5> +<a name="id769687"></a>+ <a class="link" href="define_tpl_struct.html#fusion.adapted.define_tpl_struct.example">Example</a>
+ </h5>+<pre class="programlisting"><span class="comment">// Any instantiated demo::employee is a Fusion sequence +</span><span class="identifier">BOOST_FUSION_DEFINE_TPL_STRUCT</span><span class="special">(</span> + <span class="special">(</span><span class="identifier">demo</span><span class="special">),</span> <span class="special">(</span><span class="identifier">Name</span><span class="special">)(</span><span class="identifier">Age</span><span class="special">),</span> <span class="identifier">employee</span><span class="special">,</span> + <span class="special">(</span><span class="identifier">Name</span><span class="special">,</span> <span class="identifier">name</span><span class="special">)</span> + <span class="special">(</span><span class="identifier">Age</span><span class="special">,</span> <span class="identifier">age</span><span class="special">))</span>
+</pre> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
+ Schwinger<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="define_struct.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../adapted.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="define_assoc_struct.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_assoc_class.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,136 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/sequence.hpp> +#include <boost/fusion/support.hpp> +#include <boost/fusion/container/list.hpp> +#include <boost/fusion/container/vector.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/adapted/class/adapt_assoc_class.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/mpl/not.hpp> +#include <boost/mpl/front.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/static_assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + struct x_member; + struct y_member; + struct z_member; + + class point + { + public: + + point() : x(0), y(0) {} + point(int x, int y) : x(x), y(y) {} + + int get_x() const { return x; } + int get_y() const { return y; } + void set_x(int x_) { x = x_; } + void set_y(int y_) { y = y_; } + + private: + + int x; + int y; + }; +} + +BOOST_FUSION_ADAPT_ASSOC_CLASS( + ns::point, + (int, int, obj.get_x(), obj.set_x(val), ns::x_member) + (int, int, obj.get_y(), obj.set_y(val), ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + using namespace std; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view<ns::point>)); + 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<ns::point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<ns::point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + boost::fusion::vector<int, float> v1(4, 2); + ns::point v2(5, 3); + boost::fusion::vector<long, double> 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); + boost::fusion::vector<int, short> v(p); + v = p; + } + + { + // conversion from ns::point to list + ns::point p(5, 3); + boost::fusion::list<int, short> l(p); + l = p; + } + + { + BOOST_MPL_ASSERT((boost::mpl::is_sequence<ns::point>)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c<ns::point,0>::type + , boost::mpl::front<ns::point>::type>)); + } + + { + // assoc stuff + BOOST_MPL_ASSERT((result_of::has_key<ns::point, ns::x_member>)); + BOOST_MPL_ASSERT((result_of::has_key<ns::point, ns::y_member>));+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<ns::point, ns::z_member> >));
++ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<ns::point, ns::x_member>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<ns::point, ns::y_member>::type, int>));
+ + ns::point p(5, 3); + + BOOST_TEST(at_key<ns::x_member>(p) == 5); + BOOST_TEST(at_key<ns::y_member>(p) == 3); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_assoc_class_named.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,142 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/sequence.hpp> +#include <boost/fusion/support.hpp> +#include <boost/fusion/container/list.hpp> +#include <boost/fusion/container/vector.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/adapted/class/adapt_assoc_class_named.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/mpl/not.hpp> +#include <boost/mpl/front.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/static_assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + struct x_member; + struct y_member; + struct z_member; + + class point + { + public: + + point() : x(0), y(0) {} + point(int x, int y) : x(x), y(y) {} + + int get_x() const { return x; } + int get_y() const { return y; } + void set_x(int x_) { x = x_; } + void set_y(int y_) { y = y_; } + + private: + + int x; + int y; + }; +} + +BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED( + ns::point, + point, + (int, int, obj.obj.get_x(), obj.obj.set_x(val), ns::x_member) + (int, int, obj.obj.get_y(), obj.obj.set_y(val), ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + using namespace std; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view<adapted::point>)); + ns::point basep(123, 456); + adapted::point p(basep); + + 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<adapted::point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<adapted::point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + boost::fusion::vector<int, float> v1(4, 2); + ns::point basev2(5, 3); + adapted::point v2(basev2); + boost::fusion::vector<long, double> 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 adapted::point to vector + ns::point basep(5, 3); + adapted::point p(basep); + boost::fusion::vector<int, short> v(p); + v = p; + } + + { + // conversion from adated::point to list + ns::point basep(5, 3); + adapted::point p(basep); + boost::fusion::list<int, short> l(p); + l = p; + } + + { + BOOST_MPL_ASSERT((boost::mpl::is_sequence<adapted::point>)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c<adapted::point,0>::type + , boost::mpl::front<adapted::point>::type>)); + } + + { + // assoc stuff+ BOOST_MPL_ASSERT((result_of::has_key<adapted::point, ns::x_member>)); + BOOST_MPL_ASSERT((result_of::has_key<adapted::point, ns::y_member>)); + BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<adapted::point, ns::z_member> >));
++ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<adapted::point, ns::x_member>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<adapted::point, ns::y_member>::type, int>));
+ + ns::point basep(5, 3); + adapted::point p(basep); + + BOOST_TEST(at_key<ns::x_member>(p) == 5); + BOOST_TEST(at_key<ns::y_member>(p) == 3); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_assoc_struct_named.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,121 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/sequence.hpp> +#include <boost/fusion/support.hpp> +#include <boost/fusion/container/list.hpp> +#include <boost/fusion/container/vector.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/mpl/not.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/static_assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + struct x_member; + struct y_member; + struct z_member; + + struct point + { + int x; + int y; + }; +} + +BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED( + ns::point, + point, + (int, x, ns::x_member) + (int, y, ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view<adapted::point>)); + ns::point basep = {123, 456}; + adapted::point p(basep); + + 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<adapted::point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<adapted::point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + vector<int, float> v1(4, 2); + ns::point basev2 = {5, 3}; + adapted::point v2(basev2); + + vector<long, double> 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 adapted::point to vector + ns::point basep = {5, 3}; + adapted::point p(basep); + vector<int, short> v(p); + v = p; + } + + { + // conversion from adapted::point to list + ns::point basep = {5, 3}; + adapted::point p(basep); + list<int, short> l(p); + l = p; + } + + { + // assoc stuff+ BOOST_MPL_ASSERT((result_of::has_key<adapted::point, ns::x_member>)); + BOOST_MPL_ASSERT((result_of::has_key<adapted::point, ns::y_member>)); + BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<adapted::point, ns::z_member> >));
++ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<adapted::point, ns::x_member>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<adapted::point, ns::y_member>::type, int>));
+ + ns::point basep = {5, 3}; + adapted::point p(basep); + + BOOST_TEST(at_key<ns::x_member>(p) == 5); + BOOST_TEST(at_key<ns::y_member>(p) == 3); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_assoc_tpl_class.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,140 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/sequence.hpp> +#include <boost/fusion/support.hpp> +#include <boost/fusion/container/list.hpp> +#include <boost/fusion/container/vector.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/adapted/class/adapt_assoc_class.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/mpl/not.hpp> +#include <boost/mpl/front.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/static_assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + struct x_member; + struct y_member; + struct z_member; + + template<typename X, typename Y> + class point + { + public: + + point() : x(0), y(0) {} + point(X x, Y y) : x(x), y(y) {} + + X get_x() const { return x; } + Y get_y() const { return y; } + void set_x(X x_) { x = x_; } + void set_y(Y y_) { y = y_; } + + private: + + X x; + Y y; + }; +} + +BOOST_FUSION_ADAPT_ASSOC_TPL_CLASS( + (X)(Y), + (ns::point)(X)(Y), + (X, X, obj.get_x(), obj.set_x(val), ns::x_member) + (Y, Y, obj.get_y(), obj.set_y(val), ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + using namespace std; + + typedef ns::point<int,int> point; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view<point>)); + 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<point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + boost::fusion::vector<int, float> v1(4, 2); + point v2(5, 3); + boost::fusion::vector<long, double> 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 point to vector + point p(5, 3); + boost::fusion::vector<int, short> v(p); + v = p; + } + + { + // conversion from point to list + point p(5, 3); + boost::fusion::list<int, short> l(p); + l = p; + } + + { + BOOST_MPL_ASSERT((boost::mpl::is_sequence<point>)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c<point,0>::type + , boost::mpl::front<point>::type>)); + } + + { + // assoc stuff + BOOST_MPL_ASSERT((result_of::has_key<point, ns::x_member>)); + BOOST_MPL_ASSERT((result_of::has_key<point, ns::y_member>));+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<point, ns::z_member> >));
++ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::x_member>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::y_member>::type, int>));
+ + point p(5, 3); + + BOOST_TEST(at_key<ns::x_member>(p) == 5); + BOOST_TEST(at_key<ns::y_member>(p) == 3); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_assoc_tpl_struct.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,133 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp> +#include <boost/fusion/sequence/intrinsic/at.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/fusion/sequence/intrinsic/empty.hpp> +#include <boost/fusion/sequence/intrinsic/front.hpp> +#include <boost/fusion/sequence/intrinsic/back.hpp> +#include <boost/fusion/sequence/intrinsic/has_key.hpp> +#include <boost/fusion/sequence/intrinsic/at_key.hpp> +#include <boost/fusion/sequence/intrinsic/value_at_key.hpp> +#include <boost/fusion/sequence/io/out.hpp> +#include <boost/fusion/container/vector/vector.hpp> +#include <boost/fusion/container/list/list.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/container/vector/convert.hpp> +#include <boost/fusion/sequence/comparison/equal_to.hpp> +#include <boost/fusion/sequence/comparison/not_equal_to.hpp> +#include <boost/fusion/sequence/comparison/less.hpp> +#include <boost/fusion/sequence/comparison/less_equal.hpp> +#include <boost/fusion/sequence/comparison/greater.hpp> +#include <boost/fusion/sequence/comparison/greater_equal.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/mpl/not.hpp> +#include <boost/type_traits/is_same.hpp> +#include <boost/static_assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + struct x_member; + struct y_member; + struct z_member; + + template<typename X, typename Y> + struct point + { + X x; + Y y; + }; +} + +BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( + (X)(Y), + (ns::point)(X)(Y), + (int, x, ns::x_member) + (int, y, ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + + typedef ns::point<int,int> point; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view<point>)); + 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<point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + vector<int, float> v1(4, 2); + point v2 = {5, 3}; + vector<long, double> 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 point to vector + point p = {5, 3}; + vector<int, short> v(p); + v = p; + } + + { + // conversion from point to list + point p = {5, 3}; + list<int, short> l(p); + l = p; + } + + { + // assoc stuff + BOOST_MPL_ASSERT((result_of::has_key<point, ns::x_member>)); + BOOST_MPL_ASSERT((result_of::has_key<point, ns::y_member>));+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<point, ns::z_member> >));
++ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::x_member>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<point, ns::y_member>::type, int>));
+ + point p = {5, 3}; + + BOOST_TEST(at_key<ns::x_member>(p) == 5); + BOOST_TEST(at_key<ns::y_member>(p) == 3); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_class.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,129 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/adapted/class/adapt_class.hpp> +#include <boost/fusion/sequence/intrinsic/at.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/fusion/sequence/intrinsic/empty.hpp> +#include <boost/fusion/sequence/intrinsic/front.hpp> +#include <boost/fusion/sequence/intrinsic/back.hpp> +#include <boost/fusion/sequence/intrinsic/value_at.hpp> +#include <boost/fusion/sequence/io/out.hpp> +#include <boost/fusion/container/vector/vector.hpp> +#include <boost/fusion/container/list/list.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/container/vector/convert.hpp> +#include <boost/fusion/sequence/comparison/equal_to.hpp> +#include <boost/fusion/sequence/comparison/not_equal_to.hpp> +#include <boost/fusion/sequence/comparison/less.hpp> +#include <boost/fusion/sequence/comparison/less_equal.hpp> +#include <boost/fusion/sequence/comparison/greater.hpp> +#include <boost/fusion/sequence/comparison/greater_equal.hpp> +#include <boost/fusion/mpl.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/mpl/front.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/mpl/assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + class point + { + public: + + point() : x(0), y(0) {} + point(int x, int y) : x(x), y(y) {} + + int get_x() const { return x; } + int get_y() const { return y; } + void set_x(int x_) { x = x_; } + void set_y(int y_) { y = y_; } + + private: + + int x; + int y; + }; +} + +BOOST_FUSION_ADAPT_CLASS( + ns::point, + (int, int, obj.get_x(), obj.set_x(val)) + (int, int, obj.get_y(), obj.set_y(val)) +) + +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>)); + 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<ns::point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<ns::point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + fusion::vector<int, float> v1(4, 2); + ns::point v2(5, 3); + fusion::vector<long, double> 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<int, short> v(p); + v = p; + } + + { + // conversion from ns::point to list + ns::point p(5, 3); + fusion::list<int, short> l(p); + l = p; + } + + { + BOOST_MPL_ASSERT((mpl::is_sequence<ns::point>)); + BOOST_MPL_ASSERT((boost::is_same< + fusion::result_of::value_at_c<ns::point,0>::type + , mpl::front<ns::point>::type>)); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_class_named.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,137 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/adapted/class/adapt_class_named.hpp> +#include <boost/fusion/sequence/intrinsic/at.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/fusion/sequence/intrinsic/empty.hpp> +#include <boost/fusion/sequence/intrinsic/front.hpp> +#include <boost/fusion/sequence/intrinsic/back.hpp> +#include <boost/fusion/sequence/intrinsic/value_at.hpp> +#include <boost/fusion/sequence/io/out.hpp> +#include <boost/fusion/container/vector/vector.hpp> +#include <boost/fusion/container/list/list.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/container/vector/convert.hpp> +#include <boost/fusion/sequence/comparison/equal_to.hpp> +#include <boost/fusion/sequence/comparison/not_equal_to.hpp> +#include <boost/fusion/sequence/comparison/less.hpp> +#include <boost/fusion/sequence/comparison/less_equal.hpp> +#include <boost/fusion/sequence/comparison/greater.hpp> +#include <boost/fusion/sequence/comparison/greater_equal.hpp> +#include <boost/fusion/mpl.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/mpl/front.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/mpl/assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + class point + { + public: + + point() : x(0), y(0) {} + point(int x, int y) : x(x), y(y) {} + + int get_x() const { return x; } + int get_y() const { return y; } + void set_x(int x_) { x = x_; } + void set_y(int y_) { y = y_; } + + private: + + int x; + int y; + }; +} + +// this creates a fusion view: boost::fusion::adapted::point +BOOST_FUSION_ADAPT_CLASS_NAMED( + ns::point, point, + (int, int, obj.obj.get_x(), obj.obj.set_x(val)) + (int, int, obj.obj.get_y(), obj.obj.set_y(val)) +) + +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<adapted::point>)); + ns::point basep(123, 456); + adapted::point p(basep); + + 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<adapted::point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<adapted::point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + fusion::vector<int, float> v1(4, 2); + ns::point basep(5, 3); + adapted::point v2(basep); + + fusion::vector<long, double> 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 basep(5, 3); + adapted::point p(basep); + + fusion::vector<int, short> v(p); + v = p; + } + + { + // conversion from ns::point to list + ns::point basep(5, 3); + adapted::point p(basep); + + fusion::list<int, short> l(p); + l = p; + } + + { + BOOST_MPL_ASSERT((mpl::is_sequence<adapted::point>)); + BOOST_MPL_ASSERT((boost::is_same< + fusion::result_of::value_at_c<adapted::point,0>::type + , mpl::front<adapted::point>::type>)); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_struct_named.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,138 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/adapted/struct/adapt_struct_named.hpp> +#include <boost/fusion/sequence/intrinsic/at.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/fusion/sequence/intrinsic/empty.hpp> +#include <boost/fusion/sequence/intrinsic/front.hpp> +#include <boost/fusion/sequence/intrinsic/back.hpp> +#include <boost/fusion/sequence/intrinsic/value_at.hpp> +#include <boost/fusion/sequence/io/out.hpp> +#include <boost/fusion/container/vector/vector.hpp> +#include <boost/fusion/container/list/list.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/container/vector/convert.hpp> +#include <boost/fusion/sequence/comparison/equal_to.hpp> +#include <boost/fusion/sequence/comparison/not_equal_to.hpp> +#include <boost/fusion/sequence/comparison/less.hpp> +#include <boost/fusion/sequence/comparison/less_equal.hpp> +#include <boost/fusion/sequence/comparison/greater.hpp> +#include <boost/fusion/sequence/comparison/greater_equal.hpp> +#include <boost/fusion/mpl.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/mpl/front.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/mpl/assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + struct point + { + int x; + int y; + }; +} + +// this creates a fusion view: boost::fusion::adapted::point +BOOST_FUSION_ADAPT_STRUCT_NAMED( + ns::point, point, + (int, x) + (int, y) +) + +// this creates a fusion view: ns1::s1 +struct s { int m; }; +BOOST_FUSION_ADAPT_STRUCT_NAMED_NS(s, (ns1), s1, (int, m)) + +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<adapted::point>)); + ns::point basep = {123, 456}; + adapted::point p(basep); + + 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<adapted::point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<adapted::point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + fusion::vector<int, float> v1(4, 2); + ns::point p = {5, 3}; + adapted::point v2(p); + + fusion::vector<long, double> 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 adapted::point to vector + ns::point basep = {5, 3}; + adapted::point p(basep); + fusion::vector<int, short> v(p); + v = p; + } + + { + // conversion from adapted::point to list + ns::point basep = {5, 3}; + adapted::point p(basep); + fusion::list<int, short> l(p); + l = p; + } + + { // begin/end + using namespace boost::fusion; + using boost::is_same; + + typedef result_of::begin<ns1::s1>::type b; + typedef result_of::end<ns1::s1>::type e; + // this fails + BOOST_MPL_ASSERT((is_same<result_of::next<b>::type, e>)); + } + + + { + BOOST_MPL_ASSERT((mpl::is_sequence<adapted::point>)); + BOOST_MPL_ASSERT((boost::is_same< + fusion::result_of::value_at_c<adapted::point,0>::type + , mpl::front<adapted::point>::type>)); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_tpl_class.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,133 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/adapted/class/adapt_class.hpp> +#include <boost/fusion/sequence/intrinsic/at.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/fusion/sequence/intrinsic/empty.hpp> +#include <boost/fusion/sequence/intrinsic/front.hpp> +#include <boost/fusion/sequence/intrinsic/back.hpp> +#include <boost/fusion/sequence/intrinsic/value_at.hpp> +#include <boost/fusion/sequence/io/out.hpp> +#include <boost/fusion/container/vector/vector.hpp> +#include <boost/fusion/container/list/list.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/container/vector/convert.hpp> +#include <boost/fusion/sequence/comparison/equal_to.hpp> +#include <boost/fusion/sequence/comparison/not_equal_to.hpp> +#include <boost/fusion/sequence/comparison/less.hpp> +#include <boost/fusion/sequence/comparison/less_equal.hpp> +#include <boost/fusion/sequence/comparison/greater.hpp> +#include <boost/fusion/sequence/comparison/greater_equal.hpp> +#include <boost/fusion/mpl.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/mpl/front.hpp> +#include <boost/mpl/is_sequence.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/static_assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + template<typename X, typename Y> + class point + { + public: + + point() : x(0), y(0) {} + point(X x, Y y) : x(x), y(y) {} + + X get_x() const { return x; } + Y get_y() const { return y; } + void set_x(X x_) { x = x_; } + void set_y(Y y_) { y = y_; } + + private: + + X x; + Y y; + }; +} + +BOOST_FUSION_ADAPT_TPL_CLASS( + (X)(Y), + (ns::point)(X)(Y), + (X, X, obj.get_x(), obj.set_x(val)) + (Y, Y, obj.get_y(), obj.set_y(val)) +) + +int +main() +{ + using namespace boost::fusion; + using namespace std; + + typedef ns::point<int, int> point; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view<point>)); + 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<point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + boost::fusion::vector<int, float> v1(4, 2); + point v2(5, 3); + boost::fusion::vector<long, double> 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 point to vector + point p(5, 3); + boost::fusion::vector<int, short> v(p); + v = p; + } + + { + // conversion from point to list + point p(5, 3); + boost::fusion::list<int, short> l(p); + l = p; + } + + { + BOOST_MPL_ASSERT((boost::mpl::is_sequence<point>)); + BOOST_MPL_ASSERT((boost::is_same< + boost::fusion::result_of::value_at_c<point,0>::type + , boost::mpl::front<point>::type>)); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/adapt_tpl_struct.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,122 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/adapted/struct/adapt_struct.hpp> +#include <boost/fusion/sequence/intrinsic/at.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/fusion/sequence/intrinsic/empty.hpp> +#include <boost/fusion/sequence/intrinsic/front.hpp> +#include <boost/fusion/sequence/intrinsic/back.hpp> +#include <boost/fusion/sequence/io/out.hpp> +#include <boost/fusion/container/vector/vector.hpp> +#include <boost/fusion/container/list/list.hpp> +#include <boost/fusion/container/generation/make_vector.hpp> +#include <boost/fusion/container/vector/convert.hpp> +#include <boost/fusion/sequence/comparison/equal_to.hpp> +#include <boost/fusion/sequence/comparison/not_equal_to.hpp> +#include <boost/fusion/sequence/comparison/less.hpp> +#include <boost/fusion/sequence/comparison/less_equal.hpp> +#include <boost/fusion/sequence/comparison/greater.hpp> +#include <boost/fusion/sequence/comparison/greater_equal.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/static_assert.hpp> +#include <iostream> +#include <string> + +namespace ns +{ + template<typename X, typename Y> + struct point + { + X x; + Y y; + }; +} + +BOOST_FUSION_ADAPT_TPL_STRUCT( + (X)(Y), + (ns::point)(X)(Y), + (X, x) + (Y, y) +) + +template<typename M> +struct s { M m; }; +BOOST_FUSION_ADAPT_TPL_STRUCT((M), (s)(M), (M, m)) + +int +main() +{ + using namespace boost::fusion; + + typedef ns::point<int, int> point; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view<point>)); + 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<point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + vector<int, float> v1(4, 2); + point v2 = {5, 3}; + vector<long, double> 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 point to vector + point p = {5, 3}; + vector<int, short> v(p); + v = p; + } + + { + // conversion from point to list + point p = {5, 3}; + list<int, short> l(p); + l = p; + } + + { // begin/end + using namespace boost::fusion; + + typedef result_of::begin<s<int> >::type b; + typedef result_of::end<s<int> >::type e; + // this fails + BOOST_MPL_ASSERT((boost::is_same<result_of::next<b>::type, e>)); + } + + return boost::report_errors(); +} + ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/boost_array.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2010 Christopher Schmidt ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> + +#include <boost/fusion/adapted/boost_array.hpp> +#include <boost/array.hpp> + +#include <boost/fusion/sequence/intrinsic.hpp> +#include <boost/fusion/support/is_sequence.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/fusion/iterator.hpp> + +#include <boost/mpl/assert.hpp> + +int main() +{ + using namespace boost::fusion; + typedef boost::array<int,3> array_type; + + BOOST_MPL_ASSERT((traits::is_sequence<array_type>)); + BOOST_MPL_ASSERT_NOT((traits::is_view<array_type>)); + + 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(); +} ======================================= --- /dev/null+++ /trunk/libs/fusion/test/sequence/define_assoc_struct.cpp Fri May 28 01:35:26 2010
@@ -0,0 +1,114 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt ++ Distributed under the 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 <boost/detail/lightweight_test.hpp> +#include <boost/fusion/sequence.hpp> +#include <boost/fusion/container.hpp> +#include <boost/fusion/support.hpp> +#include <boost/fusion/adapted/struct/define_assoc_struct.hpp> +#include <boost/preprocessor/empty.hpp> +#include <boost/mpl/assert.hpp> +#include <boost/static_assert.hpp> +#include <iostream> + +namespace ns +{ + struct x_member; + struct y_member; + struct z_member; +} + +BOOST_FUSION_DEFINE_ASSOC_STRUCT( + (ns), + point, + (int, x, ns::x_member) + (int, y, ns::y_member) +) + +int +main() +{ + using namespace boost::fusion; + + std::cout << tuple_open('['); + std::cout << tuple_close(']'); + std::cout << tuple_delimiter(", "); + + { + BOOST_MPL_ASSERT_NOT((traits::is_view<ns::point>)); + 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<ns::point>::value == 2); + BOOST_STATIC_ASSERT(!result_of::empty<ns::point>::value); + + BOOST_TEST(front(p) == 6); + BOOST_TEST(back(p) == 9); + } + + { + vector<int, float> v1(4, 2); + ns::point v2(5, 3); + vector<long, double> 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); + vector<int, short> v(p); + v = p; + } + + { + // conversion from ns::point to list + ns::point p(5, 3); + list<int, short> l(p); + l = p; + } + + { + // assoc stuff + BOOST_MPL_ASSERT((result_of::has_key<ns::point, ns::x_member>)); + BOOST_MPL_ASSERT((result_of::has_key<ns::point, ns::y_member>));+ BOOST_MPL_ASSERT((boost::mpl::not_<result_of::has_key<ns::point, ns::z_member> >));
++ BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<ns::point, ns::x_member>::type, int>)); + BOOST_MPL_ASSERT((boost::is_same<result_of::value_at_key<ns::point, ns::y_member>::type, int>));
+ + ns::point p(5, 3); + + BOOST_TEST(at_key<ns::x_member>(p) == 5); + BOOST_TEST(at_key<ns::y_member>(p) == 3); + } + + { + ns::point p = make_list(5,3); + BOOST_TEST(p == make_vector(5,3)); + + p = make_list(3,5); + BOOST_TEST(p == make_vector(3,5)); + } + + return boost::report_errors(); +} + ======================================= ***Additional files exist in this changeset.***