|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r55536 - in sandbox/move: boost/container boost/container/detail boost/intrusive boost/intrusive/detail boost/move libs/container libs/container/doc libs/container/doc/html libs/container/doc/html/boost libs/container/doc/html/boost/container libs/container/doc/html/container libs/container/doc/html/images libs/container/example libs/container/proj libs/container/proj/vc7ide libs/container/test libs/intrusive libs/intrusive/doc libs/intrusive/doc/html libs/intrusive/doc/html/images libs/intrusive/example libs/intrusive/perf libs/intrusive/proj libs/intrusive/proj/vc7ide libs/intrusive/proj/vc7ide/_intrusivelib libs/intrusive/proj/vc7ide/any_test libs/intrusive/proj/vc7ide/avl_multiset libs/intrusive/proj/vc7ide/avl_set libs/intrusive/proj/vc7ide/custom_bucket_traits libs/intrusive/proj/vc7ide/default_hook libs/intrusive/proj/vc7ide/external_value_traits libs/intrusive/proj/vc7ide/list libs/intrusive/proj/vc7ide/make_functions libs/intrusive/proj/vc7ide/multiset libs/intrusive/proj/vc7ide/perf_test libs/intrusive/proj/vc7ide/set libs/intrusive/proj/vc7ide/sg_multiset libs/intrusive/proj/vc7ide/sg_set libs/intrusive/proj/vc7ide/slist libs/intrusive/proj/vc7ide/splay_multiset libs/intrusive/proj/vc7ide/splay_set libs/intrusive/proj/vc7ide/stateful_value_traits libs/intrusive/proj/vc7ide/treap_multiset libs/intrusive/proj/vc7ide/treap_set libs/intrusive/proj/vc7ide/unordered_multiset libs/intrusive/proj/vc7ide/unordered_set libs/intrusive/proj/vc7ide/virtual_base libs/intrusive/test libs/move libs/move/doc libs/move/doc/html libs/move/doc/html/boost libs/move/doc/html/move libs/move/example libs/move/proj/vc7ide libs/move/test
From: igaztanaga_at_[hidden]
Date: 2009-08-12 04:41:46
Author: igaztanaga
Date: 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
New Revision: 55536
URL: http://svn.boost.org/trac/boost/changeset/55536
Log:
-> Move: non-const rvalues of copyable and movable types are moved instead of copied. Documentation improved.
-> Container: Added test cases and documentation.
-> Intrusive: Container depends on this post-1.40 Intrusive version.
Added:
sandbox/move/boost/container/container_fwd.hpp (contents, props changed)
sandbox/move/boost/container/detail/adaptive_node_pool_impl.hpp (contents, props changed)
sandbox/move/boost/container/detail/math_functions.hpp (contents, props changed)
sandbox/move/boost/container/detail/node_pool_impl.hpp (contents, props changed)
sandbox/move/boost/container/detail/pool_common.hpp (contents, props changed)
sandbox/move/boost/intrusive/
sandbox/move/boost/intrusive/any_hook.hpp (contents, props changed)
sandbox/move/boost/intrusive/avl_set.hpp (contents, props changed)
sandbox/move/boost/intrusive/avl_set_hook.hpp (contents, props changed)
sandbox/move/boost/intrusive/avltree.hpp (contents, props changed)
sandbox/move/boost/intrusive/avltree_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/bs_set_hook.hpp (contents, props changed)
sandbox/move/boost/intrusive/circular_list_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/circular_slist_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/derivation_value_traits.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/
sandbox/move/boost/intrusive/detail/any_node_and_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/assert.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/avltree_node.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/clear_on_destructor_base.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/common_slist_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/config_begin.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/config_end.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/ebo_functor_holder.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/function_detector.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/generic_hook.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/hashtable_node.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/is_stateful_value_traits.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/list_node.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/mpl.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/parent_from_member.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/pointer_to_other.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/rbtree_node.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/slist_node.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/transform_iterator.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/tree_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/tree_node.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/utilities.hpp (contents, props changed)
sandbox/move/boost/intrusive/detail/workaround.hpp (contents, props changed)
sandbox/move/boost/intrusive/hashtable.hpp (contents, props changed)
sandbox/move/boost/intrusive/intrusive_fwd.hpp (contents, props changed)
sandbox/move/boost/intrusive/linear_slist_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/link_mode.hpp (contents, props changed)
sandbox/move/boost/intrusive/list.hpp (contents, props changed)
sandbox/move/boost/intrusive/list_hook.hpp (contents, props changed)
sandbox/move/boost/intrusive/member_value_traits.hpp (contents, props changed)
sandbox/move/boost/intrusive/options.hpp (contents, props changed)
sandbox/move/boost/intrusive/pointer_plus_bits.hpp (contents, props changed)
sandbox/move/boost/intrusive/priority_compare.hpp (contents, props changed)
sandbox/move/boost/intrusive/rbtree.hpp (contents, props changed)
sandbox/move/boost/intrusive/rbtree_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/set.hpp (contents, props changed)
sandbox/move/boost/intrusive/set_hook.hpp (contents, props changed)
sandbox/move/boost/intrusive/sg_set.hpp (contents, props changed)
sandbox/move/boost/intrusive/sgtree.hpp (contents, props changed)
sandbox/move/boost/intrusive/sgtree_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/slist.hpp (contents, props changed)
sandbox/move/boost/intrusive/slist_hook.hpp (contents, props changed)
sandbox/move/boost/intrusive/splay_set.hpp (contents, props changed)
sandbox/move/boost/intrusive/splay_set_hook.hpp (contents, props changed)
sandbox/move/boost/intrusive/splaytree.hpp (contents, props changed)
sandbox/move/boost/intrusive/splaytree_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/treap.hpp (contents, props changed)
sandbox/move/boost/intrusive/treap_algorithms.hpp (contents, props changed)
sandbox/move/boost/intrusive/treap_set.hpp (contents, props changed)
sandbox/move/boost/intrusive/trivial_value_traits.hpp (contents, props changed)
sandbox/move/boost/intrusive/unordered_set.hpp (contents, props changed)
sandbox/move/boost/intrusive/unordered_set_hook.hpp (contents, props changed)
sandbox/move/libs/container/
sandbox/move/libs/container/doc/
sandbox/move/libs/container/doc/Jamfile.v2 (contents, props changed)
sandbox/move/libs/container/doc/container.qbk (contents, props changed)
sandbox/move/libs/container/doc/html/
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id278368.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id284069.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id289293.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id292993.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id298411.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id303345.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id307572.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id308752.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id318445.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id278357.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id284058.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id289281.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id292981.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id298399.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id303333.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id307560.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id308740.html (contents, props changed)
sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id318433.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/
sandbox/move/libs/container/doc/html/boost/container/
sandbox/move/libs/container/doc/html/boost/container/basic_string.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/deque.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/flat_map.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/flat_multimap.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/flat_multiset.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/flat_set.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/list.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/map.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/multimap.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/multiset.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_range.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_range_impl_t.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156270.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156279.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156280.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156282.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id277802.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278914.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278923.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278927.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279032.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279061.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279065.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279068.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/set.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/slist.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/stable_vector.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/string.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/vector.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost/container/wstring.html (contents, props changed)
sandbox/move/libs/container/doc/html/boost_container_reference.html (contents, props changed)
sandbox/move/libs/container/doc/html/boostbook.css (contents, props changed)
sandbox/move/libs/container/doc/html/container/
sandbox/move/libs/container/doc/html/container/acknowledgements_notes.html (contents, props changed)
sandbox/move/libs/container/doc/html/container/emplace.html (contents, props changed)
sandbox/move/libs/container/doc/html/container/intro.html (contents, props changed)
sandbox/move/libs/container/doc/html/container/move_containers.html (contents, props changed)
sandbox/move/libs/container/doc/html/container/other_features.html (contents, props changed)
sandbox/move/libs/container/doc/html/container/recursive_containers.html (contents, props changed)
sandbox/move/libs/container/doc/html/container/release_notes.html (contents, props changed)
sandbox/move/libs/container/doc/html/images/
sandbox/move/libs/container/doc/html/images/blank.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/caution.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/draft.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/home.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/important.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/next.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/note.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/prev.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/tip.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/toc-blank.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/toc-minus.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/toc-plus.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/up.png (contents, props changed)
sandbox/move/libs/container/doc/html/images/warning.png (contents, props changed)
sandbox/move/libs/container/doc/html/index.html (contents, props changed)
sandbox/move/libs/container/doc/html/reference.css (contents, props changed)
sandbox/move/libs/container/doc/html/stable_vector.html (contents, props changed)
sandbox/move/libs/container/doc/html/string.html (contents, props changed)
sandbox/move/libs/container/doc/html/wstring.html (contents, props changed)
sandbox/move/libs/container/example/
sandbox/move/libs/container/example/Jamfile.v2 (contents, props changed)
sandbox/move/libs/container/example/doc_emplace.cpp (contents, props changed)
sandbox/move/libs/container/example/doc_move_containers.cpp (contents, props changed)
sandbox/move/libs/container/example/doc_recursive_containers.cpp (contents, props changed)
sandbox/move/libs/container/index.html (contents, props changed)
sandbox/move/libs/container/proj/
sandbox/move/libs/container/proj/to-do.txt (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/
sandbox/move/libs/container/proj/vc7ide/container.sln (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/container.vcproj (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/deque_test.vcproj (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/flat_tree_test.vcproj (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/list_ex.vcproj (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/slist_test.vcproj (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/stable_vector_test.vcproj (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/string_test.vcproj (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/tree_test.vcproj (contents, props changed)
sandbox/move/libs/container/proj/vc7ide/vector_test.vcproj (contents, props changed)
sandbox/move/libs/container/test/
sandbox/move/libs/container/test/Jamfile.v2 (contents, props changed)
sandbox/move/libs/container/test/boost_interprocess_check.hpp (contents, props changed)
sandbox/move/libs/container/test/check_equal_containers.hpp (contents, props changed)
sandbox/move/libs/container/test/deque_test.cpp (contents, props changed)
sandbox/move/libs/container/test/dummy_test_allocator.hpp (contents, props changed)
sandbox/move/libs/container/test/emplace_test.hpp (contents, props changed)
sandbox/move/libs/container/test/expand_bwd_test_allocator.hpp (contents, props changed)
sandbox/move/libs/container/test/expand_bwd_test_template.hpp (contents, props changed)
sandbox/move/libs/container/test/flat_tree_test.cpp (contents, props changed)
sandbox/move/libs/container/test/heap_allocator_v1.hpp (contents, props changed)
sandbox/move/libs/container/test/list_test.cpp (contents, props changed)
sandbox/move/libs/container/test/list_test.hpp (contents, props changed)
sandbox/move/libs/container/test/map_test.hpp (contents, props changed)
sandbox/move/libs/container/test/movable_int.hpp (contents, props changed)
sandbox/move/libs/container/test/print_container.hpp (contents, props changed)
sandbox/move/libs/container/test/set_test.hpp (contents, props changed)
sandbox/move/libs/container/test/slist_test.cpp (contents, props changed)
sandbox/move/libs/container/test/stable_vector_test.cpp (contents, props changed)
sandbox/move/libs/container/test/string_test.cpp (contents, props changed)
sandbox/move/libs/container/test/tree_test.cpp (contents, props changed)
sandbox/move/libs/container/test/util.hpp (contents, props changed)
sandbox/move/libs/container/test/vector_test.cpp (contents, props changed)
sandbox/move/libs/container/test/vector_test.hpp (contents, props changed)
sandbox/move/libs/intrusive/
sandbox/move/libs/intrusive/CMakeLists.txt (contents, props changed)
sandbox/move/libs/intrusive/doc/
sandbox/move/libs/intrusive/doc/Jamfile.v2 (contents, props changed)
sandbox/move/libs/intrusive/doc/html/
sandbox/move/libs/intrusive/doc/html/boostbook.css (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/
sandbox/move/libs/intrusive/doc/html/images/blank.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/caution.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/draft.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/home.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/important.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/next.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/note.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/prev.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/tip.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/toc-blank.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/toc-minus.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/toc-plus.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/up.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/images/warning.png (contents, props changed)
sandbox/move/libs/intrusive/doc/html/reference.css (contents, props changed)
sandbox/move/libs/intrusive/doc/intrusive.qbk (contents, props changed)
sandbox/move/libs/intrusive/example/
sandbox/move/libs/intrusive/example/Jamfile.v2 (contents, props changed)
sandbox/move/libs/intrusive/example/doc_advanced_value_traits.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_advanced_value_traits2.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_any_hook.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_assoc_optimized_code.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_auto_unlink.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_avl_set.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_avltree_algorithms.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_bucket_traits.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_clone_from.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_entity.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_erasing_and_disposing.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_external_value_traits.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_how_to_use.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_iterator_from_value.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_list.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_list_algorithms.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_offset_ptr.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_positional_insertion.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_rbtree_algorithms.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_set.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_sg_set.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_slist.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_slist_algorithms.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_splay_algorithms.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_splay_set.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_splaytree_algorithms.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_stateful_value_traits.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_treap_algorithms.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_treap_set.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_unordered_set.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_value_traits.cpp (contents, props changed)
sandbox/move/libs/intrusive/example/doc_window.cpp (contents, props changed)
sandbox/move/libs/intrusive/index.html (contents, props changed)
sandbox/move/libs/intrusive/module.cmake (contents, props changed)
sandbox/move/libs/intrusive/perf/
sandbox/move/libs/intrusive/perf/Jamfile.v2 (contents, props changed)
sandbox/move/libs/intrusive/perf/perf_list.cpp (contents, props changed)
sandbox/move/libs/intrusive/proj/
sandbox/move/libs/intrusive/proj/vc7ide/
sandbox/move/libs/intrusive/proj/vc7ide/Intrusive.sln (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/Intrusive.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/_intrusivelib/
sandbox/move/libs/intrusive/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/any_test/
sandbox/move/libs/intrusive/proj/vc7ide/any_test/any_test.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/avl_multiset/
sandbox/move/libs/intrusive/proj/vc7ide/avl_multiset/avl_multiset.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/avl_set/
sandbox/move/libs/intrusive/proj/vc7ide/avl_set/avl_set.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/custom_bucket_traits/
sandbox/move/libs/intrusive/proj/vc7ide/custom_bucket_traits/custom_bucket_traits.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/default_hook/
sandbox/move/libs/intrusive/proj/vc7ide/default_hook/default_hook.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/external_value_traits/
sandbox/move/libs/intrusive/proj/vc7ide/external_value_traits/external_value_traits.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/list/
sandbox/move/libs/intrusive/proj/vc7ide/list/list.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/make_functions/
sandbox/move/libs/intrusive/proj/vc7ide/make_functions/make_functions.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/multiset/
sandbox/move/libs/intrusive/proj/vc7ide/multiset/multiset.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/perf_test/
sandbox/move/libs/intrusive/proj/vc7ide/perf_test/perf_test.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/set/
sandbox/move/libs/intrusive/proj/vc7ide/set/set.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/sg_multiset/
sandbox/move/libs/intrusive/proj/vc7ide/sg_multiset/sg_multiset.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/sg_set/
sandbox/move/libs/intrusive/proj/vc7ide/sg_set/sg_set.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/slist/
sandbox/move/libs/intrusive/proj/vc7ide/slist/slist.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/splay_multiset/
sandbox/move/libs/intrusive/proj/vc7ide/splay_multiset/splay_multiset.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/splay_set/
sandbox/move/libs/intrusive/proj/vc7ide/splay_set/splay_set.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/stateful_value_traits/
sandbox/move/libs/intrusive/proj/vc7ide/stateful_value_traits/stateful_value_traits.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/to-do.txt (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/treap_multiset/
sandbox/move/libs/intrusive/proj/vc7ide/treap_multiset/treap_multiset.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/treap_set/
sandbox/move/libs/intrusive/proj/vc7ide/treap_set/treap_set.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/unordered_multiset/
sandbox/move/libs/intrusive/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/unordered_set/
sandbox/move/libs/intrusive/proj/vc7ide/unordered_set/unordered_set.vcproj (contents, props changed)
sandbox/move/libs/intrusive/proj/vc7ide/virtual_base/
sandbox/move/libs/intrusive/proj/vc7ide/virtual_base/virtual_base.vcproj (contents, props changed)
sandbox/move/libs/intrusive/test/
sandbox/move/libs/intrusive/test/Jamfile.v2 (contents, props changed)
sandbox/move/libs/intrusive/test/any_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/avl_multiset_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/avl_set_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/common_functors.hpp (contents, props changed)
sandbox/move/libs/intrusive/test/custom_bucket_traits_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/default_hook_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/external_value_traits_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/generic_assoc_test.hpp (contents, props changed)
sandbox/move/libs/intrusive/test/generic_multiset_test.hpp (contents, props changed)
sandbox/move/libs/intrusive/test/generic_set_test.hpp (contents, props changed)
sandbox/move/libs/intrusive/test/itestvalue.hpp (contents, props changed)
sandbox/move/libs/intrusive/test/list_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/make_functions_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/multiset_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/set_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/sg_multiset_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/sg_set_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/slist_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/smart_ptr.hpp (contents, props changed)
sandbox/move/libs/intrusive/test/splay_multiset_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/splay_set_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/stateful_value_traits_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/test_container.hpp (contents, props changed)
sandbox/move/libs/intrusive/test/test_macros.hpp (contents, props changed)
sandbox/move/libs/intrusive/test/treap_multiset_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/treap_set_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/unordered_multiset_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/unordered_set_test.cpp (contents, props changed)
sandbox/move/libs/intrusive/test/virtual_base_test.cpp (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_COPYABLE_AND_MOVABLE.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_COPY_ASSIGN_REF.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_COPY_REF.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_COPY_REF_2_TEMPL_ARGS.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_COPY_REF_3_TEMPL_ARGS.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_ENABLE_MOVE_EMULATION.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_FWD_REF.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_MOVABLE_AND_COPYABLE.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_MOVABLE_BUT_NOT_COPYABLE.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_RV_REF.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_RV_REF_2_TEMPL_ARGS.html (contents, props changed)
sandbox/move/libs/move/doc/html/BOOST_RV_REF_3_TEMPL_ARGS.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/
sandbox/move/libs/move/doc/html/boost/back_move_insert_iterator.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/back_move_inserter.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/forward.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/front_move_insert_iterator.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/front_move_inserter.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_nothrow_move.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155896.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155897.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155899.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155904.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155909.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155910.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155911.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155923.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155929.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155930.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155948.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155950.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155951.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155953.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155954.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/is_movable.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/make_move_iterator.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_backward.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155909.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155910.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155913.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155920.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155930.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155931.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155932.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155937.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155950.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155952.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155962.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155965.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155971.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155974.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id155976.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id156178.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183580.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183581.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183583.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183590.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183601.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183602.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183604.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183607.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183623.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183632.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id183635.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id255937.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id255941.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id256214.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_id257364.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_insert_iterator.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_inserter.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/move_iterator.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/uninitialized_copy_or_move.html (contents, props changed)
sandbox/move/libs/move/doc/html/boost/uninitialized_move.html (contents, props changed)
sandbox/move/libs/move/doc/html/index.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/
sandbox/move/libs/move/doc/html/move/composition_inheritance.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/construct_forwarding.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/implementing_movable_classes.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/introduction.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/macros.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/movable_only_classes.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/move_algorithms.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/move_and_containers.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/move_inserters.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/move_iterator.html (contents, props changed)
sandbox/move/libs/move/doc/html/move/reference.html (contents, props changed)
sandbox/move/libs/move/index.html (contents, props changed)
sandbox/move/libs/move/proj/vc7ide/copy_move_optimization.vcproj (contents, props changed)
sandbox/move/libs/move/test/copy_move_optimization.cpp (contents, props changed)
Removed:
sandbox/move/boost/container/containers_fwd.hpp
Text files modified:
sandbox/move/boost/container/deque.hpp | 6
sandbox/move/boost/container/detail/advanced_insert_int.hpp | 2
sandbox/move/boost/container/detail/algorithms.hpp | 2
sandbox/move/boost/container/detail/allocation_type.hpp | 2
sandbox/move/boost/container/detail/config_begin.hpp | 2
sandbox/move/boost/container/detail/config_end.hpp | 2
sandbox/move/boost/container/detail/flat_tree.hpp | 38 ++
sandbox/move/boost/container/detail/iterators.hpp | 2
sandbox/move/boost/container/detail/mpl.hpp | 2
sandbox/move/boost/container/detail/multiallocation_chain.hpp | 467 ++++++---------------------------------
sandbox/move/boost/container/detail/node_alloc_holder.hpp | 34 +-
sandbox/move/boost/container/detail/pair.hpp | 11
sandbox/move/boost/container/detail/preprocessor.hpp | 2
sandbox/move/boost/container/detail/transform_iterator.hpp | 2
sandbox/move/boost/container/detail/tree.hpp | 70 +++++
sandbox/move/boost/container/detail/type_traits.hpp | 2
sandbox/move/boost/container/detail/utilities.hpp | 8
sandbox/move/boost/container/detail/variadic_templates_tools.hpp | 2
sandbox/move/boost/container/detail/version_type.hpp | 2
sandbox/move/boost/container/detail/workaround.hpp | 4
sandbox/move/boost/container/flat_map.hpp | 50 +++
sandbox/move/boost/container/flat_set.hpp | 50 +++
sandbox/move/boost/container/list.hpp | 40 ++-
sandbox/move/boost/container/map.hpp | 48 +++
sandbox/move/boost/container/set.hpp | 48 +++
sandbox/move/boost/container/slist.hpp | 43 ++-
sandbox/move/boost/container/stable_vector.hpp | 433 ++++++++++++++++--------------------
sandbox/move/boost/container/string.hpp | 31 +
sandbox/move/boost/container/vector.hpp | 52 ++-
sandbox/move/boost/move/move.hpp | 158 ++++++++++---
sandbox/move/libs/move/doc/move.qbk | 97 ++++---
sandbox/move/libs/move/example/doc_clone_ptr.cpp | 67 ++--
sandbox/move/libs/move/example/doc_construct_forward.cpp | 11
sandbox/move/libs/move/example/doc_file_descriptor.cpp | 24 +-
sandbox/move/libs/move/example/movable.hpp | 7
35 files changed, 897 insertions(+), 924 deletions(-)
Added: sandbox/move/boost/container/container_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/container/container_fwd.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,187 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINERS_CONTAINERS_FWD_HPP
+#define BOOST_CONTAINERS_CONTAINERS_FWD_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+// Standard predeclarations
+//////////////////////////////////////////////////////////////////////////////
+
+/// @cond
+
+namespace boost{
+namespace intrusive{
+ //Create namespace to avoid compilation errors
+}}
+
+namespace boost{ namespace container{ namespace containers_detail{
+
+namespace bi = boost::intrusive;
+
+}}}
+
+namespace std {
+
+template <class T>
+class allocator;
+
+template <class T>
+struct less;
+
+template <class T1, class T2>
+struct pair;
+
+template <class CharType>
+struct char_traits;
+
+} //namespace std {
+
+/// @endcond
+
+//////////////////////////////////////////////////////////////////////////////
+// Containers
+//////////////////////////////////////////////////////////////////////////////
+
+namespace boost {
+namespace container {
+
+//vector class
+template <class T
+ ,class A = std::allocator<T> >
+class vector;
+
+//vector class
+template <class T
+ ,class A = std::allocator<T> >
+class stable_vector;
+
+//vector class
+template <class T
+ ,class A = std::allocator<T> >
+class deque;
+
+//list class
+template <class T
+ ,class A = std::allocator<T> >
+class list;
+
+//slist class
+template <class T
+ ,class Alloc = std::allocator<T> >
+class slist;
+
+//set class
+template <class T
+ ,class Pred = std::less<T>
+ ,class Alloc = std::allocator<T> >
+class set;
+
+//multiset class
+template <class T
+ ,class Pred = std::less<T>
+ ,class Alloc = std::allocator<T> >
+class multiset;
+
+//map class
+template <class Key
+ ,class T
+ ,class Pred = std::less<Key>
+ ,class Alloc = std::allocator<std::pair<const Key, T> > >
+class map;
+
+//multimap class
+template <class Key
+ ,class T
+ ,class Pred = std::less<Key>
+ ,class Alloc = std::allocator<std::pair<const Key, T> > >
+class multimap;
+
+//flat_set class
+template <class T
+ ,class Pred = std::less<T>
+ ,class Alloc = std::allocator<T> >
+class flat_set;
+
+//flat_multiset class
+template <class T
+ ,class Pred = std::less<T>
+ ,class Alloc = std::allocator<T> >
+class flat_multiset;
+
+//flat_map class
+template <class Key
+ ,class T
+ ,class Pred = std::less<Key>
+ ,class Alloc = std::allocator<std::pair<Key, T> > >
+class flat_map;
+
+//flat_multimap class
+template <class Key
+ ,class T
+ ,class Pred = std::less<Key>
+ ,class Alloc = std::allocator<std::pair<Key, T> > >
+class flat_multimap;
+
+//basic_string class
+template <class CharT
+ ,class Traits = std::char_traits<CharT>
+ ,class Alloc = std::allocator<CharT> >
+class basic_string;
+
+//! Type used to tag that the input range is
+//! guaranteed to be ordered
+struct ordered_range_impl_t {};
+
+//! Type used to tag that the input range is
+//! guaranteed to be ordered and unique
+struct ordered_unique_range_impl_t{};
+
+/// @cond
+
+typedef ordered_range_impl_t * ordered_range_t;
+typedef ordered_unique_range_impl_t *ordered_unique_range_t;
+
+/// @endcond
+
+//! Value used to tag that the input range is
+//! guaranteed to be ordered
+static const ordered_range_t ordered_range = 0;
+
+//! Value used to tag that the input range is
+//! guaranteed to be ordered and unique
+static const ordered_unique_range_t ordered_unique_range = 0;
+
+/// @cond
+
+namespace detail_really_deep_namespace {
+
+//Otherwise, gcc issues a warning of previously defined
+//anonymous_instance and unique_instance
+struct dummy
+{
+ dummy()
+ {
+ (void)ordered_range;
+ (void)ordered_unique_range;
+ }
+};
+
+} //detail_really_deep_namespace {
+
+/// @endcond
+
+}} //namespace boost { namespace container {
+
+#endif //#ifndef BOOST_CONTAINERS_CONTAINERS_FWD_HPP
Deleted: sandbox/move/boost/container/containers_fwd.hpp
==============================================================================
--- sandbox/move/boost/container/containers_fwd.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
+++ (empty file)
@@ -1,153 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
-// Software License, Version 1.0. (See accompanying file
-// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_CONTAINERS_CONTAINERS_FWD_HPP
-#define BOOST_CONTAINERS_CONTAINERS_FWD_HPP
-
-#if (defined _MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-// Standard predeclarations
-//////////////////////////////////////////////////////////////////////////////
-
-/// @cond
-
-namespace boost{
-namespace intrusive{
- //Create namespace to avoid compilation errors
-}}
-
-namespace boost{ namespace container{ namespace containers_detail{
-
-namespace bi = boost::intrusive;
-
-}}}
-
-namespace std {
-
-template <class T>
-class allocator;
-
-template <class T>
-struct less;
-
-template <class T1, class T2>
-struct pair;
-
-template <class CharType>
-struct char_traits;
-
-} //namespace std {
-
-/// @endcond
-
-//////////////////////////////////////////////////////////////////////////////
-// Containers
-//////////////////////////////////////////////////////////////////////////////
-
-#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
-namespace boost {
-namespace container {
-#else
-namespace boost {
-namespace container {
-#endif
-
-//vector class
-template <class T
- ,class A = std::allocator<T> >
-class vector;
-
-//vector class
-template <class T
-,class A = std::allocator<T> >
-class deque;
-
-//list class
-template <class T
- ,class A = std::allocator<T> >
-class list;
-
-//slist class
-template <class T
- ,class Alloc = std::allocator<T> >
-class slist;
-
-//set class
-template <class T
- ,class Pred = std::less<T>
- ,class Alloc = std::allocator<T> >
-class set;
-
-//multiset class
-template <class T
- ,class Pred = std::less<T>
- ,class Alloc = std::allocator<T> >
-class multiset;
-
-//map class
-template <class Key
- ,class T
- ,class Pred = std::less<Key>
- ,class Alloc = std::allocator<std::pair<const Key, T> > >
-class map;
-
-//multimap class
-template <class Key
- ,class T
- ,class Pred = std::less<Key>
- ,class Alloc = std::allocator<std::pair<const Key, T> > >
-class multimap;
-
-//flat_set class
-template <class T
- ,class Pred = std::less<T>
- ,class Alloc = std::allocator<T> >
-class flat_set;
-
-//flat_multiset class
-template <class T
- ,class Pred = std::less<T>
- ,class Alloc = std::allocator<T> >
-class flat_multiset;
-
-//flat_map class
-template <class Key
- ,class T
- ,class Pred = std::less<Key>
- ,class Alloc = std::allocator<std::pair<Key, T> > >
-class flat_map;
-
-//flat_multimap class
-template <class Key
- ,class T
- ,class Pred = std::less<Key>
- ,class Alloc = std::allocator<std::pair<Key, T> > >
-class flat_multimap;
-
-//basic_string class
-template <class CharT
- ,class Traits = std::char_traits<CharT>
- ,class Alloc = std::allocator<CharT> >
-class basic_string;
-
-//string class
-typedef basic_string
- <char
- ,std::char_traits<char>
- ,std::allocator<char> >
-string;
-
-}} //namespace boost { namespace container {
-
-#endif //#ifndef BOOST_CONTAINERS_CONTAINERS_FWD_HPP
-
Modified: sandbox/move/boost/container/deque.hpp
==============================================================================
--- sandbox/move/boost/container/deque.hpp (original)
+++ sandbox/move/boost/container/deque.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -55,7 +55,7 @@
#include <boost/container/detail/iterators.hpp>
#include <boost/container/detail/algorithms.hpp>
#include <boost/container/detail/mpl.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <cstddef>
#include <iterator>
#include <cassert>
@@ -530,6 +530,7 @@
/// @cond
private: // Internal typedefs
+ BOOST_COPYABLE_AND_MOVABLE(deque)
typedef ptr_alloc_ptr index_pointer;
static std::size_t s_buffer_size()
{ return Base::s_buffer_size(); }
@@ -542,7 +543,6 @@
allocator_type get_allocator() const { return Base::alloc(); }
public: // Basic accessors
- BOOST_ENABLE_MOVE_EMULATION(deque)
iterator begin()
{ return this->members_.m_start; }
@@ -653,7 +653,7 @@
priv_destroy_range(this->members_.m_start, this->members_.m_finish);
}
- deque& operator= (const deque& x)
+ deque& operator= (BOOST_COPY_ASSIGN_REF(deque) x)
{
const size_type len = size();
if (&x != this) {
Added: sandbox/move/boost/container/detail/adaptive_node_pool_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/container/detail/adaptive_node_pool_impl.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,638 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP
+#define BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/container_fwd.hpp>
+#include <boost/container/detail/workaround.hpp>
+#include <boost/container/detail/utilities.hpp>
+#include <boost/pointer_to_other.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#include <boost/container/detail/math_functions.hpp>
+#include <boost/container/detail/mpl.hpp>
+#include <boost/container/detail/pool_common.hpp>
+#include <cassert>
+#include <cstddef>
+
+namespace boost {
+namespace container {
+namespace containers_detail {
+
+struct hdr_offset_holder
+{
+ hdr_offset_holder(std::size_t offset = 0)
+ : hdr_offset(offset)
+ {}
+ std::size_t hdr_offset;
+};
+
+template<class VoidPointer>
+struct adaptive_pool_types
+{
+ typedef VoidPointer void_pointer;
+ typedef typename bi::make_set_base_hook
+ < bi::void_pointer<void_pointer>
+ , bi::optimize_size<true>
+ , bi::constant_time_size<false>
+ , bi::link_mode<bi::normal_link> >::type multiset_hook_t;
+
+ struct block_info_t
+ :
+ public hdr_offset_holder,
+ public multiset_hook_t
+ {
+ typedef typename node_slist<void_pointer>::node_slist_t free_nodes_t;
+ //An intrusive list of free node from this block
+ free_nodes_t free_nodes;
+ friend bool operator <(const block_info_t &l, const block_info_t &r)
+ {
+// { return l.free_nodes.size() < r.free_nodes.size(); }
+ //Let's order blocks first by free nodes and then by address
+ //so that highest address fully free blocks are deallocated.
+ //This improves returning memory to the OS (trimming).
+ const bool is_less = l.free_nodes.size() < r.free_nodes.size();
+ const bool is_equal = l.free_nodes.size() == r.free_nodes.size();
+ return is_less || (is_equal && (&l < &r));
+ }
+ };
+ typedef typename bi::make_multiset
+ <block_info_t, bi::base_hook<multiset_hook_t> >::type block_multiset_t;
+};
+
+
+inline std::size_t calculate_alignment
+ ( std::size_t overhead_percent, std::size_t real_node_size
+ , std::size_t hdr_size, std::size_t hdr_offset_size, std::size_t payload_per_allocation)
+{
+ //to-do: handle real_node_size != node_size
+ const std::size_t divisor = overhead_percent*real_node_size;
+ const std::size_t dividend = hdr_offset_size*100;
+ std::size_t elements_per_subblock = (dividend - 1)/divisor + 1;
+ std::size_t candidate_power_of_2 =
+ upper_power_of_2(elements_per_subblock*real_node_size + hdr_offset_size);
+ bool overhead_satisfied = false;
+ //Now calculate the wors-case overhead for a subblock
+ const std::size_t max_subblock_overhead = hdr_size + payload_per_allocation;
+ while(!overhead_satisfied){
+ elements_per_subblock = (candidate_power_of_2 - max_subblock_overhead)/real_node_size;
+ const std::size_t overhead_size = candidate_power_of_2 - elements_per_subblock*real_node_size;
+ if(overhead_size*100/candidate_power_of_2 < overhead_percent){
+ overhead_satisfied = true;
+ }
+ else{
+ candidate_power_of_2 <<= 1;
+ }
+ }
+ return candidate_power_of_2;
+}
+
+inline void calculate_num_subblocks
+ (std::size_t alignment, std::size_t real_node_size, std::size_t elements_per_block
+ , std::size_t &num_subblocks, std::size_t &real_num_node, std::size_t overhead_percent
+ , std::size_t hdr_size, std::size_t hdr_offset_size, std::size_t payload_per_allocation)
+{
+ std::size_t elements_per_subblock = (alignment - hdr_offset_size)/real_node_size;
+ std::size_t possible_num_subblock = (elements_per_block - 1)/elements_per_subblock + 1;
+ std::size_t hdr_subblock_elements = (alignment - hdr_size - payload_per_allocation)/real_node_size;
+ while(((possible_num_subblock-1)*elements_per_subblock + hdr_subblock_elements) < elements_per_block){
+ ++possible_num_subblock;
+ }
+ elements_per_subblock = (alignment - hdr_offset_size)/real_node_size;
+ bool overhead_satisfied = false;
+ while(!overhead_satisfied){
+ const std::size_t total_data = (elements_per_subblock*(possible_num_subblock-1) + hdr_subblock_elements)*real_node_size;
+ const std::size_t total_size = alignment*possible_num_subblock;
+ if((total_size - total_data)*100/total_size < overhead_percent){
+ overhead_satisfied = true;
+ }
+ else{
+ ++possible_num_subblock;
+ }
+ }
+ num_subblocks = possible_num_subblock;
+ real_num_node = (possible_num_subblock-1)*elements_per_subblock + hdr_subblock_elements;
+}
+
+template<class SegmentManagerBase, bool AlignOnly = false>
+class private_adaptive_node_pool_impl
+{
+ //Non-copyable
+ private_adaptive_node_pool_impl();
+ private_adaptive_node_pool_impl(const private_adaptive_node_pool_impl &);
+ private_adaptive_node_pool_impl &operator=(const private_adaptive_node_pool_impl &);
+ typedef private_adaptive_node_pool_impl this_type;
+
+ typedef typename SegmentManagerBase::void_pointer void_pointer;
+ static const std::size_t PayloadPerAllocation = SegmentManagerBase::PayloadPerAllocation;
+ typedef bool_<AlignOnly> IsAlignOnly;
+ typedef true_ AlignOnlyTrue;
+ typedef false_ AlignOnlyFalse;
+
+ public:
+ typedef typename node_slist<void_pointer>::node_t node_t;
+ typedef typename node_slist<void_pointer>::node_slist_t free_nodes_t;
+ typedef typename SegmentManagerBase::multiallocation_chain multiallocation_chain;
+
+ private:
+ typedef typename adaptive_pool_types<void_pointer>::block_info_t block_info_t;
+ typedef typename adaptive_pool_types<void_pointer>::block_multiset_t block_multiset_t;
+ typedef typename block_multiset_t::iterator block_iterator;
+
+ static const std::size_t MaxAlign = alignment_of<node_t>::value;
+ static const std::size_t HdrSize = ((sizeof(block_info_t)-1)/MaxAlign+1)*MaxAlign;
+ static const std::size_t HdrOffsetSize = ((sizeof(hdr_offset_holder)-1)/MaxAlign+1)*MaxAlign;
+
+
+ public:
+ //!Segment manager typedef
+ typedef SegmentManagerBase segment_manager_base_type;
+
+ //!Constructor from a segment manager. Never throws
+ private_adaptive_node_pool_impl
+ ( segment_manager_base_type *segment_mngr_base
+ , std::size_t node_size
+ , std::size_t nodes_per_block
+ , std::size_t max_free_blocks
+ , unsigned char overhead_percent
+ )
+ : m_max_free_blocks(max_free_blocks)
+ , m_real_node_size(lcm(node_size, std::size_t(alignment_of<node_t>::value)))
+ //Round the size to a power of two value.
+ //This is the total memory size (including payload) that we want to
+ //allocate from the general-purpose allocator
+ , m_real_block_alignment
+ (AlignOnly ?
+ upper_power_of_2(HdrSize + m_real_node_size*nodes_per_block) :
+ calculate_alignment( overhead_percent, m_real_node_size
+ , HdrSize, HdrOffsetSize, PayloadPerAllocation))
+ //This is the real number of nodes per block
+ , m_num_subblocks(0)
+ , m_real_num_node(AlignOnly ? (m_real_block_alignment - PayloadPerAllocation - HdrSize)/m_real_node_size : 0)
+ //General purpose allocator
+ , mp_segment_mngr_base(segment_mngr_base)
+ , m_block_multiset()
+ , m_totally_free_blocks(0)
+ {
+ if(!AlignOnly){
+ calculate_num_subblocks
+ ( m_real_block_alignment
+ , m_real_node_size
+ , nodes_per_block
+ , m_num_subblocks
+ , m_real_num_node
+ , overhead_percent
+ , HdrSize
+ , HdrOffsetSize
+ , PayloadPerAllocation);
+ }
+ }
+
+ //!Destructor. Deallocates all allocated blocks. Never throws
+ ~private_adaptive_node_pool_impl()
+ { priv_clear(); }
+
+ std::size_t get_real_num_node() const
+ { return m_real_num_node; }
+
+ //!Returns the segment manager. Never throws
+ segment_manager_base_type* get_segment_manager_base()const
+ { return containers_detail::get_pointer(mp_segment_mngr_base); }
+
+ //!Allocates array of count elements. Can throw
+ void *allocate_node()
+ {
+ priv_invariants();
+ //If there are no free nodes we allocate a new block
+ if (m_block_multiset.empty()){
+ priv_alloc_block(1);
+ }
+ //We take the first free node the multiset can't be empty
+ return priv_take_first_node();
+ }
+
+ //!Deallocates an array pointed by ptr. Never throws
+ void deallocate_node(void *pElem)
+ {
+ multiallocation_chain chain;
+ chain.push_front(void_pointer(pElem));
+ this->priv_reinsert_nodes_in_block(chain, 1);
+ //Update free block count<
+ if(m_totally_free_blocks > m_max_free_blocks){
+ this->priv_deallocate_free_blocks(m_max_free_blocks);
+ }
+ priv_invariants();
+ }
+
+ //!Allocates n nodes.
+ //!Can throw
+ multiallocation_chain allocate_nodes(const std::size_t n)
+ {
+ multiallocation_chain chain;
+ std::size_t i = 0;
+ try{
+ priv_invariants();
+ while(i != n){
+ //If there are no free nodes we allocate all needed blocks
+ if (m_block_multiset.empty()){
+ priv_alloc_block(((n - i) - 1)/m_real_num_node + 1);
+ }
+ free_nodes_t &free_nodes = m_block_multiset.begin()->free_nodes;
+ const std::size_t free_nodes_count_before = free_nodes.size();
+ if(free_nodes_count_before == m_real_num_node){
+ --m_totally_free_blocks;
+ }
+ const std::size_t num_elems = ((n-i) < free_nodes_count_before) ? (n-i) : free_nodes_count_before;
+ for(std::size_t j = 0; j != num_elems; ++j){
+ void *new_node = &free_nodes.front();
+ free_nodes.pop_front();
+ chain.push_back(new_node);
+ }
+
+ if(free_nodes.empty()){
+ m_block_multiset.erase(m_block_multiset.begin());
+ }
+ i += num_elems;
+ }
+ }
+ catch(...){
+ this->deallocate_nodes(boost::move(chain));
+ throw;
+ }
+ priv_invariants();
+ return boost::move(chain);
+ }
+
+ //!Deallocates a linked list of nodes. Never throws
+ void deallocate_nodes(multiallocation_chain nodes)
+ {
+ this->priv_reinsert_nodes_in_block(nodes, nodes.size());
+ if(m_totally_free_blocks > m_max_free_blocks){
+ this->priv_deallocate_free_blocks(m_max_free_blocks);
+ }
+ }
+
+ void deallocate_free_blocks()
+ { this->priv_deallocate_free_blocks(0); }
+
+ std::size_t num_free_nodes()
+ {
+ typedef typename block_multiset_t::const_iterator citerator;
+ std::size_t count = 0;
+ citerator it (m_block_multiset.begin()), itend(m_block_multiset.end());
+ for(; it != itend; ++it){
+ count += it->free_nodes.size();
+ }
+ return count;
+ }
+
+ void swap(private_adaptive_node_pool_impl &other)
+ {
+ assert(m_max_free_blocks == other.m_max_free_blocks);
+ assert(m_real_node_size == other.m_real_node_size);
+ assert(m_real_block_alignment == other.m_real_block_alignment);
+ assert(m_real_num_node == other.m_real_num_node);
+ std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
+ std::swap(m_totally_free_blocks, other.m_totally_free_blocks);
+ m_block_multiset.swap(other.m_block_multiset);
+ }
+
+ //Deprecated, use deallocate_free_blocks
+ void deallocate_free_chunks()
+ { this->priv_deallocate_free_blocks(0); }
+
+ private:
+ void priv_deallocate_free_blocks(std::size_t max_free_blocks)
+ {
+ priv_invariants();
+ //Now check if we've reached the free nodes limit
+ //and check if we have free blocks. If so, deallocate as much
+ //as we can to stay below the limit
+ for( block_iterator itend = m_block_multiset.end()
+ ; m_totally_free_blocks > max_free_blocks
+ ; --m_totally_free_blocks
+ ){
+ assert(!m_block_multiset.empty());
+ block_iterator it = itend;
+ --it;
+ assert(it->free_nodes.size() == m_real_num_node);
+ m_block_multiset.erase_and_dispose(it, block_destroyer(this));
+ }
+ }
+
+ void priv_reinsert_nodes_in_block(multiallocation_chain &chain, std::size_t n)
+ {
+ block_iterator block_it(m_block_multiset.end());
+ while(n--){
+ void *pElem = containers_detail::get_pointer(chain.front());
+ chain.pop_front();
+ priv_invariants();
+ block_info_t *block_info = this->priv_block_from_node(pElem);
+ assert(block_info->free_nodes.size() < m_real_num_node);
+ //We put the node at the beginning of the free node list
+ node_t * to_deallocate = static_cast<node_t*>(pElem);
+ block_info->free_nodes.push_front(*to_deallocate);
+
+ block_iterator this_block(block_multiset_t::s_iterator_to(*block_info));
+ block_iterator next_block(this_block);
+ ++next_block;
+
+ //Cache the free nodes from the block
+ std::size_t this_block_free_nodes = this_block->free_nodes.size();
+
+ if(this_block_free_nodes == 1){
+ m_block_multiset.insert(m_block_multiset.begin(), *block_info);
+ }
+ else{
+ block_iterator next_block(this_block);
+ ++next_block;
+ if(next_block != block_it){
+ std::size_t next_free_nodes = next_block->free_nodes.size();
+ if(this_block_free_nodes > next_free_nodes){
+ //Now move the block to the new position
+ m_block_multiset.erase(this_block);
+ m_block_multiset.insert(*block_info);
+ }
+ }
+ }
+ //Update free block count
+ if(this_block_free_nodes == m_real_num_node){
+ ++m_totally_free_blocks;
+ }
+ priv_invariants();
+ }
+ }
+
+ node_t *priv_take_first_node()
+ {
+ assert(m_block_multiset.begin() != m_block_multiset.end());
+ //We take the first free node the multiset can't be empty
+ free_nodes_t &free_nodes = m_block_multiset.begin()->free_nodes;
+ node_t *first_node = &free_nodes.front();
+ const std::size_t free_nodes_count = free_nodes.size();
+ assert(0 != free_nodes_count);
+ free_nodes.pop_front();
+ if(free_nodes_count == 1){
+ m_block_multiset.erase(m_block_multiset.begin());
+ }
+ else if(free_nodes_count == m_real_num_node){
+ --m_totally_free_blocks;
+ }
+ priv_invariants();
+ return first_node;
+ }
+
+ class block_destroyer;
+ friend class block_destroyer;
+
+ class block_destroyer
+ {
+ public:
+ block_destroyer(const this_type *impl)
+ : mp_impl(impl)
+ {}
+
+ void operator()(typename block_multiset_t::pointer to_deallocate)
+ { return this->do_destroy(to_deallocate, IsAlignOnly()); }
+
+ private:
+ void do_destroy(typename block_multiset_t::pointer to_deallocate, AlignOnlyTrue)
+ {
+ std::size_t free_nodes = to_deallocate->free_nodes.size();
+ (void)free_nodes;
+ assert(free_nodes == mp_impl->m_real_num_node);
+ mp_impl->mp_segment_mngr_base->deallocate(to_deallocate);
+ }
+
+ void do_destroy(typename block_multiset_t::pointer to_deallocate, AlignOnlyFalse)
+ {
+ std::size_t free_nodes = to_deallocate->free_nodes.size();
+ (void)free_nodes;
+ assert(free_nodes == mp_impl->m_real_num_node);
+ assert(0 == to_deallocate->hdr_offset);
+ hdr_offset_holder *hdr_off_holder = mp_impl->priv_first_subblock_from_block(containers_detail::get_pointer(to_deallocate));
+ mp_impl->mp_segment_mngr_base->deallocate(hdr_off_holder);
+ }
+
+ const this_type *mp_impl;
+ };
+
+ //This macro will activate invariant checking. Slow, but helpful for debugging the code.
+ //#define BOOST_CONTAINER_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
+ void priv_invariants()
+ #ifdef BOOST_CONTAINER_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
+ #undef BOOST_CONTAINER_ADAPTIVE_NODE_POOL_CHECK_INVARIANTS
+ {
+ //We iterate through the block tree to free the memory
+ block_iterator it(m_block_multiset.begin()),
+ itend(m_block_multiset.end()), to_deallocate;
+ if(it != itend){
+ for(++it; it != itend; ++it){
+ block_iterator prev(it);
+ --prev;
+ std::size_t sp = prev->free_nodes.size(),
+ si = it->free_nodes.size();
+ assert(sp <= si);
+ (void)sp; (void)si;
+ }
+ }
+ //Check that the total free nodes are correct
+ it = m_block_multiset.begin();
+ itend = m_block_multiset.end();
+ std::size_t total_free_nodes = 0;
+ for(; it != itend; ++it){
+ total_free_nodes += it->free_nodes.size();
+ }
+ assert(total_free_nodes >= m_totally_free_blocks*m_real_num_node);
+
+ //Check that the total totally free blocks are correct
+ it = m_block_multiset.begin();
+ itend = m_block_multiset.end();
+ total_free = 0;
+ for(; it != itend; ++it){
+ total_free += it->free_nodes.size() == m_real_num_node;
+ }
+ assert(total_free >= m_totally_free_blocks);
+
+ if(!AlignOnly){
+ //Check that header offsets are correct
+ it = m_block_multiset.begin();
+ for(; it != itend; ++it){
+ hdr_offset_holder *hdr_off_holder = priv_first_subblock_from_block(&*it);
+ for(std::size_t i = 0, max = m_num_subblocks; i < max; ++i){
+ assert(hdr_off_holder->hdr_offset == std::size_t(reinterpret_cast<char*>(&*it)- reinterpret_cast<char*>(hdr_off_holder)));
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
+ hdr_off_holder = reinterpret_cast<hdr_offset_holder *>(reinterpret_cast<char*>(hdr_off_holder) + m_real_block_alignment);
+ }
+ }
+ }
+ }
+ #else
+ {} //empty
+ #endif
+
+ //!Deallocates all used memory. Never throws
+ void priv_clear()
+ {
+ #ifndef NDEBUG
+ block_iterator it = m_block_multiset.begin();
+ block_iterator itend = m_block_multiset.end();
+ std::size_t num_free_nodes = 0;
+ for(; it != itend; ++it){
+ //Check for memory leak
+ assert(it->free_nodes.size() == m_real_num_node);
+ ++num_free_nodes;
+ }
+ assert(num_free_nodes == m_totally_free_blocks);
+ #endif
+ //Check for memory leaks
+ priv_invariants();
+ m_block_multiset.clear_and_dispose(block_destroyer(this));
+ m_totally_free_blocks = 0;
+ }
+
+ block_info_t *priv_block_from_node(void *node, AlignOnlyFalse) const
+ {
+ hdr_offset_holder *hdr_off_holder =
+ reinterpret_cast<hdr_offset_holder*>((std::size_t)node & std::size_t(~(m_real_block_alignment - 1)));
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
+ block_info_t *block = reinterpret_cast<block_info_t *>
+ (reinterpret_cast<char*>(hdr_off_holder) + hdr_off_holder->hdr_offset);
+ assert(block->hdr_offset == 0);
+ return block;
+ }
+
+ block_info_t *priv_block_from_node(void *node, AlignOnlyTrue) const
+ {
+ return (block_info_t *)((std::size_t)node & std::size_t(~(m_real_block_alignment - 1)));
+ }
+
+ block_info_t *priv_block_from_node(void *node) const
+ { return priv_block_from_node(node, IsAlignOnly()); }
+
+ hdr_offset_holder *priv_first_subblock_from_block(block_info_t *block) const
+ {
+ hdr_offset_holder *hdr_off_holder = reinterpret_cast<hdr_offset_holder*>
+ (reinterpret_cast<char*>(block) - (m_num_subblocks-1)*m_real_block_alignment);
+ assert(hdr_off_holder->hdr_offset == std::size_t(reinterpret_cast<char*>(block) - reinterpret_cast<char*>(hdr_off_holder)));
+ assert(0 == ((std::size_t)hdr_off_holder & (m_real_block_alignment - 1)));
+ assert(0 == (hdr_off_holder->hdr_offset & (m_real_block_alignment - 1)));
+ return hdr_off_holder;
+ }
+
+ //!Allocates a several blocks of nodes. Can throw
+ void priv_alloc_block(std::size_t n, AlignOnlyTrue)
+ {
+ std::size_t real_block_size = m_real_block_alignment - PayloadPerAllocation;
+ for(std::size_t i = 0; i != n; ++i){
+ //We allocate a new NodeBlock and put it the last
+ //element of the tree
+ char *mem_address = static_cast<char*>
+ (mp_segment_mngr_base->allocate_aligned(real_block_size, m_real_block_alignment));
+ if(!mem_address) throw std::bad_alloc();
+ ++m_totally_free_blocks;
+ block_info_t *c_info = new(mem_address)block_info_t;
+ m_block_multiset.insert(m_block_multiset.end(), *c_info);
+
+ mem_address += HdrSize;
+ //We initialize all Nodes in Node Block to insert
+ //them in the free Node list
+ typename free_nodes_t::iterator prev_insert_pos = c_info->free_nodes.before_begin();
+ for(std::size_t i = 0; i < m_real_num_node; ++i){
+ prev_insert_pos = c_info->free_nodes.insert_after(prev_insert_pos, *(node_t*)mem_address);
+ mem_address += m_real_node_size;
+ }
+ }
+ }
+
+ void priv_alloc_block(std::size_t n, AlignOnlyFalse)
+ {
+ std::size_t real_block_size = m_real_block_alignment*m_num_subblocks - PayloadPerAllocation;
+ std::size_t elements_per_subblock = (m_real_block_alignment - HdrOffsetSize)/m_real_node_size;
+ std::size_t hdr_subblock_elements = (m_real_block_alignment - HdrSize - PayloadPerAllocation)/m_real_node_size;
+
+ for(std::size_t i = 0; i != n; ++i){
+ //We allocate a new NodeBlock and put it the last
+ //element of the tree
+ char *mem_address = static_cast<char*>
+ (mp_segment_mngr_base->allocate_aligned(real_block_size, m_real_block_alignment));
+ if(!mem_address) throw std::bad_alloc();
+ ++m_totally_free_blocks;
+
+ //First initialize header information on the last subblock
+ char *hdr_addr = mem_address + m_real_block_alignment*(m_num_subblocks-1);
+ block_info_t *c_info = new(hdr_addr)block_info_t;
+ //Some structural checks
+ assert(static_cast<void*>(&static_cast<hdr_offset_holder*>(c_info)->hdr_offset) ==
+ static_cast<void*>(c_info));
+ typename free_nodes_t::iterator prev_insert_pos = c_info->free_nodes.before_begin();
+ for( std::size_t subblock = 0, maxsubblock = m_num_subblocks - 1
+ ; subblock < maxsubblock
+ ; ++subblock, mem_address += m_real_block_alignment){
+ //Initialize header offset mark
+ new(mem_address) hdr_offset_holder(std::size_t(hdr_addr - mem_address));
+ char *pNode = mem_address + HdrOffsetSize;
+ for(std::size_t i = 0; i < elements_per_subblock; ++i){
+ prev_insert_pos = c_info->free_nodes.insert_after(prev_insert_pos, *new (pNode) node_t);
+ pNode += m_real_node_size;
+ }
+ }
+ {
+ char *pNode = hdr_addr + HdrSize;
+ //We initialize all Nodes in Node Block to insert
+ //them in the free Node list
+ for(std::size_t i = 0; i < hdr_subblock_elements; ++i){
+ prev_insert_pos = c_info->free_nodes.insert_after(prev_insert_pos, *new (pNode) node_t);
+ pNode += m_real_node_size;
+ }
+ }
+ //Insert the block after the free node list is full
+ m_block_multiset.insert(m_block_multiset.end(), *c_info);
+ }
+ }
+
+ //!Allocates a block of nodes. Can throw std::bad_alloc
+ void priv_alloc_block(std::size_t n)
+ { return priv_alloc_block(n, IsAlignOnly()); }
+
+ private:
+ typedef typename boost::pointer_to_other
+ <void_pointer, segment_manager_base_type>::type segment_mngr_base_ptr_t;
+ const std::size_t m_max_free_blocks;
+ const std::size_t m_real_node_size;
+ //Round the size to a power of two value.
+ //This is the total memory size (including payload) that we want to
+ //allocate from the general-purpose allocator
+ const std::size_t m_real_block_alignment;
+ std::size_t m_num_subblocks;
+ //This is the real number of nodes per block
+ //const
+ std::size_t m_real_num_node;
+ segment_mngr_base_ptr_t mp_segment_mngr_base; //Segment manager
+ block_multiset_t m_block_multiset; //Intrusive block list
+ std::size_t m_totally_free_blocks; //Free blocks
+};
+
+} //namespace containers_detail {
+} //namespace container {
+} //namespace boost {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP
Modified: sandbox/move/boost/container/detail/advanced_insert_int.hpp
==============================================================================
--- sandbox/move/boost/container/detail/advanced_insert_int.hpp (original)
+++ sandbox/move/boost/container/detail/advanced_insert_int.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
Modified: sandbox/move/boost/container/detail/algorithms.hpp
==============================================================================
--- sandbox/move/boost/container/detail/algorithms.hpp (original)
+++ sandbox/move/boost/container/detail/algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008.
+// (C) Copyright Ion Gaztanaga 2005-2009.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
Modified: sandbox/move/boost/container/detail/allocation_type.hpp
==============================================================================
--- sandbox/move/boost/container/detail/allocation_type.hpp (original)
+++ sandbox/move/boost/container/detail/allocation_type.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
Modified: sandbox/move/boost/container/detail/config_begin.hpp
==============================================================================
--- sandbox/move/boost/container/detail/config_begin.hpp (original)
+++ sandbox/move/boost/container/detail/config_begin.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
Modified: sandbox/move/boost/container/detail/config_end.hpp
==============================================================================
--- sandbox/move/boost/container/detail/config_end.hpp (original)
+++ sandbox/move/boost/container/detail/config_end.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
Modified: sandbox/move/boost/container/detail/flat_tree.hpp
==============================================================================
--- sandbox/move/boost/container/detail/flat_tree.hpp (original)
+++ sandbox/move/boost/container/detail/flat_tree.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -35,6 +35,8 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
+#include <boost/container/container_fwd.hpp>
+
#include <algorithm>
#include <functional>
#include <utility>
@@ -91,7 +93,12 @@
//Inherit from value_compare to do EBO
: public value_compare
{
- public:
+ private:
+ BOOST_COPYABLE_AND_MOVABLE(Data)
+ public:
+ Data(const Data &d)
+ : value_compare(d), m_vect(d.m_vect)
+ {}
Data(const Compare &comp,
const vector_t &vect)
: value_compare(comp), m_vect(vect){}
@@ -103,14 +110,28 @@
Data(const Compare &comp,
const allocator_t &alloc)
: value_compare(comp), m_vect(alloc){}
- public:
+
+ Data& operator=(BOOST_COPY_ASSIGN_REF(Data) d)
+ {
+ value_compare::operator=(d);
+ m_vect = d.m_vect;
+ return *this;
+ }
+
+ Data& operator=(BOOST_RV_REF(Data) d)
+ {
+ value_compare::operator=(boost::move(static_cast<value_compare &>(d)));
+ m_vect = boost::move(d.m_vect);
+ return *this;
+ }
+
vector_t m_vect;
};
Data m_data;
+ BOOST_COPYABLE_AND_MOVABLE(flat_tree)
public:
- BOOST_ENABLE_MOVE_EMULATION(flat_tree)
typedef typename vector_t::value_type value_type;
typedef typename vector_t::pointer pointer;
@@ -143,10 +164,17 @@
: m_data(boost::move(x.m_data))
{ }
+ template <class InputIterator>
+ flat_tree( ordered_range_t, InputIterator first, InputIterator last
+ , const Compare& comp = Compare()
+ , const allocator_type& a = allocator_type())
+ : m_data(comp, a)
+ { this->m_data.m_vect.insert(this->m_data.m_vect.end(), first, last); }
+
~flat_tree()
{ }
- flat_tree& operator=(const flat_tree& x)
+ flat_tree& operator=(BOOST_COPY_ASSIGN_REF(flat_tree) x)
{ m_data = x.m_data; return *this; }
flat_tree& operator=(BOOST_RV_REF(flat_tree) mx)
Modified: sandbox/move/boost/container/detail/iterators.hpp
==============================================================================
--- sandbox/move/boost/container/detail/iterators.hpp (original)
+++ sandbox/move/boost/container/detail/iterators.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008.
+// (C) Copyright Ion Gaztanaga 2005-2009.
// (C) Copyright Gennaro Prota 2003 - 2004.
//
// Distributed under the Boost Software License, Version 1.0.
Added: sandbox/move/boost/container/detail/math_functions.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/container/detail/math_functions.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,110 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Stephen Cleary 2000.
+// (C) Copyright Ion Gaztanaga 2007-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+// This file is a slightly modified file from Boost.Pool
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_DETAIL_MATH_FUNCTIONS_HPP
+#define BOOST_CONTAINER_DETAIL_MATH_FUNCTIONS_HPP
+
+#include <climits>
+#include <boost/static_assert.hpp>
+
+namespace boost {
+namespace container {
+namespace containers_detail {
+
+// Greatest common divisor and least common multiple
+
+//
+// gcd is an algorithm that calculates the greatest common divisor of two
+// integers, using Euclid's algorithm.
+//
+// Pre: A > 0 && B > 0
+// Recommended: A > B
+template <typename Integer>
+inline Integer gcd(Integer A, Integer B)
+{
+ do
+ {
+ const Integer tmp(B);
+ B = A % B;
+ A = tmp;
+ } while (B != 0);
+
+ return A;
+}
+
+//
+// lcm is an algorithm that calculates the least common multiple of two
+// integers.
+//
+// Pre: A > 0 && B > 0
+// Recommended: A > B
+template <typename Integer>
+inline Integer lcm(const Integer & A, const Integer & B)
+{
+ Integer ret = A;
+ ret /= gcd(A, B);
+ ret *= B;
+ return ret;
+}
+
+template <typename Integer>
+inline Integer log2_ceil(const Integer & A)
+{
+ Integer i = 0;
+ Integer power_of_2 = 1;
+
+ while(power_of_2 < A){
+ power_of_2 <<= 1;
+ ++i;
+ }
+ return i;
+}
+
+template <typename Integer>
+inline Integer upper_power_of_2(const Integer & A)
+{
+ Integer power_of_2 = 1;
+
+ while(power_of_2 < A){
+ power_of_2 <<= 1;
+ }
+ return power_of_2;
+}
+
+//This function uses binary search to discover the
+//highest set bit of the integer
+inline std::size_t floor_log2 (std::size_t x)
+{
+ const std::size_t Bits = sizeof(std::size_t)*CHAR_BIT;
+ const bool Size_t_Bits_Power_2= !(Bits & (Bits-1));
+ BOOST_STATIC_ASSERT(((Size_t_Bits_Power_2)== true));
+
+ std::size_t n = x;
+ std::size_t log2 = 0;
+
+ for(std::size_t shift = Bits >> 1; shift; shift >>= 1){
+ std::size_t tmp = n >> shift;
+ if (tmp)
+ log2 += shift, n = tmp;
+ }
+
+ return log2;
+}
+
+} // namespace containers_detail
+} // namespace container
+} // namespace boost
+
+#endif
Modified: sandbox/move/boost/container/detail/mpl.hpp
==============================================================================
--- sandbox/move/boost/container/detail/mpl.hpp (original)
+++ sandbox/move/boost/container/detail/mpl.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008.
+// (C) Copyright Ion Gaztanaga 2005-2009.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
Modified: sandbox/move/boost/container/detail/multiallocation_chain.hpp
==============================================================================
--- sandbox/move/boost/container/detail/multiallocation_chain.hpp (original)
+++ sandbox/move/boost/container/detail/multiallocation_chain.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -12,423 +12,122 @@
#define BOOST_CONTAINERS_DETAIL_MULTIALLOCATION_CHAIN_HPP
#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/container_fwd.hpp>
#include <boost/container/detail/utilities.hpp>
#include <boost/container/detail/type_traits.hpp>
#include <boost/container/detail/transform_iterator.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/pointer_to_other.hpp>
+#include <boost/move/move.hpp>
namespace boost {
namespace container {
namespace containers_detail {
template<class VoidPointer>
-class basic_multiallocation_slist
+class basic_multiallocation_chain
{
-public:
- typedef VoidPointer void_pointer;
+ private:
+ typedef bi::slist_base_hook<bi::void_pointer<VoidPointer>
+ ,bi::link_mode<bi::normal_link>
+ > node;
+
+ typedef bi::slist< node
+ , bi::linear<true>
+ , bi::cache_last<true>
+ > slist_impl_t;
+ slist_impl_t slist_impl_;
-private:
- static VoidPointer &priv_get_ref(const VoidPointer &p)
- { return *static_cast<void_pointer*>(containers_detail::get_pointer(p)); }
-
- basic_multiallocation_slist(basic_multiallocation_slist &);
- basic_multiallocation_slist &operator=(basic_multiallocation_slist &);
-
-public:
- BOOST_ENABLE_MOVE_EMULATION(basic_multiallocation_slist)
-
- //!This iterator is returned by "allocate_many" functions so that
- //!the user can access the multiple buffers allocated in a single call
- class iterator
- : public std::iterator<std::input_iterator_tag, char>
- {
- friend class basic_multiallocation_slist<void_pointer>;
- void unspecified_bool_type_func() const {}
- typedef void (iterator::*unspecified_bool_type)() const;
-
- iterator(void_pointer node_range)
- : next_node_(node_range)
- {}
+ static node & to_node(VoidPointer p)
+ { return *static_cast<node*>(static_cast<void*>(containers_detail::get_pointer(p))); }
- public:
- typedef char value_type;
- typedef value_type & reference;
- typedef value_type * pointer;
-
- iterator()
- : next_node_(0)
- {}
-
- iterator &operator=(const iterator &other)
- { next_node_ = other.next_node_; return *this; }
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_multiallocation_chain)
public:
- iterator& operator++()
- {
- next_node_ = *static_cast<void_pointer*>(containers_detail::get_pointer(next_node_));
- return *this;
- }
-
- iterator operator++(int)
- {
- iterator result(*this);
- ++*this;
- return result;
- }
-
- bool operator== (const iterator& other) const
- { return next_node_ == other.next_node_; }
-
- bool operator!= (const iterator& other) const
- { return !operator== (other); }
-
- reference operator*() const
- { return *static_cast<char*>(containers_detail::get_pointer(next_node_)); }
-
- operator unspecified_bool_type() const
- { return next_node_? &iterator::unspecified_bool_type_func : 0; }
-
- pointer operator->() const
- { return &(*(*this)); }
-
- private:
- void_pointer next_node_;
- };
-private:
- iterator it_;
-public:
- basic_multiallocation_slist()
- : it_(iterator())
- {}
+ typedef VoidPointer void_pointer;
+ typedef typename slist_impl_t::iterator iterator;
- basic_multiallocation_slist(void_pointer p)
- : it_(p ? iterator_to(p) : iterator())
+ basic_multiallocation_chain()
+ : slist_impl_()
{}
- basic_multiallocation_slist(BOOST_RV_REF(basic_multiallocation_slist) other)
- : it_(iterator())
- { this->swap(other); }
+ basic_multiallocation_chain(BOOST_RV_REF(basic_multiallocation_chain) other)
+ : slist_impl_()
+ { slist_impl_.swap(other.slist_impl_); }
- basic_multiallocation_slist& operator=(BOOST_RV_REF(basic_multiallocation_slist) other)
+ basic_multiallocation_chain& operator=(BOOST_RV_REF(basic_multiallocation_chain) other)
{
- basic_multiallocation_slist tmp(boost::move(other));
+ basic_multiallocation_chain tmp(boost::move(other));
this->swap(tmp);
return *this;
}
bool empty() const
- { return !it_; }
-
- iterator before_begin() const
- { return iterator(void_pointer(const_cast<void*>(static_cast<const void*>(&it_.next_node_)))); }
-
- iterator begin() const
- { return it_; }
-
- iterator end() const
- { return iterator(); }
-
- void clear()
- { this->it_.next_node_ = void_pointer(0); }
-
- iterator insert_after(iterator it, void_pointer m)
- {
- priv_get_ref(m) = priv_get_ref(it.next_node_);
- priv_get_ref(it.next_node_) = m;
- return iterator(m);
- }
-
- void push_front(void_pointer m)
- {
- priv_get_ref(m) = this->it_.next_node_;
- this->it_.next_node_ = m;
- }
-
- void pop_front()
- { ++it_; }
-
- void *front() const
- { return containers_detail::get_pointer(it_.next_node_); }
-
- void splice_after(iterator after_this, iterator before_begin, iterator before_end)
- {
- if (after_this != before_begin && after_this != before_end && before_begin != before_end) {
- void_pointer next_b = priv_get_ref(before_begin.next_node_);
- void_pointer next_e = priv_get_ref(before_end.next_node_);
- void_pointer next_p = priv_get_ref(after_this.next_node_);
- priv_get_ref(before_begin.next_node_) = next_e;
- priv_get_ref(before_end.next_node_) = next_p;
- priv_get_ref(after_this.next_node_) = next_b;
- }
- }
-
- void swap(basic_multiallocation_slist &other_chain)
- {
- std::swap(this->it_, other_chain.it_);
- }
-
- static iterator iterator_to(void_pointer p)
- { return iterator(p); }
+ { return slist_impl_.empty(); }
- void_pointer extract_data()
- {
- void_pointer ret = empty() ? void_pointer(0) : void_pointer(&*it_);
- it_ = iterator();
- return ret;
- }
-};
-
-template<class VoidPointer>
-class basic_multiallocation_cached_slist
-{
-private:
- basic_multiallocation_slist<VoidPointer> slist_;
- typename basic_multiallocation_slist<VoidPointer>::iterator last_;
-
- basic_multiallocation_cached_slist(basic_multiallocation_cached_slist &);
- basic_multiallocation_cached_slist &operator=(basic_multiallocation_cached_slist &);
-
-public:
- BOOST_ENABLE_MOVE_EMULATION(basic_multiallocation_cached_slist)
-
- typedef typename basic_multiallocation_slist<VoidPointer>::void_pointer void_pointer;
- typedef typename basic_multiallocation_slist<VoidPointer>::iterator iterator;
-
- basic_multiallocation_cached_slist()
- : slist_(), last_(slist_.before_begin())
- {}
- /*
- basic_multiallocation_cached_slist(iterator first_node)
- : slist_(first_node), last_(slist_.before_begin())
- {
- iterator end;
- while(first_node != end){
- ++last_;
- }
- }*/
-
- basic_multiallocation_cached_slist(void_pointer p1, void_pointer p2)
- : slist_(p1), last_(p2 ? iterator_to(p2) : slist_.before_begin())
- {}
-
- basic_multiallocation_cached_slist(BOOST_RV_REF(basic_multiallocation_cached_slist) other)
- : slist_(), last_(slist_.before_begin())
- { this->swap(other); }
-
- basic_multiallocation_cached_slist& operator=(BOOST_RV_REF(basic_multiallocation_cached_slist) other)
- {
- basic_multiallocation_cached_slist tmp(boost::move(other));
- this->swap(tmp);
- return *this;
- }
-
- bool empty() const
- { return slist_.empty(); }
+ std::size_t size() const
+ { return slist_impl_.size(); }
- iterator before_begin() const
- { return slist_.before_begin(); }
+ iterator before_begin()
+ { return slist_impl_.before_begin(); }
- iterator begin() const
- { return slist_.begin(); }
+ iterator begin()
+ { return slist_impl_.begin(); }
- iterator end() const
- { return slist_.end(); }
+ iterator end()
+ { return slist_impl_.end(); }
- iterator last() const
- { return last_; }
+ iterator last()
+ { return slist_impl_.last(); }
void clear()
- {
- slist_.clear();
- last_ = slist_.before_begin();
- }
+ { slist_impl_.clear(); }
iterator insert_after(iterator it, void_pointer m)
- {
- slist_.insert_after(it, m);
- if(it == last_){
- last_ = slist_.iterator_to(m);
- }
- return iterator_to(m);
- }
+ { return slist_impl_.insert_after(it, to_node(m)); }
void push_front(void_pointer m)
- { this->insert_after(this->before_begin(), m); }
+ { return slist_impl_.push_front(to_node(m)); }
void push_back(void_pointer m)
- { this->insert_after(last_, m); }
+ { return slist_impl_.push_back(to_node(m)); }
void pop_front()
- {
- if(last_ == slist_.begin()){
- last_ = slist_.before_begin();
- }
- slist_.pop_front();
- }
-
- void *front() const
- { return slist_.front(); }
-
- void splice_after(iterator after_this, iterator before_begin, iterator before_end)
- {
- if(before_begin == before_end)
- return;
- if(after_this == last_){
- last_ = before_end;
- }
- slist_.splice_after(after_this, before_begin, before_end);
- }
-
- void swap(basic_multiallocation_cached_slist &x)
- {
- slist_.swap(x.slist_);
- using std::swap;
- swap(last_, x.last_);
- if(last_ == x.before_begin()){
- last_ = this->before_begin();
- }
- if(x.last_ == this->before_begin()){
- x.last_ = x.before_begin();
- }
- }
-
- static iterator iterator_to(void_pointer p)
- { return basic_multiallocation_slist<VoidPointer>::iterator_to(p); }
-
- std::pair<void_pointer, void_pointer> extract_data()
- {
- if(this->empty()){
- return std::pair<void_pointer, void_pointer>(void_pointer(0), void_pointer(0));
- }
- else{
- void_pointer p1 = slist_.extract_data();
- void_pointer p2 = void_pointer(&*last_);
- last_ = iterator();
- return std::pair<void_pointer, void_pointer>(p1, p2);
- }
- }
-};
-
-template<class MultiallocatorCachedSlist>
-class basic_multiallocation_cached_counted_slist
-{
-private:
- MultiallocatorCachedSlist cached_slist_;
- std::size_t size_;
-
- basic_multiallocation_cached_counted_slist(basic_multiallocation_cached_counted_slist &);
- basic_multiallocation_cached_counted_slist &operator=(basic_multiallocation_cached_counted_slist &);
-
-public:
- BOOST_ENABLE_MOVE_EMULATION(basic_multiallocation_cached_counted_slist)
-
- typedef typename MultiallocatorCachedSlist::void_pointer void_pointer;
- typedef typename MultiallocatorCachedSlist::iterator iterator;
-
- basic_multiallocation_cached_counted_slist()
- : cached_slist_(), size_(0)
- {}
-
- basic_multiallocation_cached_counted_slist(void_pointer p1, void_pointer p2, std::size_t n)
- : cached_slist_(p1, p2), size_(n)
- {}
-
- basic_multiallocation_cached_counted_slist(BOOST_RV_REF(basic_multiallocation_cached_counted_slist) other)
- : cached_slist_(), size_(0)
- { this->swap(other); }
-
- basic_multiallocation_cached_counted_slist& operator=(BOOST_RV_REF(basic_multiallocation_cached_counted_slist) other)
- {
- basic_multiallocation_cached_counted_slist tmp(boost::move(other));
- this->swap(tmp);
- return *this;
- }
-
- basic_multiallocation_cached_counted_slist (MultiallocatorCachedSlist mem, std::size_t n)
- : cached_slist_(boost::move(mem)), size_(n)
- {}
-
- bool empty() const
- { return cached_slist_.empty(); }
-
- std::size_t size() const
- { return size_; }
-
- iterator before_begin() const
- { return cached_slist_.before_begin(); }
-
- iterator begin() const
- { return cached_slist_.begin(); }
+ { return slist_impl_.pop_front(); }
- iterator end() const
- { return cached_slist_.end(); }
+ void *front()
+ { return &*slist_impl_.begin(); }
- iterator last() const
- { return cached_slist_.last(); }
+ void splice_after(iterator after_this, basic_multiallocation_chain &x, iterator before_begin, iterator before_end)
+ { slist_impl_.splice_after(after_this, x.slist_impl_, before_begin, before_end); }
- void clear()
- {
- cached_slist_.clear();
- size_ = 0;
- }
-
- iterator insert_after(iterator it, void_pointer m)
- {
- iterator ret = cached_slist_.insert_after(it, m);
- ++size_;
- return ret;
- }
-
- void push_front(void_pointer m)
- { this->insert_after(this->before_begin(), m); }
+ void splice_after(iterator after_this, basic_multiallocation_chain &x, iterator before_begin, iterator before_end, std::size_t n)
+ { slist_impl_.splice_after(after_this, x.slist_impl_, before_begin, before_end, n); }
- void push_back(void_pointer m)
- { this->insert_after(this->before_begin(), m); }
+ void splice_after(iterator after_this, basic_multiallocation_chain &x)
+ { slist_impl_.splice_after(after_this, x.slist_impl_); }
- void pop_front()
- {
- cached_slist_.pop_front();
- --size_;
- }
+ void incorporate_after(iterator after_this, void_pointer begin , iterator before_end)
+ { slist_impl_.incorporate_after(after_this, &to_node(begin), &to_node(before_end)); }
- void *front() const
- { return cached_slist_.front(); }
+ void incorporate_after(iterator after_this, void_pointer begin, void_pointer before_end, std::size_t n)
+ { slist_impl_.incorporate_after(after_this, &to_node(begin), &to_node(before_end), n); }
- void splice_after(iterator after_this, basic_multiallocation_cached_counted_slist &x, iterator before_begin, iterator before_end)
- {
- std::size_t n = static_cast<std::size_t>(std::distance(before_begin, before_end));
- this->splice_after(after_this, x, before_begin, before_end, n);
- }
-
- void splice_after(iterator after_this, basic_multiallocation_cached_counted_slist &x, iterator before_begin, iterator before_end, std::size_t n)
- {
- cached_slist_.splice_after(after_this, before_begin, before_end);
- size_ += n;
- x.size_ -= n;
- }
-
- void splice_after(iterator after_this, basic_multiallocation_cached_counted_slist &x)
- {
- cached_slist_.splice_after(after_this, x.before_begin(), x.last());
- size_ += x.size_;
- x.size_ = 0;
- }
-
- void swap(basic_multiallocation_cached_counted_slist &x)
- {
- cached_slist_.swap(x.cached_slist_);
- using std::swap;
- swap(size_, x.size_);
- }
+ void swap(basic_multiallocation_chain &x)
+ { slist_impl_.swap(x.slist_impl_); }
static iterator iterator_to(void_pointer p)
- { return MultiallocatorCachedSlist::iterator_to(p); }
+ { return slist_impl_t::s_iterator_to(to_node(p)); }
std::pair<void_pointer, void_pointer> extract_data()
{
- size_ = 0;
- return cached_slist_.extract_data();
+ std::pair<void_pointer, void_pointer> ret
+ (slist_impl_.begin().operator->()
+ ,slist_impl_.last().operator->());
+ slist_impl_.clear();
+ return ret;
}
};
@@ -436,40 +135,32 @@
struct cast_functor
{
typedef typename containers_detail::add_reference<T>::type result_type;
- result_type operator()(char &ptr) const
+ template<class U>
+ result_type operator()(U &ptr) const
{ return *static_cast<T*>(static_cast<void*>(&ptr)); }
};
-
template<class MultiallocationChain, class T>
class transform_multiallocation_chain
{
-private:
+ private:
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(transform_multiallocation_chain)
MultiallocationChain holder_;
typedef typename MultiallocationChain::void_pointer void_pointer;
typedef typename boost::pointer_to_other
<void_pointer, T>::type pointer;
- transform_multiallocation_chain(transform_multiallocation_chain &);
- transform_multiallocation_chain &operator=(transform_multiallocation_chain &);
-
static pointer cast(void_pointer p)
{
return pointer(static_cast<T*>(containers_detail::get_pointer(p)));
}
-public:
- BOOST_ENABLE_MOVE_EMULATION(transform_multiallocation_chain)
-
- typedef transform_iterator
+ public:
+ typedef transform_iterator
< typename MultiallocationChain::iterator
, containers_detail::cast_functor <T> > iterator;
- transform_multiallocation_chain(void_pointer p1, void_pointer p2, std::size_t n)
- : holder_(p1, p2, n)
- {}
-
transform_multiallocation_chain()
: holder_()
{}
@@ -494,32 +185,32 @@
void swap(transform_multiallocation_chain &other_chain)
{ holder_.swap(other_chain.holder_); }
- /*
- void splice_after(iterator after_this, iterator before_begin, iterator before_end)
- { holder_.splice_after(after_this.base(), before_begin.base(), before_end.base()); }
- */
+
void splice_after(iterator after_this, transform_multiallocation_chain &x, iterator before_begin, iterator before_end, std::size_t n)
{ holder_.splice_after(after_this.base(), x.holder_, before_begin.base(), before_end.base(), n); }
+ void incorporate_after(iterator after_this, void_pointer begin, void_pointer before_end, std::size_t n)
+ { holder_.incorporate_after(after_this.base(), begin, before_end, n); }
+
void pop_front()
{ holder_.pop_front(); }
- pointer front() const
+ pointer front()
{ return cast(holder_.front()); }
bool empty() const
{ return holder_.empty(); }
- iterator before_begin() const
+ iterator before_begin()
{ return iterator(holder_.before_begin()); }
- iterator begin() const
+ iterator begin()
{ return iterator(holder_.begin()); }
- iterator end() const
+ iterator end()
{ return iterator(holder_.end()); }
- iterator last() const
+ iterator last()
{ return iterator(holder_.last()); }
std::size_t size() const
Modified: sandbox/move/boost/container/detail/node_alloc_holder.hpp
==============================================================================
--- sandbox/move/boost/container/detail/node_alloc_holder.hpp (original)
+++ sandbox/move/boost/container/detail/node_alloc_holder.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -60,13 +60,10 @@
void priv_deallocate(allocator_v2)
{ m_alloc.deallocate_one(m_ptr); }
- scoped_deallocator(scoped_deallocator &);
- scoped_deallocator& operator=(scoped_deallocator &);
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(scoped_deallocator)
public:
- BOOST_ENABLE_MOVE_EMULATION(scoped_deallocator)
-
pointer m_ptr;
Allocator& m_alloc;
@@ -180,11 +177,9 @@
typedef allocator_destroyer<NodeAlloc> Destroyer;
private:
- node_alloc_holder(node_alloc_holder&);
- node_alloc_holder & operator=(node_alloc_holder&);
+ BOOST_COPYABLE_AND_MOVABLE(node_alloc_holder)
public:
- BOOST_ENABLE_MOVE_EMULATION(node_alloc_holder)
node_alloc_holder(const ValAlloc &a)
: members_(a)
@@ -198,6 +193,12 @@
: members_(boost::move(other.node_alloc()))
{ this->swap(other); }
+ node_alloc_holder & operator=(BOOST_COPY_ASSIGN_REF(node_alloc_holder) other)
+ { members_.assign(other.node_alloc()); }
+
+ node_alloc_holder & operator=(BOOST_RV_REF(node_alloc_holder) other)
+ { members_.assign(other.node_alloc()); }
+
template<class Pred>
node_alloc_holder(const ValAlloc &a, const Pred &c)
: members_(a, typename ICont::value_compare(c))
@@ -239,12 +240,7 @@
template<class Convertible1, class Convertible2>
static void construct(const NodePtr &ptr,
- #ifdef BOOST_HAS_RVALUE_REFS
- std::pair<Convertible1, Convertible2> &&
- #else
- boost::rv<std::pair<Convertible1, Convertible2> > &
- #endif
- value)
+ BOOST_RV_REF_2_TEMPL_ARGS(std::pair, Convertible1, Convertible2) value)
{
typedef typename Node::hook_type hook_type;
typedef typename Node::value_type::first_type first_type;
@@ -372,7 +368,7 @@
int constructed = 0;
Node *p = 0;
BOOST_TRY{
- for(difference_type i = 0; i < n; ++i, ++beg, --constructed){
+ for(difference_type i = 0; i < n; ++i, ++beg, --constructed){
p = containers_detail::get_pointer(mem.front());
mem.pop_front();
//This can throw
@@ -393,7 +389,6 @@
BOOST_CATCH_END
}
return beg;
-
}
void clear(allocator_v1)
@@ -470,6 +465,13 @@
members_holder(const ConvertibleToAlloc &c2alloc, const Pred &c)
: NodeAlloc(c2alloc), m_icont(c)
{}
+
+ template<class ConvertibleToAlloc>
+ void assign (const ConvertibleToAlloc &c2alloc)
+ {
+ NodeAlloc::operator=(c2alloc);
+ }
+
//The intrusive container
ICont m_icont;
} members_;
Added: sandbox/move/boost/container/detail/node_pool_impl.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/container/detail/node_pool_impl.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,366 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_DETAIL_NODE_POOL_IMPL_HPP
+#define BOOST_CONTAINER_DETAIL_NODE_POOL_IMPL_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/container_fwd.hpp>
+#include <boost/container/detail/workaround.hpp>
+#include <boost/container/detail/utilities.hpp>
+#include <boost/pointer_to_other.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#include <boost/container/detail/math_functions.hpp>
+#include <boost/container/detail/mpl.hpp>
+#include <boost/container/detail/pool_common.hpp>
+#include <cassert>
+#include <cstddef>
+#include <functional> //std::unary_function
+
+namespace boost {
+namespace container {
+namespace containers_detail {
+
+template<class SegmentManagerBase>
+class private_node_pool_impl
+{
+ //Non-copyable
+ private_node_pool_impl();
+ private_node_pool_impl(const private_node_pool_impl &);
+ private_node_pool_impl &operator=(const private_node_pool_impl &);
+
+ //A node object will hold node_t when it's not allocated
+ public:
+ typedef typename SegmentManagerBase::void_pointer void_pointer;
+ typedef typename node_slist<void_pointer>::slist_hook_t slist_hook_t;
+ typedef typename node_slist<void_pointer>::node_t node_t;
+ typedef typename node_slist<void_pointer>::node_slist_t free_nodes_t;
+ typedef typename SegmentManagerBase::multiallocation_chain multiallocation_chain;
+
+ private:
+ typedef typename bi::make_slist
+ < node_t, bi::base_hook<slist_hook_t>
+ , bi::linear<true>
+ , bi::constant_time_size<false> >::type blockslist_t;
+ public:
+
+ //!Segment manager typedef
+ typedef SegmentManagerBase segment_manager_base_type;
+
+ //!Constructor from a segment manager. Never throws
+ private_node_pool_impl(segment_manager_base_type *segment_mngr_base, std::size_t node_size, std::size_t nodes_per_block)
+ : m_nodes_per_block(nodes_per_block)
+ , m_real_node_size(lcm(node_size, std::size_t(alignment_of<node_t>::value)))
+ //General purpose allocator
+ , mp_segment_mngr_base(segment_mngr_base)
+ , m_blocklist()
+ , m_freelist()
+ //Debug node count
+ , m_allocated(0)
+ {}
+
+ //!Destructor. Deallocates all allocated blocks. Never throws
+ ~private_node_pool_impl()
+ { this->purge_blocks(); }
+
+ std::size_t get_real_num_node() const
+ { return m_nodes_per_block; }
+
+ //!Returns the segment manager. Never throws
+ segment_manager_base_type* get_segment_manager_base()const
+ { return containers_detail::get_pointer(mp_segment_mngr_base); }
+
+ void *allocate_node()
+ { return priv_alloc_node(); }
+
+ //!Deallocates an array pointed by ptr. Never throws
+ void deallocate_node(void *ptr)
+ { priv_dealloc_node(ptr); }
+
+ //!Allocates a singly linked list of n nodes ending in null pointer.
+ multiallocation_chain allocate_nodes(const std::size_t n)
+ {
+ //Preallocate all needed blocks to fulfill the request
+ std::size_t cur_nodes = m_freelist.size();
+ if(cur_nodes < n){
+ priv_alloc_block(((n - cur_nodes) - 1)/m_nodes_per_block + 1);
+ }
+
+ //We just iterate the needed nodes to get the last we'll erase
+ typedef typename free_nodes_t::iterator free_iterator;
+ free_iterator before_last_new_it = m_freelist.before_begin();
+ for(std::size_t j = 0; j != n; ++j){
+ ++before_last_new_it;
+ }
+
+ //Cache the first node of the allocated range before erasing
+ free_iterator first_node(m_freelist.begin());
+ free_iterator last_node (before_last_new_it);
+
+ //Erase the range. Since we already have the distance, this is O(1)
+ m_freelist.erase_after( m_freelist.before_begin()
+ , ++free_iterator(before_last_new_it)
+ , n);
+
+ //Now take the last erased node and just splice it in the end
+ //of the intrusive list that will be traversed by the multialloc iterator.
+ multiallocation_chain chain;
+ chain.incorporate_after(chain.before_begin(), &*first_node, &*last_node, n);
+ m_allocated += n;
+ return boost::move(chain);
+ }
+
+ void deallocate_nodes(multiallocation_chain chain)
+ {
+ typedef typename multiallocation_chain::iterator iterator;
+ iterator it(chain.begin()), itend(chain.end());
+ while(it != itend){
+ void *pElem = &*it;
+ ++it;
+ priv_dealloc_node(pElem);
+ }
+ }
+
+ //!Deallocates all the free blocks of memory. Never throws
+ void deallocate_free_blocks()
+ {
+ typedef typename free_nodes_t::iterator nodelist_iterator;
+ typename blockslist_t::iterator bit(m_blocklist.before_begin()),
+ it(m_blocklist.begin()),
+ itend(m_blocklist.end());
+ free_nodes_t backup_list;
+ nodelist_iterator backup_list_last = backup_list.before_begin();
+
+ //Execute the algorithm and get an iterator to the last value
+ std::size_t blocksize = get_rounded_size
+ (m_real_node_size*m_nodes_per_block, alignment_of<node_t>::value);
+
+ while(it != itend){
+ //Collect all the nodes from the block pointed by it
+ //and push them in the list
+ free_nodes_t free_nodes;
+ nodelist_iterator last_it = free_nodes.before_begin();
+ const void *addr = get_block_from_hook(&*it, blocksize);
+
+ m_freelist.remove_and_dispose_if
+ (is_between(addr, blocksize), push_in_list(free_nodes, last_it));
+
+ //If the number of nodes is equal to m_nodes_per_block
+ //this means that the block can be deallocated
+ if(free_nodes.size() == m_nodes_per_block){
+ //Unlink the nodes
+ free_nodes.clear();
+ it = m_blocklist.erase_after(bit);
+ mp_segment_mngr_base->deallocate((void*)addr);
+ }
+ //Otherwise, insert them in the backup list, since the
+ //next "remove_if" does not need to check them again.
+ else{
+ //Assign the iterator to the last value if necessary
+ if(backup_list.empty() && !m_freelist.empty()){
+ backup_list_last = last_it;
+ }
+ //Transfer nodes. This is constant time.
+ backup_list.splice_after
+ ( backup_list.before_begin()
+ , free_nodes
+ , free_nodes.before_begin()
+ , last_it
+ , free_nodes.size());
+ bit = it;
+ ++it;
+ }
+ }
+ //We should have removed all the nodes from the free list
+ assert(m_freelist.empty());
+
+ //Now pass all the node to the free list again
+ m_freelist.splice_after
+ ( m_freelist.before_begin()
+ , backup_list
+ , backup_list.before_begin()
+ , backup_list_last
+ , backup_list.size());
+ }
+
+ std::size_t num_free_nodes()
+ { return m_freelist.size(); }
+
+ //!Deallocates all used memory. Precondition: all nodes allocated from this pool should
+ //!already be deallocated. Otherwise, undefined behaviour. Never throws
+ void purge_blocks()
+ {
+ //check for memory leaks
+ assert(m_allocated==0);
+ std::size_t blocksize = get_rounded_size
+ (m_real_node_size*m_nodes_per_block, alignment_of<node_t>::value);
+ typename blockslist_t::iterator
+ it(m_blocklist.begin()), itend(m_blocklist.end()), aux;
+
+ //We iterate though the NodeBlock list to free the memory
+ while(!m_blocklist.empty()){
+ void *addr = get_block_from_hook(&m_blocklist.front(), blocksize);
+ m_blocklist.pop_front();
+ mp_segment_mngr_base->deallocate((void*)addr);
+ }
+ //Just clear free node list
+ m_freelist.clear();
+ }
+
+ void swap(private_node_pool_impl &other)
+ {
+ assert(m_nodes_per_block == other.m_nodes_per_block);
+ assert(m_real_node_size == other.m_real_node_size);
+ std::swap(mp_segment_mngr_base, other.mp_segment_mngr_base);
+ m_blocklist.swap(other.m_blocklist);
+ m_freelist.swap(other.m_freelist);
+ std::swap(m_allocated, other.m_allocated);
+ }
+
+ private:
+
+ struct push_in_list
+ {
+ push_in_list(free_nodes_t &l, typename free_nodes_t::iterator &it)
+ : slist_(l), last_it_(it)
+ {}
+
+ void operator()(typename free_nodes_t::pointer p) const
+ {
+ slist_.push_front(*p);
+ if(slist_.size() == 1){ //Cache last element
+ ++last_it_ = slist_.begin();
+ }
+ }
+
+ private:
+ free_nodes_t &slist_;
+ typename free_nodes_t::iterator &last_it_;
+ };
+
+ struct is_between
+ : std::unary_function<typename free_nodes_t::value_type, bool>
+ {
+ is_between(const void *addr, std::size_t size)
+ : beg_(static_cast<const char *>(addr)), end_(beg_+size)
+ {}
+
+ bool operator()(typename free_nodes_t::const_reference v) const
+ {
+ return (beg_ <= reinterpret_cast<const char *>(&v) &&
+ end_ > reinterpret_cast<const char *>(&v));
+ }
+ private:
+ const char * beg_;
+ const char * end_;
+ };
+
+ //!Allocates one node, using single segregated storage algorithm.
+ //!Never throws
+ node_t *priv_alloc_node()
+ {
+ //If there are no free nodes we allocate a new block
+ if (m_freelist.empty())
+ priv_alloc_block();
+ //We take the first free node
+ node_t *n = (node_t*)&m_freelist.front();
+ m_freelist.pop_front();
+ ++m_allocated;
+ return n;
+ }
+
+ //!Deallocates one node, using single segregated storage algorithm.
+ //!Never throws
+ void priv_dealloc_node(void *pElem)
+ {
+ //We put the node at the beginning of the free node list
+ node_t * to_deallocate = static_cast<node_t*>(pElem);
+ m_freelist.push_front(*to_deallocate);
+ assert(m_allocated>0);
+ --m_allocated;
+ }
+
+ //!Allocates several blocks of nodes. Can throw
+ void priv_alloc_block(std::size_t num_blocks = 1)
+ {
+ if(!num_blocks)
+ return;
+ std::size_t blocksize =
+ get_rounded_size(m_real_node_size*m_nodes_per_block, alignment_of<node_t>::value);
+
+ try{
+ for(std::size_t i = 0; i != num_blocks; ++i){
+ //We allocate a new NodeBlock and put it as first
+ //element in the free Node list
+ char *pNode = reinterpret_cast<char*>
+ (mp_segment_mngr_base->allocate(blocksize + sizeof(node_t)));
+ char *pBlock = pNode;
+ m_blocklist.push_front(get_block_hook(pBlock, blocksize));
+
+ //We initialize all Nodes in Node Block to insert
+ //them in the free Node list
+ for(std::size_t i = 0; i < m_nodes_per_block; ++i, pNode += m_real_node_size){
+ m_freelist.push_front(*new (pNode) node_t);
+ }
+ }
+ }
+ catch(...){
+ //to-do: if possible, an efficient way to deallocate allocated blocks
+ throw;
+ }
+ }
+
+ //!Deprecated, use deallocate_free_blocks
+ void deallocate_free_chunks()
+ { this->deallocate_free_blocks(); }
+
+ //!Deprecated, use purge_blocks
+ void purge_chunks()
+ { this->purge_blocks(); }
+
+ private:
+ //!Returns a reference to the block hook placed in the end of the block
+ static node_t & get_block_hook (void *block, std::size_t blocksize)
+ {
+ return *reinterpret_cast<node_t*>(reinterpret_cast<char*>(block) + blocksize);
+ }
+
+ //!Returns the starting address of the block reference to the block hook placed in the end of the block
+ void *get_block_from_hook (node_t *hook, std::size_t blocksize)
+ {
+ return (reinterpret_cast<char*>(hook) - blocksize);
+ }
+
+ private:
+ typedef typename boost::pointer_to_other
+ <void_pointer, segment_manager_base_type>::type segment_mngr_base_ptr_t;
+
+ const std::size_t m_nodes_per_block;
+ const std::size_t m_real_node_size;
+ segment_mngr_base_ptr_t mp_segment_mngr_base; //Segment manager
+ blockslist_t m_blocklist; //Intrusive container of blocks
+ free_nodes_t m_freelist; //Intrusive container of free nods
+ std::size_t m_allocated; //Used nodes for debugging
+};
+
+
+} //namespace containers_detail {
+} //namespace container {
+} //namespace boost {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP
Modified: sandbox/move/boost/container/detail/pair.hpp
==============================================================================
--- sandbox/move/boost/container/detail/pair.hpp (original)
+++ sandbox/move/boost/container/detail/pair.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -38,8 +38,10 @@
template <class T1, class T2>
struct pair
{
- BOOST_ENABLE_MOVE_EMULATION(pair)
+ private:
+ BOOST_COPYABLE_AND_MOVABLE(pair)
+ public:
typedef T1 first_type;
typedef T2 second_type;
@@ -118,6 +120,13 @@
#include BOOST_PP_LOCAL_ITERATE()
#endif
+ pair& operator=(BOOST_COPY_ASSIGN_REF(pair) p)
+ {
+ first = p.first;
+ second = p.second;
+ return *this;
+ }
+
pair& operator=(BOOST_RV_REF(pair) p)
{
first = boost::move(p.first);
Added: sandbox/move/boost/container/detail/pool_common.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/container/detail/pool_common.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_DETAIL_NODE_POOL_COMMON_HPP
+#define BOOST_CONTAINER_DETAIL_NODE_POOL_COMMON_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <new>
+
+namespace boost {
+namespace container {
+namespace containers_detail {
+
+template<class VoidPointer>
+struct node_slist
+{
+ //This hook will be used to chain the individual nodes
+ typedef typename bi::make_slist_base_hook
+ <bi::void_pointer<VoidPointer>, bi::link_mode<bi::normal_link> >::type slist_hook_t;
+
+ //A node object will hold node_t when it's not allocated
+ typedef slist_hook_t node_t;
+
+ typedef typename bi::make_slist
+ <node_t, bi::linear<true>, bi::base_hook<slist_hook_t> >::type node_slist_t;
+};
+
+template<class T>
+struct is_stateless_segment_manager
+{
+ static const bool value = false;
+};
+
+} //namespace containers_detail {
+} //namespace container {
+} //namespace boost {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_DETAIL_ADAPTIVE_NODE_POOL_IMPL_HPP
Modified: sandbox/move/boost/container/detail/preprocessor.hpp
==============================================================================
--- sandbox/move/boost/container/detail/preprocessor.hpp (original)
+++ sandbox/move/boost/container/detail/preprocessor.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
Modified: sandbox/move/boost/container/detail/transform_iterator.hpp
==============================================================================
--- sandbox/move/boost/container/detail/transform_iterator.hpp (original)
+++ sandbox/move/boost/container/detail/transform_iterator.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008.
+// (C) Copyright Ion Gaztanaga 2005-2009.
// (C) Copyright Gennaro Prota 2003 - 2004.
//
// Distributed under the Boost Software License, Version 1.0.
Modified: sandbox/move/boost/container/detail/tree.hpp
==============================================================================
--- sandbox/move/boost/container/detail/tree.hpp (original)
+++ sandbox/move/boost/container/detail/tree.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -44,6 +44,7 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
+#include <boost/container/container_fwd.hpp>
#include <boost/move/move.hpp>
#include <boost/pointer_to_other.hpp>
@@ -297,9 +298,9 @@
AllocHolder &m_holder;
Icont &m_icont;
};
+ BOOST_COPYABLE_AND_MOVABLE(rbtree)
public:
- BOOST_ENABLE_MOVE_EMULATION(rbtree)
typedef Key key_type;
typedef Value value_type;
@@ -451,6 +452,15 @@
priv_create_and_insert_nodes(first, last, unique_insertion, alloc_version(), ItCat());
}
+ template <class InputIterator>
+ rbtree( ordered_range_t, InputIterator first, InputIterator last
+ , const key_compare& comp = key_compare(), const allocator_type& a = allocator_type())
+ : AllocHolder(a, comp)
+ {
+ typedef typename std::iterator_traits<InputIterator>::iterator_category ItCat;
+ priv_create_and_insert_ordered_nodes(first, last, alloc_version(), ItCat());
+ }
+
rbtree(const rbtree& x)
: AllocHolder(x, x.key_comp())
{
@@ -465,7 +475,7 @@
~rbtree()
{} //AllocHolder clears the tree
- rbtree& operator=(const rbtree& x)
+ rbtree& operator=(BOOST_COPY_ASSIGN_REF(rbtree) x)
{
if (this != &x) {
//Transfer all the nodes to a temporary tree
@@ -873,14 +883,6 @@
//Iterator range version
template<class InpIterator>
void priv_create_and_insert_nodes
- (InpIterator beg, InpIterator end, bool unique)
- {
- typedef typename std::iterator_traits<InpIterator>::iterator_category ItCat;
- priv_create_and_insert_nodes(beg, end, unique, alloc_version(), ItCat());
- }
-
- template<class InpIterator>
- void priv_create_and_insert_nodes
(InpIterator beg, InpIterator end, bool unique, allocator_v1, std::input_iterator_tag)
{
if(unique){
@@ -934,6 +936,52 @@
}
}
}
+
+ //Iterator range version
+ template<class InpIterator>
+ void priv_create_and_insert_ordered_nodes
+ (InpIterator beg, InpIterator end, allocator_v1, std::input_iterator_tag)
+ {
+ const_iterator cend_n(this->cend());
+ for (; beg != end; ++beg){
+ this->insert_before(cend_n, *beg);
+ }
+ }
+
+ template<class InpIterator>
+ void priv_create_and_insert_ordered_nodes
+ (InpIterator beg, InpIterator end, allocator_v2, std::input_iterator_tag)
+ { //Just forward to the default one
+ priv_create_and_insert_ordered_nodes(beg, end, allocator_v1(), std::input_iterator_tag());
+ }
+
+ class back_insertion_functor;
+ friend class back_insertion_functor;
+
+ class back_insertion_functor
+ {
+ Icont &icont_;
+
+ public:
+ back_insertion_functor(Icont &icont)
+ : icont_(icont)
+ {}
+
+ void operator()(Node &n)
+ { this->icont_.push_back(n); }
+ };
+
+
+ template<class FwdIterator>
+ void priv_create_and_insert_ordered_nodes
+ (FwdIterator beg, FwdIterator end, allocator_v2, std::forward_iterator_tag)
+ {
+ if(beg != end){
+ //Optimized allocation and construction
+ this->allocate_many_and_construct
+ (beg, std::distance(beg, end), back_insertion_functor(this->icont()));
+ }
+ }
};
template <class Key, class Value, class KeyOfValue,
Modified: sandbox/move/boost/container/detail/type_traits.hpp
==============================================================================
--- sandbox/move/boost/container/detail/type_traits.hpp (original)
+++ sandbox/move/boost/container/detail/type_traits.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
// (C) Copyright John Maddock 2000.
-// (C) Copyright Ion Gaztanaga 2005-2008.
+// (C) Copyright Ion Gaztanaga 2005-2009.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
Modified: sandbox/move/boost/container/detail/utilities.hpp
==============================================================================
--- sandbox/move/boost/container/detail/utilities.hpp (original)
+++ sandbox/move/boost/container/detail/utilities.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -79,6 +79,12 @@
swap(x, y);
}
+//Rounds "orig_size" by excess to round_to bytes
+inline std::size_t get_rounded_size(std::size_t orig_size, std::size_t round_to)
+{
+ return ((orig_size-1)/round_to+1)*round_to;
+}
+
template <std::size_t OrigSize, std::size_t RoundTo>
struct ct_rounded_size
{
Modified: sandbox/move/boost/container/detail/variadic_templates_tools.hpp
==============================================================================
--- sandbox/move/boost/container/detail/variadic_templates_tools.hpp (original)
+++ sandbox/move/boost/container/detail/variadic_templates_tools.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2008-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2008-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
Modified: sandbox/move/boost/container/detail/version_type.hpp
==============================================================================
--- sandbox/move/boost/container/detail/version_type.hpp (original)
+++ sandbox/move/boost/container/detail/version_type.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
Modified: sandbox/move/boost/container/detail/workaround.hpp
==============================================================================
--- sandbox/move/boost/container/detail/workaround.hpp (original)
+++ sandbox/move/boost/container/detail/workaround.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -14,7 +14,7 @@
#include <boost/container/detail/config_begin.hpp>
#if defined(BOOST_HAS_RVALUE_REFS) && defined(BOOST_HAS_VARIADIC_TMPL)\
- && !defined(BOOST_CONTAINER_DISABLE_VARIADIC_TMPL)
+ && !defined(BOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL)
#define BOOST_CONTAINERS_PERFECT_FORWARDING
#endif
Modified: sandbox/move/boost/container/flat_map.hpp
==============================================================================
--- sandbox/move/boost/container/flat_map.hpp (original)
+++ sandbox/move/boost/container/flat_map.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -18,7 +18,7 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <utility>
#include <functional>
#include <memory>
@@ -77,6 +77,7 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(flat_map)
//This is the tree that we should store if pair was movable
typedef containers_detail::flat_tree<Key,
std::pair<Key, T>,
@@ -119,7 +120,6 @@
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(flat_map)
// typedefs:
typedef typename tree_t::key_type key_type;
@@ -158,6 +158,20 @@
: m_flat_tree(comp, force<impl_allocator_type>(a))
{ m_flat_tree.insert_unique(first, last); }
+ //! <b>Effects</b>: Constructs an empty flat_map using the specified comparison object and
+ //! allocator, and inserts elements from the ordered unique range [first ,last). This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
+ //! unique values.
+ //!
+ //! <b>Complexity</b>: Linear in N.
+ template <class InputIterator>
+ flat_map( ordered_unique_range_t, InputIterator first, InputIterator last
+ , const Pred& comp = Pred(), const allocator_type& a = allocator_type())
+ : m_flat_tree(ordered_range, first, last, comp, a)
+ {}
+
//! <b>Effects</b>: Copy constructs a flat_map.
//!
//! <b>Complexity</b>: Linear in x.size().
@@ -177,8 +191,8 @@
//! <b>Effects</b>: Makes *this a copy of x.
//!
//! <b>Complexity</b>: Linear in x.size().
- flat_map<Key,T,Pred,Alloc>& operator=(const flat_map<Key, T, Pred, Alloc>& x)
- { m_flat_tree = x.m_flat_tree; return *this; }
+ flat_map<Key,T,Pred,Alloc>& operator=(BOOST_COPY_ASSIGN_REF(flat_map) x)
+ { m_flat_tree = x.m_flat_tree; return *this; }
//! <b>Effects</b>: Move constructs a flat_map.
//! Constructs *this using x's resources.
@@ -796,6 +810,7 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(flat_multimap)
typedef containers_detail::flat_tree<Key,
std::pair<Key, T>,
containers_detail::select1st< std::pair<Key, T> >,
@@ -835,7 +850,6 @@
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(flat_multimap)
// typedefs:
typedef typename tree_t::key_type key_type;
@@ -876,6 +890,20 @@
: m_flat_tree(comp, force<impl_allocator_type>(a))
{ m_flat_tree.insert_equal(first, last); }
+ //! <b>Effects</b>: Constructs an empty flat_multimap using the specified comparison object and
+ //! allocator, and inserts elements from the ordered range [first ,last). This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
+ //!
+ //! <b>Complexity</b>: Linear in N.
+ template <class InputIterator>
+ flat_multimap(ordered_range_t, InputIterator first, InputIterator last,
+ const Pred& comp = Pred(),
+ const allocator_type& a = allocator_type())
+ : m_flat_tree(ordered_range, first, last, comp, a)
+ {}
+
//! <b>Effects</b>: Copy constructs a flat_multimap.
//!
//! <b>Complexity</b>: Linear in x.size().
@@ -894,7 +922,7 @@
//! <b>Effects</b>: Makes *this a copy of x.
//!
//! <b>Complexity</b>: Linear in x.size().
- flat_multimap<Key,T,Pred,Alloc>& operator=(const flat_multimap<Key,T,Pred,Alloc>& x)
+ flat_multimap<Key,T,Pred,Alloc>& operator=(BOOST_COPY_ASSIGN_REF(flat_multimap) x)
{ m_flat_tree = x.m_flat_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
@@ -1361,10 +1389,12 @@
inline void swap(flat_multimap<Key,T,Pred,Alloc>& x, flat_multimap<Key,T,Pred,Alloc>& y)
{ x.swap(y); }
-}
+}}
/// @cond
+namespace boost {
+
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class K, class T, class C, class A>
@@ -1373,9 +1403,9 @@
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
-/// @endcond
+} //namespace boost {
-}
+/// @endcond
#include <boost/container/detail/config_end.hpp>
Modified: sandbox/move/boost/container/flat_set.hpp
==============================================================================
--- sandbox/move/boost/container/flat_set.hpp (original)
+++ sandbox/move/boost/container/flat_set.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -18,7 +18,7 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <utility>
#include <functional>
#include <memory>
@@ -65,12 +65,12 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(flat_set)
typedef containers_detail::flat_tree<T, T, containers_detail::identity<T>, Pred, Alloc> tree_t;
tree_t m_flat_tree; // flat tree representing flat_set
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(flat_set)
// typedefs:
typedef typename tree_t::key_type key_type;
@@ -111,6 +111,21 @@
: m_flat_tree(comp, a)
{ m_flat_tree.insert_unique(first, last); }
+ //! <b>Effects</b>: Constructs an empty flat_set using the specified comparison object and
+ //! allocator, and inserts elements from the ordered unique range [first ,last). This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
+ //! unique values.
+ //!
+ //! <b>Complexity</b>: Linear in N.
+ template <class InputIterator>
+ flat_set(ordered_unique_range_t, InputIterator first, InputIterator last,
+ const Pred& comp = Pred(),
+ const allocator_type& a = allocator_type())
+ : m_flat_tree(ordered_range, first, last, comp, a)
+ {}
+
//! <b>Effects</b>: Copy constructs a map.
//!
//! <b>Complexity</b>: Linear in x.size().
@@ -129,7 +144,7 @@
//! <b>Effects</b>: Makes *this a copy of x.
//!
//! <b>Complexity</b>: Linear in x.size().
- flat_set<T,Pred,Alloc>& operator=(const flat_set<T, Pred, Alloc>& x)
+ flat_set<T,Pred,Alloc>& operator=(BOOST_COPY_ASSIGN_REF(flat_set) x)
{ m_flat_tree = x.m_flat_tree; return *this; }
//! <b>Effects</b>: Makes *this a copy of x.
@@ -643,13 +658,12 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(flat_multiset)
typedef containers_detail::flat_tree<T, T, containers_detail::identity<T>, Pred, Alloc> tree_t;
tree_t m_flat_tree; // flat tree representing flat_multiset
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(flat_multiset)
-
// typedefs:
typedef typename tree_t::key_type key_type;
typedef typename tree_t::value_type value_type;
@@ -680,6 +694,20 @@
: m_flat_tree(comp, a)
{ m_flat_tree.insert_equal(first, last); }
+ //! <b>Effects</b>: Constructs an empty flat_multiset using the specified comparison object and
+ //! allocator, and inserts elements from the ordered range [first ,last ). This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
+ //!
+ //! <b>Complexity</b>: Linear in N.
+ template <class InputIterator>
+ flat_multiset(ordered_range_t, InputIterator first, InputIterator last,
+ const Pred& comp = Pred(),
+ const allocator_type& a = allocator_type())
+ : m_flat_tree(ordered_range, first, last, comp, a)
+ {}
+
flat_multiset(const flat_multiset<T,Pred,Alloc>& x)
: m_flat_tree(x.m_flat_tree) {}
@@ -687,7 +715,7 @@
: m_flat_tree(boost::move(x.m_flat_tree))
{}
- flat_multiset<T,Pred,Alloc>& operator=(const flat_multiset<T,Pred,Alloc>& x)
+ flat_multiset<T,Pred,Alloc>& operator=(BOOST_COPY_ASSIGN_REF(flat_multiset) x)
{ m_flat_tree = x.m_flat_tree; return *this; }
flat_multiset<T,Pred,Alloc>& operator=(BOOST_RV_REF(flat_multiset) mx)
@@ -1141,10 +1169,10 @@
inline void swap(flat_multiset<T,Pred,Alloc>& x, flat_multiset<T,Pred,Alloc>& y)
{ x.swap(y); }
-} //namespace container {
-
/// @cond
+} //namespace container {
+
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class C, class A>
@@ -1153,9 +1181,11 @@
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
+namespace container {
+
/// @endcond
-}
+}}
#include <boost/container/detail/config_end.hpp>
Modified: sandbox/move/boost/container/list.hpp
==============================================================================
--- sandbox/move/boost/container/list.hpp (original)
+++ sandbox/move/boost/container/list.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -49,7 +49,7 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <boost/container/detail/version_type.hpp>
#include <boost/move/move.hpp>
#include <boost/pointer_to_other.hpp>
@@ -60,11 +60,13 @@
#include <boost/intrusive/list.hpp>
#include <boost/container/detail/node_alloc_holder.hpp>
-#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
+#if defined(BOOST_CONTAINERS_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+#else
//Preprocessor library to emulate perfect forwarding
#include <boost/container/detail/preprocessor.hpp>
#endif
+#include <stdexcept>
#include <iterator>
#include <utility>
#include <memory>
@@ -95,7 +97,18 @@
: public list_hook<VoidPointer>::type
{
- #ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
+ #if defined(BOOST_CONTAINERS_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ list_node()
+ : m_data()
+ {}
+
+ template<class ...Args>
+ list_node(Args &&...args)
+ : m_data(boost::forward<Args>(args)...)
+ {}
+
+ #else //#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
list_node()
: m_data()
@@ -110,12 +123,6 @@
#define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINERS_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
- #else //#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
-
- template<class ...Args>
- list_node(Args &&...args)
- : m_data(boost::forward<Args>(args)...)
- {}
#endif//#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
T m_data;
@@ -222,6 +229,7 @@
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(list)
typedef difference_type list_difference_type;
typedef pointer list_pointer;
typedef const_pointer list_const_pointer;
@@ -230,8 +238,6 @@
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(list)
-
//! Const iterator used to iterate through a list.
class const_iterator
/// @cond
@@ -724,7 +730,7 @@
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the number of elements in x.
- ThisType& operator=(const ThisType& x)
+ ThisType& operator=(BOOST_COPY_ASSIGN_REF(ThisType) x)
{
if (this != &x) {
this->assign(x.begin(), x.end());
@@ -1345,10 +1351,10 @@
x.swap(y);
}
-} //namespace container {
-
/// @cond
+} //namespace container {
+
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class A>
@@ -1357,9 +1363,11 @@
static const bool value = has_trivial_destructor<A>::value;
};
+namespace container {
+
/// @endcond
-}
+}}
#include <boost/container/detail/config_end.hpp>
Modified: sandbox/move/boost/container/map.hpp
==============================================================================
--- sandbox/move/boost/container/map.hpp (original)
+++ sandbox/move/boost/container/map.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -50,7 +50,7 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <utility>
#include <functional>
#include <memory>
@@ -99,6 +99,7 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(map)
typedef containers_detail::rbtree<Key,
std::pair<const Key, T>,
containers_detail::select1st< std::pair<const Key, T> >,
@@ -108,7 +109,6 @@
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(map)
// typedefs:
typedef typename tree_t::key_type key_type;
@@ -167,6 +167,20 @@
: m_tree(first, last, comp, a, true)
{}
+ //! <b>Effects</b>: Constructs an empty map using the specified comparison object and
+ //! allocator, and inserts elements from the ordered unique range [first ,last). This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
+ //! unique values.
+ //!
+ //! <b>Complexity</b>: Linear in N.
+ template <class InputIterator>
+ map( ordered_unique_range_t, InputIterator first, InputIterator last
+ , const Pred& comp = Pred(), const allocator_type& a = allocator_type())
+ : m_tree(ordered_range, first, last, comp, a)
+ {}
+
//! <b>Effects</b>: Copy constructs a map.
//!
//! <b>Complexity</b>: Linear in x.size().
@@ -186,7 +200,7 @@
//! <b>Effects</b>: Makes *this a copy of x.
//!
//! <b>Complexity</b>: Linear in x.size().
- map& operator=(const map<Key, T, Pred, Alloc>& x)
+ map& operator=(BOOST_COPY_ASSIGN_REF(map) x)
{ m_tree = x.m_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
@@ -738,6 +752,7 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(multimap)
typedef containers_detail::rbtree<Key,
std::pair<const Key, T>,
containers_detail::select1st< std::pair<const Key, T> >,
@@ -747,7 +762,6 @@
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(multimap)
// typedefs:
typedef typename tree_t::key_type key_type;
@@ -807,6 +821,20 @@
: m_tree(first, last, comp, a, false)
{}
+ //! <b>Effects</b>: Constructs an empty multimap using the specified comparison object and
+ //! allocator, and inserts elements from the ordered range [first ,last). This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
+ //!
+ //! <b>Complexity</b>: Linear in N.
+ template <class InputIterator>
+ multimap(ordered_range_t ordered_range, InputIterator first, InputIterator last, const Pred& comp = Pred(),
+ const allocator_type& a = allocator_type())
+ : m_tree(ordered_range, first, last, comp, a)
+ {}
+
+
//! <b>Effects</b>: Copy constructs a multimap.
//!
//! <b>Complexity</b>: Linear in x.size().
@@ -826,7 +854,7 @@
//! <b>Effects</b>: Makes *this a copy of x.
//!
//! <b>Complexity</b>: Linear in x.size().
- multimap& operator=(const multimap<Key,T,Pred,Alloc>& x)
+ multimap& operator=(BOOST_COPY_ASSIGN_REF(multimap) x)
{ m_tree = x.m_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
@@ -1234,10 +1262,10 @@
inline void swap(multimap<Key,T,Pred,Alloc>& x, multimap<Key,T,Pred,Alloc>& y)
{ x.swap(y); }
-} //namespace container {
-
/// @cond
+} //namespace container {
+
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class K, class T, class C, class A>
@@ -1246,9 +1274,11 @@
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
+namespace container {
+
/// @endcond
-}
+}}
#include <boost/container/detail/config_end.hpp>
Modified: sandbox/move/boost/container/set.hpp
==============================================================================
--- sandbox/move/boost/container/set.hpp (original)
+++ sandbox/move/boost/container/set.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -49,7 +49,7 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <utility>
#include <functional>
@@ -94,13 +94,13 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(set)
typedef containers_detail::rbtree<T, T,
containers_detail::identity<T>, Pred, Alloc> tree_t;
tree_t m_tree; // red-black tree representing set
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(set)
// typedefs:
typedef typename tree_t::key_type key_type;
@@ -140,6 +140,20 @@
: m_tree(first, last, comp, a, true)
{}
+ //! <b>Effects</b>: Constructs an empty set using the specified comparison object and
+ //! allocator, and inserts elements from the ordered unique range [first ,last). This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate and must be
+ //! unique values.
+ //!
+ //! <b>Complexity</b>: Linear in N.
+ template <class InputIterator>
+ set( ordered_unique_range_t, InputIterator first, InputIterator last
+ , const Pred& comp = Pred(), const allocator_type& a = allocator_type())
+ : m_tree(ordered_range, first, last, comp, a)
+ {}
+
//! <b>Effects</b>: Copy constructs a set.
//!
//! <b>Complexity</b>: Linear in x.size().
@@ -159,7 +173,7 @@
//! <b>Effects</b>: Makes *this a copy of x.
//!
//! <b>Complexity</b>: Linear in x.size().
- set<T,Pred,Alloc>& operator=(const set<T, Pred, Alloc>& x)
+ set& operator=(BOOST_COPY_ASSIGN_REF(set) x)
{ m_tree = x.m_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
@@ -610,13 +624,13 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(multiset)
typedef containers_detail::rbtree<T, T,
containers_detail::identity<T>, Pred, Alloc> tree_t;
tree_t m_tree; // red-black tree representing multiset
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(multiset)
// typedefs:
typedef typename tree_t::key_type key_type;
@@ -657,6 +671,20 @@
: m_tree(first, last, comp, a, false)
{}
+ //! <b>Effects</b>: Constructs an empty multiset using the specified comparison object and
+ //! allocator, and inserts elements from the ordered range [first ,last ). This function
+ //! is more efficient than the normal range creation for ordered ranges.
+ //!
+ //! <b>Requires</b>: [first ,last) must be ordered according to the predicate.
+ //!
+ //! <b>Complexity</b>: Linear in N.
+ template <class InputIterator>
+ multiset( ordered_range_t ordered_range, InputIterator first, InputIterator last
+ , const Pred& comp = Pred()
+ , const allocator_type& a = allocator_type())
+ : m_tree(ordered_range, first, last, comp, a)
+ {}
+
//! <b>Effects</b>: Copy constructs a multiset.
//!
//! <b>Complexity</b>: Linear in x.size().
@@ -676,7 +704,7 @@
//! <b>Effects</b>: Makes *this a copy of x.
//!
//! <b>Complexity</b>: Linear in x.size().
- multiset<T,Pred,Alloc>& operator=(const multiset& x)
+ multiset& operator=(BOOST_COPY_ASSIGN_REF(multiset) x)
{ m_tree = x.m_tree; return *this; }
//! <b>Effects</b>: this->swap(x.get()).
@@ -1080,10 +1108,10 @@
inline void swap(multiset<T,Pred,Alloc>& x, multiset<T,Pred,Alloc>& y)
{ x.swap(y); }
-} //namespace container {
-
/// @cond
+} //namespace container {
+
//!has_trivial_destructor_after_move<> == true_type
//!specialization for optimizations
template <class T, class C, class A>
@@ -1092,9 +1120,11 @@
static const bool value = has_trivial_destructor<A>::value && has_trivial_destructor<C>::value;
};
+namespace container {
+
/// @endcond
-}
+}}
#include <boost/container/detail/config_end.hpp>
Modified: sandbox/move/boost/container/slist.hpp
==============================================================================
--- sandbox/move/boost/container/slist.hpp (original)
+++ sandbox/move/boost/container/slist.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2004-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2004-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -8,7 +8,7 @@
//
//////////////////////////////////////////////////////////////////////////////
//
-// This file comes from SGI's stl_slist.h file. Modified by Ion Gaztanaga 2004-2008
+// This file comes from SGI's stl_slist.h file. Modified by Ion Gaztanaga 2004-2009
// Renaming, isolating and porting to generic algorithms. Pointer typedef
// set to allocator::pointer to allow placing it in shared memory.
//
@@ -50,7 +50,7 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <boost/move/move.hpp>
#include <boost/pointer_to_other.hpp>
#include <boost/container/detail/utilities.hpp>
@@ -61,11 +61,13 @@
#include <boost/intrusive/slist.hpp>
-#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
+#if defined(BOOST_CONTAINERS_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//Preprocessor library to emulate perfect forwarding
+#else
#include <boost/container/detail/preprocessor.hpp>
#endif
+#include <stdexcept>
#include <iterator>
#include <utility>
#include <memory>
@@ -95,7 +97,18 @@
struct slist_node
: public slist_hook<VoidPointer>::type
{
- #ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
+ #if defined(BOOST_CONTAINERS_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ slist_node()
+ : m_data()
+ {}
+
+ template<class ...Args>
+ slist_node(Args &&...args)
+ : m_data(boost::forward<Args>(args)...)
+ {}
+
+ #else //#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
slist_node()
: m_data()
@@ -110,17 +123,7 @@
#define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINERS_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
- #else //#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
-
- slist_node()
- : m_data()
- {}
-
- template<class ...Args>
- slist_node(Args &&...args)
- : m_data(boost::forward<Args>(args)...)
- {}
- #endif//#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
+ #endif//#ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
T m_data;
};
@@ -249,6 +252,7 @@
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(slist)
typedef difference_type list_difference_type;
typedef pointer list_pointer;
typedef const_pointer list_const_pointer;
@@ -257,7 +261,6 @@
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(slist)
//! Const iterator used to iterate through a list.
class const_iterator
@@ -411,7 +414,7 @@
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the number of elements in x.
- slist& operator= (const slist& x)
+ slist& operator= (BOOST_COPY_ASSIGN_REF(slist) x)
{
if (&x != this){
this->assign(x.begin(), x.end());
@@ -1470,10 +1473,12 @@
static const bool value = has_trivial_destructor<A>::value;
};
-} //namespace boost{
+namespace container {
/// @endcond
+}} //namespace boost{ namespace container {
+
// Specialization of insert_iterator so that insertions will be constant
// time rather than linear time.
Modified: sandbox/move/boost/container/stable_vector.hpp
==============================================================================
--- sandbox/move/boost/container/stable_vector.hpp (original)
+++ sandbox/move/boost/container/stable_vector.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,3 +1,12 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2008-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
/* Stable vector.
*
* Copyright 2008 Joaquin M Lopez Munoz.
@@ -6,11 +15,16 @@
* http://www.boost.org/LICENSE_1_0.txt)
*/
-#ifndef STABLE_VECTOR_HPP_3A7EB5C0_55BF_11DD_AE16_0800200C9A66
-#define STABLE_VECTOR_HPP_3A7EB5C0_55BF_11DD_AE16_0800200C9A66
+#ifndef BOOST_CONTAINER_STABLE_VECTOR_HPP
+#define BOOST_CONTAINER_STABLE_VECTOR_HPP
-#include <algorithm>
-#include <stdexcept>
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+#include <boost/container/container_fwd.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/not.hpp>
#include <boost/noncopyable.hpp>
@@ -18,10 +32,17 @@
#include <boost/container/detail/version_type.hpp>
#include <boost/container/detail/multiallocation_chain.hpp>
#include <boost/container/detail/utilities.hpp>
+#include <boost/container/detail/iterators.hpp>
#include <boost/container/detail/algorithms.hpp>
#include <boost/pointer_to_other.hpp>
#include <boost/get_pointer.hpp>
+#include <algorithm>
+#include <stdexcept>
+#include <memory>
+
+///@cond
+
#define STABLE_VECTOR_USE_CONTAINERS_VECTOR
#if defined (STABLE_VECTOR_USE_CONTAINERS_VECTOR)
@@ -36,15 +57,12 @@
#include <boost/assert.hpp>
#endif
-#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
-namespace boost {
-namespace container {
-#else
+///@endcond
+
namespace boost {
namespace container {
-#endif
-/// @cond
+///@cond
namespace stable_vector_detail{
@@ -96,104 +114,6 @@
bool do_clear_;
};
-template <class T, class Difference = std::ptrdiff_t>
-class constant_iterator
- : public std::iterator
- <std::random_access_iterator_tag, T, Difference, const T*, const T &>
-{
- typedef constant_iterator<T, Difference> this_type;
-
- public:
- explicit constant_iterator(const T &ref, Difference range_size)
- : m_ptr(&ref), m_num(range_size){}
-
- //Constructors
- constant_iterator()
- : m_ptr(0), m_num(0){}
-
- constant_iterator& operator++()
- { increment(); return *this; }
-
- constant_iterator operator++(int)
- {
- constant_iterator result (*this);
- increment();
- return result;
- }
-
- friend bool operator== (const constant_iterator& i, const constant_iterator& i2)
- { return i.equal(i2); }
-
- friend bool operator!= (const constant_iterator& i, const constant_iterator& i2)
- { return !(i == i2); }
-
- friend bool operator< (const constant_iterator& i, const constant_iterator& i2)
- { return i.less(i2); }
-
- friend bool operator> (const constant_iterator& i, const constant_iterator& i2)
- { return i2 < i; }
-
- friend bool operator<= (const constant_iterator& i, const constant_iterator& i2)
- { return !(i > i2); }
-
- friend bool operator>= (const constant_iterator& i, const constant_iterator& i2)
- { return !(i < i2); }
-
- friend Difference operator- (const constant_iterator& i, const constant_iterator& i2)
- { return i2.distance_to(i); }
-
- //Arithmetic
- constant_iterator& operator+=(Difference off)
- { this->advance(off); return *this; }
-
- constant_iterator operator+(Difference off) const
- {
- constant_iterator other(*this);
- other.advance(off);
- return other;
- }
-
- friend constant_iterator operator+(Difference off, const constant_iterator& right)
- { return right + off; }
-
- constant_iterator& operator-=(Difference off)
- { this->advance(-off); return *this; }
-
- constant_iterator operator-(Difference off) const
- { return *this + (-off); }
-
- const T& operator*() const
- { return dereference(); }
-
- const T* operator->() const
- { return &(dereference()); }
-
- private:
- const T * m_ptr;
- Difference m_num;
-
- void increment()
- { --m_num; }
-
- void decrement()
- { ++m_num; }
-
- bool equal(const this_type &other) const
- { return m_num == other.m_num; }
-
- bool less(const this_type &other) const
- { return other.m_num < m_num; }
-
- const T & dereference() const
- { return *m_ptr; }
-
- void advance(Difference n)
- { m_num -= n; }
-
- Difference distance_to(const this_type &other)const
- { return m_num - other.m_num; }
-};
-
template<class VoidPtr>
struct node_type_base
{/*
@@ -212,7 +132,18 @@
struct node_type
: public node_type_base<VoidPointer>
{
- #ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
+ #if defined(BOOST_CONTAINERS_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
+
+ node_type()
+ : value()
+ {}
+
+ template<class ...Args>
+ node_type(Args &&...args)
+ : value(boost::forward<Args>(args)...)
+ {}
+
+ #else //BOOST_CONTAINERS_PERFECT_FORWARDING
node_type()
: value()
@@ -227,17 +158,7 @@
#define BOOST_PP_LOCAL_LIMITS (1, BOOST_CONTAINERS_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
- #else //#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
-
- node_type()
- : value()
- {}
-
- template<class ...Args>
- node_type(Args &&...args)
- : value(boost::forward<Args>(args)...)
- {}
- #endif//#ifndef BOOST_CONTAINERS_PERFECT_FORWARDING
+ #endif//BOOST_CONTAINERS_PERFECT_FORWARDING
void set_pointer(VoidPointer p)
{ node_type_base<VoidPointer>::set_pointer(p); }
@@ -265,12 +186,12 @@
friend class iterator<T, const T, typename boost::pointer_to_other<Pointer, T>::type>;
public:
- typedef std::random_access_iterator_tag iterator_category;
- typedef Value value_type;
- typedef typename std::iterator_traits
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef Value value_type;
+ typedef typename std::iterator_traits
<Pointer>::difference_type difference_type;
- typedef Pointer pointer;
- typedef Value & reference;
+ typedef Pointer pointer;
+ typedef Value & reference;
iterator()
{}
@@ -393,18 +314,6 @@
node_type_ptr_t pn;
};
-/*
-class node_access
-{
- public:
- template<typename T, typename Value, typename VoidPointer>
- static typename iterator<T, Value, VoidPointer>::node_type_t* get(const iterator<T,Value,VoidPointer>& it)
- {
- return stable_vector_detail::get_pointer(it.pn);
- }
-};
-*/
-
template<class Allocator, unsigned int Version>
struct select_multiallocation_chain
{
@@ -415,10 +324,9 @@
struct select_multiallocation_chain<Allocator, 1>
{
typedef typename Allocator::template
- rebind<void>::other::pointer void_ptr;
- typedef containers_detail::basic_multiallocation_cached_slist<void_ptr> multialloc_cached;
- typedef containers_detail::basic_multiallocation_cached_counted_slist
- <multialloc_cached> multialloc_cached_counted;
+ rebind<void>::other::pointer void_ptr;
+ typedef containers_detail::basic_multiallocation_chain
+ <void_ptr> multialloc_cached_counted;
typedef boost::container::containers_detail::transform_multiallocation_chain
<multialloc_cached_counted, typename Allocator::value_type> type;
};
@@ -438,7 +346,32 @@
/// @endcond
-template<typename T,typename Allocator=std::allocator<T> >
+//!Help taken from ( Introducing stable_vector)
+//!
+//!We present stable_vector, a fully STL-compliant stable container that provides
+//!most of the features of std::vector except element contiguity.
+//!
+//!General properties: stable_vector satisfies all the requirements of a container,
+//!a reversible container and a sequence and provides all the optional operations
+//!present in std::vector. Like std::vector, iterators are random access.
+//!stable_vector does not provide element contiguity; in exchange for this absence,
+//!the container is stable, i.e. references and iterators to an element of a stable_vector
+//!remain valid as long as the element is not erased, and an iterator that has been
+//!assigned the return value of end() always remain valid until the destruction of
+//!the associated stable_vector.
+//!
+//!Operation complexity: The big-O complexities of stable_vector operations match
+//!exactly those of std::vector. In general, insertion/deletion is constant time at
+//!the end of the sequence and linear elsewhere. Unlike std::vector, stable_vector
+//!does not internally perform any value_type destruction, copy or assignment
+//!operations other than those exactly corresponding to the insertion of new
+//!elements or deletion of stored elements, which can sometimes compensate in terms
+//!of performance for the extra burden of doing more pointer manipulation and an
+//!additional allocation per element.
+//!
+//!Exception safety: As stable_vector does not internally copy elements around, some
+//!operations provide stronger exception safety guarantees than in std::vector:
+template<typename T, typename Allocator>
class stable_vector
{
typedef typename Allocator::template
@@ -515,6 +448,7 @@
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
private:
+ BOOST_COPYABLE_AND_MOVABLE(stable_vector)
static const size_type ExtraPointers = 3;
typedef typename stable_vector_detail::
select_multiallocation_chain
@@ -523,7 +457,6 @@
>::type multiallocation_chain;
public:
- BOOST_ENABLE_MOVE_EMULATION(stable_vector)
// construct/copy/destroy:
explicit stable_vector(const Allocator& al=Allocator())
@@ -533,7 +466,7 @@
}
explicit stable_vector(size_type n)
- : internal_data(Allocator()), impl(allocator_type())
+ : internal_data(Allocator()),impl(Allocator())
{
stable_vector_detail::clear_on_destroy<stable_vector> cod(*this);
this->resize(n);
@@ -579,7 +512,7 @@
clear_pool();
}
- stable_vector& operator=(const stable_vector &x)
+ stable_vector& operator=(BOOST_COPY_ASSIGN_REF(stable_vector) x)
{
STABLE_VECTOR_CHECK_INVARIANT;
if (this != &x) {
@@ -605,7 +538,7 @@
void assign(size_type n,const T& t)
{
- typedef stable_vector_detail::constant_iterator<value_type, difference_type> cvalue_iterator;
+ typedef constant_iterator<value_type, difference_type> cvalue_iterator;
return assign_dispatch(cvalue_iterator(t, n), cvalue_iterator(), boost::mpl::false_());
}
@@ -697,99 +630,6 @@
}
}
- void clear_pool(allocator_v1)
- {
- if(!impl.empty() && impl.back()){
- void_ptr &p1 = *(impl.end()-2);
- void_ptr &p2 = impl.back();
-
- multiallocation_chain holder(p1, p2, this->internal_data.pool_size);
- while(!holder.empty()){
- node_type_ptr_t n = holder.front();
- holder.pop_front();
- this->deallocate_one(n);
- }
- p1 = p2 = 0;
- this->internal_data.pool_size = 0;
- }
- }
-
- void clear_pool(allocator_v2)
- {
-
- if(!impl.empty() && impl.back()){
- void_ptr &p1 = *(impl.end()-2);
- void_ptr &p2 = impl.back();
- multiallocation_chain holder(p1, p2, this->internal_data.pool_size);
- get_al().deallocate_individual(boost::move(holder));
- p1 = p2 = 0;
- this->internal_data.pool_size = 0;
- }
- }
-
- void clear_pool()
- {
- this->clear_pool(alloc_version());
- }
-
- void add_to_pool(size_type n)
- {
- this->add_to_pool(n, alloc_version());
- }
-
- void add_to_pool(size_type n, allocator_v1)
- {
- size_type remaining = n;
- while(remaining--){
- this->put_in_pool(this->allocate_one());
- }
- }
-
- void add_to_pool(size_type n, allocator_v2)
- {
- void_ptr &p1 = *(impl.end()-2);
- void_ptr &p2 = impl.back();
- multiallocation_chain holder(p1, p2, this->internal_data.pool_size);
- BOOST_STATIC_ASSERT((boost::is_movable<multiallocation_chain>::value == true));
- multiallocation_chain m (get_al().allocate_individual(n));
- holder.splice_after(holder.before_begin(), m, m.before_begin(), m.last(), n);
- this->internal_data.pool_size += n;
- std::pair<void_ptr, void_ptr> data(holder.extract_data());
- p1 = data.first;
- p2 = data.second;
- }
-
- void put_in_pool(node_type_ptr_t p)
- {
- void_ptr &p1 = *(impl.end()-2);
- void_ptr &p2 = impl.back();
- multiallocation_chain holder(p1, p2, internal_data.pool_size);
- holder.push_front(p);
- ++this->internal_data.pool_size;
- std::pair<void_ptr, void_ptr> ret(holder.extract_data());
- p1 = ret.first;
- p2 = ret.second;
- }
-
- node_type_ptr_t get_from_pool()
- {
- if(!impl.back()){
- return node_type_ptr_t(0);
- }
- else{
- void_ptr &p1 = *(impl.end()-2);
- void_ptr &p2 = impl.back();
- multiallocation_chain holder(p1, p2, internal_data.pool_size);
- node_type_ptr_t ret = holder.front();
- holder.pop_front();
- std::pair<void_ptr, void_ptr> data(holder.extract_data());
- p1 = data.first;
- p2 = data.second;
- --this->internal_data.pool_size;
- return ret;
- }
- }
-
// element access:
reference operator[](size_type n){return value(impl[n]);}
@@ -834,7 +674,7 @@
iterator insert(const_iterator position, const T& t)
{
- typedef stable_vector_detail::constant_iterator<value_type, difference_type> cvalue_iterator;
+ typedef constant_iterator<value_type, difference_type> cvalue_iterator;
return this->insert_iter(position, cvalue_iterator(t, 1), cvalue_iterator(), std::forward_iterator_tag());
}
@@ -864,7 +704,7 @@
boost::mpl::not_<boost::is_integral<InputIterator> >());
}
- #ifdef BOOST_CONTAINERS_PERFECT_FORWARDING
+ #if defined(BOOST_CONTAINERS_PERFECT_FORWARDING) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
//! <b>Effects</b>: Inserts an object of type T constructed with
//! std::forward<Args>(args)... in the end of the vector.
@@ -976,6 +816,109 @@
/// @cond
private:
+ void clear_pool(allocator_v1)
+ {
+ if(!impl.empty() && impl.back()){
+ void_ptr &p1 = *(impl.end()-2);
+ void_ptr &p2 = impl.back();
+
+ multiallocation_chain holder;
+ holder.incorporate_after(holder.before_begin(), p1, p2, this->internal_data.pool_size);
+ while(!holder.empty()){
+ node_type_ptr_t n = holder.front();
+ holder.pop_front();
+ this->deallocate_one(n);
+ }
+ p1 = p2 = 0;
+ this->internal_data.pool_size = 0;
+ }
+ }
+
+ void clear_pool(allocator_v2)
+ {
+
+ if(!impl.empty() && impl.back()){
+ void_ptr &p1 = *(impl.end()-2);
+ void_ptr &p2 = impl.back();
+ multiallocation_chain holder;
+ holder.incorporate_after(holder.before_begin(), p1, p2, internal_data.pool_size);
+ get_al().deallocate_individual(boost::move(holder));
+ p1 = p2 = 0;
+ this->internal_data.pool_size = 0;
+ }
+ }
+
+ void clear_pool()
+ {
+ this->clear_pool(alloc_version());
+ }
+
+ void add_to_pool(size_type n)
+ {
+ this->add_to_pool(n, alloc_version());
+ }
+
+ void add_to_pool(size_type n, allocator_v1)
+ {
+ size_type remaining = n;
+ while(remaining--){
+ this->put_in_pool(this->allocate_one());
+ }
+ }
+
+ void add_to_pool(size_type n, allocator_v2)
+ {
+ void_ptr &p1 = *(impl.end()-2);
+ void_ptr &p2 = impl.back();
+ multiallocation_chain holder;
+ holder.incorporate_after(holder.before_begin(), p1, p2, internal_data.pool_size);
+ BOOST_STATIC_ASSERT((boost::is_movable<multiallocation_chain>::value == true));
+ multiallocation_chain m (get_al().allocate_individual(n));
+ holder.splice_after(holder.before_begin(), m, m.before_begin(), m.last(), n);
+ this->internal_data.pool_size += n;
+ std::pair<void_ptr, void_ptr> data(holder.extract_data());
+ p1 = data.first;
+ p2 = data.second;
+ }
+
+ void put_in_pool(node_type_ptr_t p)
+ {
+ void_ptr &p1 = *(impl.end()-2);
+ void_ptr &p2 = impl.back();
+ multiallocation_chain holder;
+ holder.incorporate_after(holder.before_begin(), p1, p2, internal_data.pool_size);
+ holder.push_front(p);
+ ++this->internal_data.pool_size;
+ std::pair<void_ptr, void_ptr> ret(holder.extract_data());
+ p1 = ret.first;
+ p2 = ret.second;
+ }
+
+ node_type_ptr_t get_from_pool()
+ {
+ if(!impl.back()){
+ return node_type_ptr_t(0);
+ }
+ else{
+ void_ptr &p1 = *(impl.end()-2);
+ void_ptr &p2 = impl.back();
+ multiallocation_chain holder;
+ holder.incorporate_after(holder.before_begin(), p1, p2, internal_data.pool_size);
+ node_type_ptr_t ret = holder.front();
+ holder.pop_front();
+ --this->internal_data.pool_size;
+ if(!internal_data.pool_size){
+ p1 = p2 = 0;
+ }
+ else{
+ std::pair<void_ptr, void_ptr> data(holder.extract_data());
+ p1 = data.first;
+ p2 = data.second;
+ }
+ return ret;
+ }
+ }
+
void insert_iter_prolog(size_type n, difference_type d)
{
initialize_end_node(n);
@@ -1009,7 +952,7 @@
template<typename Integer>
void assign_dispatch(Integer n, Integer t, boost::mpl::true_)
{
- typedef stable_vector_detail::constant_iterator<value_type, difference_type> cvalue_iterator;
+ typedef constant_iterator<value_type, difference_type> cvalue_iterator;
this->assign_dispatch(cvalue_iterator(t, n), cvalue_iterator(), boost::mpl::false_());
}
@@ -1125,7 +1068,7 @@
void insert_not_iter(const_iterator position, size_type n, const T& t)
{
- typedef stable_vector_detail::constant_iterator<value_type, difference_type> cvalue_iterator;
+ typedef constant_iterator<value_type, difference_type> cvalue_iterator;
this->insert_iter(position, cvalue_iterator(t, n), cvalue_iterator(), std::forward_iterator_tag());
}
@@ -1353,4 +1296,6 @@
}}
-#endif
+#include <boost/container/detail/config_end.hpp>
+
+#endif //BOOST_CONTAINER_STABLE_VECTOR_HPP
Modified: sandbox/move/boost/container/string.hpp
==============================================================================
--- sandbox/move/boost/container/string.hpp (original)
+++ sandbox/move/boost/container/string.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -8,7 +8,7 @@
//
//////////////////////////////////////////////////////////////////////////////
//
-// This file comes from SGI's string file. Modified by Ion Gaztanaga 2004-2008
+// This file comes from SGI's string file. Modified by Ion Gaztanaga 2004-2009
// Renaming, isolating and porting to generic algorithms. Pointer typedef
// set to allocator::pointer to allow placing it in shared memory.
//
@@ -31,7 +31,7 @@
#include <boost/container/detail/workaround.hpp>
#include <boost/container/detail/workaround.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <boost/container/detail/utilities.hpp>
#include <boost/container/detail/iterators.hpp>
#include <boost/container/detail/algorithms.hpp>
@@ -83,12 +83,9 @@
class basic_string_base
{
basic_string_base();
- basic_string_base(basic_string_base&);
- basic_string_base & operator=(basic_string_base&);
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(basic_string_base)
public:
- BOOST_ENABLE_MOVE_EMULATION(basic_string_base)
-
typedef A allocator_type;
//! The stored allocator type
typedef allocator_type stored_allocator_type;
@@ -448,6 +445,7 @@
{
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(basic_string)
typedef containers_detail::basic_string_base<A> base_t;
static const typename base_t::size_type InternalBufferChars = base_t::InternalBufferChars;
@@ -485,7 +483,6 @@
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(basic_string)
//! The allocator type
typedef A allocator_type;
@@ -621,7 +618,7 @@
//! <b>Postcondition</b>: x == *this.
//!
//! <b>Complexity</b>: Linear to the elements x contains.
- basic_string& operator=(const basic_string& s)
+ basic_string& operator=(BOOST_COPY_ASSIGN_REF(basic_string) s)
{
if (&s != this)
this->assign(s.begin(), s.end());
@@ -1874,6 +1871,22 @@
/// @endcond
};
+//!Typedef for a basic_string of
+//!narrow characters
+typedef basic_string
+ <char
+ ,std::char_traits<char>
+ ,std::allocator<char> >
+string;
+
+//!Typedef for a basic_string of
+//!narrow characters
+typedef basic_string
+ <wchar_t
+ ,std::char_traits<wchar_t>
+ ,std::allocator<wchar_t> >
+wstring;
+
/// @cond
template <class CharT, class Traits, class A>
Modified: sandbox/move/boost/container/vector.hpp
==============================================================================
--- sandbox/move/boost/container/vector.hpp (original)
+++ sandbox/move/boost/container/vector.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
@@ -45,6 +45,7 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
+#include <boost/container/container_fwd.hpp>
#include <cstddef>
#include <memory>
@@ -64,19 +65,14 @@
#include <boost/container/detail/iterators.hpp>
#include <boost/container/detail/algorithms.hpp>
#include <boost/container/detail/destroyers.hpp>
-#include <boost/container/containers_fwd.hpp>
+#include <boost/container/container_fwd.hpp>
#include <boost/move/move.hpp>
#include <boost/pointer_to_other.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/advanced_insert_int.hpp>
-#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED
namespace boost {
namespace container {
-#else
-namespace boost {
-namespace container {
-#endif
/// @cond
@@ -446,6 +442,7 @@
/// @cond
private:
+ BOOST_COPYABLE_AND_MOVABLE(vector)
typedef containers_detail::advanced_insert_aux_int<T, T*> advanced_insert_aux_int_t;
typedef containers_detail::vector_value_traits<value_type, A> value_traits;
@@ -459,7 +456,6 @@
/// @endcond
public:
- BOOST_ENABLE_MOVE_EMULATION(vector)
//! <b>Effects</b>: Constructs a vector taking the allocator as parameter.
//!
@@ -853,7 +849,7 @@
//! <b>Throws</b>: If memory allocation throws or T's copy constructor throws.
//!
//! <b>Complexity</b>: Linear to the number of elements in x.
- vector& operator=(const vector& x)
+ vector& operator=(BOOST_COPY_ASSIGN_REF(vector) x)
{
if (&x != this){
this->assign(x.members_.m_start, x.members_.m_start + x.members_.m_size);
@@ -1336,6 +1332,8 @@
void priv_range_insert_expand_forward(T* pos, size_type n, advanced_insert_aux_int_t &interf)
{
+ //n can't be 0, because there is nothing to do in that case
+ if(!n) return;
//There is enough memory
T* old_finish = containers_detail::get_pointer(this->members_.m_start) + this->members_.m_size;
const size_type elems_after = old_finish - pos;
@@ -1367,7 +1365,8 @@
void priv_range_insert_new_allocation
(T* new_start, size_type new_cap, T* pos, size_type n, advanced_insert_aux_int_t &interf)
{
- T* new_finish = new_start;
+ //n can be zero, if we want to reallocate!
+ T *new_finish = new_start;
T *old_finish;
//Anti-exception rollbacks
typename value_traits::UCopiedArrayDeallocator scoped_alloc(new_start, this->alloc(), new_cap);
@@ -1375,36 +1374,40 @@
//Initialize with [begin(), pos) old buffer
//the start of the new buffer
- new_finish = boost::uninitialized_move
- (containers_detail::get_pointer(this->members_.m_start), pos, old_finish = new_finish);
- constructed_values_destroyer.increment_size(new_finish - old_finish);
+ T *old_buffer = containers_detail::get_pointer(this->members_.m_start);
+ if(old_buffer){
+ new_finish = boost::uninitialized_move
+ (containers_detail::get_pointer(this->members_.m_start), pos, old_finish = new_finish);
+ constructed_values_destroyer.increment_size(new_finish - old_finish);
+ }
//Initialize new objects, starting from previous point
interf.uninitialized_copy_all_to(old_finish = new_finish);
new_finish += n;
constructed_values_destroyer.increment_size(new_finish - old_finish);
//Initialize from the rest of the old buffer,
//starting from previous point
- new_finish = boost::uninitialized_move
- ( pos, containers_detail::get_pointer(this->members_.m_start) + this->members_.m_size, new_finish);
- //All construction successful, disable rollbacks
- constructed_values_destroyer.release();
- scoped_alloc.release();
- //Destroy and deallocate old elements
- //If there is allocated memory, destroy and deallocate
- if(this->members_.m_start != 0){
+ if(old_buffer){
+ new_finish = boost::uninitialized_move
+ (pos, old_buffer + this->members_.m_size, new_finish);
+ //Destroy and deallocate old elements
+ //If there is allocated memory, destroy and deallocate
if(!value_traits::trivial_dctr_after_move)
- this->destroy_n(containers_detail::get_pointer(this->members_.m_start), this->members_.m_size);
+ this->destroy_n(old_buffer, this->members_.m_size);
this->alloc().deallocate(this->members_.m_start, this->members_.m_capacity);
}
this->members_.m_start = new_start;
this->members_.m_size = new_finish - new_start;
this->members_.m_capacity = new_cap;
+ //All construction successful, disable rollbacks
+ constructed_values_destroyer.release();
+ scoped_alloc.release();
}
void priv_range_insert_expand_backwards
(T* new_start, size_type new_capacity,
T* pos, const size_type n, advanced_insert_aux_int_t &interf)
{
+ //n can be zero to just expand capacity
//Backup old data
T* old_start = containers_detail::get_pointer(this->members_.m_start);
T* old_finish = old_start + this->members_.m_size;
@@ -1723,6 +1726,10 @@
void priv_assign_aux(FwdIt first, FwdIt last, std::forward_iterator_tag)
{
size_type n = std::distance(first, last);
+ if(!n){
+ this->prot_destroy_all();
+ return;
+ }
//Check if we have enough memory or try to expand current memory
size_type remaining = this->members_.m_capacity - this->members_.m_size;
bool same_buffer_start;
@@ -1749,7 +1756,6 @@
if (this->size() >= n){
//There is memory, but there are more old elements than new ones
//Overwrite old elements with new ones
- // iG std::copy(first, last, start);
std::copy(first, last, start);
//Destroy remaining old elements
this->destroy_n(start + n, this->members_.m_size - n);
Added: sandbox/move/boost/intrusive/any_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/any_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,344 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_ANY_HOOK_HPP
+#define BOOST_INTRUSIVE_ANY_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/any_node_and_algorithms.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/generic_hook.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+template<class VoidPointer>
+struct get_any_node_algo
+{
+ typedef any_algorithms<VoidPointer> type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c \c any_base_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_any_base_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_any_node_algo<typename packed_options::void_pointer>
+ , typename packed_options::tag
+ , packed_options::link_mode
+ , detail::AnyBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Derive a class from this hook in order to store objects of that class
+//! in an intrusive container.
+//!
+//! The hook admits the following options: \c tag<>, \c void_pointer<> and
+//! \c link_mode<>.
+//!
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c any_base_hook, then each \c any_base_hook needs its
+//! unique tag.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link, \c safe_link).
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class any_base_hook
+ : public make_any_base_hook
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <O1, O2, O3>
+ #else
+ <Options...>
+ #endif
+ ::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
+ //! <b>Effects</b>: If link_mode is or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ any_base_hook();
+
+ //! <b>Effects</b>: If link_mode is or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ any_base_hook(const any_base_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ any_base_hook& operator=(const any_base_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a container an assertion is raised.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~any_base_hook();
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c container::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+ #endif
+};
+
+//! Helper metafunction to define a \c \c any_member_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_any_member_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_any_node_algo<typename packed_options::void_pointer>
+ , member_tag
+ , packed_options::link_mode
+ , detail::NoBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Store this hook in a class to be inserted
+//! in an intrusive container.
+//!
+//! The hook admits the following options: \c void_pointer<> and
+//! \c link_mode<>.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link or \c safe_link).
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class any_member_hook
+ : public make_any_member_hook
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <O1, O2, O3>
+ #else
+ <Options...>
+ #endif
+ ::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ public:
+ //! <b>Effects</b>: If link_mode is or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ any_member_hook();
+
+ //! <b>Effects</b>: If link_mode is or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ any_member_hook(const any_member_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ any_member_hook& operator=(const any_member_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a container an assertion is raised.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~any_member_hook();
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c container::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+ #endif
+};
+
+/// @cond
+
+namespace detail{
+
+template<class ValueTraits>
+struct any_to_get_base_pointer_type
+{
+ typedef typename pointer_to_other
+ <typename ValueTraits::boost_intrusive_tags::node_traits::node_ptr, void>::type type;
+};
+
+template<class ValueTraits>
+struct any_to_get_member_pointer_type
+{
+ typedef typename pointer_to_other
+ <typename ValueTraits::node_ptr, void>::type type;
+};
+
+//!This option setter specifies that the container
+//!must use the specified base hook
+template<class BaseHook, template <class> class NodeTraits>
+struct any_to_some_hook
+{
+ typedef typename BaseHook::template pack<none>::value_traits old_value_traits;
+ template<class Base>
+ struct pack : public Base
+ {
+ struct value_traits : public old_value_traits
+ {
+ static const bool is_any_hook = true;
+ typedef typename detail::eval_if_c
+ < detail::internal_base_hook_bool_is_true<old_value_traits>::value
+ , any_to_get_base_pointer_type<old_value_traits>
+ , any_to_get_member_pointer_type<old_value_traits>
+ >::type void_pointer;
+ typedef NodeTraits<void_pointer> node_traits;
+ };
+ };
+};
+
+} //namespace detail{
+
+/// @endcond
+
+//!This option setter specifies that
+//!any hook should behave as an slist hook
+template<class BaseHook>
+struct any_to_slist_hook
+/// @cond
+ : public detail::any_to_some_hook<BaseHook, any_slist_node_traits>
+/// @endcond
+{};
+
+//!This option setter specifies that
+//!any hook should behave as an list hook
+template<class BaseHook>
+struct any_to_list_hook
+/// @cond
+ : public detail::any_to_some_hook<BaseHook, any_list_node_traits>
+/// @endcond
+{};
+
+//!This option setter specifies that
+//!any hook should behave as a set hook
+template<class BaseHook>
+struct any_to_set_hook
+/// @cond
+ : public detail::any_to_some_hook<BaseHook, any_rbtree_node_traits>
+/// @endcond
+{};
+
+//!This option setter specifies that
+//!any hook should behave as an avl_set hook
+template<class BaseHook>
+struct any_to_avl_set_hook
+/// @cond
+ : public detail::any_to_some_hook<BaseHook, any_avltree_node_traits>
+/// @endcond
+{};
+
+//!This option setter specifies that any
+//!hook should behave as a bs_set hook
+template<class BaseHook>
+struct any_to_bs_set_hook
+/// @cond
+ : public detail::any_to_some_hook<BaseHook, any_tree_node_traits>
+/// @endcond
+{};
+
+//!This option setter specifies that any hook
+//!should behave as an unordered set hook
+template<class BaseHook>
+struct any_to_unordered_set_hook
+/// @cond
+ : public detail::any_to_some_hook<BaseHook, any_unordered_node_traits>
+/// @endcond
+{};
+
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_ANY_HOOK_HPP
Added: sandbox/move/boost/intrusive/avl_set.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/avl_set.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,2320 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_AVL_SET_HPP
+#define BOOST_INTRUSIVE_AVL_SET_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/avltree.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <iterator>
+
+namespace boost {
+namespace intrusive {
+
+//! The class template avl_set is an intrusive container, that mimics most of
+//! the interface of std::set as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class avl_set_impl
+{
+ /// @cond
+ typedef avltree_impl<Config> tree_type;
+ //! This class is
+ //! non-copyable
+ avl_set_impl (const avl_set_impl&);
+
+ //! This class is
+ //! non-assignable
+ avl_set_impl &operator =(const avl_set_impl&);
+
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the value_compare object throws.
+ avl_set_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty avl_set and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is std::distance(last, first).
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ avl_set_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(true, b, e, cmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the avl_set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~avl_set_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of avl_set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the avl_set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static avl_set_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<avl_set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &avl_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of avl_set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const avl_set_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<avl_set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &avl_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static avl_set_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<avl_set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &avl_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const avl_set_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<avl_set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &avl_set_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the avl_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns true is the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the avl_set.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two sets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(avl_set_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const avl_set_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Treaps to inserts value into the avl_set.
+ //!
+ //! <b>Returns</b>: If the value
+ //! is not already present inserts it and returns a pair containing the
+ //! iterator to the new value and true. If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert(reference value)
+ { return tree_.insert_unique(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Treaps to to insert x into the avl_set, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the
+ //! new element was inserted into the avl_set.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_unique(hint, value); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the avl_set, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the avl_set.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_check
+ (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(key, key_value_comp, commit_data); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the avl_set, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the avl_set.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_check
+ (const_iterator hint, const KeyType &key
+ ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(hint, key, key_value_comp, commit_data); }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the avl_set between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_commit(reference value, const insert_commit_data &commit_data)
+ { return tree_.insert_unique_commit(value, commit_data); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the avl_set.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_unique(b, e); }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate. "value" must not be equal to any
+ //! inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" or "value" is not unique tree ordering and uniqueness
+ //! invariants will be broken respectively.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ { return tree_.insert_before(pos, value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be greater than
+ //! any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than or equal to the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ { tree_.push_back(value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be less
+ //! than any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than or equal to the the mimum inserted key tree ordering or uniqueness
+ //! invariants will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ { tree_.push_front(value); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size()) + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If the comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)). Basic guarantee.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value) const
+ { return tree_.find(value) != end(); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp) != end(); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound(const_reference value) const
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound(const_reference value) const
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find(const_reference value) const
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a avl_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the avl_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a avl_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! avl_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a avl_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the avl_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a avl_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! avl_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a avl_set/avl_multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ /// @cond
+ friend bool operator==(const avl_set_impl &x, const avl_set_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const avl_set_impl &x, const avl_set_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avl_set_impl<T, Options...> &x, const avl_set_impl<T, Options...> &y)
+#else
+(const avl_set_impl<Config> &x, const avl_set_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avl_set_impl<T, Options...> &x, const avl_set_impl<T, Options...> &y)
+#else
+(const avl_set_impl<Config> &x, const avl_set_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avl_set_impl<T, Options...> &x, const avl_set_impl<T, Options...> &y)
+#else
+(const avl_set_impl<Config> &x, const avl_set_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avl_set_impl<T, Options...> &x, const avl_set_impl<T, Options...> &y)
+#else
+(const avl_set_impl<Config> &x, const avl_set_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(avl_set_impl<T, Options...> &x, avl_set_impl<T, Options...> &y)
+#else
+(avl_set_impl<Config> &x, avl_set_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c avl_set that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_avl_set
+{
+ /// @cond
+ typedef avl_set_impl
+ < typename make_avltree_opt
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <T, O1, O2, O3, O4>
+ #else
+ <T, Options...>
+ #endif
+ ::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class avl_set
+ : public make_avl_set
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <T, O1, O2, O3, O4>
+ #else
+ <T, Options...>
+ #endif
+ ::type
+{
+ typedef typename make_avl_set
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <T, O1, O2, O3, O4>
+ #else
+ <T, Options...>
+ #endif
+ ::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ avl_set( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ avl_set( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, v_traits)
+ {}
+
+ static avl_set &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<avl_set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const avl_set &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const avl_set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static avl_set &container_from_iterator(iterator end_iterator)
+ { return static_cast<avl_set &>(Base::container_from_iterator(end_iterator)); }
+
+ static const avl_set &container_from_iterator(const_iterator end_iterator)
+ { return static_cast<const avl_set &>(Base::container_from_iterator(end_iterator)); }
+};
+
+#endif
+
+//! The class template avl_multiset is an intrusive container, that mimics most of
+//! the interface of std::avl_multiset as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class avl_multiset_impl
+{
+ /// @cond
+ typedef avltree_impl<Config> tree_type;
+
+ //Non-copyable and non-assignable
+ avl_multiset_impl (const avl_multiset_impl&);
+ avl_multiset_impl &operator =(const avl_multiset_impl&);
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ avl_multiset_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty avl_multiset and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is the distance between first and last
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ avl_multiset_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(false, b, e, cmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the avl_multiset
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~avl_multiset_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of avl_multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the avl_multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static avl_multiset_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<avl_multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &avl_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of avl_multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the avl_multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const avl_multiset_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<avl_multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &avl_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static avl_multiset_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<avl_multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &avl_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const avl_multiset_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<avl_multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &avl_multiset_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns true is the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the avl_multiset.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two avl_multisets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(avl_multiset_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const avl_multiset_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the avl_multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(reference value)
+ { return tree_.insert_equal(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts x into the avl_multiset, using pos as a hint to
+ //! where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_equal(hint, value); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the avl_multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_equal(b, e); }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate. "value" must not be equal to any
+ //! inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" or "value" is not unique tree ordering and uniqueness
+ //! invariants will be broken respectively.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ { return tree_.insert_before(pos, value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be greater than
+ //! any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than or equal to the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ { tree_.push_back(value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be less
+ //! than any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than or equal to the the mimum inserted key tree ordering or uniqueness
+ //! invariants will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ { tree_.push_front(value); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value) const
+ { return tree_.count(value); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.count(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound(const_reference value) const
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound(const_reference value) const
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find(const_reference value) const
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a avl_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the avl_multiset
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a avl_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! avl_multiset that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a avl_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the avl_multiset
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a avl_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! avl_multiset that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a avl_multiset/avl_multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ /// @cond
+ friend bool operator==(const avl_multiset_impl &x, const avl_multiset_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const avl_multiset_impl &x, const avl_multiset_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avl_multiset_impl<T, Options...> &x, const avl_multiset_impl<T, Options...> &y)
+#else
+(const avl_multiset_impl<Config> &x, const avl_multiset_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avl_multiset_impl<T, Options...> &x, const avl_multiset_impl<T, Options...> &y)
+#else
+(const avl_multiset_impl<Config> &x, const avl_multiset_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avl_multiset_impl<T, Options...> &x, const avl_multiset_impl<T, Options...> &y)
+#else
+(const avl_multiset_impl<Config> &x, const avl_multiset_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avl_multiset_impl<T, Options...> &x, const avl_multiset_impl<T, Options...> &y)
+#else
+(const avl_multiset_impl<Config> &x, const avl_multiset_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(avl_multiset_impl<T, Options...> &x, avl_multiset_impl<T, Options...> &y)
+#else
+(avl_multiset_impl<Config> &x, avl_multiset_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c avl_multiset that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_avl_multiset
+{
+ /// @cond
+ typedef avl_multiset_impl
+ < typename make_avltree_opt
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <T, O1, O2, O3, O4>
+ #else
+ <T, Options...>
+ #endif
+ ::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class avl_multiset
+ : public make_avl_multiset<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_avl_multiset
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <T, O1, O2, O3, O4>
+ #else
+ <T, Options...>
+ #endif
+ ::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ avl_multiset( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ avl_multiset( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, v_traits)
+ {}
+
+ static avl_multiset &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<avl_multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const avl_multiset &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const avl_multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static avl_multiset &container_from_iterator(iterator end_iterator)
+ { return static_cast<avl_multiset &>(Base::container_from_iterator(end_iterator)); }
+
+ static const avl_multiset &container_from_iterator(const_iterator end_iterator)
+ { return static_cast<const avl_multiset &>(Base::container_from_iterator(end_iterator)); }
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_AVL_SET_HPP
Added: sandbox/move/boost/intrusive/avl_set_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/avl_set_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,295 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_AVL_SET_HOOK_HPP
+#define BOOST_INTRUSIVE_AVL_SET_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/avltree_node.hpp>
+#include <boost/intrusive/avltree_algorithms.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/generic_hook.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+template<class VoidPointer, bool OptimizeSize = false>
+struct get_avl_set_node_algo
+{
+ typedef avltree_algorithms<avltree_node_traits<VoidPointer, OptimizeSize> > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c avl_set_base_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none, class O4 = none>
+#endif
+struct make_avl_set_base_hook
+{
+ /// @cond
+ typedef typename pack_options
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <hook_defaults, O1, O2, O3, O4>
+ #else
+ <hook_defaults, Options...>
+ #endif
+ ::type packed_options;
+
+ typedef detail::generic_hook
+ < get_avl_set_node_algo<typename packed_options::void_pointer
+ ,packed_options::optimize_size>
+ , typename packed_options::tag
+ , packed_options::link_mode
+ , detail::AvlSetBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Derive a class from avl_set_base_hook in order to store objects in
+//! in an avl_set/avl_multiset. avl_set_base_hook holds the data necessary to maintain
+//! the avl_set/avl_multiset and provides an appropriate value_traits class for avl_set/avl_multiset.
+//!
+//! The hook admits the following options: \c tag<>, \c void_pointer<>,
+//! \c link_mode<> and \c optimize_size<>.
+//!
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! unique tag.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c optimize_size<> will tell the hook to optimize the hook for size instead
+//! of speed.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3, class O4>
+#endif
+class avl_set_base_hook
+ : public make_avl_set_base_hook
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <O1, O2, O3, O4>
+ #else
+ <Options...>
+ #endif
+ ::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ avl_set_base_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ avl_set_base_hook(const avl_set_base_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ avl_set_base_hook& operator=(const avl_set_base_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~avl_set_base_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(avl_set_base_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+//! Helper metafunction to define a \c avl_set_member_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none, class O4 = none>
+#endif
+struct make_avl_set_member_hook
+{
+ /// @cond
+ typedef typename pack_options
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <hook_defaults, O1, O2, O3, O4>
+ #else
+ <hook_defaults, Options...>
+ #endif
+ ::type packed_options;
+
+ typedef detail::generic_hook
+ < get_avl_set_node_algo<typename packed_options::void_pointer
+ ,packed_options::optimize_size>
+ , member_tag
+ , packed_options::link_mode
+ , detail::NoBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Put a public data member avl_set_member_hook in order to store objects of this class in
+//! an avl_set/avl_multiset. avl_set_member_hook holds the data necessary for maintaining the
+//! avl_set/avl_multiset and provides an appropriate value_traits class for avl_set/avl_multiset.
+//!
+//! The hook admits the following options: \c void_pointer<>,
+//! \c link_mode<> and \c optimize_size<>.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c optimize_size<> will tell the hook to optimize the hook for size instead
+//! of speed.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3, class O4>
+#endif
+class avl_set_member_hook
+ : public make_avl_set_member_hook
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <O1, O2, O3, O4>
+ #else
+ <Options...>
+ #endif
+ ::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ avl_set_member_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ avl_set_member_hook(const avl_set_member_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ avl_set_member_hook& operator=(const avl_set_member_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~avl_set_member_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(avl_set_member_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_AVL_SET_HOOK_HPP
Added: sandbox/move/boost/intrusive/avltree.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/avltree.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,1647 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_AVLTREE_HPP
+#define BOOST_INTRUSIVE_AVLTREE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <algorithm>
+#include <cstddef>
+#include <functional>
+#include <iterator>
+#include <utility>
+
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/avl_set_hook.hpp>
+#include <boost/intrusive/detail/avltree_node.hpp>
+#include <boost/intrusive/detail/tree_node.hpp>
+#include <boost/intrusive/detail/ebo_functor_holder.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/clear_on_destructor_base.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/avltree_algorithms.hpp>
+#include <boost/intrusive/link_mode.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+template <class ValueTraits, class Compare, class SizeType, bool ConstantTimeSize>
+struct avl_setopt
+{
+ typedef ValueTraits value_traits;
+ typedef Compare compare;
+ typedef SizeType size_type;
+ static const bool constant_time_size = ConstantTimeSize;
+};
+
+template <class T>
+struct avl_set_defaults
+ : pack_options
+ < none
+ , base_hook<detail::default_avl_set_hook>
+ , constant_time_size<true>
+ , size_type<std::size_t>
+ , compare<std::less<T> >
+ >::type
+{};
+
+/// @endcond
+
+//! The class template avltree is an intrusive AVL tree container, that
+//! is used to construct intrusive avl_set and avl_multiset containers.
+//! The no-throw guarantee holds only, if the value_compare object
+//! doesn't throw.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class avltree_impl
+ : private detail::clear_on_destructor_base<avltree_impl<Config> >
+{
+ template<class C> friend class detail::clear_on_destructor_base;
+ public:
+ typedef typename Config::value_traits value_traits;
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ /// @endcond
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::const_pointer const_pointer;
+ typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef value_type key_type;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ typedef typename std::iterator_traits<pointer>::difference_type difference_type;
+ typedef typename Config::size_type size_type;
+ typedef typename Config::compare value_compare;
+ typedef value_compare key_compare;
+ typedef tree_iterator<avltree_impl, false> iterator;
+ typedef tree_iterator<avltree_impl, true> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename boost::pointer_to_other
+ <pointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, const node>::type const_node_ptr;
+ typedef avltree_algorithms<node_traits> node_algorithms;
+
+ static const bool constant_time_size = Config::constant_time_size;
+ static const bool stateful_value_traits = detail::store_cont_ptr_on_it<avltree_impl>::value;
+
+ /// @cond
+ private:
+ typedef detail::size_holder<constant_time_size, size_type> size_traits;
+
+ //noncopyable
+ avltree_impl (const avltree_impl&);
+ avltree_impl operator =(const avltree_impl&);
+
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ //Constant-time size is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(constant_time_size && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+
+ struct header_plus_size : public size_traits
+ { node header_; };
+
+ struct node_plus_pred_t : public detail::ebo_functor_holder<value_compare>
+ {
+ node_plus_pred_t(const value_compare &comp)
+ : detail::ebo_functor_holder<value_compare>(comp)
+ {}
+ header_plus_size header_plus_size_;
+ };
+
+ struct data_t : public avltree_impl::value_traits
+ {
+ typedef typename avltree_impl::value_traits value_traits;
+ data_t(const value_compare & comp, const value_traits &val_traits)
+ : value_traits(val_traits), node_plus_pred_(comp)
+ {}
+ node_plus_pred_t node_plus_pred_;
+ } data_;
+
+ const value_compare &priv_comp() const
+ { return data_.node_plus_pred_.get(); }
+
+ value_compare &priv_comp()
+ { return data_.node_plus_pred_.get(); }
+
+ const node &priv_header() const
+ { return data_.node_plus_pred_.header_plus_size_.header_; }
+
+ node &priv_header()
+ { return data_.node_plus_pred_.header_plus_size_.header_; }
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
+ }
+
+ size_traits &priv_size_traits()
+ { return data_.node_plus_pred_.header_plus_size_; }
+
+ const size_traits &priv_size_traits() const
+ { return data_.node_plus_pred_.header_plus_size_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<false>) const
+ { return data_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<true>) const
+ { return data_.get_value_traits(*this); }
+
+ real_value_traits &get_real_value_traits(detail::bool_<false>)
+ { return data_; }
+
+ real_value_traits &get_real_value_traits(detail::bool_<true>)
+ { return data_.get_value_traits(*this); }
+
+ /// @endcond
+
+ public:
+
+ const real_value_traits &get_real_value_traits() const
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ real_value_traits &get_real_value_traits()
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ typedef typename node_algorithms::insert_commit_data insert_commit_data;
+
+ //! <b>Effects</b>: Constructs an empty tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the value_compare object throws. Basic guarantee.
+ avltree_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty tree and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is the distance between first and last.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws. Basic guarantee.
+ template<class Iterator>
+ avltree_impl( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ if(unique)
+ this->insert_unique(b, e);
+ else
+ this->insert_equal(b, e);
+ }
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~avltree_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return iterator (node_traits::get_left(node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return const_iterator (node_traits::get_left(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return iterator (node_ptr(&priv_header()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return cend(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return const_iterator (uncast(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return const_reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return const_reverse_iterator(begin()); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of avltree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the avltree associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static avltree_impl &container_from_end_iterator(iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of avltree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the avltree associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const avltree_impl &container_from_end_iterator(const_iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: it must be a valid iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static avltree_impl &container_from_iterator(iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Precondition</b>: it must be a valid end const_iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const avltree_impl &container_from_iterator(const_iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return priv_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return node_algorithms::unique(const_node_ptr(&priv_header())); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the tree.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this
+ //! if constant-time size option is disabled. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ {
+ if(constant_time_size)
+ return this->priv_size_traits().get_size();
+ else{
+ return (size_type)node_algorithms::size(const_node_ptr(&priv_header()));
+ }
+ }
+
+ //! <b>Effects</b>: Swaps the contents of two avltrees.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the comparison functor's swap call throws.
+ void swap(avltree_impl& other)
+ {
+ //This can throw
+ using std::swap;
+ swap(priv_comp(), priv_comp());
+ //These can't throw
+ node_algorithms::swap_tree(node_ptr(&priv_header()), node_ptr(&other.priv_header()));
+ if(constant_time_size){
+ size_type backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(other.priv_size_traits().get_size());
+ other.priv_size_traits().set_size(backup);
+ }
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the tree before the upper bound.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, avltree_impl>
+ key_node_comp(priv_comp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_equal_upper_bound
+ (node_ptr(&priv_header()), to_insert, key_node_comp), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case)
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(const_iterator hint, reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, avltree_impl>
+ key_node_comp(priv_comp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_equal
+ (node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp), this);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a each element of a range into the tree
+ //! before the upper bound of the key of each element.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_equal(Iterator b, Iterator e)
+ {
+ iterator end(this->end());
+ for (; b != e; ++b)
+ this->insert_equal(end, *b);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the tree if the value
+ //! is not already present.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert_unique(reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(value, priv_comp(), commit_data);
+ if(!ret.second)
+ return ret;
+ return std::pair<iterator, bool> (insert_unique_commit(value, commit_data), true);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator
+ //!
+ //! <b>Effects</b>: Tries to insert x into the tree, using "hint" as a hint
+ //! to where it will be inserted.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time (two comparisons in the worst case)
+ //! if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_unique(const_iterator hint, reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(hint, value, priv_comp(), commit_data);
+ if(!ret.second)
+ return ret.first;
+ return insert_unique_commit(value, commit_data);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Tries to insert each element of a range into the tree.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_unique(Iterator b, Iterator e)
+ {
+ if(this->empty()){
+ iterator end(this->end());
+ for (; b != e; ++b)
+ this->insert_unique(end, *b);
+ }
+ else{
+ for (; b != e; ++b)
+ this->insert_unique(*b);
+ }
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_unique_check
+ (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ comp(key_value_comp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), key, comp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_unique_check
+ (const_iterator hint, const KeyType &key
+ ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ comp(key_value_comp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), hint.pointed_node(), key, comp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the container between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_unique_commit(reference value, const insert_commit_data &commit_data)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ node_algorithms::insert_unique_commit
+ (node_ptr(&priv_header()), to_insert, commit_data);
+ return iterator(to_insert, this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" tree ordering invariant will be broken.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_before
+ (node_ptr(&priv_header()), pos.pointed_node(), to_insert), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no less
+ //! than the greatest inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ node_algorithms::push_back(node_ptr(&priv_header()), to_insert);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no greater
+ //! than the minimum inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than the minimum inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ node_algorithms::push_front(node_ptr(&priv_header()), to_insert);
+ }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ {
+ const_iterator ret(i);
+ ++ret;
+ node_ptr to_erase(i.pointed_node());
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!node_algorithms::unique(to_erase));
+ node_algorithms::erase(&priv_header(), to_erase);
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ return ret.unconst();
+ }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { size_type n; return private_erase(b, e, n); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return this->erase(value, priv_comp()); }
+
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ {
+ node_ptr to_erase(i.pointed_node());
+ iterator ret(this->erase(i));
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ return ret;
+ }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { size_type n; return private_erase(b, e, n, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ {
+ std::pair<iterator,iterator> p = this->equal_range(value);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ {
+ if(safemode_or_autounlink){
+ this->clear_and_dispose(detail::null_disposer());
+ }
+ else{
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(0);
+ }
+ }
+
+ //! <b>Effects</b>: Erases all of the elements calling disposer(p) for
+ //! each node to be erased.
+ //! <b>Complexity</b>: Average complexity for is at most O(log(size() + N)),
+ //! where N is the number of elements in the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. Calls N times to disposer functor.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ {
+ node_algorithms::clear_and_dispose(node_ptr(&priv_header())
+ , detail::node_disposer<Disposer, avltree_impl>(disposer, this));
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(0);
+ }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given value
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given value.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type count(const_reference value) const
+ { return this->count(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType &key, KeyValueCompare comp) const
+ {
+ std::pair<const_iterator, const_iterator> ret = this->equal_range(key, comp);
+ return std::distance(ret.first, ret.second);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator lower_bound(const_reference value)
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator lower_bound(const_reference value) const
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator upper_bound(const_reference value)
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator upper_bound(const_reference value) const
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator find(const_reference value)
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ return iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator find(const_reference value) const
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ return const_iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, avltree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const avltree_impl &src, Cloner cloner, Disposer disposer)
+ {
+ this->clear_and_dispose(disposer);
+ if(!src.empty()){
+ detail::exception_disposer<avltree_impl, Disposer>
+ rollback(*this, disposer);
+ node_algorithms::clone
+ (const_node_ptr(&src.priv_header())
+ ,node_ptr(&this->priv_header())
+ ,detail::node_cloner<Cloner, avltree_impl>(cloner, this)
+ ,detail::node_disposer<Disposer, avltree_impl>(disposer, this));
+ this->priv_size_traits().set_size(src.priv_size_traits().get_size());
+ this->priv_comp() = src.priv_comp();
+ rollback.release();
+ }
+ }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ {
+ node_ptr to_be_disposed(node_algorithms::unlink_leftmost_without_rebalance
+ (node_ptr(&priv_header())));
+ if(!to_be_disposed)
+ return 0;
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)//If this is commented does not work with normal_link
+ node_algorithms::init(to_be_disposed);
+ return get_real_value_traits().to_value_ptr(to_be_disposed);
+ }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ {
+ node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
+ , node_ptr(&priv_header())
+ , get_real_value_traits().to_node_ptr(with_this));
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return iterator (value_traits::to_node_ptr(value), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return iterator (value_traits::to_node_ptr(value), this); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
+
+ //! <b>Requires</b>: value shall not be in a tree.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { node_algorithms::init(value_traits::to_node_ptr(value)); }
+
+/*
+ //! <b>Effects</b>: removes x from a tree of the appropriate type. It has no effect,
+ //! if x is not in such a tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This static function is only usable with the "safe mode"
+ //! hook and non-constant time size lists. Otherwise, the user must use
+ //! the non-static "erase(reference )" member. If the user calls
+ //! this function with a non "safe mode" or constant time size list
+ //! a compilation error will be issued.
+ template<class T>
+ static void remove_node(T& value)
+ {
+ //This function is only usable for safe mode hooks and non-constant
+ //time lists.
+ //BOOST_STATIC_ASSERT((!(safemode_or_autounlink && constant_time_size)));
+ BOOST_STATIC_ASSERT((!constant_time_size));
+ BOOST_STATIC_ASSERT((boost::is_convertible<T, value_type>::value));
+ node_ptr to_remove(value_traits::to_node_ptr(value));
+ node_algorithms::unlink_and_rebalance(to_remove);
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_remove);
+ }
+*/
+
+ /// @cond
+
+ private:
+ template<class Disposer>
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n, Disposer disposer)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase_and_dispose(b++, disposer);
+ return b.unconst();
+ }
+
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase(b++);
+ return b.unconst();
+ }
+ /// @endcond
+
+ private:
+ static avltree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
+ {
+ header_plus_size *r = detail::parent_from_member<header_plus_size, node>
+ ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
+ node_plus_pred_t *n = detail::parent_from_member
+ <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
+ data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
+ avltree_impl *avl = detail::parent_from_member<avltree_impl, data_t>(d, &avltree_impl::data_);
+ return *avl;
+ }
+
+ static avltree_impl &priv_container_from_iterator(const const_iterator &it)
+ { return priv_container_from_end_iterator(it.end_iterator_from_it()); }
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avltree_impl<T, Options...> &x, const avltree_impl<T, Options...> &y)
+#else
+(const avltree_impl<Config> &x, const avltree_impl<Config> &y)
+#endif
+{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+bool operator==
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avltree_impl<T, Options...> &x, const avltree_impl<T, Options...> &y)
+#else
+(const avltree_impl<Config> &x, const avltree_impl<Config> &y)
+#endif
+{
+ typedef avltree_impl<Config> tree_type;
+ typedef typename tree_type::const_iterator const_iterator;
+
+ if(tree_type::constant_time_size && x.size() != y.size()){
+ return false;
+ }
+ const_iterator end1 = x.end();
+ const_iterator i1 = x.begin();
+ const_iterator i2 = y.begin();
+ if(tree_type::constant_time_size){
+ while (i1 != end1 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1;
+ }
+ else{
+ const_iterator end2 = y.end();
+ while (i1 != end1 && i2 != end2 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1 && i2 == end2;
+ }
+}
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avltree_impl<T, Options...> &x, const avltree_impl<T, Options...> &y)
+#else
+(const avltree_impl<Config> &x, const avltree_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avltree_impl<T, Options...> &x, const avltree_impl<T, Options...> &y)
+#else
+(const avltree_impl<Config> &x, const avltree_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avltree_impl<T, Options...> &x, const avltree_impl<T, Options...> &y)
+#else
+(const avltree_impl<Config> &x, const avltree_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const avltree_impl<T, Options...> &x, const avltree_impl<T, Options...> &y)
+#else
+(const avltree_impl<Config> &x, const avltree_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(avltree_impl<T, Options...> &x, avltree_impl<T, Options...> &y)
+#else
+(avltree_impl<Config> &x, avltree_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+/// @cond
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+struct make_avltree_opt
+{
+ typedef typename pack_options
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ < avl_set_defaults<T>, O1, O2, O3, O4>
+ #else
+ < avl_set_defaults<T>, Options...>
+ #endif
+ ::type packed_options;
+
+ typedef typename detail::get_value_traits
+ <T, typename packed_options::value_traits>::type value_traits;
+
+ typedef avl_setopt
+ < value_traits
+ , typename packed_options::compare
+ , typename packed_options::size_type
+ , packed_options::constant_time_size
+ > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c avltree that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_avltree
+{
+ /// @cond
+ typedef avltree_impl
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ < typename make_avltree_opt<T, O1, O2, O3, O4>::type
+ #else
+ < typename make_avltree_opt<T, Options...>::type
+ #endif
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class avltree
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ : public make_avltree<T, O1, O2, O3, O4>::type
+ #else
+ : public make_avltree<T, Options...>::type
+ #endif
+{
+ typedef typename make_avltree
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <T, O1, O2, O3, O4>
+ #else
+ <T, Options...>
+ #endif
+ ::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::real_value_traits real_value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
+
+ avltree( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ avltree( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(unique, b, e, cmp, v_traits)
+ {}
+
+ static avltree &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<avltree &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const avltree &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const avltree &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static avltree &container_from_iterator(iterator it)
+ { return static_cast<avltree &>(Base::container_from_iterator(it)); }
+
+ static const avltree &container_from_iterator(const_iterator it)
+ { return static_cast<const avltree &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_AVLTREE_HPP
Added: sandbox/move/boost/intrusive/avltree_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/avltree_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,943 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Daniel K. O. 2005.
+// (C) Copyright Ion Gaztanaga 2007.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_AVLTREE_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_AVLTREE_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+
+#include <cstddef>
+#include <boost/intrusive/intrusive_fwd.hpp>
+
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/tree_algorithms.hpp>
+
+
+namespace boost {
+namespace intrusive {
+
+//! avltree_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the circular list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <tt>balance</tt>: The type of the balance factor
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
+//!
+//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
+//!
+//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
+//!
+//! <tt>static balance get_balance(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_balance(node_ptr n, balance b);</tt>
+//!
+//! <tt>static balance negative();</tt>
+//!
+//! <tt>static balance zero();</tt>
+//!
+//! <tt>static balance positive();</tt>
+template<class NodeTraits>
+class avltree_algorithms
+{
+ public:
+ typedef typename NodeTraits::node node;
+ typedef NodeTraits node_traits;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+ typedef typename NodeTraits::balance balance;
+
+ /// @cond
+ private:
+ typedef detail::tree_algorithms<NodeTraits> tree_algorithms;
+
+ template<class F>
+ struct avltree_node_cloner
+ : private detail::ebo_functor_holder<F>
+ {
+ typedef detail::ebo_functor_holder<F> base_t;
+
+ avltree_node_cloner(F f)
+ : base_t(f)
+ {}
+
+ node_ptr operator()(node_ptr p)
+ {
+ node_ptr n = base_t::get()(p);
+ NodeTraits::set_balance(n, NodeTraits::get_balance(p));
+ return n;
+ }
+ };
+
+ struct avltree_erase_fixup
+ {
+ void operator()(node_ptr to_erase, node_ptr successor)
+ { NodeTraits::set_balance(successor, NodeTraits::get_balance(to_erase)); }
+ };
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ }
+ /// @endcond
+
+ public:
+ static node_ptr begin_node(const_node_ptr header)
+ { return tree_algorithms::begin_node(header); }
+
+ static node_ptr end_node(const_node_ptr header)
+ { return tree_algorithms::end_node(header); }
+
+ //! This type is the information that will be
+ //! filled by insert_unique_check
+ typedef typename tree_algorithms::insert_commit_data insert_commit_data;
+
+ //! <b>Requires</b>: header1 and header2 must be the header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //! links to the second tree and header2 will have links to the first tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void swap_tree(node_ptr header1, node_ptr header2)
+ { return tree_algorithms::swap_tree(header1, header2); }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr node2)
+ {
+ if(node1 == node2)
+ return;
+
+ node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
+ swap_nodes(node1, header1, node2, header2);
+ }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees with header header1 and header2.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
+ {
+ if(node1 == node2) return;
+
+ tree_algorithms::swap_nodes(node1, header1, node2, header2);
+ //Swap balance
+ balance c = NodeTraits::get_balance(node1);
+ NodeTraits::set_balance(node1, NodeTraits::get_balance(node2));
+ NodeTraits::set_balance(node2, c);
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing and comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
+ {
+ if(node_to_be_replaced == new_node)
+ return;
+ replace_node(node_to_be_replaced, tree_algorithms::get_header(node_to_be_replaced), new_node);
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! with header "header" and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
+ {
+ tree_algorithms::replace_node(node_to_be_replaced, header, new_node);
+ NodeTraits::set_balance(new_node, NodeTraits::get_balance(node_to_be_replaced));
+ }
+
+ //! <b>Requires</b>: node is a tree node but not the header.
+ //!
+ //! <b>Effects</b>: Unlinks the node and rebalances the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink(node_ptr node)
+ {
+ node_ptr x = NodeTraits::get_parent(node);
+ if(x){
+ while(!is_header(x))
+ x = NodeTraits::get_parent(x);
+ erase(x, node);
+ }
+ }
+
+ //! <b>Requires</b>: header is the header of a tree.
+ //!
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree, and
+ //! updates the header link to the new leftmost node.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ static node_ptr unlink_leftmost_without_rebalance(node_ptr header)
+ { return tree_algorithms::unlink_leftmost_without_rebalance(header); }
+
+ //! <b>Requires</b>: node is a node of the tree or an node initialized
+ //! by init(...).
+ //!
+ //! <b>Effects</b>: Returns true if the node is initialized by init().
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr node)
+ { return tree_algorithms::unique(node); }
+
+ //! <b>Requires</b>: node is a node of the tree but it's not the header.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes of the subtree.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr node)
+ { return tree_algorithms::count(node); }
+
+ //! <b>Requires</b>: header is the header node of the tree.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes above the header.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t size(const_node_ptr header)
+ { return tree_algorithms::size(header); }
+
+ //! <b>Requires</b>: p is a node from the tree except the header.
+ //!
+ //! <b>Effects</b>: Returns the next node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr next_node(node_ptr p)
+ { return tree_algorithms::next_node(p); }
+
+ //! <b>Requires</b>: p is a node from the tree except the leftmost node.
+ //!
+ //! <b>Effects</b>: Returns the previous node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr prev_node(node_ptr p)
+ { return tree_algorithms::prev_node(p); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: After the function unique(node) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init(node_ptr node)
+ { tree_algorithms::init(node); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: Initializes the header to represent an empty tree.
+ //! unique(header) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init_header(node_ptr header)
+ {
+ tree_algorithms::init_header(header);
+ NodeTraits::set_balance(header, NodeTraits::zero());
+ }
+
+ //! <b>Requires</b>: header must be the header of a tree, z a node
+ //! of that tree and z != header.
+ //!
+ //! <b>Effects</b>: Erases node "z" from the tree with header "header".
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr erase(node_ptr header, node_ptr z)
+ {
+ typename tree_algorithms::data_for_rebalance info;
+ tree_algorithms::erase(header, z, avltree_erase_fixup(), info);
+ node_ptr x = info.x;
+ node_ptr x_parent = info.x_parent;
+
+ //Rebalance avltree
+ rebalance_after_erasure(header, x, x_parent);
+ return z;
+ }
+
+ //! <b>Requires</b>: "cloner" must be a function
+ //! object taking a node_ptr and returning a new cloned node of it. "disposer" must
+ //! take a node_ptr and shouldn't throw.
+ //!
+ //! <b>Effects</b>: First empties target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! Then, duplicates the entire tree pointed by "source_header" cloning each
+ //! source node with <tt>node_ptr Cloner::operator()(node_ptr)</tt> to obtain
+ //! the nodes of the target tree. If "cloner" throws, the cloned target nodes
+ //! are disposed using <tt>void disposer(node_ptr)</tt>.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template <class Cloner, class Disposer>
+ static void clone
+ (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
+ {
+ avltree_node_cloner<Cloner> new_cloner(cloner);
+ tree_algorithms::clone(source_header, target_header, new_cloner, disposer);
+ }
+
+ //! <b>Requires</b>: "disposer" must be an object function
+ //! taking a node_ptr parameter and shouldn't throw.
+ //!
+ //! <b>Effects</b>: Empties the target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template<class Disposer>
+ static void clear_and_dispose(node_ptr header, Disposer disposer)
+ { tree_algorithms::clear_and_dispose(header, disposer); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is
+ //! not less than "key" according to "comp" or "header" if that element does
+ //! not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr lower_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::lower_bound(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is greater
+ //! than "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr upper_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::upper_bound(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the element that is equivalent to
+ //! "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr find
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::find(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an a pair of node_ptr delimiting a range containing
+ //! all elements that are equivalent to "key" according to "comp" or an
+ //! empty range that indicates the position where those elements would be
+ //! if they there are no equivalent elements.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> equal_range
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::equal_range(header, key, comp); }
+
+ //! <b>Requires</b>: "h" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the upper bound
+ //! according to "comp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal_upper_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp)
+ {
+ tree_algorithms::insert_equal_upper_bound(h, new_node, comp);
+ rebalance_after_insertion(h, new_node);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "h" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the lower bound
+ //! according to "comp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal_lower_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp)
+ {
+ tree_algorithms::insert_equal_lower_bound(h, new_node, comp);
+ rebalance_after_insertion(h, new_node);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
+ //! the "header"'s tree.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case).
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if new_node is inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal
+ (node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp)
+ {
+ tree_algorithms::insert_equal(header, hint, new_node, comp);
+ rebalance_after_insertion(header, new_node);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "pos" must be a valid iterator or header (end) node.
+ //! "pos" must be an iterator pointing to the successor to "new_node"
+ //! once inserted according to the order of already inserted nodes. This function does not
+ //! check "pos" and this precondition must be guaranteed by the caller.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
+ //! tree invariants might be broken.
+ static node_ptr insert_before
+ (node_ptr header, node_ptr pos, node_ptr new_node)
+ {
+ tree_algorithms::insert_before(header, pos, new_node);
+ rebalance_after_insertion(header, new_node);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering no less than the
+ //! greatest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "new_node" is less than the greatest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ static void push_back(node_ptr header, node_ptr new_node)
+ {
+ tree_algorithms::push_back(header, new_node);
+ rebalance_after_insertion(header, new_node);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering, no greater than the
+ //! lowest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "new_node" is greater than the lowest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ static void push_front(node_ptr header, node_ptr new_node)
+ {
+ tree_algorithms::push_front(header, new_node);
+ rebalance_after_insertion(header, new_node);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data)
+ { return tree_algorithms::insert_unique_check(header, key, comp, commit_data); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //! "hint" is node from the "header"'s tree.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" using "hint" as a hint to where it should be
+ //! inserted and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //! If "hint" is the upper_bound the function has constant time
+ //! complexity (two comparisons in the worst case).
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic, but it is
+ //! amortized constant time if new_node should be inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, node_ptr hint, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data)
+ { return tree_algorithms::insert_unique_check(header, hint, key, comp, commit_data); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "commit_data" must have been obtained from a previous call to
+ //! "insert_unique_check". No objects should have been inserted or erased
+ //! from the set between the "insert_unique_check" that filled "commit_data"
+ //! and the call to "insert_commit".
+ //!
+ //!
+ //! <b>Effects</b>: Inserts new_node in the set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ static void insert_unique_commit
+ (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data)
+ {
+ tree_algorithms::insert_unique_commit(header, new_value, commit_data);
+ rebalance_after_insertion(header, new_value);
+ }
+
+ //! <b>Requires</b>: "n" must be a node inserted in a tree.
+ //!
+ //! <b>Effects</b>: Returns a pointer to the header node of the tree.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_header(node_ptr n)
+ { return tree_algorithms::get_header(n); }
+
+ /// @cond
+ private:
+
+ //! <b>Requires</b>: p is a node of a tree.
+ //!
+ //! <b>Effects</b>: Returns true if p is the header of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool is_header(const_node_ptr p)
+ { return NodeTraits::get_balance(p) == NodeTraits::zero() && tree_algorithms::is_header(p); }
+
+ static void rebalance_after_erasure(node_ptr header, node_ptr x, node_ptr x_parent)
+ {
+ for (node_ptr root = NodeTraits::get_parent(header); x != root; root = NodeTraits::get_parent(header)) {
+ const balance x_parent_balance = NodeTraits::get_balance(x_parent);
+ if(x_parent_balance == NodeTraits::zero()){
+ NodeTraits::set_balance(x_parent,
+ (x == NodeTraits::get_right(x_parent) ? NodeTraits::negative() : NodeTraits::positive()));
+ break; // the height didn't change, let's stop here
+ }
+ else if(x_parent_balance == NodeTraits::negative()){
+ if (x == NodeTraits::get_left(x_parent)) {
+ NodeTraits::set_balance(x_parent, NodeTraits::zero()); // balanced
+ x = x_parent;
+ x_parent = NodeTraits::get_parent(x_parent);
+ }
+ else {
+ // x is right child
+ // a is left child
+ node_ptr a = NodeTraits::get_left(x_parent);
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(a);
+ if (NodeTraits::get_balance(a) == NodeTraits::positive()) {
+ // a MUST have a right child
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_right(a));
+ rotate_left_right(x_parent, header);
+ x = NodeTraits::get_parent(x_parent);
+ x_parent = NodeTraits::get_parent(x);
+ }
+ else {
+ rotate_right(x_parent, header);
+ x = NodeTraits::get_parent(x_parent);
+ x_parent = NodeTraits::get_parent(x);
+ }
+
+ // if changed from negative to NodeTraits::positive(), no need to check above
+ if (NodeTraits::get_balance(x) == NodeTraits::positive()){
+ break;
+ }
+ }
+ }
+ else if(x_parent_balance == NodeTraits::positive()){
+ if (x == NodeTraits::get_right(x_parent)) {
+ NodeTraits::set_balance(x_parent, NodeTraits::zero()); // balanced
+ x = x_parent;
+ x_parent = NodeTraits::get_parent(x_parent);
+ }
+ else {
+ // x is left child
+ // a is right child
+ node_ptr a = NodeTraits::get_right(x_parent);
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(a);
+ if (NodeTraits::get_balance(a) == NodeTraits::negative()) {
+ // a MUST have then a left child
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(NodeTraits::get_left(a));
+ rotate_right_left(x_parent, header);
+
+ x = NodeTraits::get_parent(x_parent);
+ x_parent = NodeTraits::get_parent(x);
+ }
+ else {
+ rotate_left(x_parent, header);
+ x = NodeTraits::get_parent(x_parent);
+ x_parent = NodeTraits::get_parent(x);
+ }
+ // if changed from NodeTraits::positive() to negative, no need to check above
+ if (NodeTraits::get_balance(x) == NodeTraits::negative()){
+ break;
+ }
+ }
+ }
+ else{
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(false); // never reached
+ }
+ }
+ }
+
+ static void rebalance_after_insertion(node_ptr header, node_ptr x)
+ {
+ NodeTraits::set_balance(x, NodeTraits::zero());
+
+ // Rebalance.
+ for(node_ptr root = NodeTraits::get_parent(header); x != root; root = NodeTraits::get_parent(header)){
+ const balance x_parent_balance = NodeTraits::get_balance(NodeTraits::get_parent(x));
+
+ if(x_parent_balance == NodeTraits::zero()){
+ // if x is left, parent will have parent->bal_factor = negative
+ // else, parent->bal_factor = NodeTraits::positive()
+ NodeTraits::set_balance( NodeTraits::get_parent(x)
+ , x == NodeTraits::get_left(NodeTraits::get_parent(x))
+ ? NodeTraits::negative() : NodeTraits::positive() );
+ x = NodeTraits::get_parent(x);
+ }
+ else if(x_parent_balance == NodeTraits::positive()){
+ // if x is a left child, parent->bal_factor = zero
+ if (x == NodeTraits::get_left(NodeTraits::get_parent(x)))
+ NodeTraits::set_balance(NodeTraits::get_parent(x), NodeTraits::zero());
+ else{ // x is a right child, needs rebalancing
+ if (NodeTraits::get_balance(x) == NodeTraits::negative())
+ rotate_right_left(NodeTraits::get_parent(x), header);
+ else
+ rotate_left(NodeTraits::get_parent(x), header);
+ }
+ break;
+ }
+ else if(x_parent_balance == NodeTraits::negative()){
+ // if x is a left child, needs rebalancing
+ if (x == NodeTraits::get_left(NodeTraits::get_parent(x))) {
+ if (NodeTraits::get_balance(x) == NodeTraits::positive())
+ rotate_left_right(NodeTraits::get_parent(x), header);
+ else
+ rotate_right(NodeTraits::get_parent(x), header);
+ }
+ else
+ NodeTraits::set_balance(NodeTraits::get_parent(x), NodeTraits::zero());
+ break;
+ }
+ else{
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(false); // never reached
+ }
+ }
+ }
+
+ static void left_right_balancing(node_ptr a, node_ptr b, node_ptr c)
+ {
+ // balancing...
+ const balance c_balance = NodeTraits::get_balance(c);
+ const balance zero_balance = NodeTraits::zero();
+ NodeTraits::set_balance(c, zero_balance);
+ if(c_balance == NodeTraits::negative()){
+ NodeTraits::set_balance(a, NodeTraits::positive());
+ NodeTraits::set_balance(b, zero_balance);
+ }
+ else if(c_balance == zero_balance){
+ NodeTraits::set_balance(a, zero_balance);
+ NodeTraits::set_balance(b, zero_balance);
+ }
+ else if(c_balance == NodeTraits::positive()){
+ NodeTraits::set_balance(a, zero_balance);
+ NodeTraits::set_balance(b, NodeTraits::negative());
+ }
+ else{
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(false); // never reached
+ }
+ }
+
+ static void rotate_left_right(const node_ptr a, node_ptr hdr)
+ {
+ // | | //
+ // a(-2) c //
+ // / \ / \ //
+ // / \ ==> / \ //
+ // (pos)b [g] b a //
+ // / \ / \ / \ //
+ // [d] c [d] e f [g] //
+ // / \ //
+ // e f //
+ node_ptr b = NodeTraits::get_left(a), c = NodeTraits::get_right(b);
+ tree_algorithms::rotate_left(b, hdr);
+ tree_algorithms::rotate_right(a, hdr);
+ left_right_balancing(a, b, c);
+ }
+
+ static void rotate_right_left(const node_ptr a, node_ptr hdr)
+ {
+ // | | //
+ // a(pos) c //
+ // / \ / \ //
+ // / \ / \ //
+ // [d] b(neg) ==> a b //
+ // / \ / \ / \ //
+ // c [g] [d] e f [g] //
+ // / \ //
+ // e f //
+ node_ptr b = NodeTraits::get_right(a), c = NodeTraits::get_left(b);
+ tree_algorithms::rotate_right(b, hdr);
+ tree_algorithms::rotate_left(a, hdr);
+ left_right_balancing(b, a, c);
+ }
+
+ static void rotate_left(const node_ptr x, node_ptr hdr)
+ {
+ const node_ptr y = NodeTraits::get_right(x);
+ tree_algorithms::rotate_left(x, hdr);
+
+ // reset the balancing factor
+ if (NodeTraits::get_balance(y) == NodeTraits::positive()) {
+ NodeTraits::set_balance(x, NodeTraits::zero());
+ NodeTraits::set_balance(y, NodeTraits::zero());
+ }
+ else { // this doesn't happen during insertions
+ NodeTraits::set_balance(x, NodeTraits::positive());
+ NodeTraits::set_balance(y, NodeTraits::negative());
+ }
+ }
+
+ static void rotate_right(const node_ptr x, node_ptr hdr)
+ {
+ const node_ptr y = NodeTraits::get_left(x);
+ tree_algorithms::rotate_right(x, hdr);
+
+ // reset the balancing factor
+ if (NodeTraits::get_balance(y) == NodeTraits::negative()) {
+ NodeTraits::set_balance(x, NodeTraits::zero());
+ NodeTraits::set_balance(y, NodeTraits::zero());
+ }
+ else { // this doesn't happen during insertions
+ NodeTraits::set_balance(x, NodeTraits::negative());
+ NodeTraits::set_balance(y, NodeTraits::positive());
+ }
+ }
+
+ /// @endcond
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_AVLTREE_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/bs_set_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/bs_set_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,294 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_BS_SET_HOOK_HPP
+#define BOOST_INTRUSIVE_BS_SET_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/tree_node.hpp>
+#include <boost/intrusive/detail/tree_algorithms.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/generic_hook.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+template<class VoidPointer>
+struct get_bs_set_node_algo
+{
+ typedef detail::tree_algorithms<tree_node_traits<VoidPointer> > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c bs_set_base_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_bs_set_base_hook
+{
+ /// @cond
+ typedef typename pack_options
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ < hook_defaults, O1, O2, O3>
+ #else
+ < hook_defaults, Options...>
+ #endif
+ ::type packed_options;
+
+ //Scapegoat trees can't be auto unlink trees
+ BOOST_STATIC_ASSERT(((int)packed_options::link_mode != (int)auto_unlink));
+
+ typedef detail::generic_hook
+ < get_bs_set_node_algo<typename packed_options::void_pointer>
+ , typename packed_options::tag
+ , packed_options::link_mode
+ , detail::BsSetBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Derive a class from bs_set_base_hook in order to store objects in
+//! in a bs_set/bs_multiset. bs_set_base_hook holds the data necessary to maintain
+//! the bs_set/bs_multiset and provides an appropriate value_traits class for bs_set/bs_multiset.
+//!
+//! The hook admits the following options: \c tag<>, \c void_pointer<>,
+//! \c link_mode<>.
+//!
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! unique tag.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class bs_set_base_hook
+ : public make_bs_set_base_hook
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <O1, O2, O3>
+ #else
+ <Options...>
+ #endif
+ ::type
+
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bs_set_base_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ bs_set_base_hook(const bs_set_base_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ bs_set_base_hook& operator=(const bs_set_base_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~bs_set_base_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(bs_set_base_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+//! Helper metafunction to define a \c bs_set_member_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_bs_set_member_hook
+{
+ /// @cond
+ typedef typename pack_options
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ < hook_defaults, O1, O2, O3>
+ #else
+ < hook_defaults, Options...>
+ #endif
+
+ ::type packed_options;
+
+ //Scapegoat trees can't be auto unlink trees
+ BOOST_STATIC_ASSERT(((int)packed_options::link_mode != (int)auto_unlink));
+
+ typedef detail::generic_hook
+ < get_bs_set_node_algo<typename packed_options::void_pointer>
+ , member_tag
+ , packed_options::link_mode
+ , detail::NoBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Put a public data member bs_set_member_hook in order to store objects of this class in
+//! a bs_set/bs_multiset. bs_set_member_hook holds the data necessary for maintaining the
+//! bs_set/bs_multiset and provides an appropriate value_traits class for bs_set/bs_multiset.
+//!
+//! The hook admits the following options: \c void_pointer<>, \c link_mode<>.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class bs_set_member_hook
+ : public make_bs_set_member_hook
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <O1, O2, O3>
+ #else
+ <Options...>
+ #endif
+ ::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bs_set_member_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ bs_set_member_hook(const bs_set_member_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ bs_set_member_hook& operator=(const bs_set_member_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~bs_set_member_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(bs_set_member_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_BS_SET_HOOK_HPP
Added: sandbox/move/boost/intrusive/circular_list_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/circular_list_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,407 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <cstddef>
+
+namespace boost {
+namespace intrusive {
+
+//! circular_list_algorithms provides basic algorithms to manipulate nodes
+//! forming a circular doubly linked list. An empty circular list is formed by a node
+//! whose pointers point to itself.
+//!
+//! circular_list_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the circular list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_previous(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_previous(node_ptr n, node_ptr prev);</tt>
+//!
+//! <tt>static node_ptr get_next(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_next(node_ptr n, node_ptr next);</tt>
+template<class NodeTraits>
+class circular_list_algorithms
+{
+ public:
+ typedef typename NodeTraits::node node;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+ typedef NodeTraits node_traits;
+
+ //! <b>Effects</b>: Constructs an non-used list element, so that
+ //! inited(this_node) == true
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void init(node_ptr this_node)
+ {
+ NodeTraits::set_next(this_node, node_ptr(0));
+ NodeTraits::set_previous(this_node, node_ptr(0));
+ }
+
+ //! <b>Effects</b>: Returns true is "this_node" is in a non-used state
+ //! as if it was initialized by the "init" function.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool inited(const_node_ptr this_node)
+ { return !NodeTraits::get_next(this_node); }
+
+ //! <b>Effects</b>: Constructs an empty list, making this_node the only
+ //! node of the circular list:
+ //! <tt>NodeTraits::get_next(this_node) == NodeTraits::get_previous(this_node)
+ //! == this_node</tt>.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void init_header(node_ptr this_node)
+ {
+ NodeTraits::set_next(this_node, this_node);
+ NodeTraits::set_previous(this_node, this_node);
+ }
+
+
+ //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
+ //! <tt>return NodeTraits::get_next(this_node) == this_node</tt>
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr this_node)
+ {
+ node_ptr next = NodeTraits::get_next(this_node);
+ return !next || next == this_node;
+ }
+
+ //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes in a circular list. If the circular list
+ //! is empty, returns 1.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr this_node)
+ {
+ std::size_t result = 0;
+ const_node_ptr p = this_node;
+ do{
+ p = NodeTraits::get_next(p);
+ ++result;
+ }while (p != this_node);
+ return result;
+ }
+
+ //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Unlinks the node from the circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr unlink(node_ptr this_node)
+ {
+ if(NodeTraits::get_next(this_node)){
+ node_ptr next(NodeTraits::get_next(this_node));
+ node_ptr prev(NodeTraits::get_previous(this_node));
+ NodeTraits::set_next(prev, next);
+ NodeTraits::set_previous(next, prev);
+ return next;
+ }
+ else{
+ return this_node;
+ }
+ }
+
+ //! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
+ //!
+ //! <b>Effects</b>: Unlinks the node [b, e) from the circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink(node_ptr b, node_ptr e)
+ {
+ if (b != e) {
+ node_ptr prevb(NodeTraits::get_previous(b));
+ NodeTraits::set_previous(e, prevb);
+ NodeTraits::set_next(prevb, e);
+ }
+ }
+
+ //! <b>Requires</b>: nxt_node must be a node of a circular list.
+ //!
+ //! <b>Effects</b>: Links this_node before nxt_node in the circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void link_before(node_ptr nxt_node, node_ptr this_node)
+ {
+ node_ptr prev(NodeTraits::get_previous(nxt_node));
+ NodeTraits::set_previous(this_node, prev);
+ NodeTraits::set_next(prev, this_node);
+ NodeTraits::set_previous(nxt_node, this_node);
+ NodeTraits::set_next(this_node, nxt_node);
+ }
+
+ //! <b>Requires</b>: prev_node must be a node of a circular list.
+ //!
+ //! <b>Effects</b>: Links this_node after prev_node in the circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void link_after(node_ptr prev_node, node_ptr this_node)
+ {
+ node_ptr next(NodeTraits::get_next(prev_node));
+ NodeTraits::set_previous(this_node, prev_node);
+ NodeTraits::set_next(this_node, next);
+ NodeTraits::set_previous(next, this_node);
+ NodeTraits::set_next(prev_node, this_node);
+ }
+
+ //! <b>Requires</b>: this_node and other_node must be nodes inserted
+ //! in circular lists or be empty circular lists.
+ //!
+ //! <b>Effects</b>: Swaps the position of the nodes: this_node is inserted in
+ //! other_nodes position in the second circular list and the other_node is inserted
+ //! in this_node's position in the first circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+/*
+ static void swap_nodes(node_ptr this_node, node_ptr other_node)
+ {
+
+ if (other_node == this_node)
+ return;
+ bool empty1 = unique(this_node);
+ bool empty2 = unique(other_node);
+
+ node_ptr next_this(NodeTraits::get_next(this_node));
+ node_ptr prev_this(NodeTraits::get_previous(this_node));
+ node_ptr next_other(NodeTraits::get_next(other_node));
+ node_ptr prev_other(NodeTraits::get_previous(other_node));
+
+ //Do the swap
+ NodeTraits::set_next(this_node, next_other);
+ NodeTraits::set_next(other_node, next_this);
+
+ NodeTraits::set_previous(this_node, prev_other);
+ NodeTraits::set_previous(other_node, prev_this);
+
+ if (empty2){
+ init(this_node);
+ }
+ else{
+ NodeTraits::set_next(prev_other, this_node);
+ NodeTraits::set_previous(next_other, this_node);
+ }
+ if (empty1){
+ init(other_node);
+ }
+ else{
+ NodeTraits::set_next(prev_this, other_node);
+ NodeTraits::set_previous(next_this, other_node);
+ }
+ }
+*/
+
+ //Watanabe version
+ private:
+ static void swap_prev(node_ptr this_node, node_ptr other_node)
+ {
+ node_ptr temp(NodeTraits::get_previous(this_node));
+ NodeTraits::set_previous(this_node, NodeTraits::get_previous(other_node));
+ NodeTraits::set_previous(other_node, temp);
+ }
+ static void swap_next(node_ptr this_node, node_ptr other_node)
+ {
+ node_ptr temp(NodeTraits::get_next(this_node));
+ NodeTraits::set_next(this_node, NodeTraits::get_next(other_node));
+ NodeTraits::set_next(other_node, temp);
+ }
+
+ public:
+ static void swap_nodes(node_ptr this_node, node_ptr other_node)
+ {
+ if (other_node == this_node)
+ return;
+ bool this_inited = inited(this_node);
+ bool other_inited = inited(other_node);
+ if(this_inited){
+ init_header(this_node);
+ }
+ if(other_inited){
+ init_header(other_node);
+ }
+
+ node_ptr next_this(NodeTraits::get_next(this_node));
+ node_ptr prev_this(NodeTraits::get_previous(this_node));
+ node_ptr next_other(NodeTraits::get_next(other_node));
+ node_ptr prev_other(NodeTraits::get_previous(other_node));
+ //these first two swaps must happen before the other two
+ swap_prev(next_this, next_other);
+ swap_next(prev_this, prev_other);
+ swap_next(this_node, other_node);
+ swap_prev(this_node, other_node);
+
+ if(this_inited){
+ init(other_node);
+ }
+ if(other_inited){
+ init(this_node);
+ }
+ }
+
+ //! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
+ //! and p must be a node of a different circular list or may not be an iterator in
+ // [b, e).
+ //!
+ //! <b>Effects</b>: Removes the nodes from [b, e) range from their circular list and inserts
+ //! them before p in p's circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void transfer(node_ptr p, node_ptr b, node_ptr e)
+ {
+ if (b != e) {
+ node_ptr prev_p(NodeTraits::get_previous(p));
+ node_ptr prev_b(NodeTraits::get_previous(b));
+ node_ptr prev_e(NodeTraits::get_previous(e));
+ NodeTraits::set_next(prev_e, p);
+ NodeTraits::set_previous(p, prev_e);
+ NodeTraits::set_next(prev_b, e);
+ NodeTraits::set_previous(e, prev_b);
+ NodeTraits::set_next(prev_p, b);
+ NodeTraits::set_previous(b, prev_p);
+ }
+ }
+
+ //! <b>Requires</b>: i must a node of a circular list
+ //! and p must be a node of a different circular list.
+ //!
+ //! <b>Effects</b>: Removes the node i from its circular list and inserts
+ //! it before p in p's circular list.
+ //! If p == i or p == NodeTraits::get_next(i), this function is a null operation.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void transfer(node_ptr p, node_ptr i)
+ {
+ node_ptr n(NodeTraits::get_next(i));
+ if(n != p && i != p){
+ node_ptr prev_p(NodeTraits::get_previous(p));
+ node_ptr prev_i(NodeTraits::get_previous(i));
+ NodeTraits::set_next(prev_p, i);
+ NodeTraits::set_previous(i, prev_p);
+ NodeTraits::set_next(i, p);
+ NodeTraits::set_previous(p, i);
+ NodeTraits::set_previous(n, prev_i);
+ NodeTraits::set_next(prev_i, n);
+
+ }
+ }
+
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: This function is linear time.
+ static void reverse(node_ptr p)
+ {
+ node_ptr f(NodeTraits::get_next(p));
+ node_ptr i(NodeTraits::get_next(f)), e(p);
+
+ while(i != e) {
+ node_ptr n = i;
+ i = NodeTraits::get_next(i);
+ transfer(f, n, i);
+ f = n;
+ }
+ }
+
+ //! <b>Effects</b>: Moves the node p n positions towards the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of moved positions.
+ static void move_backwards(node_ptr p, std::size_t n)
+ {
+ //Null shift, nothing to do
+ if(!n) return;
+ node_ptr first = NodeTraits::get_next(p);
+ //size() == 0 or 1, nothing to do
+ if(first == NodeTraits::get_previous(p)) return;
+ unlink(p);
+ //Now get the new first node
+ while(n--){
+ first = NodeTraits::get_next(first);
+ }
+ link_before(first, p);
+ }
+
+ //! <b>Effects</b>: Moves the node p n positions towards the beginning of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of moved positions.
+ static void move_forward(node_ptr p, std::size_t n)
+ {
+ //Null shift, nothing to do
+ if(!n) return;
+ node_ptr last = NodeTraits::get_previous(p);
+ //size() == 0 or 1, nothing to do
+ if(last == NodeTraits::get_next(p)) return;
+
+ unlink(p);
+ //Now get the new last node
+ while(n--){
+ last = NodeTraits::get_previous(last);
+ }
+ link_after(last, p);
+ }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_CIRCULAR_LIST_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/circular_slist_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/circular_slist_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,405 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/common_slist_algorithms.hpp>
+#include <boost/intrusive/detail/assert.hpp>
+#include <cstddef>
+
+namespace boost {
+namespace intrusive {
+
+//! circular_slist_algorithms provides basic algorithms to manipulate nodes
+//! forming a circular singly linked list. An empty circular list is formed by a node
+//! whose pointer to the next node points to itself.
+//!
+//! circular_slist_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the circular list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_next(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_next(node_ptr n, node_ptr next);</tt>
+template<class NodeTraits>
+class circular_slist_algorithms
+ /// @cond
+ : public detail::common_slist_algorithms<NodeTraits>
+ /// @endcond
+{
+ /// @cond
+ typedef detail::common_slist_algorithms<NodeTraits> base_t;
+ /// @endcond
+ public:
+ typedef typename NodeTraits::node node;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+ typedef NodeTraits node_traits;
+
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+
+ //! <b>Effects</b>: Constructs an non-used list element, putting the next
+ //! pointer to null:
+ //! <tt>NodeTraits::get_next(this_node) == 0
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void init(node_ptr this_node);
+
+ //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
+ //! or it's a not inserted node:
+ //! <tt>return !NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</tt>
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr this_node);
+
+ //! <b>Effects</b>: Returns true is "this_node" has the same state as
+ //! if it was inited using "init(node_ptr)"
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool inited(const_node_ptr this_node);
+
+ //! <b>Requires</b>: prev_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Unlinks the next node of prev_node from the circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink_after(node_ptr prev_node);
+
+ //! <b>Requires</b>: prev_node and last_node must be in a circular list
+ //! or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Unlinks the range (prev_node, last_node) from the circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink_after(node_ptr prev_node, node_ptr last_node);
+
+ //! <b>Requires</b>: prev_node must be a node of a circular list.
+ //!
+ //! <b>Effects</b>: Links this_node after prev_node in the circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void link_after(node_ptr prev_node, node_ptr this_node);
+
+ //! <b>Requires</b>: b and e must be nodes of the same circular list or an empty range.
+ //! and p must be a node of a different circular list.
+ //!
+ //! <b>Effects</b>: Removes the nodes from (b, e] range from their circular list and inserts
+ //! them after p in p's circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void transfer_after(node_ptr p, node_ptr b, node_ptr e);
+
+ #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+
+ //! <b>Effects</b>: Constructs an empty list, making this_node the only
+ //! node of the circular list:
+ //! <tt>NodeTraits::get_next(this_node) == this_node</tt>.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void init_header(node_ptr this_node)
+ { NodeTraits::set_next(this_node, this_node); }
+
+ //! <b>Requires</b>: this_node and prev_init_node must be in the same circular list.
+ //!
+ //! <b>Effects</b>: Returns the previous node of this_node in the circular list starting.
+ //! the search from prev_init_node. The first node checked for equality
+ //! is NodeTraits::get_next(prev_init_node).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements between prev_init_node and this_node.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_previous_node(node_ptr prev_init_node, node_ptr this_node)
+ { return base_t::get_previous_node(prev_init_node, this_node); }
+
+ //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Returns the previous node of this_node in the circular list.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the circular list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_previous_node(node_ptr this_node)
+ { return base_t::get_previous_node(this_node, this_node); }
+
+ //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Returns the previous node of the previous node of this_node in the circular list.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the circular list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_previous_previous_node(node_ptr this_node)
+ { return get_previous_previous_node(this_node, this_node); }
+
+ //! <b>Requires</b>: this_node and prev_prev_init_node must be in the same circular list.
+ //!
+ //! <b>Effects</b>: Returns the previous node of the previous node of this_node in the
+ //! circular list starting. the search from prev_init_node. The first node checked
+ //! for equality is NodeTraits::get_next((NodeTraits::get_next(prev_prev_init_node)).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the circular list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_previous_previous_node(node_ptr prev_prev_init_node, node_ptr this_node)
+ {
+ node_ptr p = prev_prev_init_node;
+ node_ptr p_next = NodeTraits::get_next(p);
+ node_ptr p_next_next = NodeTraits::get_next(p_next);
+ while (this_node != p_next_next){
+ p = p_next;
+ p_next = p_next_next;
+ p_next_next = NodeTraits::get_next(p_next);
+ }
+ return p;
+ }
+
+ //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes in a circular list. If the circular list
+ //! is empty, returns 1.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr this_node)
+ {
+ std::size_t result = 0;
+ const_node_ptr p = this_node;
+ do{
+ p = NodeTraits::get_next(p);
+ ++result;
+ } while (p != this_node);
+ return result;
+ }
+
+ //! <b>Requires</b>: this_node must be in a circular list, be an empty circular list or be inited.
+ //!
+ //! <b>Effects</b>: Unlinks the node from the circular list.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the circular list
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink(node_ptr this_node)
+ {
+ if(NodeTraits::get_next(this_node))
+ base_t::unlink_after(get_previous_node(this_node));
+ }
+
+ //! <b>Requires</b>: nxt_node must be a node of a circular list.
+ //!
+ //! <b>Effects</b>: Links this_node before nxt_node in the circular list.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the circular list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void link_before (node_ptr nxt_node, node_ptr this_node)
+ { base_t::link_after(get_previous_node(nxt_node), this_node); }
+
+ //! <b>Requires</b>: this_node and other_node must be nodes inserted
+ //! in circular lists or be empty circular lists.
+ //!
+ //! <b>Effects</b>: Swaps the position of the nodes: this_node is inserted in
+ //! other_nodes position in the second circular list and the other_node is inserted
+ //! in this_node's position in the first circular list.
+ //!
+ //! <b>Complexity</b>: Linear to number of elements of both lists
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void swap_nodes(node_ptr this_node, node_ptr other_node)
+ {
+ if (other_node == this_node)
+ return;
+ bool this_inited = base_t::inited(this_node);
+ bool other_inited = base_t::inited(other_node);
+ if(this_inited){
+ base_t::init_header(this_node);
+ }
+ if(other_inited){
+ base_t::init_header(other_node);
+ }
+
+ bool empty1 = base_t::unique(this_node);
+ bool empty2 = base_t::unique(other_node);
+ node_ptr prev_this (get_previous_node(this_node));
+ node_ptr prev_other(get_previous_node(other_node));
+
+ node_ptr this_next (NodeTraits::get_next(this_node));
+ node_ptr other_next(NodeTraits::get_next(other_node));
+ NodeTraits::set_next(this_node, other_next);
+ NodeTraits::set_next(other_node, this_next);
+ NodeTraits::set_next(empty1 ? other_node : prev_this, other_node);
+ NodeTraits::set_next(empty2 ? this_node : prev_other, this_node);
+
+ if(this_inited){
+ base_t::init(other_node);
+ }
+ if(other_inited){
+ base_t::init(this_node);
+ }
+ }
+
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: This function is linear to the contained elements.
+ static void reverse(node_ptr p)
+ {
+ node_ptr i = NodeTraits::get_next(p), e(p);
+ for (;;) {
+ node_ptr nxt(NodeTraits::get_next(i));
+ if (nxt == e)
+ break;
+ base_t::transfer_after(e, i, nxt);
+ }
+ }
+
+ //! <b>Effects</b>: Moves the node p n positions towards the end of the list.
+ //!
+ //! <b>Returns</b>: The previous node of p after the function if there has been any movement,
+ //! Null if n leads to no movement.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
+ static node_ptr move_backwards(node_ptr p, std::size_t n)
+ {
+ //Null shift, nothing to do
+ if(!n) return node_ptr(0);
+ node_ptr first = NodeTraits::get_next(p);
+
+ //count() == 1 or 2, nothing to do
+ if(NodeTraits::get_next(first) == p)
+ return node_ptr(0);
+
+ bool end_found = false;
+ node_ptr new_last(0);
+
+ //Now find the new last node according to the shift count.
+ //If we find p before finding the new last node
+ //unlink p, shortcut the search now that we know the size of the list
+ //and continue.
+ for(std::size_t i = 1; i <= n; ++i){
+ new_last = first;
+ first = NodeTraits::get_next(first);
+ if(first == p){
+ //Shortcut the shift with the modulo of the size of the list
+ n %= i;
+ if(!n)
+ return node_ptr(0);
+ i = 0;
+ //Unlink p and continue the new first node search
+ first = NodeTraits::get_next(p);
+ base_t::unlink_after(new_last);
+ end_found = true;
+ }
+ }
+
+ //If the p has not been found in the previous loop, find it
+ //starting in the new first node and unlink it
+ if(!end_found){
+ base_t::unlink_after(base_t::get_previous_node(first, p));
+ }
+
+ //Now link p after the new last node
+ base_t::link_after(new_last, p);
+ return new_last;
+ }
+
+ //! <b>Effects</b>: Moves the node p n positions towards the beginning of the list.
+ //!
+ //! <b>Returns</b>: The previous node of p after the function if there has been any movement,
+ //! Null if n leads equals to no movement.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
+ static node_ptr move_forward(node_ptr p, std::size_t n)
+ {
+ //Null shift, nothing to do
+ if(!n) return node_ptr(0);
+ node_ptr first = node_traits::get_next(p);
+
+ //count() == 1 or 2, nothing to do
+ if(node_traits::get_next(first) == p) return node_ptr(0);
+
+ //Iterate until p is found to know where the current last node is.
+ //If the shift count is less than the size of the list, we can also obtain
+ //the position of the new last node after the shift.
+ node_ptr old_last(first), next_to_it, new_last(p);
+ std::size_t distance = 1;
+ while(p != (next_to_it = node_traits::get_next(old_last))){
+ if(++distance > n)
+ new_last = node_traits::get_next(new_last);
+ old_last = next_to_it;
+ }
+ //If the shift was bigger or equal than the size, obtain the equivalent
+ //forward shifts and find the new last node.
+ if(distance <= n){
+ //Now find the equivalent forward shifts.
+ //Shortcut the shift with the modulo of the size of the list
+ std::size_t new_before_last_pos = (distance - (n % distance))% distance;
+ //If the shift is a multiple of the size there is nothing to do
+ if(!new_before_last_pos) return node_ptr(0);
+
+ for( new_last = p
+ ; new_before_last_pos--
+ ; new_last = node_traits::get_next(new_last)){
+ //empty
+ }
+ }
+
+ //Now unlink p and link it after the new last node
+ base_t::unlink_after(old_last);
+ base_t::link_after(new_last, p);
+ return new_last;
+ }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_CIRCULAR_SLIST_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/derivation_value_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/derivation_value_traits.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,56 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DERIVATION_VALUE_TRAITS_HPP
+#define BOOST_INTRUSIVE_DERIVATION_VALUE_TRAITS_HPP
+
+#include <boost/intrusive/link_mode.hpp>
+#include <iterator>
+
+namespace boost {
+namespace intrusive {
+
+//!This value traits template is used to create value traits
+//!from user defined node traits where value_traits::value_type will
+//!derive from node_traits::node
+template<class T, class NodeTraits, link_mode_type LinkMode = safe_link>
+struct derivation_value_traits
+{
+ public:
+ typedef NodeTraits node_traits;
+ typedef T value_type;
+ typedef typename node_traits::node node;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+ typedef typename boost::pointer_to_other<node_ptr, T>::type pointer;
+ typedef typename boost::pointer_to_other<node_ptr, const T>::type const_pointer;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ static const link_mode_type link_mode = LinkMode;
+
+ static node_ptr to_node_ptr(reference value)
+ { return node_ptr(&value); }
+
+ static const_node_ptr to_node_ptr(const_reference value)
+ { return node_ptr(&value); }
+
+ static pointer to_value_ptr(node_ptr n)
+ { return pointer(static_cast<T*>(detail::get_pointer(n))); }
+
+ static const_pointer to_value_ptr(const_node_ptr n)
+ { return const_pointer(static_cast<T*>(detail::get_pointer(n))); }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#endif //BOOST_INTRUSIVE_DERIVATION_VALUE_TRAITS_HPP
Added: sandbox/move/boost/intrusive/detail/any_node_and_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/any_node_and_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,296 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_ANY_NODE_HPP
+#define BOOST_INTRUSIVE_ANY_NODE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <cstddef>
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+
+template<class VoidPointer>
+struct any_node
+{
+ typedef typename boost::pointer_to_other
+ <VoidPointer, any_node>::type node_ptr;
+ node_ptr node_ptr_1;
+ node_ptr node_ptr_2;
+ node_ptr node_ptr_3;
+ std::size_t size_t_1;
+};
+
+template<class VoidPointer>
+struct any_list_node_traits
+{
+ typedef any_node<VoidPointer> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ static node_ptr get_next(const_node_ptr n)
+ { return n->node_ptr_1; }
+
+ static void set_next(node_ptr n, node_ptr next)
+ { n->node_ptr_1 = next; }
+
+ static node_ptr get_previous(const_node_ptr n)
+ { return n->node_ptr_2; }
+
+ static void set_previous(node_ptr n, node_ptr prev)
+ { n->node_ptr_2 = prev; }
+};
+
+
+template<class VoidPointer>
+struct any_slist_node_traits
+{
+ typedef any_node<VoidPointer> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ static node_ptr get_next(const_node_ptr n)
+ { return n->node_ptr_1; }
+
+ static void set_next(node_ptr n, node_ptr next)
+ { n->node_ptr_1 = next; }
+};
+
+
+template<class VoidPointer>
+struct any_unordered_node_traits
+ : public any_slist_node_traits<VoidPointer>
+{
+ typedef any_slist_node_traits<VoidPointer> reduced_slist_node_traits;
+ typedef typename reduced_slist_node_traits::node node;
+ typedef typename reduced_slist_node_traits::node_ptr node_ptr;
+ typedef typename reduced_slist_node_traits::const_node_ptr const_node_ptr;
+
+ static const bool store_hash = true;
+ static const bool optimize_multikey = true;
+
+ static node_ptr get_next(const_node_ptr n)
+ { return node_ptr(&static_cast<node &>(*n->node_ptr_1)); }
+
+ static void set_next(node_ptr n, node_ptr next)
+ { n->node_ptr_1 = next; }
+
+ static node_ptr get_prev_in_group(const_node_ptr n)
+ { return n->node_ptr_2; }
+
+ static void set_prev_in_group(node_ptr n, node_ptr prev)
+ { n->node_ptr_2 = prev; }
+
+ static std::size_t get_hash(const_node_ptr n)
+ { return n->size_t_1; }
+
+ static void set_hash(node_ptr n, std::size_t h)
+ { n->size_t_1 = h; }
+};
+
+
+template<class VoidPointer>
+struct any_rbtree_node_traits
+{
+ typedef any_node<VoidPointer> node;
+
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ typedef std::size_t color;
+
+ static node_ptr get_parent(const_node_ptr n)
+ { return n->node_ptr_1; }
+
+ static void set_parent(node_ptr n, node_ptr p)
+ { n->node_ptr_1 = p; }
+
+ static node_ptr get_left(const_node_ptr n)
+ { return n->node_ptr_2; }
+
+ static void set_left(node_ptr n, node_ptr l)
+ { n->node_ptr_2 = l; }
+
+ static node_ptr get_right(const_node_ptr n)
+ { return n->node_ptr_3; }
+
+ static void set_right(node_ptr n, node_ptr r)
+ { n->node_ptr_3 = r; }
+
+ static color get_color(const_node_ptr n)
+ { return n->size_t_1; }
+
+ static void set_color(node_ptr n, color c)
+ { n->size_t_1 = c; }
+
+ static color black()
+ { return 0u; }
+
+ static color red()
+ { return 1u; }
+};
+
+
+template<class VoidPointer>
+struct any_avltree_node_traits
+{
+ typedef any_node<VoidPointer> node;
+
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+ typedef std::size_t balance;
+
+ static node_ptr get_parent(const_node_ptr n)
+ { return n->node_ptr_1; }
+
+ static void set_parent(node_ptr n, node_ptr p)
+ { n->node_ptr_1 = p; }
+
+ static node_ptr get_left(const_node_ptr n)
+ { return n->node_ptr_2; }
+
+ static void set_left(node_ptr n, node_ptr l)
+ { n->node_ptr_2 = l; }
+
+ static node_ptr get_right(const_node_ptr n)
+ { return n->node_ptr_3; }
+
+ static void set_right(node_ptr n, node_ptr r)
+ { n->node_ptr_3 = r; }
+
+ static balance get_balance(const_node_ptr n)
+ { return n->size_t_1; }
+
+ static void set_balance(node_ptr n, balance b)
+ { n->size_t_1 = b; }
+
+ static balance negative()
+ { return 0u; }
+
+ static balance zero()
+ { return 1u; }
+
+ static balance positive()
+ { return 2u; }
+};
+
+
+template<class VoidPointer>
+struct any_tree_node_traits
+{
+ typedef any_node<VoidPointer> node;
+
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ static node_ptr get_parent(const_node_ptr n)
+ { return n->node_ptr_1; }
+
+ static void set_parent(node_ptr n, node_ptr p)
+ { n->node_ptr_1 = p; }
+
+ static node_ptr get_left(const_node_ptr n)
+ { return n->node_ptr_2; }
+
+ static void set_left(node_ptr n, node_ptr l)
+ { n->node_ptr_2 = l; }
+
+ static node_ptr get_right(const_node_ptr n)
+ { return n->node_ptr_3; }
+
+ static void set_right(node_ptr n, node_ptr r)
+ { n->node_ptr_3 = r; }
+};
+
+template<class VoidPointer>
+class any_node_traits
+{
+ public:
+ typedef any_node<VoidPointer> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+};
+
+template<class VoidPointer>
+class any_algorithms
+{
+ template <class T>
+ static void function_not_available_for_any_hooks(typename detail::enable_if<detail::is_same<T, bool> >::type)
+ {}
+
+ public:
+ typedef any_node<VoidPointer> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+ typedef any_node_traits<VoidPointer> node_traits;
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: After the function unique(node) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init(node_ptr node)
+ { node->node_ptr_1 = 0; };
+
+ //! <b>Effects</b>: Returns true if node is in the same state as if called init(node)
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool inited(const_node_ptr node)
+ { return !node->node_ptr_1; };
+
+ static bool unique(const_node_ptr node)
+ { return 0 == node->node_ptr_1; }
+
+ static void unlink(node_ptr)
+ {
+ //Auto-unlink hooks and unlink() are not available for any hooks
+ any_algorithms<VoidPointer>::template function_not_available_for_any_hooks<node_ptr>();
+ }
+
+ static void swap_nodes(node_ptr l, node_ptr r)
+ {
+ //Any nodes have no swap_nodes capability because they don't know
+ //what algorithm they must use to unlink the node from the container
+ any_algorithms<VoidPointer>::template function_not_available_for_any_hooks<node_ptr>();
+ }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_ANY_NODE_HPP
Added: sandbox/move/boost/intrusive/detail/assert.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/assert.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,41 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_ASSERT_HPP
+#define BOOST_INTRUSIVE_DETAIL_ASSERT_HPP
+
+#if defined(_MSC_VER)&&(_MSC_VER>=1200)
+#pragma once
+#endif
+
+#if !defined(BOOST_INTRUSIVE_INVARIANT_ASSERT)
+ #include <boost/assert.hpp>
+ #define BOOST_INTRUSIVE_INVARIANT_ASSERT BOOST_ASSERT
+#elif defined(BOOST_INTRUSIVE_INVARIANT_ASSERT_INCLUDE)
+ #include BOOST_INTRUSIVE_INVARIANT_ASSERT_INCLUDE
+#endif
+
+#if !defined(BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT)
+ #include <boost/assert.hpp>
+ #define BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT BOOST_ASSERT
+#elif defined(BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE)
+ #include BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE
+#endif
+
+#if !defined(BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT)
+ #include <boost/assert.hpp>
+ #define BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT BOOST_ASSERT
+#elif defined(BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE)
+ #include BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE
+#endif
+
+#endif //BOOST_INTRUSIVE_DETAIL_ASSERT_HPP
Added: sandbox/move/boost/intrusive/detail/avltree_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/avltree_node.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,179 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_AVLTREE_NODE_HPP
+#define BOOST_INTRUSIVE_AVLTREE_NODE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/avltree_algorithms.hpp>
+#include <boost/intrusive/pointer_plus_bits.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/////////////////////////////////////////////////////////////////////////////
+// //
+// Generic node_traits for any pointer type //
+// //
+/////////////////////////////////////////////////////////////////////////////
+
+//This is the compact representation: 3 pointers
+template<class VoidPointer>
+struct compact_avltree_node
+{
+ typedef typename pointer_to_other
+ <VoidPointer
+ ,compact_avltree_node<VoidPointer> >::type node_ptr;
+ enum balance { negative_t, zero_t, positive_t };
+ node_ptr parent_, left_, right_;
+};
+
+//This is the normal representation: 3 pointers + enum
+template<class VoidPointer>
+struct avltree_node
+{
+ typedef typename pointer_to_other
+ <VoidPointer
+ ,avltree_node<VoidPointer> >::type node_ptr;
+ enum balance { negative_t, zero_t, positive_t };
+ node_ptr parent_, left_, right_;
+ balance balance_;
+};
+
+//This is the default node traits implementation
+//using a node with 3 generic pointers plus an enum
+template<class VoidPointer>
+struct default_avltree_node_traits_impl
+{
+ typedef avltree_node<VoidPointer> node;
+
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+ typedef typename node::balance balance;
+
+ static node_ptr get_parent(const_node_ptr n)
+ { return n->parent_; }
+
+ static void set_parent(node_ptr n, node_ptr p)
+ { n->parent_ = p; }
+
+ static node_ptr get_left(const_node_ptr n)
+ { return n->left_; }
+
+ static void set_left(node_ptr n, node_ptr l)
+ { n->left_ = l; }
+
+ static node_ptr get_right(const_node_ptr n)
+ { return n->right_; }
+
+ static void set_right(node_ptr n, node_ptr r)
+ { n->right_ = r; }
+
+ static balance get_balance(const_node_ptr n)
+ { return n->balance_; }
+
+ static void set_balance(node_ptr n, balance b)
+ { n->balance_ = b; }
+
+ static balance negative()
+ { return node::negative_t; }
+
+ static balance zero()
+ { return node::zero_t; }
+
+ static balance positive()
+ { return node::positive_t; }
+};
+
+//This is the compact node traits implementation
+//using a node with 3 generic pointers
+template<class VoidPointer>
+struct compact_avltree_node_traits_impl
+{
+ typedef compact_avltree_node<VoidPointer> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+ typedef typename node::balance balance;
+
+ typedef pointer_plus_bits<node_ptr, 2> ptr_bit;
+
+ static node_ptr get_parent(const_node_ptr n)
+ { return ptr_bit::get_pointer(n->parent_); }
+
+ static void set_parent(node_ptr n, node_ptr p)
+ { ptr_bit::set_pointer(n->parent_, p); }
+
+ static node_ptr get_left(const_node_ptr n)
+ { return n->left_; }
+
+ static void set_left(node_ptr n, node_ptr l)
+ { n->left_ = l; }
+
+ static node_ptr get_right(const_node_ptr n)
+ { return n->right_; }
+
+ static void set_right(node_ptr n, node_ptr r)
+ { n->right_ = r; }
+
+ static balance get_balance(const_node_ptr n)
+ { return (balance)ptr_bit::get_bits(n->parent_); }
+
+ static void set_balance(node_ptr n, balance b)
+ { ptr_bit::set_bits(n->parent_, (std::size_t)b); }
+
+ static balance negative()
+ { return node::negative_t; }
+
+ static balance zero()
+ { return node::zero_t; }
+
+ static balance positive()
+ { return node::positive_t; }
+};
+
+//Dispatches the implementation based on the boolean
+template<class VoidPointer, bool Compact>
+struct avltree_node_traits_dispatch
+ : public default_avltree_node_traits_impl<VoidPointer>
+{};
+
+template<class VoidPointer>
+struct avltree_node_traits_dispatch<VoidPointer, true>
+ : public compact_avltree_node_traits_impl<VoidPointer>
+{};
+
+//Inherit from the detail::link_dispatch depending on the embedding capabilities
+template<class VoidPointer, bool OptimizeSize = false>
+struct avltree_node_traits
+ : public avltree_node_traits_dispatch
+ < VoidPointer
+ , OptimizeSize &&
+ max_pointer_plus_bits
+ < VoidPointer
+ , detail::alignment_of<compact_avltree_node<VoidPointer> >::value
+ >::value >= 2u
+ >
+{};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_AVLTREE_NODE_HPP
Added: sandbox/move/boost/intrusive/detail/clear_on_destructor_base.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/clear_on_destructor_base.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,36 @@
+//////} // ///////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2008-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_CLEAR_ON_DESTRUCTOR_HPP
+#define BOOST_INTRUSIVE_DETAIL_CLEAR_ON_DESTRUCTOR_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template<class Derived>
+class clear_on_destructor_base
+{
+ protected:
+ ~clear_on_destructor_base()
+ {
+ static_cast<Derived*>(this)->clear();
+ }
+};
+
+} // namespace detail {
+} // namespace intrusive {
+} // namespace boost {
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTRUSIVE_DETAIL_CLEAR_ON_DESTRUCTOR_HPP
Added: sandbox/move/boost/intrusive/detail/common_slist_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/common_slist_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,103 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/assert.hpp>
+#include <cstddef>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template<class NodeTraits>
+class common_slist_algorithms
+{
+ public:
+ typedef typename NodeTraits::node node;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+ typedef NodeTraits node_traits;
+
+ static node_ptr get_previous_node(node_ptr prev_init_node, node_ptr this_node)
+ {
+ node_ptr p = prev_init_node;
+ for( node_ptr p_next
+ ; this_node != (p_next = NodeTraits::get_next(p))
+ ; p = p_next){
+ //Logic error: possible use of linear lists with
+ //operations only permitted with lists
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(p);
+ }
+ return p;
+ }
+
+ static void init_header(node_ptr this_node)
+ { NodeTraits::set_next(this_node, this_node); }
+
+ static void init(node_ptr this_node)
+ { NodeTraits::set_next(this_node, node_ptr(0)); }
+
+ static bool unique(const_node_ptr this_node)
+ {
+ node_ptr next = NodeTraits::get_next(this_node);
+ return !next || next == this_node;
+ }
+
+ static bool inited(const_node_ptr this_node)
+ { return !NodeTraits::get_next(this_node); }
+
+ static void unlink_after(node_ptr prev_node)
+ {
+ node_ptr this_node(NodeTraits::get_next(prev_node));
+ NodeTraits::set_next(prev_node, NodeTraits::get_next(this_node));
+ }
+
+ static void unlink_after(node_ptr prev_node, node_ptr last_node)
+ { NodeTraits::set_next(prev_node, last_node); }
+
+ static void link_after(node_ptr prev_node, node_ptr this_node)
+ {
+ NodeTraits::set_next(this_node, NodeTraits::get_next(prev_node));
+ NodeTraits::set_next(prev_node, this_node);
+ }
+
+ static void incorporate_after(node_ptr bp, node_ptr b, node_ptr be)
+ {
+ node_ptr p(NodeTraits::get_next(bp));
+ NodeTraits::set_next(bp, b);
+ NodeTraits::set_next(be, p);
+ }
+
+ static void transfer_after(node_ptr bp, node_ptr bb, node_ptr be)
+ {
+ if (bp != bb && bp != be && bb != be) {
+ node_ptr next_b = NodeTraits::get_next(bb);
+ node_ptr next_e = NodeTraits::get_next(be);
+ node_ptr next_p = NodeTraits::get_next(bp);
+ NodeTraits::set_next(bb, next_e);
+ NodeTraits::set_next(be, next_p);
+ NodeTraits::set_next(bp, next_b);
+ }
+ }
+};
+
+} //namespace detail
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_COMMON_SLIST_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/detail/config_begin.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/config_begin.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_CONFIG_INCLUDED
+#define BOOST_INTRUSIVE_CONFIG_INCLUDED
+#include <boost/config.hpp>
+#endif
+
+#ifdef BOOST_MSVC
+
+ #pragma warning (push)
+ //
+ //'function' : resolved overload was found by argument-dependent lookup
+ //A function found by argument-dependent lookup (Koenig lookup) was eventually
+ //chosen by overload resolution.
+ //
+ //In Visual C++ .NET and earlier compilers, a different function would have
+ //been called. To pick the original function, use an explicitly qualified name.
+ //
+
+ //warning C4275: non dll-interface class 'x' used as base for
+ //dll-interface class 'Y'
+ #pragma warning (disable : 4275)
+ //warning C4251: 'x' : class 'y' needs to have dll-interface to
+ //be used by clients of class 'z'
+ #pragma warning (disable : 4251)
+ #pragma warning (disable : 4675)
+ #pragma warning (disable : 4996)
+ #pragma warning (disable : 4503)
+ #pragma warning (disable : 4284) // odd return type for operator->
+ #pragma warning (disable : 4244) // possible loss of data
+ #pragma warning (disable : 4521) ////Disable "multiple copy constructors specified"
+ #pragma warning (disable : 4522)
+ #pragma warning (disable : 4146)
+ #pragma warning (disable : 4267) //conversion from 'X' to 'Y', possible loss of data
+ #pragma warning (disable : 4127) //conditional expression is constant
+ #pragma warning (disable : 4706) //assignment within conditional expression
+ #pragma warning (disable : 4541) //'typeid' used on polymorphic type 'boost::exception' with /GR-
+ #pragma warning (disable : 4512) //'typeid' used on polymorphic type 'boost::exception' with /GR-
+#endif
+
+//#define BOOST_INTRUSIVE_USE_ITERATOR_FACADE
+//#define BOOST_INTRUSIVE_USE_ITERATOR_ENABLE_IF_CONVERTIBLE
Added: sandbox/move/boost/intrusive/detail/config_end.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/config_end.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,15 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#if defined BOOST_MSVC
+ #pragma warning (pop)
+#endif
Added: sandbox/move/boost/intrusive/detail/ebo_functor_holder.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/ebo_functor_holder.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,95 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Joaquin M Lopez Munoz 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP
+#define BOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template<typename T, bool IsEmpty = true>
+class ebo_functor_holder_impl
+{
+ public:
+ ebo_functor_holder_impl()
+ {}
+ ebo_functor_holder_impl(const T& t)
+ : t_(t)
+ {}
+ template<class Arg1, class Arg2>
+ ebo_functor_holder_impl(const Arg1& arg1, const Arg2& arg2)
+ : t_(arg1, arg2)
+ {}
+
+ T& get(){return t_;}
+ const T& get()const{return t_;}
+
+ private:
+ T t_;
+};
+
+template<typename T>
+class ebo_functor_holder_impl<T, false>
+ : public T
+{
+ public:
+ ebo_functor_holder_impl()
+ {}
+ ebo_functor_holder_impl(const T& t)
+ : T(t)
+ {}
+ template<class Arg1, class Arg2>
+ ebo_functor_holder_impl(const Arg1& arg1, const Arg2& arg2)
+ : T(arg1, arg2)
+ {}
+
+ T& get(){return *this;}
+ const T& get()const{return *this;}
+};
+
+template<typename T>
+class ebo_functor_holder
+ : public ebo_functor_holder_impl<T, is_unary_or_binary_function<T>::value>
+{
+ private:
+ typedef ebo_functor_holder_impl<T, is_unary_or_binary_function<T>::value> super;
+
+ public:
+ ebo_functor_holder(){}
+ ebo_functor_holder(const T& t)
+ : super(t)
+ {}
+
+ template<class Arg1, class Arg2>
+ ebo_functor_holder(const Arg1& arg1, const Arg2& arg2)
+ : super(arg1, arg2)
+ {}
+
+ ebo_functor_holder& operator=(const ebo_functor_holder& x)
+ {
+ this->get()=x.get();
+ return *this;
+ }
+};
+
+
+} //namespace detail {
+} //namespace intrusive {
+} //namespace boost {
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTRUSIVE_DETAIL_EBO_HOLDER_HPP
Added: sandbox/move/boost/intrusive/detail/function_detector.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/function_detector.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,87 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+// This code was modified from the code posted by Alexandre Courpron in his
+// article "Interface Detection" in The Code Project:
+///////////////////////////////////////////////////////////////////////////////
+// Copyright 2007 Alexandre Courpron
+//
+// Permission to use, copy, modify, redistribute and sell this software,
+// provided that this copyright notice appears on all copies of the software.
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP
+#define BOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace function_detector {
+
+ typedef char NotFoundType;
+ struct StaticFunctionType { NotFoundType x [2]; };
+ struct NonStaticFunctionType { NotFoundType x [3]; };
+
+ enum
+ { NotFound = 0,
+ StaticFunction = sizeof( StaticFunctionType ) - sizeof( NotFoundType ),
+ NonStaticFunction = sizeof( NonStaticFunctionType ) - sizeof( NotFoundType )
+ };
+
+} //namespace boost {
+} //namespace intrusive {
+} //namespace function_detector {
+
+#define BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(Identifier, InstantiationKey) \
+ namespace boost { \
+ namespace intrusive { \
+ namespace function_detector { \
+ template < class T, \
+ class NonStaticType, \
+ class NonStaticConstType, \
+ class StaticType > \
+ class DetectMember_##InstantiationKey_##Identifier { \
+ template < NonStaticType > \
+ struct TestNonStaticNonConst ; \
+ \
+ template < NonStaticConstType > \
+ struct TestNonStaticConst ; \
+ \
+ template < StaticType > \
+ struct TestStatic ; \
+ \
+ template <class U > \
+ static NonStaticFunctionType Test( TestNonStaticNonConst<&U::Identifier>*, int ); \
+ \
+ template <class U > \
+ static NonStaticFunctionType Test( TestNonStaticConst<&U::Identifier>*, int ); \
+ \
+ template <class U> \
+ static StaticFunctionType Test( TestStatic<&U::Identifier>*, int ); \
+ \
+ template <class U> \
+ static NotFoundType Test( ... ); \
+ public : \
+ static const int check = NotFound + (sizeof(Test<T>(0, 0)) - sizeof(NotFoundType));\
+ };\
+}}} //namespace boost::intrusive::function_detector {
+
+#define BOOST_INTRUSIVE_DETECT_FUNCTION(Class, InstantiationKey, ReturnType, Identifier, Params) \
+ ::boost::intrusive::function_detector::DetectMember_##InstantiationKey_##Identifier< Class,\
+ ReturnType (Class::*)Params,\
+ ReturnType (Class::*)Params const,\
+ ReturnType (*)Params \
+ >::check
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //@ifndef BOOST_INTRUSIVE_DETAIL_FUNCTION_DETECTOR_HPP
Added: sandbox/move/boost/intrusive/detail/generic_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/generic_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,203 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_GENERIC_HOOK_HPP
+#define BOOST_INTRUSIVE_GENERIC_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/static_assert.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+/// @cond
+
+enum
+{ NoBaseHook
+, ListBaseHook
+, SlistBaseHook
+, SetBaseHook
+, UsetBaseHook
+, SplaySetBaseHook
+, AvlSetBaseHook
+, BsSetBaseHook
+, AnyBaseHook
+};
+
+struct no_default_definer{};
+
+template <class Hook, unsigned int>
+struct default_definer;
+
+template <class Hook>
+struct default_definer<Hook, ListBaseHook>
+{ typedef Hook default_list_hook; };
+
+template <class Hook>
+struct default_definer<Hook, SlistBaseHook>
+{ typedef Hook default_slist_hook; };
+
+template <class Hook>
+struct default_definer<Hook, SetBaseHook>
+{ typedef Hook default_set_hook; };
+
+template <class Hook>
+struct default_definer<Hook, UsetBaseHook>
+{ typedef Hook default_uset_hook; };
+
+template <class Hook>
+struct default_definer<Hook, SplaySetBaseHook>
+{ typedef Hook default_splay_set_hook; };
+
+template <class Hook>
+struct default_definer<Hook, AvlSetBaseHook>
+{ typedef Hook default_avl_set_hook; };
+
+template <class Hook>
+struct default_definer<Hook, BsSetBaseHook>
+{ typedef Hook default_bs_set_hook; };
+
+template <class Hook>
+struct default_definer<Hook, AnyBaseHook>
+{ typedef Hook default_any_hook; };
+
+template <class Hook, unsigned int BaseHookType>
+struct make_default_definer
+{
+ typedef typename detail::if_c
+ < BaseHookType != 0
+ , default_definer<Hook, BaseHookType>
+ , no_default_definer>::type type;
+};
+
+template
+ < class GetNodeAlgorithms
+ , class Tag
+ , link_mode_type LinkMode
+ , int HookType
+ >
+struct make_node_holder
+{
+ typedef typename detail::if_c
+ <!detail::is_same<Tag, member_tag>::value
+ , detail::node_holder
+ < typename GetNodeAlgorithms::type::node
+ , Tag
+ , LinkMode
+ , HookType>
+ , typename GetNodeAlgorithms::type::node
+ >::type type;
+};
+
+/// @endcond
+
+template
+ < class GetNodeAlgorithms
+ , class Tag
+ , link_mode_type LinkMode
+ , int HookType
+ >
+class generic_hook
+ /// @cond
+
+ //If the hook is a base hook, derive generic hook from detail::node_holder
+ //so that a unique base class is created to convert from the node
+ //to the type. This mechanism will be used by base_hook_traits.
+ //
+ //If the hook is a member hook, generic hook will directly derive
+ //from the hook.
+ : public make_default_definer
+ < generic_hook<GetNodeAlgorithms, Tag, LinkMode, HookType>
+ , detail::is_same<Tag, default_tag>::value*HookType
+ >::type
+ , public make_node_holder<GetNodeAlgorithms, Tag, LinkMode, HookType>::type
+ /// @endcond
+{
+ /// @cond
+ typedef typename GetNodeAlgorithms::type node_algorithms;
+ typedef typename node_algorithms::node node;
+ typedef typename node_algorithms::node_ptr node_ptr;
+ typedef typename node_algorithms::const_node_ptr const_node_ptr;
+
+ public:
+ struct boost_intrusive_tags
+ {
+ static const int hook_type = HookType;
+ static const link_mode_type link_mode = LinkMode;
+ typedef Tag tag;
+ typedef typename GetNodeAlgorithms::type::node_traits node_traits;
+ static const bool is_base_hook = !detail::is_same<Tag, member_tag>::value;
+ static const bool safemode_or_autounlink =
+ (int)link_mode == (int)auto_unlink || (int)link_mode == (int)safe_link;
+ };
+
+ public:
+ /// @endcond
+
+ generic_hook()
+ {
+ if(boost_intrusive_tags::safemode_or_autounlink){
+ node_algorithms::init(static_cast<node*>(this));
+ }
+ }
+
+ generic_hook(const generic_hook& )
+ {
+ if(boost_intrusive_tags::safemode_or_autounlink){
+ node_algorithms::init(static_cast<node*>(this));
+ }
+ }
+
+ generic_hook& operator=(const generic_hook& )
+ { return *this; }
+
+ ~generic_hook()
+ {
+ destructor_impl
+ (*this, detail::link_dispatch<boost_intrusive_tags::link_mode>());
+ }
+
+ void swap_nodes(generic_hook &other)
+ {
+ node_algorithms::swap_nodes
+ ( static_cast<node*>(this), static_cast<node*>(&other));
+ }
+
+ bool is_linked() const
+ {
+ //is_linked() can be only used in safe-mode or auto-unlink
+ BOOST_STATIC_ASSERT(( boost_intrusive_tags::safemode_or_autounlink ));
+ return !node_algorithms::unique
+ (static_cast<const node*>(this));
+ }
+
+ void unlink()
+ {
+ BOOST_STATIC_ASSERT(( (int)boost_intrusive_tags::link_mode == (int)auto_unlink ));
+ node_algorithms::unlink(static_cast<node*>(this));
+ node_algorithms::init(static_cast<node*>(this));
+ }
+};
+
+} //namespace detail
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_GENERIC_HOOK_HPP
Added: sandbox/move/boost/intrusive/detail/hashtable_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/hashtable_node.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,203 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_HASHTABLE_NODE_HPP
+#define BOOST_INTRUSIVE_HASHTABLE_NODE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/circular_list_algorithms.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/slist_node.hpp> //remove-me
+#include <cstddef>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template<int Dummy = 0>
+struct prime_list_holder
+{
+ static const std::size_t prime_list[];
+ static const std::size_t prime_list_size;
+};
+
+template<int Dummy>
+const std::size_t prime_list_holder<Dummy>::prime_list[] = {
+ 53ul, 97ul, 193ul, 389ul, 769ul,
+ 1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
+ 49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
+ 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
+ 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
+ 1610612741ul, 3221225473ul, 4294967291ul };
+
+template<int Dummy>
+const std::size_t prime_list_holder<Dummy>::prime_list_size
+ = sizeof(prime_list)/sizeof(std::size_t);
+
+template <class Slist>
+struct bucket_impl : public Slist
+{
+ typedef Slist slist_type;
+ bucket_impl()
+ {}
+
+ bucket_impl(const bucket_impl &)
+ {}
+
+ ~bucket_impl()
+ {
+ //This bucket is still being used!
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(Slist::empty());
+ }
+
+ bucket_impl &operator=(const bucket_impl&)
+ {
+ //This bucket is still in use!
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(Slist::empty());
+ //Slist::clear();
+ return *this;
+ }
+};
+
+template<class Slist>
+struct bucket_traits_impl
+{
+ /// @cond
+ typedef typename boost::pointer_to_other
+ < typename Slist::pointer, bucket_impl<Slist> >::type bucket_ptr;
+ typedef typename Slist::size_type size_type;
+ /// @endcond
+
+ bucket_traits_impl(bucket_ptr buckets, size_type len)
+ : buckets_(buckets), buckets_len_(len)
+ {}
+
+ bucket_ptr bucket_begin() const
+ { return buckets_; }
+
+ size_type bucket_count() const
+ { return buckets_len_; }
+
+ private:
+ bucket_ptr buckets_;
+ size_type buckets_len_;
+};
+
+template<class Container, bool IsConst>
+class hashtable_iterator
+ : public std::iterator
+ < std::forward_iterator_tag
+ , typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>::type
+ >
+{
+ typedef typename Container::real_value_traits real_value_traits;
+ typedef typename Container::siterator siterator;
+ typedef typename Container::const_siterator const_siterator;
+ typedef typename Container::bucket_type bucket_type;
+ typedef typename boost::pointer_to_other
+ < typename Container::pointer, const Container>::type const_cont_ptr;
+ typedef typename Container::size_type size_type;
+
+ static typename Container::node_ptr downcast_bucket(typename bucket_type::node_ptr p)
+ { return typename Container::node_ptr(&static_cast<typename Container::node&>(*p)); }
+
+ public:
+ typedef typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>::type value_type;
+
+ hashtable_iterator ()
+ {}
+
+ explicit hashtable_iterator(siterator ptr, const Container *cont)
+ : slist_it_ (ptr), cont_ (cont)
+ {}
+
+ hashtable_iterator(const hashtable_iterator<Container, false> &other)
+ : slist_it_(other.slist_it()), cont_(other.get_container())
+ {}
+
+ const siterator &slist_it() const
+ { return slist_it_; }
+
+ hashtable_iterator<Container, false> unconst() const
+ { return hashtable_iterator<Container, false>(this->slist_it(), this->get_container()); }
+
+ public:
+ hashtable_iterator& operator++()
+ { this->increment(); return *this; }
+
+ hashtable_iterator operator++(int)
+ {
+ hashtable_iterator result (*this);
+ this->increment();
+ return result;
+ }
+
+ friend bool operator== (const hashtable_iterator& i, const hashtable_iterator& i2)
+ { return i.slist_it_ == i2.slist_it_; }
+
+ friend bool operator!= (const hashtable_iterator& i, const hashtable_iterator& i2)
+ { return !(i == i2); }
+
+ value_type& operator*() const
+ { return *this->operator ->(); }
+
+ value_type* operator->() const
+ { return detail::get_pointer(this->get_real_value_traits()->to_value_ptr(downcast_bucket(slist_it_.pointed_node()))); }
+
+ const Container *get_container() const
+ { return detail::get_pointer(cont_); }
+
+ const real_value_traits *get_real_value_traits() const
+ { return &this->get_container()->get_real_value_traits(); }
+
+ private:
+ void increment()
+ {
+ const Container *cont = detail::get_pointer(cont_);
+ bucket_type* buckets = detail::get_pointer(cont->bucket_pointer());
+ size_type buckets_len = cont->bucket_count();
+
+ ++slist_it_;
+ if(buckets[0].cend().pointed_node() <= slist_it_.pointed_node() &&
+ slist_it_.pointed_node()<= buckets[buckets_len].cend().pointed_node() ){
+ //Now get the bucket_impl from the iterator
+ const bucket_type &b = static_cast<const bucket_type&>
+ (bucket_type::slist_type::container_from_end_iterator(slist_it_));
+
+ //Now just calculate the index b has in the bucket array
+ size_type n_bucket = static_cast<size_type>(&b - &buckets[0]);
+ do{
+ if (++n_bucket == buckets_len){
+ slist_it_ = (&buckets[0] + buckets_len)->end();
+ break;
+ }
+ slist_it_ = buckets[n_bucket].begin();
+ }
+ while (slist_it_ == buckets[n_bucket].end());
+ }
+ }
+
+ siterator slist_it_;
+ const_cont_ptr cont_;
+};
+
+} //namespace detail {
+} //namespace intrusive {
+} //namespace boost {
+
+#endif
Added: sandbox/move/boost/intrusive/detail/is_stateful_value_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/is_stateful_value_traits.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,56 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
+#define BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/function_detector.hpp>
+
+BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_node_ptr, boost_intrusive)
+BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_value_ptr, boost_intrusive)
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template<class ValueTraits>
+struct is_stateful_value_traits
+{
+ typedef typename ValueTraits::node_ptr node_ptr;
+ typedef typename ValueTraits::pointer pointer;
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ValueTraits::const_node_ptr const_node_ptr;
+ typedef typename ValueTraits::const_pointer const_pointer;
+
+ typedef ValueTraits value_traits;
+
+ static const bool value =
+ (boost::intrusive::function_detector::NonStaticFunction ==
+ (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, node_ptr, to_node_ptr, (value_type&) )))
+ ||
+ (boost::intrusive::function_detector::NonStaticFunction ==
+ (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, pointer, to_value_ptr, (node_ptr) )))
+ ||
+ (boost::intrusive::function_detector::NonStaticFunction ==
+ (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_node_ptr, to_node_ptr, (const value_type&) )))
+ ||
+ (boost::intrusive::function_detector::NonStaticFunction ==
+ (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_pointer, to_value_ptr, (const_node_ptr) )))
+ ;
+};
+
+}}}
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //@ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
Added: sandbox/move/boost/intrusive/detail/list_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/list_node.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,188 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_LIST_NODE_HPP
+#define BOOST_INTRUSIVE_LIST_NODE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+
+namespace boost {
+namespace intrusive {
+
+// list_node_traits can be used with circular_list_algorithms and supplies
+// a list_node holding the pointers needed for a double-linked list
+// it is used by list_derived_node and list_member_node
+
+template<class VoidPointer>
+struct list_node
+{
+ typedef typename boost::pointer_to_other
+ <VoidPointer, list_node>::type node_ptr;
+ node_ptr next_;
+ node_ptr prev_;
+};
+
+template<class VoidPointer>
+struct list_node_traits
+{
+ typedef list_node<VoidPointer> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ static node_ptr get_previous(const_node_ptr n)
+ { return n->prev_; }
+
+ static void set_previous(node_ptr n, node_ptr prev)
+ { n->prev_ = prev; }
+
+ static node_ptr get_next(const_node_ptr n)
+ { return n->next_; }
+
+ static void set_next(node_ptr n, node_ptr next)
+ { n->next_ = next; }
+};
+
+// list_iterator provides some basic functions for a
+// node oriented bidirectional iterator:
+template<class Container, bool IsConst>
+class list_iterator
+ : public std::iterator
+ < std::bidirectional_iterator_tag
+ , typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>::type
+ >
+{
+ protected:
+ typedef typename Container::real_value_traits real_value_traits;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, void>::type void_pointer;
+ static const bool store_container_ptr =
+ detail::store_cont_ptr_on_it<Container>::value;
+
+ public:
+ typedef typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>
+ ::type value_type;
+ typedef value_type & reference;
+ typedef value_type * pointer;
+
+ list_iterator()
+ : members_ (node_ptr(0), 0)
+ {}
+
+ explicit list_iterator(node_ptr node, const Container *cont_ptr)
+ : members_ (node, cont_ptr)
+ {}
+
+ list_iterator(list_iterator<Container, false> const& other)
+ : members_(other.pointed_node(), other.get_container())
+ {}
+
+ const node_ptr &pointed_node() const
+ { return members_.nodeptr_; }
+
+ list_iterator &operator=(const node_ptr &node)
+ { members_.nodeptr_ = node; return static_cast<list_iterator&>(*this); }
+
+ public:
+ list_iterator& operator++()
+ {
+ members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
+ return static_cast<list_iterator&> (*this);
+ }
+
+ list_iterator operator++(int)
+ {
+ list_iterator result (*this);
+ members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
+ return result;
+ }
+
+ list_iterator& operator--()
+ {
+ members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_);
+ return static_cast<list_iterator&> (*this);
+ }
+
+ list_iterator operator--(int)
+ {
+ list_iterator result (*this);
+ members_.nodeptr_ = node_traits::get_previous(members_.nodeptr_);
+ return result;
+ }
+
+ bool operator== (const list_iterator& i) const
+ { return members_.nodeptr_ == i.pointed_node(); }
+
+ bool operator!= (const list_iterator& i) const
+ { return !operator== (i); }
+
+ value_type& operator*() const
+ { return *operator->(); }
+
+ pointer operator->() const
+ { return detail::get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
+
+ const Container *get_container() const
+ {
+ if(store_container_ptr){
+ const Container* c = static_cast<const Container*>(members_.get_ptr());
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(c != 0);
+ return c;
+ }
+ else{
+ return 0;
+ }
+ }
+
+ const real_value_traits *get_real_value_traits() const
+ {
+ if(store_container_ptr)
+ return &this->get_container()->get_real_value_traits();
+ else
+ return 0;
+ }
+
+ list_iterator<Container, false> unconst() const
+ { return list_iterator<Container, false>(this->pointed_node(), this->get_container()); }
+
+ private:
+ struct members
+ : public detail::select_constptr
+ <void_pointer, store_container_ptr>::type
+ {
+ typedef typename detail::select_constptr
+ <void_pointer, store_container_ptr>::type Base;
+
+ members(const node_ptr &n_ptr, const void *cont)
+ : Base(cont), nodeptr_(n_ptr)
+ {}
+
+ node_ptr nodeptr_;
+ } members_;
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_LIST_NODE_HPP
Added: sandbox/move/boost/intrusive/detail/mpl.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/mpl.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,370 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_MPL_HPP
+#define BOOST_INTRUSIVE_DETAIL_MPL_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <cstddef>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+typedef char one;
+struct two {one _[2];};
+
+template< bool C_ >
+struct bool_
+{
+ static const bool value = C_;
+};
+
+typedef bool_<true> true_;
+typedef bool_<false> false_;
+
+typedef true_ true_type;
+typedef false_ false_type;
+
+typedef char yes_type;
+struct no_type
+{
+ char padding[8];
+};
+
+template <bool B, class T = void>
+struct enable_if_c {
+ typedef T type;
+};
+
+template <class T>
+struct enable_if_c<false, T> {};
+
+template <class Cond, class T = void>
+struct enable_if : public enable_if_c<Cond::value, T>{};
+
+template<class F, class Param>
+struct apply
+{
+ typedef typename F::template apply<Param>::type type;
+};
+
+template <class T, class U>
+class is_convertible
+{
+ typedef char true_t;
+ class false_t { char dummy[2]; };
+ static true_t dispatch(U);
+ static false_t dispatch(...);
+ static const T &trigger();
+ public:
+ static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t);
+};
+
+template<
+ bool C
+ , typename T1
+ , typename T2
+ >
+struct if_c
+{
+ typedef T1 type;
+};
+
+template<
+ typename T1
+ , typename T2
+ >
+struct if_c<false,T1,T2>
+{
+ typedef T2 type;
+};
+
+template<
+ typename C
+ , typename T1
+ , typename T2
+ >
+struct if_
+{
+ typedef typename if_c<0 != C::value, T1, T2>::type type;
+};
+
+template<
+ bool C
+ , typename F1
+ , typename F2
+ >
+struct eval_if_c
+ : if_c<C,F1,F2>::type
+{};
+
+template<
+ typename C
+ , typename T1
+ , typename T2
+ >
+struct eval_if
+ : if_<C,T1,T2>::type
+{};
+
+// identity is an extension: it is not part of the standard.
+template <class T>
+struct identity
+{
+ typedef T type;
+};
+
+#if defined(BOOST_MSVC) || defined(__BORLANDC_)
+#define BOOST_INTRUSIVE_TT_DECL __cdecl
+#else
+#define BOOST_INTRUSIVE_TT_DECL
+#endif
+
+#if defined(_MSC_EXTENSIONS) && !defined(__BORLAND__) && !defined(_WIN64)
+#define BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
+#endif
+
+template <typename T>
+struct is_unary_or_binary_function_impl
+{ static const bool value = false; };
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (*)()>
+{ static const bool value = true; };
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (*)(...)>
+{ static const bool value = true; };
+/*
+#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (__stdcall*)()>
+{ static const bool value = true; };
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (__stdcall*)(...)>
+{ static const bool value = true; };
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (__stdcall*)(...)>
+{ static const bool value = true; };
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (__fastcall*)()>
+{ static const bool value = true; };
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (__fastcall*)(...)>
+{ static const bool value = true; };
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (__cdecl*)()>
+{ static const bool value = true; };
+
+template <typename R>
+struct is_unary_or_binary_function_impl<R (__cdecl*)(...)>
+{ static const bool value = true; };
+#endif
+*/
+template <typename R, class T0>
+struct is_unary_or_binary_function_impl<R (*)(T0)>
+{ static const bool value = true; };
+
+template <typename R, class T0>
+struct is_unary_or_binary_function_impl<R (*)(T0...)>
+{ static const bool value = true; };
+
+#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
+
+template <typename R, class T0>
+struct is_unary_or_binary_function_impl<R (__stdcall*)(T0)>
+{ static const bool value = true; };
+/*
+template <typename R, class T0>
+struct is_unary_or_binary_function_impl<R (__stdcall*)(T0...)>
+{ static const bool value = true; };
+
+template <typename R, class T0>
+struct is_unary_or_binary_function_impl<R (__fastcall*)(T0)>
+{ static const bool value = true; };
+
+template <typename R, class T0>
+struct is_unary_or_binary_function_impl<R (__fastcall*)(T0...)>
+{ static const bool value = true; };
+
+template <typename R, class T0>
+struct is_unary_or_binary_function_impl<R (__cdecl*)(T0)>
+{ static const bool value = true; };
+
+template <typename R, class T0>
+struct is_unary_or_binary_function_impl<R (__cdecl*)(T0...)>
+{ static const bool value = true; };
+*/
+#endif
+
+template <typename R, class T0, class T1>
+struct is_unary_or_binary_function_impl<R (*)(T0, T1)>
+{ static const bool value = true; };
+
+template <typename R, class T0, class T1>
+struct is_unary_or_binary_function_impl<R (*)(T0, T1...)>
+{ static const bool value = true; };
+/*
+#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
+
+template <typename R, class T0, class T1>
+struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1)>
+{ static const bool value = true; };
+
+template <typename R, class T0, class T1>
+struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1...)>
+{ static const bool value = true; };
+
+template <typename R, class T0, class T1>
+struct is_unary_or_binary_function_impl<R (__fastcall*)(T0, T1)>
+{ static const bool value = true; };
+
+template <typename R, class T0, class T1>
+struct is_unary_or_binary_function_impl<R (__fastcall*)(T0, T1...)>
+{ static const bool value = true; };
+
+template <typename R, class T0, class T1>
+struct is_unary_or_binary_function_impl<R (__cdecl*)(T0, T1)>
+{ static const bool value = true; };
+
+template <typename R, class T0, class T1>
+struct is_unary_or_binary_function_impl<R (__cdecl*)(T0, T1...)>
+{ static const bool value = true; };
+#endif
+*/
+template <typename T>
+struct is_unary_or_binary_function_impl<T&>
+{ static const bool value = false; };
+
+template<typename T>
+struct is_unary_or_binary_function
+{ static const bool value = is_unary_or_binary_function_impl<T>::value; };
+
+//boost::alignment_of yields to 10K lines of preprocessed code, so we
+//need an alternative
+template <typename T> struct alignment_of;
+
+template <typename T>
+struct alignment_of_hack
+{
+ char c;
+ T t;
+ alignment_of_hack();
+};
+
+template <unsigned A, unsigned S>
+struct alignment_logic
+{
+ static const std::size_t value = A < S ? A : S;
+};
+
+template< typename T >
+struct alignment_of
+{
+ static const std::size_t value = alignment_logic
+ < sizeof(alignment_of_hack<T>) - sizeof(T)
+ , sizeof(T)
+ >::value;
+};
+
+template <typename T, typename U>
+struct is_same
+{
+ typedef char yes_type;
+ struct no_type
+ {
+ char padding[8];
+ };
+
+ template <typename V>
+ static yes_type is_same_tester(V*, V*);
+ static no_type is_same_tester(...);
+
+ static T *t;
+ static U *u;
+
+ static const bool value = sizeof(yes_type) == sizeof(is_same_tester(t,u));
+};
+
+template<typename T>
+struct add_const
+{ typedef const T type; };
+
+template<typename T>
+struct remove_const
+{ typedef T type; };
+
+template<typename T>
+struct remove_const<const T>
+{ typedef T type; };
+
+template<class T>
+struct remove_reference
+{
+ typedef T type;
+};
+
+template<class T>
+struct remove_reference<T&>
+{
+ typedef T type;
+};
+
+template<class Class>
+class is_empty_class
+{
+ template <typename T>
+ struct empty_helper_t1 : public T
+ {
+ empty_helper_t1();
+ int i[256];
+ };
+
+ struct empty_helper_t2
+ { int i[256]; };
+
+ public:
+ static const bool value = sizeof(empty_helper_t1<Class>) == sizeof(empty_helper_t2);
+};
+
+template<std::size_t S>
+struct ls_zeros
+{
+ static const std::size_t value = (S & std::size_t(1)) ? 0 : (1 + ls_zeros<(S>>1u)>::value);
+};
+
+template<>
+struct ls_zeros<0>
+{
+ static const std::size_t value = 0;
+};
+
+template<>
+struct ls_zeros<1>
+{
+ static const std::size_t value = 0;
+};
+
+} //namespace detail
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_DETAIL_MPL_HPP
Added: sandbox/move/boost/intrusive/detail/parent_from_member.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/parent_from_member.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,71 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
+#define BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <cstddef>
+
+#if defined(BOOST_MSVC) || ((defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && defined(BOOST_INTEL))
+
+#define BOOST_INTRUSIVE_MSVC_COMPLIANT_PTR_TO_MEMBER
+#include <boost/cstdint.hpp>
+#endif
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template<class Parent, class Member>
+inline std::ptrdiff_t offset_from_pointer_to_member(const Member Parent::* ptr_to_member)
+{
+ //The implementation of a pointer to member is compiler dependent.
+ #if defined(BOOST_INTRUSIVE_MSVC_COMPLIANT_PTR_TO_MEMBER)
+ //msvc compliant compilers use their the first 32 bits as offset (even in 64 bit mode)
+ return *(const boost::int32_t*)(void*)&ptr_to_member;
+ //This works with gcc, msvc, ac++, ibmcpp
+ #elif defined(__GNUC__) || defined(__HP_aCC) || defined(BOOST_INTEL) || \
+ defined(__IBMCPP__) || defined(__DECCXX)
+ const Parent * const parent = 0;
+ const char *const member = reinterpret_cast<const char*>(&(parent->*ptr_to_member));
+ return std::ptrdiff_t(member - reinterpret_cast<const char*>(parent));
+ #else
+ //This is the traditional C-front approach: __MWERKS__, __DMC__, __SUNPRO_CC
+ return (*(const std::ptrdiff_t*)(void*)&ptr_to_member) - 1;
+ #endif
+}
+
+template<class Parent, class Member>
+inline Parent *parent_from_member(Member *member, const Member Parent::* ptr_to_member)
+{
+ return (Parent*)((char*)member -
+ offset_from_pointer_to_member(ptr_to_member));
+}
+
+template<class Parent, class Member>
+inline const Parent *parent_from_member(const Member *member, const Member Parent::* ptr_to_member)
+{
+ return (const Parent*)((const char*)member -
+ offset_from_pointer_to_member(ptr_to_member));
+}
+
+} //namespace detail {
+} //namespace intrusive {
+} //namespace boost {
+
+#ifdef BOOST_INTRUSIVE_MSVC_COMPLIANT_PTR_TO_MEMBER
+#undef BOOST_INTRUSIVE_MSVC_COMPLIANT_PTR_TO_MEMBER
+#endif
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTRUSIVE_PARENT_FROM_MEMBER_HPP
Added: sandbox/move/boost/intrusive/detail/pointer_to_other.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/pointer_to_other.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,65 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_POINTER_TO_OTHER_HPP
+#define BOOST_INTRUSIVE_POINTER_TO_OTHER_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/version.hpp>
+
+#if (BOOST_VERSION < 103400)
+
+#ifndef BOOST_POINTER_TO_OTHER_HPP_INCLUDED
+#define BOOST_POINTER_TO_OTHER_HPP_INCLUDED
+
+namespace boost {
+
+template<class T, class U>
+ struct pointer_to_other;
+
+template<class T, class U, template <class> class Sp>
+ struct pointer_to_other< Sp<T>, U >
+{
+ typedef Sp<U> type;
+};
+
+template<class T, class T2, class U,
+ template <class, class> class Sp>
+ struct pointer_to_other< Sp<T, T2>, U >
+{
+ typedef Sp<U, T2> type;
+};
+
+template<class T, class T2, class T3, class U,
+ template <class, class, class> class Sp>
+struct pointer_to_other< Sp<T, T2, T3>, U >
+{
+ typedef Sp<U, T2, T3> type;
+};
+
+template<class T, class U>
+struct pointer_to_other< T*, U >
+{
+ typedef U* type;
+};
+
+} // namespace boost
+
+#endif
+
+#else
+
+#include <boost/pointer_to_other.hpp>
+
+#endif //#ifndef BOOST_POINTER_TO_OTHER_HPP_INCLUDED
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTRUSIVE_POINTER_TO_OTHER_HPP
Added: sandbox/move/boost/intrusive/detail/rbtree_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/rbtree_node.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,177 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_RBTREE_NODE_HPP
+#define BOOST_INTRUSIVE_RBTREE_NODE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/rbtree_algorithms.hpp>
+#include <boost/intrusive/pointer_plus_bits.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/////////////////////////////////////////////////////////////////////////////
+// //
+// Generic node_traits for any pointer type //
+// //
+/////////////////////////////////////////////////////////////////////////////
+
+//This is the compact representation: 3 pointers
+template<class VoidPointer>
+struct compact_rbtree_node
+{
+ typedef typename pointer_to_other
+ <VoidPointer
+ ,compact_rbtree_node<VoidPointer> >::type node_ptr;
+ enum color { red_t, black_t };
+ node_ptr parent_, left_, right_;
+};
+
+//This is the normal representation: 3 pointers + enum
+template<class VoidPointer>
+struct rbtree_node
+{
+ typedef typename pointer_to_other
+ <VoidPointer
+ ,rbtree_node<VoidPointer> >::type node_ptr;
+
+ enum color { red_t, black_t };
+ node_ptr parent_, left_, right_;
+ color color_;
+};
+
+//This is the default node traits implementation
+//using a node with 3 generic pointers plus an enum
+template<class VoidPointer>
+struct default_rbtree_node_traits_impl
+{
+ typedef rbtree_node<VoidPointer> node;
+
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ typedef typename node::color color;
+
+ static node_ptr get_parent(const_node_ptr n)
+ { return n->parent_; }
+
+ static void set_parent(node_ptr n, node_ptr p)
+ { n->parent_ = p; }
+
+ static node_ptr get_left(const_node_ptr n)
+ { return n->left_; }
+
+ static void set_left(node_ptr n, node_ptr l)
+ { n->left_ = l; }
+
+ static node_ptr get_right(const_node_ptr n)
+ { return n->right_; }
+
+ static void set_right(node_ptr n, node_ptr r)
+ { n->right_ = r; }
+
+ static color get_color(const_node_ptr n)
+ { return n->color_; }
+
+ static void set_color(node_ptr n, color c)
+ { n->color_ = c; }
+
+ static color black()
+ { return node::black_t; }
+
+ static color red()
+ { return node::red_t; }
+};
+
+//This is the compact node traits implementation
+//using a node with 3 generic pointers
+template<class VoidPointer>
+struct compact_rbtree_node_traits_impl
+{
+ typedef compact_rbtree_node<VoidPointer> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ typedef pointer_plus_bits<node_ptr, 1> ptr_bit;
+
+ typedef typename node::color color;
+
+ static node_ptr get_parent(const_node_ptr n)
+ { return ptr_bit::get_pointer(n->parent_); }
+
+ static void set_parent(node_ptr n, node_ptr p)
+ { ptr_bit::set_pointer(n->parent_, p); }
+
+ static node_ptr get_left(const_node_ptr n)
+ { return n->left_; }
+
+ static void set_left(node_ptr n, node_ptr l)
+ { n->left_ = l; }
+
+ static node_ptr get_right(const_node_ptr n)
+ { return n->right_; }
+
+ static void set_right(node_ptr n, node_ptr r)
+ { n->right_ = r; }
+
+ static color get_color(const_node_ptr n)
+ { return (color)ptr_bit::get_bits(n->parent_); }
+
+ static void set_color(node_ptr n, color c)
+ { ptr_bit::set_bits(n->parent_, c != 0); }
+
+ static color black()
+ { return node::black_t; }
+
+ static color red()
+ { return node::red_t; }
+};
+
+//Dispatches the implementation based on the boolean
+template<class VoidPointer, bool Compact>
+struct rbtree_node_traits_dispatch
+ : public default_rbtree_node_traits_impl<VoidPointer>
+{};
+
+template<class VoidPointer>
+struct rbtree_node_traits_dispatch<VoidPointer, true>
+ : public compact_rbtree_node_traits_impl<VoidPointer>
+{};
+
+//Inherit from the detail::link_dispatch depending on the embedding capabilities
+template<class VoidPointer, bool OptimizeSize = false>
+struct rbtree_node_traits
+ : public rbtree_node_traits_dispatch
+ < VoidPointer
+ , OptimizeSize &&
+ (max_pointer_plus_bits
+ < VoidPointer
+ , detail::alignment_of<compact_rbtree_node<VoidPointer> >::value
+ >::value >= 1)
+ >
+{};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_RBTREE_NODE_HPP
Added: sandbox/move/boost/intrusive/detail/slist_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/slist_node.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,163 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_SLIST_NODE_HPP
+#define BOOST_INTRUSIVE_SLIST_NODE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+
+namespace boost {
+namespace intrusive {
+
+template<class VoidPointer>
+struct slist_node
+{
+ typedef typename boost::pointer_to_other
+ <VoidPointer, slist_node>::type node_ptr;
+ node_ptr next_;
+};
+
+// slist_node_traits can be used with circular_slist_algorithms and supplies
+// a slist_node holding the pointers needed for a singly-linked list
+// it is used by slist_base_hook and slist_member_hook
+template<class VoidPointer>
+struct slist_node_traits
+{
+ typedef slist_node<VoidPointer> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ static node_ptr get_next(const_node_ptr n)
+ { return n->next_; }
+
+ static void set_next(node_ptr n, node_ptr next)
+ { n->next_ = next; }
+};
+
+// slist_iterator provides some basic functions for a
+// node oriented bidirectional iterator:
+template<class Container, bool IsConst>
+class slist_iterator
+ : public std::iterator
+ < std::forward_iterator_tag
+ , typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>::type
+ >
+{
+ protected:
+ typedef typename Container::real_value_traits real_value_traits;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, void>::type void_pointer;
+ static const bool store_container_ptr =
+ detail::store_cont_ptr_on_it<Container>::value;
+
+ public:
+ typedef typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>
+ ::type value_type;
+ typedef value_type & reference;
+ typedef value_type * pointer;
+
+ slist_iterator()
+ : members_ (node_ptr(0), 0)
+ {}
+
+ explicit slist_iterator(node_ptr node, const Container *cont_ptr)
+ : members_ (node, cont_ptr)
+ {}
+
+ slist_iterator(slist_iterator<Container, false> const& other)
+ : members_(other.pointed_node(), other.get_container())
+ {}
+
+ const node_ptr &pointed_node() const
+ { return members_.nodeptr_; }
+
+ slist_iterator &operator=(const node_ptr &node)
+ { members_.nodeptr_ = node; return static_cast<slist_iterator&>(*this); }
+
+ public:
+ slist_iterator& operator++()
+ {
+ members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
+ return static_cast<slist_iterator&> (*this);
+ }
+
+ slist_iterator operator++(int)
+ {
+ slist_iterator result (*this);
+ members_.nodeptr_ = node_traits::get_next(members_.nodeptr_);
+ return result;
+ }
+
+ bool operator== (const slist_iterator& i) const
+ { return members_.nodeptr_ == i.pointed_node(); }
+
+ bool operator!= (const slist_iterator& i) const
+ { return !operator== (i); }
+
+ value_type& operator*() const
+ { return *operator->(); }
+
+ pointer operator->() const
+ { return detail::get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
+
+ const Container *get_container() const
+ {
+ if(store_container_ptr)
+ return static_cast<const Container*>(members_.get_ptr());
+ else
+ return 0;
+ }
+
+ slist_iterator<Container, false> unconst() const
+ { return slist_iterator<Container, false>(this->pointed_node(), this->get_container()); }
+
+ const real_value_traits *get_real_value_traits() const
+ {
+ if(store_container_ptr)
+ return &this->get_container()->get_real_value_traits();
+ else
+ return 0;
+ }
+
+ private:
+ struct members
+ : public detail::select_constptr
+ <void_pointer, store_container_ptr>::type
+ {
+ typedef typename detail::select_constptr
+ <void_pointer, store_container_ptr>::type Base;
+
+ members(const node_ptr &n_ptr, const void *cont)
+ : Base(cont), nodeptr_(n_ptr)
+ {}
+
+ node_ptr nodeptr_;
+ } members_;
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SLIST_NODE_HPP
Added: sandbox/move/boost/intrusive/detail/transform_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/transform_iterator.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,173 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_TRANSFORM_ITERATOR_HPP
+#define BOOST_INTRUSIVE_DETAIL_TRANSFORM_ITERATOR_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template <class PseudoReference>
+struct operator_arrow_proxy
+{
+ operator_arrow_proxy(const PseudoReference &px)
+ : m_value(px)
+ {}
+
+ PseudoReference* operator->() const { return &m_value; }
+ // This function is needed for MWCW and BCC, which won't call operator->
+ // again automatically per 13.3.1.2 para 8
+// operator T*() const { return &m_value; }
+ mutable PseudoReference m_value;
+};
+
+template <class T>
+struct operator_arrow_proxy<T&>
+{
+ operator_arrow_proxy(T &px)
+ : m_value(px)
+ {}
+
+ T* operator->() const { return &m_value; }
+ // This function is needed for MWCW and BCC, which won't call operator->
+ // again automatically per 13.3.1.2 para 8
+// operator T*() const { return &m_value; }
+ mutable T &m_value;
+};
+
+template <class Iterator, class UnaryFunction>
+class transform_iterator
+ : public std::iterator
+ < typename Iterator::iterator_category
+ , typename detail::remove_reference<typename UnaryFunction::result_type>::type
+ , typename Iterator::difference_type
+ , operator_arrow_proxy<typename UnaryFunction::result_type>
+ , typename UnaryFunction::result_type>
+{
+ public:
+ explicit transform_iterator(const Iterator &it, const UnaryFunction &f = UnaryFunction())
+ : members_(it, f)
+ {}
+
+ explicit transform_iterator()
+ : members_()
+ {}
+
+ Iterator get_it() const
+ { return members_.m_it; }
+
+ //Constructors
+ transform_iterator& operator++()
+ { increment(); return *this; }
+
+ transform_iterator operator++(int)
+ {
+ transform_iterator result (*this);
+ increment();
+ return result;
+ }
+
+ friend bool operator== (const transform_iterator& i, const transform_iterator& i2)
+ { return i.equal(i2); }
+
+ friend bool operator!= (const transform_iterator& i, const transform_iterator& i2)
+ { return !(i == i2); }
+
+/*
+ friend bool operator> (const transform_iterator& i, const transform_iterator& i2)
+ { return i2 < i; }
+
+ friend bool operator<= (const transform_iterator& i, const transform_iterator& i2)
+ { return !(i > i2); }
+
+ friend bool operator>= (const transform_iterator& i, const transform_iterator& i2)
+ { return !(i < i2); }
+*/
+ friend typename Iterator::difference_type operator- (const transform_iterator& i, const transform_iterator& i2)
+ { return i2.distance_to(i); }
+
+ //Arithmetic
+ transform_iterator& operator+=(typename Iterator::difference_type off)
+ { this->advance(off); return *this; }
+
+ transform_iterator operator+(typename Iterator::difference_type off) const
+ {
+ transform_iterator other(*this);
+ other.advance(off);
+ return other;
+ }
+
+ friend transform_iterator operator+(typename Iterator::difference_type off, const transform_iterator& right)
+ { return right + off; }
+
+ transform_iterator& operator-=(typename Iterator::difference_type off)
+ { this->advance(-off); return *this; }
+
+ transform_iterator operator-(typename Iterator::difference_type off) const
+ { return *this + (-off); }
+
+ typename UnaryFunction::result_type operator*() const
+ { return dereference(); }
+
+ operator_arrow_proxy<typename UnaryFunction::result_type>
+ operator->() const
+ { return operator_arrow_proxy<typename UnaryFunction::result_type>(dereference()); }
+
+ private:
+ struct members
+ : UnaryFunction
+ {
+ members(const Iterator &it, const UnaryFunction &f)
+ : UnaryFunction(f), m_it(it)
+ {}
+
+ members()
+ {}
+
+ Iterator m_it;
+ } members_;
+
+
+ void increment()
+ { ++members_.m_it; }
+
+ void decrement()
+ { --members_.m_it; }
+
+ bool equal(const transform_iterator &other) const
+ { return members_.m_it == other.members_.m_it; }
+
+ bool less(const transform_iterator &other) const
+ { return other.members_.m_it < members_.m_it; }
+
+ typename UnaryFunction::result_type dereference() const
+ { return members_(*members_.m_it); }
+
+ void advance(typename Iterator::difference_type n)
+ { std::advance(members_.m_it, n); }
+
+ typename Iterator::difference_type distance_to(const transform_iterator &other)const
+ { return std::distance(other.members_.m_it, members_.m_it); }
+};
+
+} //namespace detail
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_DETAIL_TRANSFORM_ITERATOR_HPP
Added: sandbox/move/boost/intrusive/detail/tree_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/tree_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,1691 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_TREE_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_TREE_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <cstddef>
+#include <boost/intrusive/detail/utilities.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+//! This is an implementation of a binary search tree.
+//! A node in the search tree has references to its children and its parent. This
+//! is to allow traversal of the whole tree from a given node making the
+//! implementation of iterator a pointer to a node.
+//! At the top of the tree a node is used specially. This node's parent pointer
+//! is pointing to the root of the tree. Its left pointer points to the
+//! leftmost node in the tree and the right pointer to the rightmost one.
+//! This node is used to represent the end-iterator.
+//!
+//! +---------+
+//! header------------------------------>| |
+//! | |
+//! +----------(left)--------| |--------(right)---------+
+//! | +---------+ |
+//! | | |
+//! | | (parent) |
+//! | | |
+//! | | |
+//! | +---------+ |
+//! root of tree ..|......................> | | |
+//! | | D | |
+//! | | | |
+//! | +-------+---------+-------+ |
+//! | | | |
+//! | | | |
+//! | | | |
+//! | | | |
+//! | | | |
+//! | +---------+ +---------+ |
+//! | | | | | |
+//! | | B | | F | |
+//! | | | | | |
+//! | +--+---------+--+ +--+---------+--+ |
+//! | | | | | |
+//! | | | | | |
+//! | | | | | |
+//! | +---+-----+ +-----+---+ +---+-----+ +-----+---+ |
+//! +-->| | | | | | | |<--+
+//! | A | | C | | E | | G |
+//! | | | | | | | |
+//! +---------+ +---------+ +---------+ +---------+
+//!
+
+//! tree_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the circular list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
+//!
+//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
+//!
+//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
+template<class NodeTraits>
+class tree_algorithms
+{
+ public:
+ typedef typename NodeTraits::node node;
+ typedef NodeTraits node_traits;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+
+ //! This type is the information that will be filled by insert_unique_check
+ struct insert_commit_data
+ {
+ insert_commit_data()
+ : link_left(false)
+ , node(0)
+ {}
+ bool link_left;
+ node_ptr node;
+ };
+
+ struct nop_erase_fixup
+ {
+ void operator()(node_ptr, node_ptr){}
+ };
+
+ /// @cond
+ private:
+ template<class Disposer>
+ struct dispose_subtree_disposer
+ {
+ dispose_subtree_disposer(Disposer &disp, node_ptr subtree)
+ : disposer_(&disp), subtree_(subtree)
+ {}
+
+ void release()
+ { disposer_ = 0; }
+
+ ~dispose_subtree_disposer()
+ {
+ if(disposer_){
+ dispose_subtree(subtree_, *disposer_);
+ }
+ }
+ Disposer *disposer_;
+ node_ptr subtree_;
+ };
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ }
+ /// @endcond
+
+ public:
+ static node_ptr begin_node(const_node_ptr header)
+ { return node_traits::get_left(header); }
+
+ static node_ptr end_node(const_node_ptr header)
+ { return uncast(header); }
+
+ //! <b>Requires</b>: node is a node of the tree or an node initialized
+ //! by init(...) or init_node.
+ //!
+ //! <b>Effects</b>: Returns true if the node is initialized by init() or init_node().
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr node)
+ { return !NodeTraits::get_parent(node); }
+
+ static node_ptr get_header(const_node_ptr node)
+ {
+ node_ptr h = uncast(node);
+ if(NodeTraits::get_parent(node)){
+ h = NodeTraits::get_parent(node);
+ while(!is_header(h))
+ h = NodeTraits::get_parent(h);
+ }
+ return h;
+ }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr node2)
+ {
+ if(node1 == node2)
+ return;
+
+ node_ptr header1(get_header(node1)), header2(get_header(node2));
+ swap_nodes(node1, header1, node2, header2);
+ }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees with header header1 and header2.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
+ {
+ if(node1 == node2)
+ return;
+
+ //node1 and node2 must not be header nodes
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT((header1 != node1 && header2 != node2));
+ if(header1 != header2){
+ //Update header1 if necessary
+ if(node1 == NodeTraits::get_left(header1)){
+ NodeTraits::set_left(header1, node2);
+ }
+
+ if(node1 == NodeTraits::get_right(header1)){
+ NodeTraits::set_right(header1, node2);
+ }
+
+ if(node1 == NodeTraits::get_parent(header1)){
+ NodeTraits::set_parent(header1, node2);
+ }
+
+ //Update header2 if necessary
+ if(node2 == NodeTraits::get_left(header2)){
+ NodeTraits::set_left(header2, node1);
+ }
+
+ if(node2 == NodeTraits::get_right(header2)){
+ NodeTraits::set_right(header2, node1);
+ }
+
+ if(node2 == NodeTraits::get_parent(header2)){
+ NodeTraits::set_parent(header2, node1);
+ }
+ }
+ else{
+ //If both nodes are from the same tree
+ //Update header if necessary
+ if(node1 == NodeTraits::get_left(header1)){
+ NodeTraits::set_left(header1, node2);
+ }
+ else if(node2 == NodeTraits::get_left(header2)){
+ NodeTraits::set_left(header2, node1);
+ }
+
+ if(node1 == NodeTraits::get_right(header1)){
+ NodeTraits::set_right(header1, node2);
+ }
+ else if(node2 == NodeTraits::get_right(header2)){
+ NodeTraits::set_right(header2, node1);
+ }
+
+ if(node1 == NodeTraits::get_parent(header1)){
+ NodeTraits::set_parent(header1, node2);
+ }
+ else if(node2 == NodeTraits::get_parent(header2)){
+ NodeTraits::set_parent(header2, node1);
+ }
+
+ //Adjust data in nodes to be swapped
+ //so that final link swap works as expected
+ if(node1 == NodeTraits::get_parent(node2)){
+ NodeTraits::set_parent(node2, node2);
+
+ if(node2 == NodeTraits::get_right(node1)){
+ NodeTraits::set_right(node1, node1);
+ }
+ else{
+ NodeTraits::set_left(node1, node1);
+ }
+ }
+ else if(node2 == NodeTraits::get_parent(node1)){
+ NodeTraits::set_parent(node1, node1);
+
+ if(node1 == NodeTraits::get_right(node2)){
+ NodeTraits::set_right(node2, node2);
+ }
+ else{
+ NodeTraits::set_left(node2, node2);
+ }
+ }
+ }
+
+ //Now swap all the links
+ node_ptr temp;
+ //swap left link
+ temp = NodeTraits::get_left(node1);
+ NodeTraits::set_left(node1, NodeTraits::get_left(node2));
+ NodeTraits::set_left(node2, temp);
+ //swap right link
+ temp = NodeTraits::get_right(node1);
+ NodeTraits::set_right(node1, NodeTraits::get_right(node2));
+ NodeTraits::set_right(node2, temp);
+ //swap parent link
+ temp = NodeTraits::get_parent(node1);
+ NodeTraits::set_parent(node1, NodeTraits::get_parent(node2));
+ NodeTraits::set_parent(node2, temp);
+
+ //Now adjust adjacent nodes for newly inserted node 1
+ if((temp = NodeTraits::get_left(node1))){
+ NodeTraits::set_parent(temp, node1);
+ }
+ if((temp = NodeTraits::get_right(node1))){
+ NodeTraits::set_parent(temp, node1);
+ }
+ if((temp = NodeTraits::get_parent(node1)) &&
+ //The header has been already updated so avoid it
+ temp != header2){
+ if(NodeTraits::get_left(temp) == node2){
+ NodeTraits::set_left(temp, node1);
+ }
+ if(NodeTraits::get_right(temp) == node2){
+ NodeTraits::set_right(temp, node1);
+ }
+ }
+ //Now adjust adjacent nodes for newly inserted node 2
+ if((temp = NodeTraits::get_left(node2))){
+ NodeTraits::set_parent(temp, node2);
+ }
+ if((temp = NodeTraits::get_right(node2))){
+ NodeTraits::set_parent(temp, node2);
+ }
+ if((temp = NodeTraits::get_parent(node2)) &&
+ //The header has been already updated so avoid it
+ temp != header1){
+ if(NodeTraits::get_left(temp) == node1){
+ NodeTraits::set_left(temp, node2);
+ }
+ if(NodeTraits::get_right(temp) == node1){
+ NodeTraits::set_right(temp, node2);
+ }
+ }
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing and comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
+ {
+ if(node_to_be_replaced == new_node)
+ return;
+ replace_node(node_to_be_replaced, get_header(node_to_be_replaced), new_node);
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! with header "header" and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
+ {
+ if(node_to_be_replaced == new_node)
+ return;
+
+ //Update header if necessary
+ if(node_to_be_replaced == NodeTraits::get_left(header)){
+ NodeTraits::set_left(header, new_node);
+ }
+
+ if(node_to_be_replaced == NodeTraits::get_right(header)){
+ NodeTraits::set_right(header, new_node);
+ }
+
+ if(node_to_be_replaced == NodeTraits::get_parent(header)){
+ NodeTraits::set_parent(header, new_node);
+ }
+
+ //Now set data from the original node
+ node_ptr temp;
+ NodeTraits::set_left(new_node, NodeTraits::get_left(node_to_be_replaced));
+ NodeTraits::set_right(new_node, NodeTraits::get_right(node_to_be_replaced));
+ NodeTraits::set_parent(new_node, NodeTraits::get_parent(node_to_be_replaced));
+
+ //Now adjust adjacent nodes for newly inserted node
+ if((temp = NodeTraits::get_left(new_node))){
+ NodeTraits::set_parent(temp, new_node);
+ }
+ if((temp = NodeTraits::get_right(new_node))){
+ NodeTraits::set_parent(temp, new_node);
+ }
+ if((temp = NodeTraits::get_parent(new_node)) &&
+ //The header has been already updated so avoid it
+ temp != header){
+ if(NodeTraits::get_left(temp) == node_to_be_replaced){
+ NodeTraits::set_left(temp, new_node);
+ }
+ if(NodeTraits::get_right(temp) == node_to_be_replaced){
+ NodeTraits::set_right(temp, new_node);
+ }
+ }
+ }
+
+ //! <b>Requires</b>: p is a node from the tree except the header.
+ //!
+ //! <b>Effects</b>: Returns the next node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr next_node(node_ptr p)
+ {
+ node_ptr p_right(NodeTraits::get_right(p));
+ if(p_right){
+ return minimum(p_right);
+ }
+ else {
+ node_ptr x = NodeTraits::get_parent(p);
+ while(p == NodeTraits::get_right(x)){
+ p = x;
+ x = NodeTraits::get_parent(x);
+ }
+ return NodeTraits::get_right(p) != x ? x : uncast(p);
+ }
+ }
+
+ //! <b>Requires</b>: p is a node from the tree except the leftmost node.
+ //!
+ //! <b>Effects</b>: Returns the previous node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr prev_node(node_ptr p)
+ {
+ if(is_header(p)){
+ return NodeTraits::get_right(p);
+ //return maximum(NodeTraits::get_parent(p));
+ }
+ else if(NodeTraits::get_left(p)){
+ return maximum(NodeTraits::get_left(p));
+ }
+ else {
+ node_ptr x = NodeTraits::get_parent(p);
+ while(p == NodeTraits::get_left(x)){
+ p = x;
+ x = NodeTraits::get_parent(x);
+ }
+ return x;
+ }
+ }
+
+ //! <b>Requires</b>: p is a node of a tree but not the header.
+ //!
+ //! <b>Effects</b>: Returns the minimum node of the subtree starting at p.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the size of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr minimum (node_ptr p)
+ {
+ for(node_ptr p_left = NodeTraits::get_left(p)
+ ;p_left
+ ;p_left = NodeTraits::get_left(p)){
+ p = p_left;
+ }
+ return p;
+ }
+
+ //! <b>Requires</b>: p is a node of a tree but not the header.
+ //!
+ //! <b>Effects</b>: Returns the maximum node of the subtree starting at p.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the size of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr maximum(node_ptr p)
+ {
+ for(node_ptr p_right = NodeTraits::get_right(p)
+ ;p_right
+ ;p_right = NodeTraits::get_right(p)){
+ p = p_right;
+ }
+ return p;
+ }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: After the function unique(node) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init(node_ptr node)
+ {
+ NodeTraits::set_parent(node, node_ptr(0));
+ NodeTraits::set_left(node, node_ptr(0));
+ NodeTraits::set_right(node, node_ptr(0));
+ };
+
+ //! <b>Effects</b>: Returns true if node is in the same state as if called init(node)
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool inited(const_node_ptr node)
+ {
+ return !NodeTraits::get_parent(node) &&
+ !NodeTraits::get_left(node) &&
+ !NodeTraits::get_right(node) ;
+ };
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: Initializes the header to represent an empty tree.
+ //! unique(header) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init_header(node_ptr header)
+ {
+ NodeTraits::set_parent(header, node_ptr(0));
+ NodeTraits::set_left(header, header);
+ NodeTraits::set_right(header, header);
+ }
+
+ //! <b>Requires</b>: "disposer" must be an object function
+ //! taking a node_ptr parameter and shouldn't throw.
+ //!
+ //! <b>Effects</b>: Empties the target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template<class Disposer>
+ static void clear_and_dispose(node_ptr header, Disposer disposer)
+ {
+ node_ptr source_root = NodeTraits::get_parent(header);
+ if(!source_root)
+ return;
+ dispose_subtree(source_root, disposer);
+ init_header(header);
+ }
+
+ //! <b>Requires</b>: header is the header of a tree.
+ //!
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree, and
+ //! updates the header link to the new leftmost node.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ static node_ptr unlink_leftmost_without_rebalance(node_ptr header)
+ {
+ node_ptr leftmost = NodeTraits::get_left(header);
+ if (leftmost == header)
+ return node_ptr(0);
+ node_ptr leftmost_parent(NodeTraits::get_parent(leftmost));
+ node_ptr leftmost_right (NodeTraits::get_right(leftmost));
+ bool is_root = leftmost_parent == header;
+
+ if (leftmost_right){
+ NodeTraits::set_parent(leftmost_right, leftmost_parent);
+ NodeTraits::set_left(header, tree_algorithms::minimum(leftmost_right));
+
+ if (is_root)
+ NodeTraits::set_parent(header, leftmost_right);
+ else
+ NodeTraits::set_left(NodeTraits::get_parent(header), leftmost_right);
+ }
+ else if (is_root){
+ NodeTraits::set_parent(header, node_ptr(0));
+ NodeTraits::set_left(header, header);
+ NodeTraits::set_right(header, header);
+ }
+ else{
+ NodeTraits::set_left(leftmost_parent, node_ptr(0));
+ NodeTraits::set_left(header, leftmost_parent);
+ }
+ return leftmost;
+ }
+
+ //! <b>Requires</b>: node is a node of the tree but it's not the header.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes of the subtree.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr subtree)
+ {
+ if(!subtree) return 0;
+ std::size_t count = 0;
+ node_ptr p = minimum(uncast(subtree));
+ bool continue_looping = true;
+ while(continue_looping){
+ ++count;
+ node_ptr p_right(NodeTraits::get_right(p));
+ if(p_right){
+ p = minimum(p_right);
+ }
+ else {
+ for(;;){
+ node_ptr q;
+ if (p == subtree){
+ continue_looping = false;
+ break;
+ }
+ q = p;
+ p = NodeTraits::get_parent(p);
+ if (NodeTraits::get_left(p) == q)
+ break;
+ }
+ }
+ }
+ return count;
+ }
+
+ //! <b>Requires</b>: node is a node of the tree but it's not the header.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes of the subtree.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t size(const_node_ptr header)
+ {
+ node_ptr beg(begin_node(header));
+ node_ptr end(end_node(header));
+ std::size_t i = 0;
+ for(;beg != end; beg = next_node(beg)) ++i;
+ return i;
+ }
+
+ //! <b>Requires</b>: header1 and header2 must be the header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //! links to the second tree and header2 will have links to the first tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void swap_tree(node_ptr header1, node_ptr header2)
+ {
+ if(header1 == header2)
+ return;
+
+ node_ptr tmp;
+
+ //Parent swap
+ tmp = NodeTraits::get_parent(header1);
+ NodeTraits::set_parent(header1, NodeTraits::get_parent(header2));
+ NodeTraits::set_parent(header2, tmp);
+ //Left swap
+ tmp = NodeTraits::get_left(header1);
+ NodeTraits::set_left(header1, NodeTraits::get_left(header2));
+ NodeTraits::set_left(header2, tmp);
+ //Right swap
+ tmp = NodeTraits::get_right(header1);
+ NodeTraits::set_right(header1, NodeTraits::get_right(header2));
+ NodeTraits::set_right(header2, tmp);
+
+ //Now test parent
+ node_ptr h1_parent(NodeTraits::get_parent(header1));
+ if(h1_parent){
+ NodeTraits::set_parent(h1_parent, header1);
+ }
+ else{
+ NodeTraits::set_left(header1, header1);
+ NodeTraits::set_right(header1, header1);
+ }
+
+ node_ptr h2_parent(NodeTraits::get_parent(header2));
+ if(h2_parent){
+ NodeTraits::set_parent(h2_parent, header2);
+ }
+ else{
+ NodeTraits::set_left(header2, header2);
+ NodeTraits::set_right(header2, header2);
+ }
+ }
+
+ static bool is_header(const_node_ptr p)
+ {
+ node_ptr p_left (NodeTraits::get_left(p));
+ node_ptr p_right(NodeTraits::get_right(p));
+ if(!NodeTraits::get_parent(p) || //Header condition when empty tree
+ (p_left && p_right && //Header always has leftmost and rightmost
+ (p_left == p_right || //Header condition when only node
+ (NodeTraits::get_parent(p_left) != p ||
+ NodeTraits::get_parent(p_right) != p ))
+ //When tree size > 1 headers can't be leftmost's
+ //and rightmost's parent
+ )){
+ return true;
+ }
+ return false;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the element that is equivalent to
+ //! "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr find
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ {
+ node_ptr end = uncast(header);
+ node_ptr y = lower_bound(header, key, comp);
+ return (y == end || comp(key, y)) ? end : y;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an a pair of node_ptr delimiting a range containing
+ //! all elements that are equivalent to "key" according to "comp" or an
+ //! empty range that indicates the position where those elements would be
+ //! if they there are no equivalent elements.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> equal_range
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ {
+ node_ptr y = uncast(header);
+ node_ptr x = NodeTraits::get_parent(header);
+
+ while(x){
+ if(comp(x, key)){
+ x = NodeTraits::get_right(x);
+ }
+ else if(comp(key, x)){
+ y = x;
+ x = NodeTraits::get_left(x);
+ }
+ else{
+ node_ptr xu(x), yu(y);
+ y = x, x = NodeTraits::get_left(x);
+ xu = NodeTraits::get_right(xu);
+
+ while(x){
+ if(comp(x, key)){
+ x = NodeTraits::get_right(x);
+ }
+ else {
+ y = x;
+ x = NodeTraits::get_left(x);
+ }
+ }
+
+ while(xu){
+ if(comp(key, xu)){
+ yu = xu;
+ xu = NodeTraits::get_left(xu);
+ }
+ else {
+ xu = NodeTraits::get_right(xu);
+ }
+ }
+ return std::pair<node_ptr,node_ptr> (y, yu);
+ }
+ }
+ return std::pair<node_ptr,node_ptr> (y, y);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is
+ //! not less than "key" according to "comp" or "header" if that element does
+ //! not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr lower_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ {
+ node_ptr y = uncast(header);
+ node_ptr x = NodeTraits::get_parent(header);
+ while(x){
+ if(comp(x, key)){
+ x = NodeTraits::get_right(x);
+ }
+ else {
+ y = x;
+ x = NodeTraits::get_left(x);
+ }
+ }
+ return y;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is greater
+ //! than "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr upper_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ {
+ node_ptr y = uncast(header);
+ node_ptr x = NodeTraits::get_parent(header);
+ while(x){
+ if(comp(key, x)){
+ y = x;
+ x = NodeTraits::get_left(x);
+ }
+ else {
+ x = NodeTraits::get_right(x);
+ }
+ }
+ return y;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "commit_data" must have been obtained from a previous call to
+ //! "insert_unique_check". No objects should have been inserted or erased
+ //! from the set between the "insert_unique_check" that filled "commit_data"
+ //! and the call to "insert_commit".
+ //!
+ //!
+ //! <b>Effects</b>: Inserts new_node in the set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ static void insert_unique_commit
+ (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data)
+ { return insert_commit(header, new_value, commit_data); }
+
+ static void insert_commit
+ (node_ptr header, node_ptr new_node, const insert_commit_data &commit_data)
+ {
+ //Check if commit_data has not been initialized by a insert_unique_check call.
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(commit_data.node != 0);
+ node_ptr parent_node(commit_data.node);
+ if(parent_node == header){
+ NodeTraits::set_parent(header, new_node);
+ NodeTraits::set_right(header, new_node);
+ NodeTraits::set_left(header, new_node);
+ }
+ else if(commit_data.link_left){
+ NodeTraits::set_left(parent_node, new_node);
+ if(parent_node == NodeTraits::get_left(header))
+ NodeTraits::set_left(header, new_node);
+ }
+ else{
+ NodeTraits::set_right(parent_node, new_node);
+ if(parent_node == NodeTraits::get_right(header))
+ NodeTraits::set_right(header, new_node);
+ }
+ NodeTraits::set_parent(new_node, parent_node);
+ NodeTraits::set_right(new_node, node_ptr(0));
+ NodeTraits::set_left(new_node, node_ptr(0));
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data, std::size_t *pdepth = 0)
+ {
+ std::size_t depth = 0;
+ node_ptr h(uncast(header));
+ node_ptr y(h);
+ node_ptr x(NodeTraits::get_parent(y));
+ node_ptr prev(0);
+
+ //Find the upper bound, cache the previous value and if we should
+ //store it in the left or right node
+ bool left_child = true;
+ while(x){
+ ++depth;
+ y = x;
+ x = (left_child = comp(key, x)) ?
+ NodeTraits::get_left(x) : (prev = y, NodeTraits::get_right(x));
+ }
+
+ if(pdepth) *pdepth = depth;
+
+ //Since we've found the upper bound there is no other value with the same key if:
+ // - There is no previous node
+ // - The previous node is less than the key
+ if(!prev || comp(prev, key)){
+ commit_data.link_left = left_child;
+ commit_data.node = y;
+ return std::pair<node_ptr, bool>(node_ptr(), true);
+ }
+ //If the previous value was not less than key, it means that it's equal
+ //(because we've checked the upper bound)
+ else{
+ return std::pair<node_ptr, bool>(prev, false);
+ }
+ }
+
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, node_ptr hint, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data, std::size_t *pdepth = 0)
+ {
+ //hint must be bigger than the key
+ if(hint == header || comp(key, hint)){
+ node_ptr prev(hint);
+ //Previous value should be less than the key
+ if(hint == begin_node(header)|| comp((prev = prev_node(hint)), key)){
+ commit_data.link_left = unique(header) || !NodeTraits::get_left(hint);
+ commit_data.node = commit_data.link_left ? hint : prev;
+ if(pdepth){
+ *pdepth = commit_data.node == header ? 0 : depth(commit_data.node) + 1;
+ }
+ return std::pair<node_ptr, bool>(node_ptr(), true);
+ }
+ }
+ //Hint was wrong, use hintless insertion
+ return insert_unique_check(header, key, comp, commit_data, pdepth);
+ }
+
+ template<class NodePtrCompare>
+ static void insert_equal_check
+ ( node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp
+ , insert_commit_data &commit_data, std::size_t *pdepth = 0)
+ {
+ if(hint == header || !comp(hint, new_node)){
+ node_ptr prev(hint);
+ if(hint == NodeTraits::get_left(header) ||
+ !comp(new_node, (prev = prev_node(hint)))){
+ bool link_left = unique(header) || !NodeTraits::get_left(hint);
+ commit_data.link_left = link_left;
+ commit_data.node = link_left ? hint : prev;
+ if(pdepth){
+ *pdepth = commit_data.node == header ? 0 : depth(commit_data.node) + 1;
+ }
+ }
+ else{
+ insert_equal_upper_bound_check(header, new_node, comp, commit_data, pdepth);
+ }
+ }
+ else{
+ insert_equal_lower_bound_check(header, new_node, comp, commit_data, pdepth);
+ }
+ }
+
+ template<class NodePtrCompare>
+ static void insert_equal_upper_bound_check
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0)
+ { insert_equal_check_impl(true, h, new_node, comp, commit_data, pdepth); }
+
+ template<class NodePtrCompare>
+ static void insert_equal_lower_bound_check
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0)
+ { insert_equal_check_impl(false, h, new_node, comp, commit_data, pdepth); }
+
+ template<class NodePtrCompare>
+ static node_ptr insert_equal
+ (node_ptr h, node_ptr hint, node_ptr new_node, NodePtrCompare comp, std::size_t *pdepth = 0)
+ {
+ insert_commit_data commit_data;
+ insert_equal_check(h, hint, new_node, comp, commit_data, pdepth);
+ insert_commit(h, new_node, commit_data);
+ return new_node;
+ }
+
+ template<class NodePtrCompare>
+ static node_ptr insert_equal_upper_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp, std::size_t *pdepth = 0)
+ {
+ insert_commit_data commit_data;
+ insert_equal_upper_bound_check(h, new_node, comp, commit_data, pdepth);
+ insert_commit(h, new_node, commit_data);
+ return new_node;
+ }
+
+ template<class NodePtrCompare>
+ static node_ptr insert_equal_lower_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp, std::size_t *pdepth = 0)
+ {
+ insert_commit_data commit_data;
+ insert_equal_lower_bound_check(h, new_node, comp, commit_data, pdepth);
+ insert_commit(h, new_node, commit_data);
+ return new_node;
+ }
+
+ static node_ptr insert_before
+ (node_ptr header, node_ptr pos, node_ptr new_node, std::size_t *pdepth = 0)
+ {
+ insert_commit_data commit_data;
+ insert_before_check(header, pos, commit_data, pdepth);
+ insert_commit(header, new_node, commit_data);
+ return new_node;
+ }
+
+ static void insert_before_check
+ ( node_ptr header, node_ptr pos
+ , insert_commit_data &commit_data, std::size_t *pdepth = 0)
+ {
+ node_ptr prev(pos);
+ if(pos != NodeTraits::get_left(header))
+ prev = prev_node(pos);
+ bool link_left = unique(header) || !NodeTraits::get_left(pos);
+ commit_data.link_left = link_left;
+ commit_data.node = link_left ? pos : prev;
+ if(pdepth){
+ *pdepth = commit_data.node == header ? 0 : depth(commit_data.node) + 1;
+ }
+ }
+
+ static void push_back
+ (node_ptr header, node_ptr new_node, std::size_t *pdepth = 0)
+ {
+ insert_commit_data commit_data;
+ push_back_check(header, commit_data, pdepth);
+ insert_commit(header, new_node, commit_data);
+ }
+
+ static void push_back_check
+ (node_ptr header, insert_commit_data &commit_data, std::size_t *pdepth = 0)
+ {
+ node_ptr prev(NodeTraits::get_right(header));
+ if(pdepth){
+ *pdepth = prev == header ? 0 : depth(prev) + 1;
+ }
+ commit_data.link_left = false;
+ commit_data.node = prev;
+ }
+
+ static void push_front
+ (node_ptr header, node_ptr new_node, std::size_t *pdepth = 0)
+ {
+ insert_commit_data commit_data;
+ push_front_check(header, commit_data, pdepth);
+ insert_commit(header, new_node, commit_data);
+ }
+
+ static void push_front_check
+ (node_ptr header, insert_commit_data &commit_data, std::size_t *pdepth = 0)
+ {
+ node_ptr pos(NodeTraits::get_left(header));
+ if(pdepth){
+ *pdepth = pos == header ? 0 : depth(pos) + 1;
+ }
+ commit_data.link_left = true;
+ commit_data.node = pos;
+ }
+
+ //! <b>Requires</b>: p can't be a header node.
+ //!
+ //! <b>Effects</b>: Calculates the depth of a node: the depth of a
+ //! node is the length (number of edges) of the path from the root
+ //! to that node. (The root node is at depth 0.)
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of nodes in the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t depth(const_node_ptr p)
+ {
+ std::size_t depth = 0;
+ node_ptr p_parent;
+ while(p != NodeTraits::get_parent(p_parent = NodeTraits::get_parent(p))){
+ ++depth;
+ p = p_parent;
+ }
+ return depth;
+ }
+
+ //! <b>Requires</b>: "cloner" must be a function
+ //! object taking a node_ptr and returning a new cloned node of it. "disposer" must
+ //! take a node_ptr and shouldn't throw.
+ //!
+ //! <b>Effects</b>: First empties target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! Then, duplicates the entire tree pointed by "source_header" cloning each
+ //! source node with <tt>node_ptr Cloner::operator()(node_ptr)</tt> to obtain
+ //! the nodes of the target tree. If "cloner" throws, the cloned target nodes
+ //! are disposed using <tt>void disposer(node_ptr)</tt>.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template <class Cloner, class Disposer>
+ static void clone
+ (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
+ {
+ if(!unique(target_header)){
+ clear_and_dispose(target_header, disposer);
+ }
+
+ node_ptr leftmost, rightmost;
+ node_ptr new_root = clone_subtree
+ (source_header, target_header, cloner, disposer, leftmost, rightmost);
+
+ //Now update header node
+ NodeTraits::set_parent(target_header, new_root);
+ NodeTraits::set_left (target_header, leftmost);
+ NodeTraits::set_right (target_header, rightmost);
+ }
+
+ template <class Cloner, class Disposer>
+ static node_ptr clone_subtree
+ ( const_node_ptr source_parent, node_ptr target_parent
+ , Cloner cloner, Disposer disposer
+ , node_ptr &leftmost_out, node_ptr &rightmost_out
+ )
+ {
+ node_ptr target_sub_root = target_parent;
+ node_ptr source_root = NodeTraits::get_parent(source_parent);
+ if(!source_root){
+ leftmost_out = rightmost_out = source_root;
+ }
+ else{
+ //We'll calculate leftmost and rightmost nodes while iterating
+ node_ptr current = source_root;
+ node_ptr insertion_point = target_sub_root = cloner(current);
+
+ //We'll calculate leftmost and rightmost nodes while iterating
+ node_ptr leftmost = target_sub_root;
+ node_ptr rightmost = target_sub_root;
+
+ //First set the subroot
+ NodeTraits::set_left(target_sub_root, node_ptr(0));
+ NodeTraits::set_right(target_sub_root, node_ptr(0));
+ NodeTraits::set_parent(target_sub_root, target_parent);
+
+ dispose_subtree_disposer<Disposer> rollback(disposer, target_sub_root);
+ while(true) {
+ //First clone left nodes
+ if( NodeTraits::get_left(current) &&
+ !NodeTraits::get_left(insertion_point)) {
+ current = NodeTraits::get_left(current);
+ node_ptr temp = insertion_point;
+ //Clone and mark as leaf
+ insertion_point = cloner(current);
+ NodeTraits::set_left (insertion_point, node_ptr(0));
+ NodeTraits::set_right (insertion_point, node_ptr(0));
+ //Insert left
+ NodeTraits::set_parent(insertion_point, temp);
+ NodeTraits::set_left (temp, insertion_point);
+ //Update leftmost
+ if(rightmost == target_sub_root)
+ leftmost = insertion_point;
+ }
+ //Then clone right nodes
+ else if( NodeTraits::get_right(current) &&
+ !NodeTraits::get_right(insertion_point)){
+ current = NodeTraits::get_right(current);
+ node_ptr temp = insertion_point;
+ //Clone and mark as leaf
+ insertion_point = cloner(current);
+ NodeTraits::set_left (insertion_point, node_ptr(0));
+ NodeTraits::set_right (insertion_point, node_ptr(0));
+ //Insert right
+ NodeTraits::set_parent(insertion_point, temp);
+ NodeTraits::set_right (temp, insertion_point);
+ //Update rightmost
+ rightmost = insertion_point;
+ }
+ //If not, go up
+ else if(current == source_root){
+ break;
+ }
+ else{
+ //Branch completed, go up searching more nodes to clone
+ current = NodeTraits::get_parent(current);
+ insertion_point = NodeTraits::get_parent(insertion_point);
+ }
+ }
+ rollback.release();
+ leftmost_out = leftmost;
+ rightmost_out = rightmost;
+ }
+ return target_sub_root;
+ }
+
+ template<class Disposer>
+ static void dispose_subtree(node_ptr x, Disposer disposer)
+ {
+ node_ptr save;
+ while (x){
+ save = NodeTraits::get_left(x);
+ if (save) {
+ // Right rotation
+ NodeTraits::set_left(x, NodeTraits::get_right(save));
+ NodeTraits::set_right(save, x);
+ }
+ else {
+ save = NodeTraits::get_right(x);
+ init(x);
+ disposer(x);
+ }
+ x = save;
+ }
+ }
+
+ //! <b>Requires</b>: p is a node of a tree.
+ //!
+ //! <b>Effects</b>: Returns true if p is a left child.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool is_left_child(node_ptr p)
+ { return NodeTraits::get_left(NodeTraits::get_parent(p)) == p; }
+
+ //! <b>Requires</b>: p is a node of a tree.
+ //!
+ //! <b>Effects</b>: Returns true if p is a right child.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool is_right_child(node_ptr p)
+ { return NodeTraits::get_right(NodeTraits::get_parent(p)) == p; }
+
+ //Fix header and own's parent data when replacing x with own, providing own's old data with parent
+ static void replace_own_impl(node_ptr own, node_ptr x, node_ptr header, node_ptr own_parent, bool own_was_left)
+ {
+ if(NodeTraits::get_parent(header) == own)
+ NodeTraits::set_parent(header, x);
+ else if(own_was_left)
+ NodeTraits::set_left(own_parent, x);
+ else
+ NodeTraits::set_right(own_parent, x);
+ }
+
+ //Fix header and own's parent data when replacing x with own, supposing own
+ //links with its parent are still ok
+ static void replace_own(node_ptr own, node_ptr x, node_ptr header)
+ {
+ node_ptr own_parent(NodeTraits::get_parent(own));
+ bool own_is_left(NodeTraits::get_left(own_parent) == own);
+ replace_own_impl(own, x, header, own_parent, own_is_left);
+ }
+
+ // rotate parent p to left (no header and p's parent fixup)
+ static node_ptr rotate_left(node_ptr p)
+ {
+ node_ptr x(NodeTraits::get_right(p));
+ node_ptr x_left(NodeTraits::get_left(x));
+ NodeTraits::set_right(p, x_left);
+ if(x_left){
+ NodeTraits::set_parent(x_left, p);
+ }
+ NodeTraits::set_left(x, p);
+ NodeTraits::set_parent(p, x);
+ return x;
+ }
+
+ // rotate parent p to left (with header and p's parent fixup)
+ static void rotate_left(node_ptr p, node_ptr header)
+ {
+ bool p_was_left(is_left_child(p));
+ node_ptr p_old_parent(NodeTraits::get_parent(p));
+ node_ptr x(rotate_left(p));
+ NodeTraits::set_parent(x, p_old_parent);
+ replace_own_impl(p, x, header, p_old_parent, p_was_left);
+ }
+
+ // rotate parent p to right (no header and p's parent fixup)
+ static node_ptr rotate_right(node_ptr p)
+ {
+ node_ptr x(NodeTraits::get_left(p));
+ node_ptr x_right(NodeTraits::get_right(x));
+ NodeTraits::set_left(p, x_right);
+ if(x_right){
+ NodeTraits::set_parent(x_right, p);
+ }
+ NodeTraits::set_right(x, p);
+ NodeTraits::set_parent(p, x);
+ return x;
+ }
+
+ // rotate parent p to right (with header and p's parent fixup)
+ static void rotate_right(node_ptr p, node_ptr header)
+ {
+ bool p_was_left(is_left_child(p));
+ node_ptr p_old_parent(NodeTraits::get_parent(p));
+ node_ptr x(rotate_right(p));
+ NodeTraits::set_parent(x, p_old_parent);
+ replace_own_impl(p, x, header, p_old_parent, p_was_left);
+ }
+
+ static void erase(node_ptr header, node_ptr z)
+ {
+ data_for_rebalance ignored;
+ erase_impl(header, z, ignored);
+ }
+
+ struct data_for_rebalance
+ {
+ node_ptr x;
+ node_ptr x_parent;
+ node_ptr y;
+ };
+
+ template<class F>
+ static void erase(node_ptr header, node_ptr z, F z_and_successor_fixup, data_for_rebalance &info)
+ {
+ erase_impl(header, z, info);
+ if(info.y != z){
+ z_and_successor_fixup(z, info.y);
+ }
+ }
+
+ static void unlink(node_ptr node)
+ {
+ node_ptr x = NodeTraits::get_parent(node);
+ if(x){
+ while(!is_header(x))
+ x = NodeTraits::get_parent(x);
+ erase(x, node);
+ }
+ }
+
+ static void tree_to_vine(node_ptr header)
+ { subtree_to_vine(NodeTraits::get_parent(header)); }
+
+ static void vine_to_tree(node_ptr header, std::size_t count)
+ { vine_to_subtree(NodeTraits::get_parent(header), count); }
+
+ static void rebalance(node_ptr header)
+ {
+ //Taken from:
+ //"Tree rebalancing in optimal time and space"
+ //Quentin F. Stout and Bette L. Warren
+ std::size_t len = 0;
+ subtree_to_vine(NodeTraits::get_parent(header), &len);
+ vine_to_subtree(NodeTraits::get_parent(header), len);
+ }
+
+ static node_ptr rebalance_subtree(node_ptr old_root)
+ {
+ std::size_t len = 0;
+ node_ptr new_root = subtree_to_vine(old_root, &len);
+ return vine_to_subtree(new_root, len);
+ }
+
+ static node_ptr subtree_to_vine(node_ptr old_root, std::size_t *plen = 0)
+ {
+ std::size_t len;
+ len = 0;
+ if(!old_root) return node_ptr(0);
+
+ //To avoid irregularities in the algorithm (old_root can be a
+ //left or right child or even the root of the tree) just put the
+ //root as the right child of its parent. Before doing this backup
+ //information to restore the original relationship after
+ //the algorithm is applied.
+ node_ptr super_root = NodeTraits::get_parent(old_root);
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(super_root);
+
+ //Get info
+ node_ptr super_root_right_backup = NodeTraits::get_right(super_root);
+ bool super_root_is_header = is_header(super_root);
+ bool old_root_is_right = is_right_child(old_root);
+
+ node_ptr x(old_root);
+ node_ptr new_root(x);
+ node_ptr save;
+ bool moved_to_right = false;
+ for( ; x; x = save){
+ save = NodeTraits::get_left(x);
+ if(save){
+ // Right rotation
+ node_ptr save_right = NodeTraits::get_right(save);
+ node_ptr x_parent = NodeTraits::get_parent(x);
+ NodeTraits::set_parent(save, x_parent);
+ NodeTraits::set_right (x_parent, save);
+ NodeTraits::set_parent(x, save);
+ NodeTraits::set_right (save, x);
+ NodeTraits::set_left(x, save_right);
+ if(save_right)
+ NodeTraits::set_parent(save_right, x);
+ if(!moved_to_right)
+ new_root = save;
+ }
+ else{
+ moved_to_right = true;
+ save = NodeTraits::get_right(x);
+ ++len;
+ }
+ }
+
+ if(super_root_is_header){
+ NodeTraits::set_right(super_root, super_root_right_backup);
+ NodeTraits::set_parent(super_root, new_root);
+ }
+ else if(old_root_is_right){
+ NodeTraits::set_right(super_root, new_root);
+ }
+ else{
+ NodeTraits::set_right(super_root, super_root_right_backup);
+ NodeTraits::set_left(super_root, new_root);
+ }
+ if(plen) *plen = len;
+ return new_root;
+ }
+
+ static node_ptr vine_to_subtree(node_ptr old_root, std::size_t count)
+ {
+ std::size_t leaf_nodes = count + 1 - ((size_t) 1 << floor_log2 (count + 1));
+ std::size_t vine_nodes = count - leaf_nodes;
+
+ node_ptr new_root = compress_subtree(old_root, leaf_nodes);
+ while(vine_nodes > 1){
+ vine_nodes /= 2;
+ new_root = compress_subtree(new_root, vine_nodes);
+ }
+ return new_root;
+ }
+
+ static node_ptr compress_subtree(node_ptr old_root, std::size_t count)
+ {
+ if(!old_root) return old_root;
+
+ //To avoid irregularities in the algorithm (old_root can be
+ //left or right child or even the root of the tree) just put the
+ //root as the right child of its parent. First obtain
+ //information to restore the original relationship after
+ //the algorithm is applied.
+ node_ptr super_root = NodeTraits::get_parent(old_root);
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(super_root);
+
+ //Get info
+ node_ptr super_root_right_backup = NodeTraits::get_right(super_root);
+ bool super_root_is_header = is_header(super_root);
+ bool old_root_is_right = is_right_child(old_root);
+
+ //Put old_root as right child
+ NodeTraits::set_right(super_root, old_root);
+
+ //Start the compression algorithm
+ node_ptr even_parent = super_root;
+ node_ptr new_root = old_root;
+
+ while(count--){
+ node_ptr even = NodeTraits::get_right(even_parent);
+ node_ptr odd = NodeTraits::get_right(even);
+
+ if(new_root == old_root)
+ new_root = odd;
+
+ node_ptr even_right = NodeTraits::get_left(odd);
+ NodeTraits::set_right(even, even_right);
+ if (even_right)
+ NodeTraits::set_parent(even_right, even);
+
+ NodeTraits::set_right(even_parent, odd);
+ NodeTraits::set_parent(odd, even_parent);
+ NodeTraits::set_left(odd, even);
+ NodeTraits::set_parent(even, odd);
+ even_parent = odd;
+ }
+
+ if(super_root_is_header){
+ NodeTraits::set_parent(super_root, new_root);
+ NodeTraits::set_right(super_root, super_root_right_backup);
+ }
+ else if(old_root_is_right){
+ NodeTraits::set_right(super_root, new_root);
+ }
+ else{
+ NodeTraits::set_left(super_root, new_root);
+ NodeTraits::set_right(super_root, super_root_right_backup);
+ }
+ return new_root;
+ }
+
+ //! <b>Requires</b>: "n" must be a node inserted in a tree.
+ //!
+ //! <b>Effects</b>: Returns a pointer to the header node of the tree.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_root(node_ptr node)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT((!inited(node)));
+ node_ptr x = NodeTraits::get_parent(node);
+ if(x){
+ while(!is_header(x)){
+ x = NodeTraits::get_parent(x);
+ }
+ return x;
+ }
+ else{
+ return node;
+ }
+ }
+
+ private:
+ template<class NodePtrCompare>
+ static void insert_equal_check_impl
+ (bool upper, node_ptr h, node_ptr new_node, NodePtrCompare comp, insert_commit_data & commit_data, std::size_t *pdepth = 0)
+ {
+ std::size_t depth = 0;
+ node_ptr y(h);
+ node_ptr x(NodeTraits::get_parent(y));
+ bool link_left;
+
+ if(upper){
+ while(x){
+ ++depth;
+ y = x;
+ x = comp(new_node, x) ?
+ NodeTraits::get_left(x) : NodeTraits::get_right(x);
+ }
+ link_left = (y == h) || comp(new_node, y);
+ }
+ else{
+ while(x){
+ ++depth;
+ y = x;
+ x = !comp(x, new_node) ?
+ NodeTraits::get_left(x) : NodeTraits::get_right(x);
+ }
+ link_left = (y == h) || !comp(y, new_node);
+ }
+
+ commit_data.link_left = link_left;
+ commit_data.node = y;
+ if(pdepth) *pdepth = depth;
+ }
+
+ static void erase_impl(node_ptr header, node_ptr z, data_for_rebalance &info)
+ {
+ node_ptr y(z);
+ node_ptr x;
+ node_ptr x_parent(0);
+ node_ptr z_left(NodeTraits::get_left(z));
+ node_ptr z_right(NodeTraits::get_right(z));
+ if(!z_left){
+ x = z_right; // x might be null.
+ }
+ else if(!z_right){ // z has exactly one non-null child. y == z.
+ x = z_left; // x is not null.
+ }
+ else{
+ // find z's successor
+ y = tree_algorithms::minimum (z_right);
+ x = NodeTraits::get_right(y); // x might be null.
+ }
+
+ if(y != z){
+ // relink y in place of z. y is z's successor
+ NodeTraits::set_parent(NodeTraits::get_left(z), y);
+ NodeTraits::set_left(y, NodeTraits::get_left(z));
+ if(y != NodeTraits::get_right(z)){
+ x_parent = NodeTraits::get_parent(y);
+ if(x)
+ NodeTraits::set_parent(x, x_parent);
+ NodeTraits::set_left(x_parent, x); // y must be a child of left_
+ NodeTraits::set_right(y, NodeTraits::get_right(z));
+ NodeTraits::set_parent(NodeTraits::get_right(z), y);
+ }
+ else
+ x_parent = y;
+ tree_algorithms::replace_own (z, y, header);
+ NodeTraits::set_parent(y, NodeTraits::get_parent(z));
+ }
+ else { // y == z --> z has only one child, or none
+ x_parent = NodeTraits::get_parent(z);
+ if(x)
+ NodeTraits::set_parent(x, x_parent);
+ tree_algorithms::replace_own (z, x, header);
+ if(NodeTraits::get_left(header) == z){
+ NodeTraits::set_left(header, !NodeTraits::get_right(z) ? // z->get_left() must be null also
+ NodeTraits::get_parent(z) : // makes leftmost == header if z == root
+ tree_algorithms::minimum (x));
+ }
+ if(NodeTraits::get_right(header) == z){
+ NodeTraits::set_right(header, !NodeTraits::get_left(z) ? // z->get_right() must be null also
+ NodeTraits::get_parent(z) : // makes rightmost == header if z == root
+ tree_algorithms::maximum(x));
+ }
+ }
+
+ info.x = x;
+ info.x_parent = x_parent;
+ info.y = y;
+ }
+};
+
+} //namespace detail {
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_TREE_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/detail/tree_node.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/tree_node.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,190 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_TREE_NODE_HPP
+#define BOOST_INTRUSIVE_TREE_NODE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+
+template<class VoidPointer>
+struct tree_node
+{
+ typedef typename pointer_to_other
+ <VoidPointer
+ ,tree_node<VoidPointer> >::type node_ptr;
+
+ node_ptr parent_, left_, right_;
+};
+
+template<class VoidPointer>
+struct tree_node_traits
+{
+ typedef tree_node<VoidPointer> node;
+
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ static node_ptr get_parent(const_node_ptr n)
+ { return n->parent_; }
+
+ static void set_parent(node_ptr n, node_ptr p)
+ { n->parent_ = p; }
+
+ static node_ptr get_left(const_node_ptr n)
+ { return n->left_; }
+
+ static void set_left(node_ptr n, node_ptr l)
+ { n->left_ = l; }
+
+ static node_ptr get_right(const_node_ptr n)
+ { return n->right_; }
+
+ static void set_right(node_ptr n, node_ptr r)
+ { n->right_ = r; }
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// //
+// Implementation of the tree iterator //
+// //
+/////////////////////////////////////////////////////////////////////////////
+
+// tree_iterator provides some basic functions for a
+// node oriented bidirectional iterator:
+template<class Container, bool IsConst>
+class tree_iterator
+ : public std::iterator
+ < std::bidirectional_iterator_tag
+ , typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>::type
+ >
+{
+ protected:
+ typedef typename Container::real_value_traits real_value_traits;
+ typedef typename Container::node_algorithms node_algorithms;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, void>::type void_pointer;
+ static const bool store_container_ptr =
+ detail::store_cont_ptr_on_it<Container>::value;
+
+ public:
+ public:
+ typedef typename detail::add_const_if_c
+ <typename Container::value_type, IsConst>
+ ::type value_type;
+ typedef value_type & reference;
+ typedef value_type * pointer;
+
+ tree_iterator()
+ : members_ (0, 0)
+ {}
+
+ explicit tree_iterator(node_ptr nodeptr, const Container *cont_ptr)
+ : members_ (nodeptr, cont_ptr)
+ {}
+
+ tree_iterator(tree_iterator<Container, false> const& other)
+ : members_(other.pointed_node(), other.get_container())
+ {}
+
+ const node_ptr &pointed_node() const
+ { return members_.nodeptr_; }
+
+ tree_iterator &operator=(const node_ptr &nodeptr)
+ { members_.nodeptr_ = nodeptr; return static_cast<tree_iterator&>(*this); }
+
+ public:
+ tree_iterator& operator++()
+ {
+ members_.nodeptr_ = node_algorithms::next_node(members_.nodeptr_);
+ return static_cast<tree_iterator&> (*this);
+ }
+
+ tree_iterator operator++(int)
+ {
+ tree_iterator result (*this);
+ members_.nodeptr_ = node_algorithms::next_node(members_.nodeptr_);
+ return result;
+ }
+
+ tree_iterator& operator--()
+ {
+ members_.nodeptr_ = node_algorithms::prev_node(members_.nodeptr_);
+ return static_cast<tree_iterator&> (*this);
+ }
+
+ tree_iterator operator--(int)
+ {
+ tree_iterator result (*this);
+ members_.nodeptr_ = node_algorithms::prev_node(members_.nodeptr_);
+ return result;
+ }
+
+ bool operator== (const tree_iterator& i) const
+ { return members_.nodeptr_ == i.pointed_node(); }
+
+ bool operator!= (const tree_iterator& i) const
+ { return !operator== (i); }
+
+ value_type& operator*() const
+ { return *operator->(); }
+
+ pointer operator->() const
+ { return detail::get_pointer(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }
+
+ const Container *get_container() const
+ { return static_cast<const Container*>(members_.get_ptr()); }
+
+ const real_value_traits *get_real_value_traits() const
+ { return &this->get_container()->get_real_value_traits(); }
+
+ tree_iterator end_iterator_from_it() const
+ {
+ return tree_iterator(node_algorithms::get_header(this->pointed_node()), this->get_container());
+ }
+
+ tree_iterator<Container, false> unconst() const
+ { return tree_iterator<Container, false>(this->pointed_node(), this->get_container()); }
+
+ private:
+ struct members
+ : public detail::select_constptr
+ <void_pointer, store_container_ptr>::type
+ {
+ typedef typename detail::select_constptr
+ <void_pointer, store_container_ptr>::type Base;
+
+ members(const node_ptr &n_ptr, const void *cont)
+ : Base(cont), nodeptr_(n_ptr)
+ {}
+
+ node_ptr nodeptr_;
+ } members_;
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_TREE_NODE_HPP
Added: sandbox/move/boost/intrusive/detail/utilities.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/utilities.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,635 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_UTILITIES_HPP
+#define BOOST_INTRUSIVE_DETAIL_UTILITIES_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/parent_from_member.hpp>
+#include <boost/intrusive/detail/ebo_functor_holder.hpp>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/is_stateful_value_traits.hpp>
+#include <boost/cstdint.hpp>
+#include <cstddef>
+#include <climits>
+#include <iterator>
+#include <boost/cstdint.hpp>
+#include <boost/static_assert.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace detail {
+
+template <class T>
+struct internal_member_value_traits
+{
+ template <class U> static detail::one test(...);
+ template <class U> static detail::two test(typename U::member_value_traits* = 0);
+ static const bool value = sizeof(test<T>(0)) == sizeof(detail::two);
+};
+
+template <class T>
+struct internal_base_hook_bool
+{
+ template<bool Add>
+ struct two_or_three {one _[2 + Add];};
+ template <class U> static one test(...);
+ template <class U> static two_or_three<U::boost_intrusive_tags::is_base_hook>
+ test (detail::bool_<U::boost_intrusive_tags::is_base_hook>* = 0);
+ static const std::size_t value = sizeof(test<T>(0));
+};
+
+template <class T>
+struct internal_base_hook_bool_is_true
+{
+ static const bool value = internal_base_hook_bool<T>::value > sizeof(one)*2;
+};
+
+template <class T>
+struct internal_any_hook_bool
+{
+ template<bool Add>
+ struct two_or_three {one _[2 + Add];};
+ template <class U> static one test(...);
+ template <class U> static two_or_three<U::is_any_hook>
+ test (detail::bool_<U::is_any_hook>* = 0);
+ static const std::size_t value = sizeof(test<T>(0));
+};
+
+template <class T>
+struct internal_any_hook_bool_is_true
+{
+ static const bool value = internal_any_hook_bool<T>::value > sizeof(one)*2;
+};
+
+
+template <class T>
+struct external_value_traits_bool
+{
+ template<bool Add>
+ struct two_or_three {one _[2 + Add];};
+ template <class U> static one test(...);
+ template <class U> static two_or_three<U::external_value_traits>
+ test (detail::bool_<U::external_value_traits>* = 0);
+ static const std::size_t value = sizeof(test<T>(0));
+};
+
+template <class T>
+struct external_bucket_traits_bool
+{
+ template<bool Add>
+ struct two_or_three {one _[2 + Add];};
+ template <class U> static one test(...);
+ template <class U> static two_or_three<U::external_bucket_traits>
+ test (detail::bool_<U::external_bucket_traits>* = 0);
+ static const std::size_t value = sizeof(test<T>(0));
+};
+
+template <class T>
+struct external_value_traits_is_true
+{
+ static const bool value = external_value_traits_bool<T>::value > sizeof(one)*2;
+};
+
+template<class Node, class Tag, link_mode_type LinkMode, int>
+struct node_holder
+ : public Node
+{};
+
+template<class SmartPtr>
+struct smart_ptr_type
+{
+ typedef typename SmartPtr::value_type value_type;
+ typedef value_type *pointer;
+ static pointer get (const SmartPtr &smartptr)
+ { return smartptr.get();}
+};
+
+template<class T>
+struct smart_ptr_type<T*>
+{
+ typedef T value_type;
+ typedef value_type *pointer;
+ static pointer get (pointer ptr)
+ { return ptr;}
+};
+
+//!Overload for smart pointers to avoid ADL problems with get_pointer
+template<class Ptr>
+inline typename smart_ptr_type<Ptr>::pointer
+get_pointer(const Ptr &ptr)
+{ return smart_ptr_type<Ptr>::get(ptr); }
+
+//This functor compares a stored value
+//and the one passed as an argument
+template<class ConstReference>
+class equal_to_value
+{
+ ConstReference t_;
+
+ public:
+ equal_to_value(ConstReference t)
+ : t_(t)
+ {}
+
+ bool operator()(ConstReference t)const
+ { return t_ == t; }
+};
+
+class null_disposer
+{
+ public:
+ template <class Pointer>
+ void operator()(Pointer)
+ {}
+};
+
+template<class NodeAlgorithms>
+class init_disposer
+{
+ typedef typename NodeAlgorithms::node_ptr node_ptr;
+
+ public:
+ void operator()(node_ptr p)
+ { NodeAlgorithms::init(p); }
+};
+
+template<bool ConstantSize, class SizeType>
+struct size_holder
+{
+ static const bool constant_time_size = ConstantSize;
+ typedef SizeType size_type;
+
+ SizeType get_size() const
+ { return size_; }
+
+ void set_size(SizeType size)
+ { size_ = size; }
+
+ void decrement()
+ { --size_; }
+
+ void increment()
+ { ++size_; }
+
+ SizeType size_;
+};
+
+template<class SizeType>
+struct size_holder<false, SizeType>
+{
+ static const bool constant_time_size = false;
+ typedef SizeType size_type;
+
+ size_type get_size() const
+ { return 0; }
+
+ void set_size(size_type)
+ {}
+
+ void decrement()
+ {}
+
+ void increment()
+ {}
+};
+
+template<class KeyValueCompare, class Container>
+struct key_nodeptr_comp
+ : private detail::ebo_functor_holder<KeyValueCompare>
+{
+ typedef typename Container::real_value_traits real_value_traits;
+ typedef typename real_value_traits::node_ptr node_ptr;
+ typedef typename real_value_traits::const_node_ptr const_node_ptr;
+ typedef detail::ebo_functor_holder<KeyValueCompare> base_t;
+ key_nodeptr_comp(KeyValueCompare kcomp, const Container *cont)
+ : base_t(kcomp), cont_(cont)
+ {}
+
+ template<class KeyType>
+ bool operator()( const_node_ptr node, const KeyType &key
+ , typename enable_if_c
+ <!is_convertible<KeyType, const_node_ptr>::value>::type * = 0) const
+ { return base_t::get()(*cont_->get_real_value_traits().to_value_ptr(node), key); }
+
+ template<class KeyType>
+ bool operator()(const KeyType &key, const_node_ptr node
+ , typename enable_if_c
+ <!is_convertible<KeyType, const_node_ptr>::value>::type * = 0) const
+ { return base_t::get()(key, *cont_->get_real_value_traits().to_value_ptr(node)); }
+
+ bool operator()(const_node_ptr node1, const_node_ptr node2) const
+ {
+ return base_t::get()
+ ( *cont_->get_real_value_traits().to_value_ptr(node1)
+ , *cont_->get_real_value_traits().to_value_ptr(node2)
+ );
+ }
+
+ const Container *cont_;
+};
+
+template<class F, class Container>
+struct node_cloner
+ : private detail::ebo_functor_holder<F>
+{
+ typedef typename Container::real_value_traits real_value_traits;
+ typedef typename Container::node_algorithms node_algorithms;
+ typedef typename real_value_traits::value_type value_type;
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::node_traits::node node;
+ typedef typename real_value_traits::node_ptr node_ptr;
+ typedef typename real_value_traits::const_node_ptr const_node_ptr;
+ typedef detail::ebo_functor_holder<F> base_t;
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ node_cloner(F f, const Container *cont)
+ : base_t(f), cont_(cont)
+ {}
+
+ node_ptr operator()(node_ptr p)
+ { return this->operator()(*p); }
+
+ node_ptr operator()(const node &to_clone)
+ {
+ const value_type &v =
+ *cont_->get_real_value_traits().to_value_ptr(const_node_ptr(&to_clone));
+ node_ptr n = cont_->get_real_value_traits().to_node_ptr(*base_t::get()(v));
+ //Cloned node must be in default mode if the linking mode requires it
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(n));
+ return n;
+ }
+
+ const Container *cont_;
+};
+
+template<class F, class Container>
+struct node_disposer
+ : private detail::ebo_functor_holder<F>
+{
+ typedef typename Container::real_value_traits real_value_traits;
+ typedef typename real_value_traits::node_ptr node_ptr;
+ typedef detail::ebo_functor_holder<F> base_t;
+ typedef typename Container::node_algorithms node_algorithms;
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ node_disposer(F f, const Container *cont)
+ : base_t(f), cont_(cont)
+ {}
+
+ void operator()(node_ptr p)
+ {
+ if(safemode_or_autounlink)
+ node_algorithms::init(p);
+ base_t::get()(cont_->get_real_value_traits().to_value_ptr(p));
+ }
+ const Container *cont_;
+};
+
+struct dummy_constptr
+{
+ dummy_constptr(const void *)
+ {}
+
+ const void *get_ptr() const
+ { return 0; }
+};
+
+template<class VoidPointer>
+struct constptr
+{
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const void>::type ConstVoidPtr;
+
+ constptr(const void *ptr)
+ : const_void_ptr_(ptr)
+ {}
+
+ const void *get_ptr() const
+ { return detail::get_pointer(const_void_ptr_); }
+
+ ConstVoidPtr const_void_ptr_;
+};
+
+template <class VoidPointer, bool store_ptr>
+struct select_constptr
+{
+ typedef typename detail::if_c
+ < store_ptr
+ , constptr<VoidPointer>
+ , dummy_constptr
+ >::type type;
+};
+
+template<class T, bool Add>
+struct add_const_if_c
+{
+ typedef typename detail::if_c
+ < Add
+ , typename detail::add_const<T>::type
+ , T
+ >::type type;
+};
+
+template <link_mode_type LinkMode>
+struct link_dispatch
+{};
+
+template<class Hook>
+void destructor_impl(Hook &hook, detail::link_dispatch<safe_link>)
+{ //If this assertion raises, you might have destroyed an object
+ //while it was still inserted in a container that is alive.
+ //If so, remove the object from the container before destroying it.
+ (void)hook; BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT(!hook.is_linked());
+}
+
+template<class Hook>
+void destructor_impl(Hook &hook, detail::link_dispatch<auto_unlink>)
+{ hook.unlink(); }
+
+template<class Hook>
+void destructor_impl(Hook &, detail::link_dispatch<normal_link>)
+{}
+
+template<class T, class NodeTraits, link_mode_type LinkMode, class Tag, int HookType>
+struct base_hook_traits
+{
+ public:
+ typedef detail::node_holder
+ <typename NodeTraits::node, Tag, LinkMode, HookType> node_holder;
+ typedef NodeTraits node_traits;
+ typedef T value_type;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+ typedef typename boost::pointer_to_other<node_ptr, T>::type pointer;
+ typedef typename boost::pointer_to_other<node_ptr, const T>::type const_pointer;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ static const link_mode_type link_mode = LinkMode;
+
+ static node_ptr to_node_ptr(reference value)
+ { return static_cast<node_holder*>(&value); }
+
+ static const_node_ptr to_node_ptr(const_reference value)
+ { return static_cast<const node_holder*>(&value); }
+
+ static pointer to_value_ptr(node_ptr n)
+ { return static_cast<T*>(static_cast<node_holder*>(&*n)); }
+
+ static const_pointer to_value_ptr(const_node_ptr n)
+ { return static_cast<const T*>(static_cast<const node_holder*>(&*n)); }
+};
+
+template<class T, class Hook, Hook T::* P>
+struct member_hook_traits
+{
+ public:
+ typedef Hook hook_type;
+ typedef typename hook_type::boost_intrusive_tags::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef T value_type;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+ typedef typename boost::pointer_to_other<node_ptr, T>::type pointer;
+ typedef typename boost::pointer_to_other<node_ptr, const T>::type const_pointer;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ static const link_mode_type link_mode = Hook::boost_intrusive_tags::link_mode;
+
+ static node_ptr to_node_ptr(reference value)
+ {
+ return reinterpret_cast<node*>(&(value.*P));
+ }
+
+ static const_node_ptr to_node_ptr(const_reference value)
+ {
+ return static_cast<const node*>(&(value.*P));
+ }
+
+ static pointer to_value_ptr(node_ptr n)
+ {
+ return detail::parent_from_member<T, Hook>
+ (static_cast<Hook*>(detail::get_pointer(n)), P);
+ }
+
+ static const_pointer to_value_ptr(const_node_ptr n)
+ {
+ return detail::parent_from_member<T, Hook>
+ (static_cast<const Hook*>(detail::get_pointer(n)), P);
+ }
+};
+
+//This function uses binary search to discover the
+//highest set bit of the integer
+inline std::size_t floor_log2 (std::size_t x)
+{
+ const std::size_t Bits = sizeof(std::size_t)*CHAR_BIT;
+ const bool Size_t_Bits_Power_2= !(Bits & (Bits-1));
+ BOOST_STATIC_ASSERT(Size_t_Bits_Power_2);
+
+ std::size_t n = x;
+ std::size_t log2 = 0;
+
+ for(std::size_t shift = Bits >> 1; shift; shift >>= 1){
+ std::size_t tmp = n >> shift;
+ if (tmp)
+ log2 += shift, n = tmp;
+ }
+
+ return log2;
+}
+
+inline float fast_log2 (float val)
+{
+ boost::uint32_t * exp_ptr =
+ static_cast<boost::uint32_t *>(static_cast<void*>(&val));
+ boost::uint32_t x = *exp_ptr;
+ const int log_2 = (int)(((x >> 23) & 255) - 128);
+ x &= ~(255 << 23);
+ x += 127 << 23;
+ *exp_ptr = x;
+
+ val = ((-1.0f/3) * val + 2) * val - 2.0f/3;
+
+ return (val + log_2);
+}
+
+inline std::size_t ceil_log2 (std::size_t x)
+{
+ return ((x & (x-1))!= 0) + floor_log2(x);
+}
+
+template<class SizeType, std::size_t N>
+struct numbits_eq
+{
+ static const bool value = sizeof(SizeType)*CHAR_BIT == N;
+};
+
+template<class SizeType, class Enabler = void >
+struct sqrt2_pow_max;
+
+template <class SizeType>
+struct sqrt2_pow_max<SizeType, typename enable_if< numbits_eq<SizeType, 32> >::type>
+{
+ static const boost::uint32_t value = 0xb504f334;
+ static const std::size_t pow = 31;
+};
+
+template <class SizeType>
+struct sqrt2_pow_max<SizeType, typename enable_if< numbits_eq<SizeType, 64> >::type>
+{
+ static const boost::uint64_t value = 0xb504f333f9de6484ull;
+ static const std::size_t pow = 63;
+};
+
+// Returns floor(pow(sqrt(2), x * 2 + 1)).
+// Defined for X from 0 up to the number of bits in size_t minus 1.
+inline std::size_t sqrt2_pow_2xplus1 (std::size_t x)
+{
+ const std::size_t value = (std::size_t)sqrt2_pow_max<std::size_t>::value;
+ const std::size_t pow = (std::size_t)sqrt2_pow_max<std::size_t>::pow;
+ return (value >> (pow - x)) + 1;
+}
+
+template<class Container, class Disposer>
+class exception_disposer
+{
+ Container *cont_;
+ Disposer &disp_;
+
+ exception_disposer(const exception_disposer&);
+ exception_disposer &operator=(const exception_disposer&);
+
+ public:
+ exception_disposer(Container &cont, Disposer &disp)
+ : cont_(&cont), disp_(disp)
+ {}
+
+ void release()
+ { cont_ = 0; }
+
+ ~exception_disposer()
+ {
+ if(cont_){
+ cont_->clear_and_dispose(disp_);
+ }
+ }
+};
+
+template<class Container, class Disposer>
+class exception_array_disposer
+{
+ Container *cont_;
+ Disposer &disp_;
+ typename Container::size_type &constructed_;
+
+ exception_array_disposer(const exception_array_disposer&);
+ exception_array_disposer &operator=(const exception_array_disposer&);
+
+ public:
+ typedef typename Container::size_type size_type;
+ exception_array_disposer
+ (Container &cont, Disposer &disp, size_type &constructed)
+ : cont_(&cont), disp_(disp), constructed_(constructed)
+ {}
+
+ void release()
+ { cont_ = 0; }
+
+ ~exception_array_disposer()
+ {
+ size_type n = constructed_;
+ if(cont_){
+ while(n--){
+ cont_[n].clear_and_dispose(disp_);
+ }
+ }
+ }
+};
+
+template <class Container>
+struct store_cont_ptr_on_it
+{
+ typedef typename Container::value_traits value_traits;
+ static const bool value = is_stateful_value_traits<value_traits>::value
+ || external_value_traits_is_true<value_traits>::value
+ ;
+};
+
+template<class Container, bool IsConst>
+struct node_to_value
+ : public detail::select_constptr
+ < typename boost::pointer_to_other
+ <typename Container::pointer, void>::type
+ , detail::store_cont_ptr_on_it<Container>::value
+ >::type
+{
+ static const bool store_container_ptr =
+ detail::store_cont_ptr_on_it<Container>::value;
+
+ typedef typename Container::real_value_traits real_value_traits;
+ typedef typename real_value_traits::value_type value_type;
+ typedef typename detail::select_constptr
+ < typename boost::pointer_to_other
+ <typename Container::pointer, void>::type
+ , store_container_ptr >::type Base;
+ typedef typename real_value_traits::node_traits::node node;
+ typedef typename detail::add_const_if_c
+ <value_type, IsConst>::type vtype;
+ typedef typename detail::add_const_if_c
+ <node, IsConst>::type ntype;
+ typedef typename boost::pointer_to_other
+ <typename Container::pointer, ntype>::type npointer;
+
+ node_to_value(const Container *cont)
+ : Base(cont)
+ {}
+
+ typedef vtype & result_type;
+ typedef ntype & first_argument_type;
+
+ const Container *get_container() const
+ {
+ if(store_container_ptr)
+ return static_cast<const Container*>(Base::get_ptr());
+ else
+ return 0;
+ }
+
+ const real_value_traits *get_real_value_traits() const
+ {
+ if(store_container_ptr)
+ return &this->get_container()->get_real_value_traits();
+ else
+ return 0;
+ }
+
+ result_type operator()(first_argument_type arg) const
+ { return *(this->get_real_value_traits()->to_value_ptr(npointer(&arg))); }
+};
+
+
+} //namespace detail
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_DETAIL_UTILITIES_HPP
Added: sandbox/move/boost/intrusive/detail/workaround.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/detail/workaround.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,30 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/interprocess for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_DETAIL_WRKRND_HPP
+#define BOOST_INTRUSIVE_DETAIL_WRKRND_HPP
+
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)
+// C++0x features are only enabled when -std=c++0x or -std=gnu++0x are
+// passed on the command line, which in turn defines
+// __GXX_EXPERIMENTAL_CXX0X__. Note: __GXX_EXPERIMENTAL_CPP0X__ is
+// defined by some very early development versions of GCC 4.3; we will
+// remove this part of the check in the near future.
+# if defined(__GXX_EXPERIMENTAL_CPP0X__) || defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define BOOST_INTRUSIVE_RVALUE_REFERENCE
+# define BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+# endif
+#endif
+
+#if defined(BOOST_INTRUSIVE_RVALUE_REFERENCE) && defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+#define BOOST_INTRUSIVE_PERFECT_FORWARDING
+#endif
+
+#endif //#ifndef BOOST_INTRUSIVE_DETAIL_WRKRND_HPP
Added: sandbox/move/boost/intrusive/hashtable.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/hashtable.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,3023 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_HASHTABLE_HPP
+#define BOOST_INTRUSIVE_HASHTABLE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+//std C++
+#include <functional> //std::equal_to
+#include <utility> //std::pair
+#include <algorithm> //std::swap, std::lower_bound, std::upper_bound
+#include <cstddef> //std::size_t
+#include <iterator> //std::iterator_traits
+//boost
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/functional/hash.hpp>
+//General intrusive utilities
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/hashtable_node.hpp>
+#include <boost/intrusive/detail/transform_iterator.hpp>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/detail/ebo_functor_holder.hpp>
+#include <boost/intrusive/detail/clear_on_destructor_base.hpp>
+//Implementation utilities
+#include <boost/intrusive/trivial_value_traits.hpp>
+#include <boost/intrusive/unordered_set_hook.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+namespace detail {
+
+struct hash_bool_flags
+{
+ static const std::size_t unique_keys_pos = 1u;
+ static const std::size_t constant_time_size_pos = 2u;
+ static const std::size_t power_2_buckets_pos = 4u;
+ static const std::size_t cache_begin_pos = 8u;
+ static const std::size_t compare_hash_pos = 16u;
+ static const std::size_t incremental_pos = 32u;
+};
+
+template
+ < class ValueTraits
+ , class Hash
+ , class Equal
+ , class SizeType
+ , class BucketTraits
+ , std::size_t BoolFlags
+ >
+struct usetopt
+{
+ typedef ValueTraits value_traits;
+ typedef Hash hash;
+ typedef Equal equal;
+ typedef SizeType size_type;
+ typedef BucketTraits bucket_traits;
+ static const std::size_t bool_flags = BoolFlags;
+};
+
+template
+ < class UsetOpt
+ , std::size_t BoolMask
+ >
+struct usetopt_mask
+{
+ typedef usetopt
+ <typename UsetOpt::value_traits
+ ,typename UsetOpt::hash
+ ,typename UsetOpt::equal
+ ,typename UsetOpt::size_type
+ ,typename UsetOpt::bucket_traits
+ ,UsetOpt::bool_flags & BoolMask
+ > type;
+};
+
+template <class NodeTraits>
+struct hash_reduced_slist_node_traits
+{
+ template <class U> static detail::one test(...);
+ template <class U> static detail::two test(typename U::reduced_slist_node_traits* = 0);
+ static const bool value = sizeof(test<NodeTraits>(0)) == sizeof(detail::two);
+};
+
+template <class NodeTraits>
+struct apply_reduced_slist_node_traits
+{
+ typedef typename NodeTraits::reduced_slist_node_traits type;
+};
+
+template <class NodeTraits>
+struct reduced_slist_node_traits
+{
+ typedef typename detail::eval_if_c
+ < hash_reduced_slist_node_traits<NodeTraits>::value
+ , apply_reduced_slist_node_traits<NodeTraits>
+ , detail::identity<NodeTraits>
+ >::type type;
+};
+
+template<class NodeTraits>
+struct get_slist_impl
+{
+ typedef trivial_value_traits<NodeTraits, normal_link> trivial_traits;
+
+ //Reducing symbol length
+ struct type : make_slist
+ < typename NodeTraits::node
+ , boost::intrusive::value_traits<trivial_traits>
+ , boost::intrusive::constant_time_size<false>
+ , boost::intrusive::size_type<std::size_t>
+ >::type
+ {};
+};
+
+template<class SupposedValueTraits>
+struct real_from_supposed_value_traits
+{
+ typedef typename detail::eval_if_c
+ < detail::external_value_traits_is_true
+ <SupposedValueTraits>::value
+ , detail::eval_value_traits
+ <SupposedValueTraits>
+ , detail::identity
+ <SupposedValueTraits>
+ >::type type;
+};
+
+template<class SupposedValueTraits>
+struct get_slist_impl_from_supposed_value_traits
+{
+ typedef typename
+ real_from_supposed_value_traits
+ < SupposedValueTraits>::type real_value_traits;
+ typedef typename detail::get_node_traits
+ <real_value_traits>::type node_traits;
+ typedef typename get_slist_impl
+ <typename reduced_slist_node_traits
+ <node_traits>::type
+ >::type type;
+};
+
+template<class SupposedValueTraits>
+struct unordered_bucket_impl
+{
+ /// @cond
+ typedef typename
+ get_slist_impl_from_supposed_value_traits
+ <SupposedValueTraits>::type slist_impl;
+ typedef detail::bucket_impl<slist_impl> implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+template<class SupposedValueTraits>
+struct unordered_bucket_ptr_impl
+{
+ /// @cond
+ typedef typename detail::get_node_traits
+ <SupposedValueTraits>::type::node_ptr node_ptr;
+ typedef typename unordered_bucket_impl
+ <SupposedValueTraits>::type bucket_type;
+ typedef typename boost::pointer_to_other
+ <node_ptr, bucket_type>::type implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+template <class T>
+struct store_hash_bool
+{
+ template<bool Add>
+ struct two_or_three {one _[2 + Add];};
+ template <class U> static one test(...);
+ template <class U> static two_or_three<U::store_hash>
+ test (detail::bool_<U::store_hash>* = 0);
+ static const std::size_t value = sizeof(test<T>(0));
+};
+
+template <class T>
+struct store_hash_is_true
+{
+ static const bool value = store_hash_bool<T>::value > sizeof(one)*2;
+};
+
+template <class T>
+struct optimize_multikey_bool
+{
+ template<bool Add>
+ struct two_or_three {one _[2 + Add];};
+ template <class U> static one test(...);
+ template <class U> static two_or_three<U::optimize_multikey>
+ test (detail::bool_<U::optimize_multikey>* = 0);
+ static const std::size_t value = sizeof(test<T>(0));
+};
+
+template <class T>
+struct optimize_multikey_is_true
+{
+ static const bool value = optimize_multikey_bool<T>::value > sizeof(one)*2;
+};
+
+template<class Config>
+struct bucket_plus_size
+ : public detail::size_holder
+ < 0 != (Config::bool_flags & hash_bool_flags::constant_time_size_pos)
+ , typename Config::size_type>
+{
+ typedef detail::size_holder
+ < 0 != (Config::bool_flags & hash_bool_flags::constant_time_size_pos)
+ , typename Config::size_type> size_traits;
+ typedef typename Config::bucket_traits bucket_traits;
+
+ bucket_plus_size(const bucket_traits &b_traits)
+ : bucket_traits_(b_traits)
+ {}
+ bucket_traits bucket_traits_;
+};
+
+template<class Config>
+struct bucket_hash_t
+ : public detail::ebo_functor_holder<typename Config::hash>
+{
+ typedef typename Config::hash hasher;
+ typedef detail::size_holder
+ < 0 != (Config::bool_flags & hash_bool_flags::constant_time_size_pos)
+ , typename Config::size_type> size_traits;
+ typedef typename Config::bucket_traits bucket_traits;
+
+ bucket_hash_t(const bucket_traits &b_traits, const hasher & h)
+ : detail::ebo_functor_holder<hasher>(h), bucket_plus_size_(b_traits)
+ {}
+
+ bucket_plus_size<Config> bucket_plus_size_;
+};
+
+template<class Config, bool>
+struct bucket_hash_equal_t : public detail::ebo_functor_holder<typename Config::equal>
+{
+ typedef typename Config::equal equal;
+ typedef typename Config::hash hasher;
+ typedef typename Config::bucket_traits bucket_traits;
+
+ bucket_hash_equal_t(const bucket_traits &b_traits, const hasher & h, const equal &e)
+ : detail::ebo_functor_holder<typename Config::equal>(e), bucket_hash(b_traits, h)
+ {}
+ bucket_hash_t<Config> bucket_hash;
+};
+
+template<class Config> //cache_begin == true version
+struct bucket_hash_equal_t<Config, true>
+ : public detail::ebo_functor_holder<typename Config::equal>
+{
+ typedef typename Config::equal equal;
+ typedef typename Config::hash hasher;
+ typedef typename Config::bucket_traits bucket_traits;
+ typedef typename unordered_bucket_ptr_impl
+ <typename Config::value_traits>::type bucket_ptr;
+
+ bucket_hash_equal_t(const bucket_traits &b_traits, const hasher & h, const equal &e)
+ : detail::ebo_functor_holder<typename Config::equal>(e), bucket_hash(b_traits, h)
+ {}
+ bucket_hash_t<Config> bucket_hash;
+ bucket_ptr cached_begin_;
+};
+
+template<class Config>
+struct hashtable_data_t : public Config::value_traits
+{
+ static const std::size_t bool_flags = Config::bool_flags;
+ typedef typename Config::value_traits value_traits;
+ typedef typename Config::equal equal;
+ typedef typename Config::hash hasher;
+ typedef typename Config::bucket_traits bucket_traits;
+
+ hashtable_data_t( const bucket_traits &b_traits, const hasher & h
+ , const equal &e, const value_traits &val_traits)
+ : Config::value_traits(val_traits), internal_(b_traits, h, e)
+ {}
+ typedef typename detail::usetopt_mask
+ < Config
+ , detail::hash_bool_flags::constant_time_size_pos
+ | detail::hash_bool_flags::incremental_pos
+ >::type masked_config_t;
+ struct internal
+ : public detail::size_holder
+ < 0 != (Config::bool_flags & hash_bool_flags::incremental_pos)
+ , typename Config::size_type>
+ {
+ internal(const bucket_traits &b_traits, const hasher & h, const equal &e)
+ : bucket_hash_equal_(b_traits, h, e)
+ {}
+
+ bucket_hash_equal_t
+ < masked_config_t
+ , 0 != (bool_flags & hash_bool_flags::cache_begin_pos)
+ > bucket_hash_equal_;
+ } internal_;
+};
+
+struct insert_commit_data_impl
+{
+ std::size_t hash;
+};
+
+template<class NodeTraits>
+struct group_functions
+{
+ typedef NodeTraits node_traits;
+ typedef unordered_group_adapter<node_traits> group_traits;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::node node;
+ typedef typename reduced_slist_node_traits
+ <node_traits>::type reduced_node_traits;
+ typedef typename reduced_node_traits::node_ptr slist_node_ptr;
+ typedef typename reduced_node_traits::node slist_node;
+ typedef circular_slist_algorithms<group_traits> group_algorithms;
+
+ static node_ptr dcast_bucket_ptr(slist_node_ptr p)
+ { return node_ptr(&static_cast<node&>(*p)); }
+
+ static slist_node_ptr priv_get_bucket_before_begin
+ (slist_node_ptr bucket_beg, slist_node_ptr bucket_end, node_ptr p)
+ {
+ //First find the last node of p's group.
+ //This requires checking the first node of the next group or
+ //the bucket node.
+ node_ptr prev_node = p;
+ node_ptr nxt(node_traits::get_next(p));
+ while(!(bucket_beg <= nxt && nxt <= bucket_end) &&
+ (group_traits::get_next(nxt) == prev_node)){
+ prev_node = nxt;
+ nxt = node_traits::get_next(nxt);
+ }
+
+ //If we've reached the bucket node just return it.
+ if(bucket_beg <= nxt && nxt <= bucket_end){
+ return nxt;
+ }
+
+ //Otherwise, iterate using group links until the bucket node
+ node_ptr first_node_of_group = nxt;
+ node_ptr last_node_group = group_traits::get_next(first_node_of_group);
+ slist_node_ptr possible_end = node_traits::get_next(last_node_group);
+
+ while(!(bucket_beg <= possible_end && possible_end <= bucket_end)){
+ first_node_of_group = dcast_bucket_ptr(possible_end);
+ last_node_group = group_traits::get_next(first_node_of_group);
+ possible_end = node_traits::get_next(last_node_group);
+ }
+ return possible_end;
+ }
+
+ static node_ptr priv_get_prev_to_first_in_group(slist_node_ptr bucket_node, node_ptr first_in_group)
+ {
+ //Just iterate using group links and obtain the node
+ //before "first_in_group)"
+ node_ptr prev_node = dcast_bucket_ptr(bucket_node);
+ node_ptr nxt(node_traits::get_next(prev_node));
+ while(nxt != first_in_group){
+ prev_node = group_traits::get_next(nxt);
+ nxt = node_traits::get_next(prev_node);
+ }
+ return prev_node;
+ }
+
+ static node_ptr priv_get_first_in_group_of_last_in_group(node_ptr last_in_group)
+ {
+ //Just iterate using group links and obtain the node
+ //before "last_in_group"
+ node_ptr possible_first = group_traits::get_next(last_in_group);
+ node_ptr possible_first_prev = group_traits::get_next(possible_first);
+ // The deleted node is at the end of the group, so the
+ // node in the group pointing to it is at the beginning
+ // of the group. Find that to change its pointer.
+ while(possible_first_prev != last_in_group){
+ possible_first = possible_first_prev;
+ possible_first_prev = group_traits::get_next(possible_first);
+ }
+ return possible_first;
+ }
+
+
+ static void priv_erase_from_group(slist_node_ptr end_ptr, node_ptr to_erase_ptr, detail::true_)
+ {
+ node_ptr nxt_ptr(node_traits::get_next(to_erase_ptr));
+ node_ptr prev_in_group_ptr(group_traits::get_next(to_erase_ptr));
+ bool last_in_group = (end_ptr == nxt_ptr) ||
+ (group_traits::get_next(nxt_ptr) != to_erase_ptr);
+ bool first_in_group = node_traits::get_next(prev_in_group_ptr) != to_erase_ptr;
+
+ if(first_in_group && last_in_group){
+ group_algorithms::init(to_erase_ptr);
+ }
+ else if(first_in_group){
+ group_algorithms::unlink_after(nxt_ptr);
+ }
+ else if(last_in_group){
+ node_ptr first_in_group =
+ priv_get_first_in_group_of_last_in_group(to_erase_ptr);
+ group_algorithms::unlink_after(first_in_group);
+ }
+ else{
+ group_algorithms::unlink_after(nxt_ptr);
+ }
+ }
+
+ static void priv_erase_from_group(slist_node_ptr, node_ptr, detail::false_)
+ {}
+
+ static node_ptr priv_get_last_in_group(node_ptr first_in_group, detail::true_)
+ { return group_traits::get_next(first_in_group); }
+
+ static node_ptr priv_get_last_in_group(node_ptr n, detail::false_)
+ { return n; }
+};
+
+template<class BucketType, class SplitTraits>
+class incremental_rehash_rollback
+{
+ private:
+ typedef BucketType bucket_type;
+ typedef SplitTraits split_traits;
+
+ incremental_rehash_rollback();
+ incremental_rehash_rollback & operator=(const incremental_rehash_rollback &);
+ incremental_rehash_rollback (const incremental_rehash_rollback &);
+
+ public:
+ incremental_rehash_rollback
+ (bucket_type &source_bucket, bucket_type &destiny_bucket, split_traits &split_traits)
+ : source_bucket_(source_bucket), destiny_bucket_(destiny_bucket)
+ , split_traits_(split_traits), released_(false)
+ {}
+
+ void release()
+ { released_ = true; }
+
+ ~incremental_rehash_rollback()
+ {
+ if(!released_){
+ //If an exception is thrown, just put all moved nodes back in the old bucket
+ //and move back the split mark.
+ destiny_bucket_.splice_after(destiny_bucket_.before_begin(), source_bucket_);
+ split_traits_.decrement();
+ }
+ }
+
+ private:
+ bucket_type &source_bucket_;
+ bucket_type &destiny_bucket_;
+ split_traits &split_traits_;
+ bool released_;
+};
+
+} //namespace detail {
+
+//!This metafunction will obtain the type of a bucket
+//!from the value_traits or hook option to be used with
+//!a hash container.
+template<class ValueTraitsOrHookOption>
+struct unordered_bucket
+ : public detail::unordered_bucket_impl
+ <typename ValueTraitsOrHookOption::
+ template pack<none>::value_traits
+ >
+{};
+
+//!This metafunction will obtain the type of a bucket pointer
+//!from the value_traits or hook option to be used with
+//!a hash container.
+template<class ValueTraitsOrHookOption>
+struct unordered_bucket_ptr
+ : public detail::unordered_bucket_ptr_impl
+ <typename ValueTraitsOrHookOption::
+ template pack<none>::value_traits
+ >
+{};
+
+//!This metafunction will obtain the type of the default bucket traits
+//!(when the user does not specify the bucket_traits<> option) from the
+//!value_traits or hook option to be used with
+//!a hash container.
+template<class ValueTraitsOrHookOption>
+struct unordered_default_bucket_traits
+{
+ /// @cond
+ typedef typename ValueTraitsOrHookOption::
+ template pack<none>::value_traits supposed_value_traits;
+ typedef typename detail::
+ get_slist_impl_from_supposed_value_traits
+ <supposed_value_traits>::type slist_impl;
+ typedef detail::bucket_traits_impl
+ <slist_impl> implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+struct default_bucket_traits;
+
+template <class T>
+struct uset_defaults
+ : pack_options
+ < none
+ , base_hook<detail::default_uset_hook>
+ , constant_time_size<true>
+ , size_type<std::size_t>
+ , equal<std::equal_to<T> >
+ , hash<boost::hash<T> >
+ , bucket_traits<default_bucket_traits>
+ , power_2_buckets<false>
+ , cache_begin<false>
+ , compare_hash<false>
+ , incremental<false>
+ >::type
+{};
+
+/// @endcond
+
+//! The class template hashtable is an intrusive hash table container, that
+//! is used to construct intrusive unordered_set and unordered_multiset containers. The
+//! no-throw guarantee holds only, if the Equal object and Hasher don't throw.
+//!
+//! hashtable is a semi-intrusive container: each object to be stored in the
+//! container must contain a proper hook, but the container also needs
+//! additional auxiliary memory to work: hashtable needs a pointer to an array
+//! of type `bucket_type` to be passed in the constructor. This bucket array must
+//! have at least the same lifetime as the container. This makes the use of
+//! hashtable more complicated than purely intrusive containers.
+//! `bucket_type` is default-constructible, copyable and assignable
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
+//! \c bucket_traits<>, power_2_buckets<>, cache_begin<> and incremental<>.
+//!
+//! hashtable only provides forward iterators but it provides 4 iterator types:
+//! iterator and const_iterator to navigate through the whole container and
+//! local_iterator and const_local_iterator to navigate through the values
+//! stored in a single bucket. Local iterators are faster and smaller.
+//!
+//! It's not recommended to use non constant-time size hashtables because several
+//! key functions, like "empty()", become non-constant time functions. Non
+//! constant_time size hashtables are mainly provided to support auto-unlink hooks.
+//!
+//! hashtables, does not make automatic rehashings nor
+//! offers functions related to a load factor. Rehashing can be explicitly requested
+//! and the user must provide a new bucket array that will be used from that moment.
+//!
+//! Since no automatic rehashing is done, iterators are never invalidated when
+//! inserting or erasing elements. Iterators are only invalidated when rehashing.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class hashtable_impl
+ : private detail::clear_on_destructor_base<hashtable_impl<Config> >
+{
+ template<class C> friend class detail::clear_on_destructor_base;
+ public:
+ typedef typename Config::value_traits value_traits;
+
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ typedef typename Config::bucket_traits bucket_traits;
+ static const bool external_bucket_traits =
+ detail::external_bucket_traits_is_true<bucket_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_bucket_traits
+ , detail::eval_bucket_traits<bucket_traits>
+ , detail::identity<bucket_traits>
+ >::type real_bucket_traits;
+ typedef typename detail::get_slist_impl
+ <typename detail::reduced_slist_node_traits
+ <typename real_value_traits::node_traits>::type
+ >::type slist_impl;
+ /// @endcond
+
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::const_pointer const_pointer;
+ typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ typedef typename std::iterator_traits<pointer>::difference_type difference_type;
+ typedef typename Config::size_type size_type;
+ typedef value_type key_type;
+ typedef typename Config::equal key_equal;
+ typedef typename Config::hash hasher;
+ typedef detail::bucket_impl<slist_impl> bucket_type;
+ typedef typename boost::pointer_to_other
+ <pointer, bucket_type>::type bucket_ptr;
+ typedef typename slist_impl::iterator siterator;
+ typedef typename slist_impl::const_iterator const_siterator;
+ typedef detail::hashtable_iterator<hashtable_impl, false> iterator;
+ typedef detail::hashtable_iterator<hashtable_impl, true> const_iterator;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename boost::pointer_to_other
+ <pointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, const node>::type const_node_ptr;
+ typedef typename slist_impl::node_algorithms node_algorithms;
+
+ static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+ static const bool store_hash = detail::store_hash_is_true<node_traits>::value;
+
+ static const bool unique_keys = 0 != (Config::bool_flags & detail::hash_bool_flags::unique_keys_pos);
+ static const bool constant_time_size = 0 != (Config::bool_flags & detail::hash_bool_flags::constant_time_size_pos);
+ static const bool cache_begin = 0 != (Config::bool_flags & detail::hash_bool_flags::cache_begin_pos);
+ static const bool compare_hash = 0 != (Config::bool_flags & detail::hash_bool_flags::compare_hash_pos);
+ static const bool incremental = 0 != (Config::bool_flags & detail::hash_bool_flags::incremental_pos);
+ static const bool power_2_buckets = incremental || (0 != (Config::bool_flags & detail::hash_bool_flags::power_2_buckets_pos));
+
+ static const bool optimize_multikey
+ = detail::optimize_multikey_is_true<node_traits>::value && !unique_keys;
+
+ /// @cond
+ private:
+
+ //Configuration error: compare_hash<> can't be specified without store_hash<>
+ //See documentation for more explanations
+ BOOST_STATIC_ASSERT((!compare_hash || store_hash));
+
+ typedef typename slist_impl::node_ptr slist_node_ptr;
+ typedef typename boost::pointer_to_other
+ <slist_node_ptr, void>::type void_pointer;
+ //We'll define group traits, but these won't be instantiated if
+ //optimize_multikey is not true
+ typedef unordered_group_adapter<node_traits> group_traits;
+ typedef circular_slist_algorithms<group_traits> group_algorithms;
+ typedef detail::bool_<store_hash> store_hash_t;
+ typedef detail::bool_<optimize_multikey> optimize_multikey_t;
+ typedef detail::bool_<cache_begin> cache_begin_t;
+ typedef detail::bool_<power_2_buckets> power_2_buckets_t;
+ typedef detail::size_holder<constant_time_size, size_type> size_traits;
+ typedef detail::size_holder<incremental, size_type> split_traits;
+ typedef detail::group_functions<node_traits> group_functions_t;
+
+ static const std::size_t hashtable_data_bool_flags_mask =
+ ( detail::hash_bool_flags::cache_begin_pos
+ | detail::hash_bool_flags::constant_time_size_pos
+ | detail::hash_bool_flags::incremental_pos
+ );
+ typedef typename detail::usetopt_mask
+ <Config, hashtable_data_bool_flags_mask>::type masked_config_t;
+ detail::hashtable_data_t<masked_config_t> data_;
+
+ template<bool IsConst>
+ struct downcast_node_to_value
+ : public detail::node_to_value<hashtable_impl, IsConst>
+ {
+ typedef detail::node_to_value<hashtable_impl, IsConst> base_t;
+ typedef typename base_t::result_type result_type;
+ typedef typename detail::add_const_if_c
+ <typename slist_impl::node, IsConst>::type &first_argument_type;
+ typedef typename detail::add_const_if_c
+ <node, IsConst>::type &intermediate_argument_type;
+
+ downcast_node_to_value(const hashtable_impl *cont)
+ : base_t(cont)
+ {}
+
+ result_type operator()(first_argument_type arg) const
+ { return this->base_t::operator()(static_cast<intermediate_argument_type>(arg)); }
+ };
+
+ template<class F>
+ struct node_cast_adaptor
+ : private detail::ebo_functor_holder<F>
+ {
+ typedef detail::ebo_functor_holder<F> base_t;
+
+ template<class ConvertibleToF>
+ node_cast_adaptor(const ConvertibleToF &c2f, const hashtable_impl *cont)
+ : base_t(base_t(c2f, cont))
+ {}
+
+ typename base_t::node_ptr operator()(const typename slist_impl::node &to_clone)
+ { return base_t::operator()(static_cast<const node &>(to_clone)); }
+
+ void operator()(typename slist_impl::node_ptr to_clone)
+ { base_t::operator()(node_ptr(&static_cast<node &>(*to_clone))); }
+ };
+
+ private:
+ //noncopyable
+ hashtable_impl (const hashtable_impl&);
+ hashtable_impl operator =(const hashtable_impl&);
+
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ //Constant-time size is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(constant_time_size && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+ //Cache begin is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(cache_begin && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+
+ template<class Disposer>
+ node_cast_adaptor<detail::node_disposer<Disposer, hashtable_impl> >
+ make_node_disposer(const Disposer &disposer) const
+ { return node_cast_adaptor<detail::node_disposer<Disposer, hashtable_impl> >(disposer, this); }
+
+ /// @endcond
+
+ public:
+ typedef detail::insert_commit_data_impl insert_commit_data;
+
+ typedef detail::transform_iterator
+ < typename slist_impl::iterator
+ , downcast_node_to_value<false> > local_iterator;
+
+ typedef detail::transform_iterator
+ < typename slist_impl::iterator
+ , downcast_node_to_value<true> > const_local_iterator;
+
+ /// @cond
+
+ const real_value_traits &get_real_value_traits(detail::bool_<false>) const
+ { return this->data_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<true>) const
+ { return data_.get_value_traits(*this); }
+
+ real_value_traits &get_real_value_traits(detail::bool_<false>)
+ { return this->data_; }
+
+ real_value_traits &get_real_value_traits(detail::bool_<true>)
+ { return data_.get_value_traits(*this); }
+
+ /// @endcond
+
+ public:
+
+ const real_value_traits &get_real_value_traits() const
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ real_value_traits &get_real_value_traits()
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ //! <b>Requires</b>: buckets must not be being used by any other resource.
+ //!
+ //! <b>Effects</b>: Constructs an empty unordered_set, storing a reference
+ //! to the bucket array and copies of the key_hasher and equal_func functors.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor or invocation of hash_func or equal_func throws.
+ //!
+ //! <b>Notes</b>: buckets array must be disposed only after
+ //! *this is disposed.
+ hashtable_impl ( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : data_(b_traits, hash_func, equal_func, v_traits)
+ {
+ priv_initialize_buckets();
+ this->priv_size_traits().set_size(size_type(0));
+ size_type bucket_size = this->priv_buckets_len();
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(bucket_size != 0);
+ //Check power of two bucket array if the option is activated
+ BOOST_INTRUSIVE_INVARIANT_ASSERT
+ (!power_2_buckets || (0 == (bucket_size & (bucket_size-1))));
+ priv_split_traits().set_size(bucket_size>>1);
+ }
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the unordered_set, if
+ //! it's a safe-mode or auto-unlink value. Otherwise constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~hashtable_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //! Worst case (empty unordered_set): O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return iterator(this->priv_begin(), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
+ //! of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //! Worst case (empty unordered_set): O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return this->cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
+ //! of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //! Worst case (empty unordered_set): O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return const_iterator(this->priv_begin(), this); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return iterator(priv_invalid_local_it(), 0); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return this->cend(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return const_iterator(priv_invalid_local_it(), 0); }
+
+ //! <b>Effects</b>: Returns the hasher object used by the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If hasher copy-constructor throws.
+ hasher hash_function() const
+ { return this->priv_hasher(); }
+
+ //! <b>Effects</b>: Returns the key_equal object used by the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_equal copy-constructor throws.
+ key_equal key_eq() const
+ { return this->priv_equal(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: if constant-time size and cache_begin options are disabled,
+ //! average constant time (worst case, with empty() == true: O(this->bucket_count()).
+ //! Otherwise constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ {
+ if(constant_time_size){
+ return !this->size();
+ }
+ else if(cache_begin){
+ return this->begin() == this->end();
+ }
+ else{
+ size_type buckets_len = this->priv_buckets_len();
+ const bucket_type *b = detail::get_pointer(this->priv_buckets());
+ for (size_type n = 0; n < buckets_len; ++n, ++b){
+ if(!b->empty()){
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the unordered_set.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if
+ //! constant_time_size is false. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ {
+ if(constant_time_size)
+ return this->priv_size_traits().get_size();
+ else{
+ size_type len = 0;
+ size_type buckets_len = this->priv_buckets_len();
+ const bucket_type *b = detail::get_pointer(this->priv_buckets());
+ for (size_type n = 0; n < buckets_len; ++n, ++b){
+ len += b->size();
+ }
+ return len;
+ }
+ }
+
+ //! <b>Requires</b>: the hasher and the equality function unqualified swap
+ //! call should not throw.
+ //!
+ //! <b>Effects</b>: Swaps the contents of two unordered_sets.
+ //! Swaps also the contained bucket array and equality and hasher functors.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison or hash functors
+ //! found using ADL throw. Basic guarantee.
+ void swap(hashtable_impl& other)
+ {
+ using std::swap;
+ //These can throw
+ swap(this->priv_equal(), other.priv_equal());
+ swap(this->priv_hasher(), other.priv_hasher());
+ //These can't throw
+ swap(this->priv_real_bucket_traits(), other.priv_real_bucket_traits());
+ priv_swap_cache(cache_begin_t(), other);
+ if(constant_time_size){
+ size_type backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(other.priv_size_traits().get_size());
+ other.priv_size_traits().set_size(backup);
+ }
+ else if(incremental){
+ size_type backup = this->priv_split_traits().get_size();
+ this->priv_split_traits().set_size(other.priv_split_traits().get_size());
+ other.priv_split_traits().set_size(backup);
+ }
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw
+ //! Cloner should yield to nodes that compare equal and produce the same
+ //! hash than the original node.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. The hash function and the equality
+ //! predicate are copied from the source.
+ //!
+ //! If store_hash option is true, this method does not use the hash function.
+ //!
+ //! If any operation throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner or hasher throw or hash or equality predicate copying
+ //! throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const hashtable_impl &src, Cloner cloner, Disposer disposer)
+ {
+ this->clear_and_dispose(disposer);
+ if(!constant_time_size || !src.empty()){
+ const size_type src_bucket_count = src.bucket_count();
+ const size_type dst_bucket_count = this->bucket_count();
+ //Check power of two bucket array if the option is activated
+ BOOST_INTRUSIVE_INVARIANT_ASSERT
+ (!power_2_buckets || (0 == (src_bucket_count & (src_bucket_count-1))));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT
+ (!power_2_buckets || (0 == (dst_bucket_count & (dst_bucket_count-1))));
+
+ //If src bucket count is bigger or equal, structural copy is possible
+ if(!incremental && (src_bucket_count >= dst_bucket_count)){
+ //First clone the first ones
+ const bucket_ptr src_buckets = src.priv_buckets();
+ const bucket_ptr dst_buckets = this->priv_buckets();
+ size_type constructed;
+ typedef node_cast_adaptor<detail::node_disposer<Disposer, hashtable_impl> > NodeDisposer;
+ typedef node_cast_adaptor<detail::node_cloner<Cloner, hashtable_impl> > NodeCloner;
+ NodeDisposer node_disp(disposer, this);
+
+ detail::exception_array_disposer<bucket_type, NodeDisposer>
+ rollback(dst_buckets[0], node_disp, constructed);
+ for( constructed = 0
+ ; constructed < dst_bucket_count
+ ; ++constructed){
+ dst_buckets[constructed].clone_from
+ ( src_buckets[constructed]
+ , NodeCloner(cloner, this), node_disp);
+ }
+ if(src_bucket_count != dst_bucket_count){
+ //Now insert the remaining ones using the modulo trick
+ for(//"constructed" comes from the previous loop
+ ; constructed < src_bucket_count
+ ; ++constructed){
+ bucket_type &dst_b =
+ dst_buckets[priv_hash_to_bucket(constructed, dst_bucket_count, dst_bucket_count)];
+ bucket_type &src_b = src_buckets[constructed];
+ for( siterator b(src_b.begin()), e(src_b.end())
+ ; b != e
+ ; ++b){
+ dst_b.push_front(*(NodeCloner(cloner, this)(*b.pointed_node())));
+ }
+ }
+ }
+ this->priv_hasher() = src.priv_hasher();
+ this->priv_equal() = src.priv_equal();
+ rollback.release();
+ this->priv_size_traits().set_size(src.priv_size_traits().get_size());
+ this->priv_split_traits().set_size(dst_bucket_count);
+ priv_insertion_update_cache(0u);
+ priv_erasure_update_cache();
+ }
+ else if(store_hash){
+ //Unlike previous cloning algorithm, this can throw
+ //if cloner, hasher or comparison functor throw
+ const_iterator b(src.begin()), e(src.end());
+ detail::exception_disposer<hashtable_impl, Disposer>
+ rollback(*this, disposer);
+ for(; b != e; ++b){
+ std::size_t hash_value = this->priv_stored_or_compute_hash(*b, store_hash_t());;
+ this->priv_insert_equal_with_hash(*cloner(*b), hash_value);
+ }
+ rollback.release();
+ }
+ else{
+ //Unlike previous cloning algorithm, this can throw
+ //if cloner, hasher or comparison functor throw
+ const_iterator b(src.begin()), e(src.end());
+ detail::exception_disposer<hashtable_impl, Disposer>
+ rollback(*this, disposer);
+ for(; b != e; ++b){
+ this->insert_equal(*cloner(*b));
+ }
+ rollback.release();
+ }
+ }
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts the value into the unordered_set.
+ //!
+ //! <b>Returns</b>: An iterator to the inserted value.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(reference value)
+ {
+ size_type bucket_num;
+ std::size_t hash_value;
+ siterator prev;
+ siterator it = this->priv_find
+ (value, this->priv_hasher(), this->priv_equal(), bucket_num, hash_value, prev);
+ return priv_insert_equal_find(value, bucket_num, hash_value, it);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Equivalent to this->insert_equal(t) for each element in [b, e).
+ //!
+ //! <b>Complexity</b>: Average case O(N), where N is std::distance(b, e).
+ //! Worst case O(N*this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_equal(Iterator b, Iterator e)
+ {
+ for (; b != e; ++b)
+ this->insert_equal(*b);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to inserts value into the unordered_set.
+ //!
+ //! <b>Returns</b>: If the value
+ //! is not already present inserts it and returns a pair containing the
+ //! iterator to the new value and true. If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert_unique(reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = this->insert_unique_check
+ (value, this->priv_hasher(), this->priv_equal(), commit_data);
+ if(!ret.second)
+ return ret;
+ return std::pair<iterator, bool>
+ (this->insert_unique_commit(value, commit_data), true);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Equivalent to this->insert_unique(t) for each element in [b, e).
+ //!
+ //! <b>Complexity</b>: Average case O(N), where N is std::distance(b, e).
+ //! Worst case O(N*this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_unique(Iterator b, Iterator e)
+ {
+ for (; b != e; ++b)
+ this->insert_unique(*b);
+ }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the unordered_set, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the hash or the equality is much cheaper to
+ //! construct than the value_type and this function offers the possibility to
+ //! use that the part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time.
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the unordered_set.
+ //!
+ //! After a successful rehashing insert_commit_data remains valid.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<iterator, bool> insert_unique_check
+ ( const KeyType &key
+ , KeyHasher hash_func
+ , KeyValueEqual equal_func
+ , insert_commit_data &commit_data)
+ {
+ size_type bucket_num;
+ siterator prev;
+ siterator prev_pos =
+ this->priv_find(key, hash_func, equal_func, bucket_num, commit_data.hash, prev);
+ bool success = prev_pos == priv_invalid_local_it();
+ if(success){
+ prev_pos = prev;
+ }
+ return std::pair<iterator, bool>(iterator(prev_pos, this),success);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the unordered_set between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the unordered_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ //!
+ //! After a successful rehashing insert_commit_data remains valid.
+ iterator insert_unique_commit(reference value, const insert_commit_data &commit_data)
+ {
+ size_type bucket_num = priv_hash_to_bucket(commit_data.hash);
+ bucket_type &b = this->priv_buckets()[bucket_num];
+ this->priv_size_traits().increment();
+ node_ptr n = node_ptr(&priv_value_to_node(value));
+ this->priv_store_hash(n, commit_data.hash, store_hash_t());
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(n));
+ priv_insertion_update_cache(bucket_num);
+ this->priv_insert_in_group(node_ptr(0), n, optimize_multikey_t());
+ return iterator(b.insert_after(b.before_begin(), *n), this);
+ }
+
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased element. No destructors are called.
+ iterator erase(const_iterator i)
+ { return this->erase_and_dispose(i, detail::null_disposer()); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average case O(std::distance(b, e)),
+ //! worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return this->erase_and_dispose(b, e, detail::null_disposer()); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ //! Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return this->erase(value, this->priv_hasher(), this->priv_equal()); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Erases all the elements that have the same hash and
+ //! compare equal with the given key.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ size_type erase(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
+ { return this->erase_and_dispose(key, hash_func, equal_func, detail::null_disposer()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<Disposer, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ iterator ret(i.unconst());
+ ++ret;
+ priv_erase(i, disposer, optimize_multikey_t());
+ this->priv_size_traits().decrement();
+ priv_erasure_update_cache();
+ return ret;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average case O(std::distance(b, e)),
+ //! worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ {
+ if(b != e){
+ //Get the bucket number and local iterator for both iterators
+ siterator first_local_it(b.slist_it());
+ size_type first_bucket_num = this->priv_get_bucket_num(first_local_it);
+
+ siterator before_first_local_it
+ = priv_get_previous(priv_buckets()[first_bucket_num], first_local_it);
+ size_type last_bucket_num;
+ siterator last_local_it;
+
+ //For the end iterator, we will assign the end iterator
+ //of the last bucket
+ if(e == this->end()){
+ last_bucket_num = this->bucket_count() - 1;
+ last_local_it = priv_buckets()[last_bucket_num].end();
+ }
+ else{
+ last_local_it = e.slist_it();
+ last_bucket_num = this->priv_get_bucket_num(last_local_it);
+ }
+ priv_erase_range(before_first_local_it, first_bucket_num, last_local_it, last_bucket_num, disposer);
+ priv_erasure_update_cache(first_bucket_num, last_bucket_num);
+ }
+ return e.unconst();
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ //! Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return this->erase_and_dispose(value, priv_hasher(), priv_equal(), disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "equal_func".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyHasher, class KeyValueEqual, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func
+ ,KeyValueEqual equal_func, Disposer disposer)
+ {
+ size_type bucket_num;
+ std::size_t h;
+ siterator prev;
+ siterator it =
+ this->priv_find(key, hash_func, equal_func, bucket_num, h, prev);
+ bool success = it != priv_invalid_local_it();
+ size_type count(0);
+ if(!success){
+ return 0;
+ }
+ else if(optimize_multikey){
+ siterator last = bucket_type::s_iterator_to
+ (*node_traits::get_next(group_functions_t::priv_get_last_in_group
+ (dcast_bucket_ptr(it.pointed_node()), optimize_multikey_t())));
+ this->priv_erase_range_impl(bucket_num, prev, last, disposer, count);
+ }
+ else{
+ //If found erase all equal values
+ bucket_type &b = this->priv_buckets()[bucket_num];
+ for(siterator end = b.end(); it != end; ++count, ++it){
+ slist_node_ptr n(it.pointed_node());
+ const value_type &v = priv_value_from_slist_node(n);
+ if(compare_hash){
+ std::size_t vh = this->priv_stored_or_compute_hash(v, store_hash_t());
+ if(h != vh || !equal_func(key, v)){
+ break;
+ }
+ }
+ else if(!equal_func(key, v)){
+ break;
+ }
+ this->priv_size_traits().decrement();
+ }
+ b.erase_after_and_dispose(prev, it, make_node_disposer(disposer));
+ }
+ priv_erasure_update_cache();
+ return count;
+ }
+
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ {
+ priv_clear_buckets();
+ this->priv_size_traits().set_size(size_type(0));
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ {
+ if(!constant_time_size || !this->empty()){
+ size_type num_buckets = this->bucket_count();
+ bucket_ptr b = this->priv_buckets();
+ for(; num_buckets--; ++b){
+ b->clear_and_dispose(make_node_disposer(disposer));
+ }
+ this->priv_size_traits().set_size(size_type(0));
+ }
+ priv_initialize_cache();
+ }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given value
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ size_type count(const_reference value) const
+ { return this->count(value, this->priv_hasher(), this->priv_equal()); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal throw.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ size_type count(const KeyType &key, const KeyHasher &hash_func, const KeyValueEqual &equal_func) const
+ {
+ size_type bucket_n1, bucket_n2, count;
+ this->priv_equal_range(key, hash_func, equal_func, bucket_n1, bucket_n2, count);
+ return count;
+ }
+
+ //! <b>Effects</b>: Finds an iterator to the first element is equal to
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ iterator find(const_reference value)
+ { return this->find(value, this->priv_hasher(), this->priv_equal()); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the given hash and equality functor or end() if
+ //! that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ iterator find(const KeyType &key, KeyHasher hash_func, KeyValueEqual equal_func)
+ {
+ size_type bucket_n;
+ std::size_t hash;
+ siterator prev;
+ siterator local_it = this->priv_find(key, hash_func, equal_func, bucket_n, hash, prev);
+ return iterator(local_it, this);
+ }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ const_iterator find(const_reference value) const
+ { return this->find(value, this->priv_hasher(), this->priv_equal()); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the given hasher and equality functor or end() if
+ //! that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ const_iterator find
+ (const KeyType &key, KeyHasher hash_func, KeyValueEqual equal_func) const
+ {
+ size_type bucket_n;
+ std::size_t hash_value;
+ siterator prev;
+ siterator sit = this->priv_find(key, hash_func, equal_func, bucket_n, hash_value, prev);
+ return const_iterator(sit, this);
+ }
+
+ //! <b>Effects</b>: Returns a range containing all elements with values equivalent
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return this->equal_range(value, this->priv_hasher(), this->priv_equal()); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns a range containing all elements with equivalent
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or the equal_func throw.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<iterator,iterator> equal_range
+ (const KeyType &key, KeyHasher hash_func, KeyValueEqual equal_func)
+ {
+ size_type bucket_n1, bucket_n2, count;
+ std::pair<siterator, siterator> ret = this->priv_equal_range
+ (key, hash_func, equal_func, bucket_n1, bucket_n2, count);
+ return std::pair<iterator, iterator>
+ (iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Effects</b>: Returns a range containing all elements with values equivalent
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return this->equal_range(value, this->priv_hasher(), this->priv_equal()); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns a range containing all elements with equivalent
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the hasher or equal_func throw.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<const_iterator,const_iterator> equal_range
+ (const KeyType &key, KeyHasher hash_func, KeyValueEqual equal_func) const
+ {
+ size_type bucket_n1, bucket_n2, count;
+ std::pair<siterator, siterator> ret =
+ this->priv_equal_range(key, hash_func, equal_func, bucket_n1, bucket_n2, count);
+ return std::pair<const_iterator, const_iterator>
+ (const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator belonging to the unordered_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the internal hash function throws.
+ iterator iterator_to(reference value)
+ {
+ return iterator(bucket_type::s_iterator_to(priv_value_to_node(value)), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator belonging to the
+ //! unordered_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the internal hash function throws.
+ const_iterator iterator_to(const_reference value) const
+ {
+ return const_iterator(bucket_type::s_iterator_to(priv_value_to_node(const_cast<reference>(value))), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static local_iterator s_local_iterator_to(reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ siterator sit = bucket_type::s_iterator_to(((hashtable_impl*)0)->priv_value_to_node(value));
+ return local_iterator(sit, (hashtable_impl*)0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
+ //! the unordered_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_local_iterator s_local_iterator_to(const_reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ siterator sit = bucket_type::s_iterator_to(((hashtable_impl*)0)->priv_value_to_node(const_cast<value_type&>(value)));
+ return const_local_iterator(sit, (hashtable_impl*)0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ local_iterator local_iterator_to(reference value)
+ {
+ siterator sit = bucket_type::s_iterator_to(this->priv_value_to_node(value));
+ return local_iterator(sit, this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
+ //! the unordered_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_local_iterator local_iterator_to(const_reference value) const
+ {
+ siterator sit = bucket_type::s_iterator_to
+ (const_cast<node &>(this->priv_value_to_node(value)));
+ return const_local_iterator(sit, this);
+ }
+
+ //! <b>Effects</b>: Returns the number of buckets passed in the constructor
+ //! or the last rehash function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type bucket_count() const
+ { return this->priv_buckets_len(); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns the number of elements in the nth bucket.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type bucket_size(size_type n) const
+ { return this->priv_buckets()[n].size(); }
+
+ //! <b>Effects</b>: Returns the index of the bucket in which elements
+ //! with keys equivalent to k would be found, if any such element existed.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the hash functor throws.
+ //!
+ //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
+ size_type bucket(const key_type& k) const
+ { return this->bucket(k, this->priv_hasher()); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! <b>Effects</b>: Returns the index of the bucket in which elements
+ //! with keys equivalent to k would be found, if any such element existed.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If hash_func throws.
+ //!
+ //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
+ template<class KeyType, class KeyHasher>
+ size_type bucket(const KeyType& k, const KeyHasher &hash_func) const
+ { return priv_hash_to_bucket(hash_func(k)); }
+
+ //! <b>Effects</b>: Returns the bucket array pointer passed in the constructor
+ //! or the last rehash function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bucket_ptr bucket_pointer() const
+ { return this->priv_buckets(); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ local_iterator begin(size_type n)
+ { return local_iterator(this->priv_buckets()[n].begin(), this); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator begin(size_type n) const
+ { return this->cbegin(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator cbegin(size_type n) const
+ {
+ siterator sit = const_cast<bucket_type&>(this->priv_buckets()[n]).begin();
+ return const_local_iterator(sit, this);
+ }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ local_iterator end(size_type n)
+ { return local_iterator(this->priv_buckets()[n].end(), this); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator end(size_type n) const
+ { return this->cend(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator cend(size_type n) const
+ { return const_local_iterator(const_cast<bucket_type&>(this->priv_buckets()[n]).end(), this); }
+
+ //! <b>Requires</b>: new_buckets must be a pointer to a new bucket array
+ //! or the same as the old bucket array. new_size is the length of the
+ //! the array pointed by new_buckets. If new_buckets == this->bucket_pointer()
+ //! n can be bigger or smaller than this->bucket_count().
+ //! 'new_bucket_traits' copy constructor should not throw.
+ //!
+ //! <b>Effects</b>: Updates the internal reference with the new bucket erases
+ //! the values from the old bucket and inserts then in the new one.
+ //! Bucket traits hold by *this is assigned from new_bucket_traits.
+ //! If the container is configured as incremental<>, the split bucket is set
+ //! to the new bucket_len().
+ //!
+ //! If store_hash option is true, this method does not use the hash function.
+ //!
+ //! <b>Complexity</b>: Average case linear in this->size(), worst case quadratic.
+ //!
+ //! <b>Throws</b>: If the hasher functor throws. Basic guarantee.
+ void rehash(const bucket_traits &new_bucket_traits)
+ {
+ bucket_ptr new_buckets = new_bucket_traits.bucket_begin();
+ size_type new_buckets_len = new_bucket_traits.bucket_count();
+ bucket_ptr old_buckets = this->priv_buckets();
+ size_type old_buckets_len = this->priv_buckets_len();
+
+ //Check power of two bucket array if the option is activated
+ BOOST_INTRUSIVE_INVARIANT_ASSERT
+ (!power_2_buckets || (0 == (new_buckets_len & (new_buckets_len-1u))));
+
+ size_type n = priv_get_cache_bucket_num();
+ const bool same_buffer = old_buckets == new_buckets;
+ //If the new bucket length is a common factor
+ //of the old one we can avoid hash calculations.
+ const bool fast_shrink = (!incremental) && (old_buckets_len > new_buckets_len) &&
+ (power_2_buckets ||(old_buckets_len % new_buckets_len) == 0);
+ //If we are shrinking the same bucket array and it's
+ //is a fast shrink, just rehash the last nodes
+ size_type new_first_bucket_num = new_buckets_len;
+ if(same_buffer && fast_shrink && (n < new_buckets_len)){
+ n = new_buckets_len;
+ new_first_bucket_num = priv_get_cache_bucket_num();
+ }
+
+ //Anti-exception stuff: they destroy the elements if something goes wrong.
+ //If the source and destination buckets are the same, the second rollback function
+ //is harmless, because all elements have been already unlinked and destroyed
+ typedef detail::init_disposer<node_algorithms> NodeDisposer;
+ NodeDisposer node_disp;
+ detail::exception_array_disposer<bucket_type, NodeDisposer>
+ rollback1(new_buckets[0], node_disp, new_buckets_len);
+ detail::exception_array_disposer<bucket_type, NodeDisposer>
+ rollback2(old_buckets[0], node_disp, old_buckets_len);
+
+ //Put size in a safe value for rollback exception
+ size_type size_backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(0);
+ //Put cache to safe position
+ priv_initialize_cache();
+ priv_insertion_update_cache(size_type(0u));
+
+ //Iterate through nodes
+ for(; n < old_buckets_len; ++n){
+ bucket_type &old_bucket = old_buckets[n];
+
+ if(!fast_shrink){
+ siterator before_i(old_bucket.before_begin());
+ siterator end(old_bucket.end());
+ siterator i(old_bucket.begin());
+ for(;i != end; ++i){
+ const value_type &v = priv_value_from_slist_node(i.pointed_node());
+ const std::size_t hash_value = this->priv_stored_or_compute_hash(v, store_hash_t());
+ const size_type new_n = priv_hash_to_bucket(hash_value, new_buckets_len, new_buckets_len);
+ if(cache_begin && new_n < new_first_bucket_num)
+ new_first_bucket_num = new_n;
+ siterator last = bucket_type::s_iterator_to
+ (*group_functions_t::priv_get_last_in_group
+ (dcast_bucket_ptr(i.pointed_node()), optimize_multikey_t()));
+ if(same_buffer && new_n == n){
+ before_i = last;
+ }
+ else{
+ bucket_type &new_b = new_buckets[new_n];
+ new_b.splice_after(new_b.before_begin(), old_bucket, before_i, last);
+ }
+ i = before_i;
+ }
+ }
+ else{
+ const size_type new_n = priv_hash_to_bucket(n, new_buckets_len, new_buckets_len);
+ if(cache_begin && new_n < new_first_bucket_num)
+ new_first_bucket_num = new_n;
+ bucket_type &new_b = new_buckets[new_n];
+ if(!old_bucket.empty()){
+ new_b.splice_after( new_b.before_begin()
+ , old_bucket
+ , old_bucket.before_begin()
+ , priv_get_last(old_bucket));
+ }
+ }
+ }
+
+ this->priv_size_traits().set_size(size_backup);
+ this->priv_split_traits().set_size(new_buckets_len);
+ this->priv_real_bucket_traits() = new_bucket_traits;
+ priv_initialize_cache();
+ priv_insertion_update_cache(new_first_bucket_num);
+ rollback1.release();
+ rollback2.release();
+ }
+
+ //! <b>Requires</b>:
+ //!
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
+ //!
+ //! <b>Note</b>: this method is only available if incremental<true> option is activated.
+ bool incremental_rehash(bool grow = true)
+ {
+ //This function is only available for containers with incremental hashing
+ BOOST_STATIC_ASSERT(( incremental && power_2_buckets ));
+ size_type split_idx = priv_split_traits().get_size();
+ size_type bucket_len = priv_buckets_len();
+
+ if(grow){
+ //Test if the split variable can be changed
+ if(split_idx >= bucket_len)
+ return false;
+
+ size_type bucket_len = priv_buckets_len();
+ size_type bucket_to_rehash = split_idx - bucket_len/2;
+ bucket_type &old_bucket = this->priv_buckets()[bucket_to_rehash];
+ siterator before_i(old_bucket.before_begin());
+ siterator end(old_bucket.end());
+ siterator i(old_bucket.begin());
+ priv_split_traits().increment();
+
+ //Anti-exception stuff: if an exception is thrown while
+ //moving elements from old_bucket to the target bucket, all moved
+ //elements are moved back to the original one.
+ detail::incremental_rehash_rollback<bucket_type, split_traits> rollback
+ ( this->priv_buckets()[split_idx], old_bucket, priv_split_traits());
+ for(;i != end; ++i){
+ const value_type &v = priv_value_from_slist_node(i.pointed_node());
+ const std::size_t hash_value = this->priv_stored_or_compute_hash(v, store_hash_t());
+ const size_type new_n = priv_hash_to_bucket(hash_value);
+ siterator last = bucket_type::s_iterator_to
+ (*group_functions_t::priv_get_last_in_group
+ (dcast_bucket_ptr(i.pointed_node()), optimize_multikey_t()));
+ if(new_n == bucket_to_rehash){
+ before_i = last;
+ }
+ else{
+ bucket_type &new_b = this->priv_buckets()[new_n];
+ new_b.splice_after(new_b.before_begin(), old_bucket, before_i, last);
+ }
+ i = before_i;
+ }
+ rollback.release();
+ priv_erasure_update_cache();
+ return true;
+ }
+ else{
+ //Test if the split variable can be changed
+ if(split_idx <= bucket_len/2)
+ return false;
+ const size_type target_bucket_num = split_idx - 1 - bucket_len/2;
+ bucket_type &target_bucket = this->priv_buckets()[target_bucket_num];
+ bucket_type &source_bucket = this->priv_buckets()[split_idx-1];
+ target_bucket.splice_after(target_bucket.cbefore_begin(), source_bucket);
+ priv_split_traits().decrement();
+ priv_insertion_update_cache(target_bucket_num);
+ return true;
+ }
+ }
+
+ //! <b>Effects</b>: If new_bucket_traits.bucket_count() is not
+ //! this->bucket_count()/2 or this->bucket_count()*2, or
+ //! this->split_bucket() != new_bucket_traits.bucket_count() returns false
+ //! and does nothing.
+ //!
+ //! Otherwise, copy assigns new_bucket_traits to the internal bucket_traits
+ //! and transfers all the objects from old buckets to the new ones.
+ //!
+ //! <b>Complexity</b>: Linear to size().
+ //!
+ //! <b>Throws</b>: Nothing
+ //!
+ //! <b>Note</b>: this method is only available if incremental<true> option is activated.
+ bool incremental_rehash(const bucket_traits &new_bucket_traits)
+ {
+ //This function is only available for containers with incremental hashing
+ BOOST_STATIC_ASSERT(( incremental && power_2_buckets ));
+ size_type new_bucket_traits_size = new_bucket_traits.bucket_count();
+ size_type cur_bucket_traits = this->priv_buckets_len();
+ if(new_bucket_traits_size/2 != cur_bucket_traits && new_bucket_traits_size != cur_bucket_traits/2){
+ return false;
+ }
+
+ const size_type split_idx = this->split_count();
+
+ if(new_bucket_traits_size/2 == cur_bucket_traits){
+ //Test if the split variable can be changed
+ if(!(split_idx >= cur_bucket_traits))
+ return false;
+ }
+ else{
+ //Test if the split variable can be changed
+ if(!(split_idx <= cur_bucket_traits/2))
+ return false;
+ }
+
+ const size_type ini_n = priv_get_cache_bucket_num();
+ const bucket_ptr old_buckets = this->priv_buckets();
+ this->priv_real_bucket_traits() = new_bucket_traits;
+ if(new_bucket_traits.bucket_begin() != old_buckets){
+ for(size_type n = ini_n; n < split_idx; ++n){
+ bucket_type &new_bucket = new_bucket_traits.bucket_begin()[n];
+ bucket_type &old_bucket = old_buckets[n];
+ new_bucket.splice_after(new_bucket.cbefore_begin(), old_bucket);
+ }
+ //Put cache to safe position
+ priv_initialize_cache();
+ priv_insertion_update_cache(ini_n);
+ }
+ return true;
+ }
+
+ //! <b>Requires</b>:
+ //!
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
+ size_type split_count() const
+ {
+ //This function is only available if incremental hashing is activated
+ BOOST_STATIC_ASSERT(( incremental && power_2_buckets ));
+ return this->priv_split_traits().get_size();
+ }
+
+ //! <b>Effects</b>: Returns the nearest new bucket count optimized for
+ //! the container that is bigger than n. This suggestion can be used
+ //! to create bucket arrays with a size that will usually improve
+ //! container's performance. If such value does not exist, the
+ //! higher possible value is returned.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static size_type suggested_upper_bucket_count(size_type n)
+ {
+ const std::size_t *primes = &detail::prime_list_holder<0>::prime_list[0];
+ const std::size_t *primes_end = primes + detail::prime_list_holder<0>::prime_list_size;
+ size_type const* bound = std::lower_bound(primes, primes_end, n);
+ if(bound == primes_end)
+ bound--;
+ return size_type(*bound);
+ }
+
+ //! <b>Effects</b>: Returns the nearest new bucket count optimized for
+ //! the container that is smaller than n. This suggestion can be used
+ //! to create bucket arrays with a size that will usually improve
+ //! container's performance. If such value does not exist, the
+ //! lower possible value is returned.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static size_type suggested_lower_bucket_count(size_type n)
+ {
+ const std::size_t *primes = &detail::prime_list_holder<0>::prime_list[0];
+ const std::size_t *primes_end = primes + detail::prime_list_holder<0>::prime_list_size;
+ size_type const* bound = std::upper_bound(primes, primes_end, n);
+ if(bound != primes_end)
+ bound--;
+ return size_type(*bound);
+ }
+
+ /// @cond
+ private:
+
+ std::size_t priv_hash_to_bucket(std::size_t hash_value) const
+ { return priv_hash_to_bucket(hash_value, this->priv_real_bucket_traits().bucket_count(), priv_split_traits().get_size()); }
+
+ std::size_t priv_hash_to_bucket(std::size_t hash_value, std::size_t bucket_len, std::size_t split) const
+ {
+ std::size_t bucket_number = priv_hash_to_bucket_impl(hash_value, bucket_len, power_2_buckets_t());
+ if(incremental)
+ if(bucket_number >= split)
+ bucket_number -= bucket_len/2;
+ return bucket_number;
+ }
+
+ std::size_t priv_hash_to_bucket_impl(std::size_t hash_value, std::size_t bucket_len, detail::bool_<false>) const
+ { return hash_value % bucket_len; }
+
+ std::size_t priv_hash_to_bucket_impl(std::size_t hash_value, std::size_t bucket_len, detail::bool_<true>) const
+ { return hash_value & (bucket_len - 1); }
+
+ const key_equal &priv_equal() const
+ { return static_cast<const key_equal&>(this->data_.internal_.bucket_hash_equal_.get()); }
+
+ key_equal &priv_equal()
+ { return static_cast<key_equal&>(this->data_.internal_.bucket_hash_equal_.get()); }
+
+ value_type &priv_value_from_slist_node(slist_node_ptr n)
+ { return *this->get_real_value_traits().to_value_ptr(dcast_bucket_ptr(n)); }
+
+ const value_type &priv_value_from_slist_node(slist_node_ptr n) const
+ { return *this->get_real_value_traits().to_value_ptr(dcast_bucket_ptr(n)); }
+
+ const real_bucket_traits &priv_real_bucket_traits(detail::bool_<false>) const
+ { return this->data_.internal_.bucket_hash_equal_.bucket_hash.bucket_plus_size_.bucket_traits_; }
+
+ const real_bucket_traits &priv_real_bucket_traits(detail::bool_<true>) const
+ { return this->data_.internal_.bucket_hash_equal_.bucket_hash.bucket_plus_size_.bucket_traits_.get_bucket_traits(*this); }
+
+ real_bucket_traits &priv_real_bucket_traits(detail::bool_<false>)
+ { return this->data_.internal_.bucket_hash_equal_.bucket_hash.bucket_plus_size_.bucket_traits_; }
+
+ real_bucket_traits &priv_real_bucket_traits(detail::bool_<true>)
+ { return this->data_.internal_.bucket_hash_equal_.bucket_hash.bucket_plus_size_.bucket_traits_.get_bucket_traits(*this); }
+
+ const real_bucket_traits &priv_real_bucket_traits() const
+ { return this->priv_real_bucket_traits(detail::bool_<external_bucket_traits>()); }
+
+ real_bucket_traits &priv_real_bucket_traits()
+ { return this->priv_real_bucket_traits(detail::bool_<external_bucket_traits>()); }
+
+ const hasher &priv_hasher() const
+ { return static_cast<const hasher&>(this->data_.internal_.bucket_hash_equal_.bucket_hash.get()); }
+
+ hasher &priv_hasher()
+ { return static_cast<hasher&>(this->data_.internal_.bucket_hash_equal_.bucket_hash.get()); }
+
+ bucket_ptr priv_buckets() const
+ { return this->priv_real_bucket_traits().bucket_begin(); }
+
+ size_type priv_buckets_len() const
+ { return this->priv_real_bucket_traits().bucket_count(); }
+
+ static node_ptr uncast(const_node_ptr ptr)
+ { return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); }
+
+ node &priv_value_to_node(value_type &v)
+ { return *this->get_real_value_traits().to_node_ptr(v); }
+
+ const node &priv_value_to_node(const value_type &v) const
+ { return *this->get_real_value_traits().to_node_ptr(v); }
+
+ size_traits &priv_size_traits()
+ { return this->data_.internal_.bucket_hash_equal_.bucket_hash.bucket_plus_size_; }
+
+ const size_traits &priv_size_traits() const
+ { return this->data_.internal_.bucket_hash_equal_.bucket_hash.bucket_plus_size_; }
+
+ split_traits &priv_split_traits()
+ { return this->data_.internal_; }
+
+ const split_traits &priv_split_traits() const
+ { return this->data_.internal_; }
+
+ template<class Disposer>
+ void priv_erase_range_impl
+ (size_type bucket_num, siterator before_first_it, siterator end, Disposer disposer, size_type &num_erased)
+ {
+ const bucket_ptr buckets = priv_buckets();
+ bucket_type &b = buckets[bucket_num];
+
+ if(before_first_it == b.before_begin() && end == b.end()){
+ priv_erase_range_impl(bucket_num, 1, disposer, num_erased);
+ }
+ else{
+ num_erased = 0;
+ siterator to_erase(before_first_it);
+ ++to_erase;
+ slist_node_ptr end_ptr = end.pointed_node();
+ while(to_erase != end){
+ group_functions_t::priv_erase_from_group(end_ptr, dcast_bucket_ptr(to_erase.pointed_node()), optimize_multikey_t());
+ to_erase = b.erase_after_and_dispose(before_first_it, make_node_disposer(disposer));
+ ++num_erased;
+ }
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size()-num_erased);
+ }
+ }
+
+ template<class Disposer>
+ void priv_erase_range_impl
+ (size_type first_bucket_num, size_type num_buckets, Disposer disposer, size_type &num_erased)
+ {
+ //Now fully clear the intermediate buckets
+ const bucket_ptr buckets = priv_buckets();
+ num_erased = 0;
+ for(size_type i = first_bucket_num; i < (num_buckets + first_bucket_num); ++i){
+ bucket_type &b = buckets[i];
+ siterator b_begin(b.before_begin());
+ siterator nxt(b_begin);
+ ++nxt;
+ siterator end(b.end());
+ while(nxt != end){
+ priv_init_group(nxt.pointed_node(), optimize_multikey_t());
+ nxt = b.erase_after_and_dispose
+ (b_begin, make_node_disposer(disposer));
+ this->priv_size_traits().decrement();
+ ++num_erased;
+ }
+ }
+ }
+
+ template<class Disposer>
+ void priv_erase_range( siterator before_first_it, size_type first_bucket
+ , siterator last_it, size_type last_bucket
+ , Disposer disposer)
+ {
+ size_type num_erased;
+ if (first_bucket == last_bucket){
+ priv_erase_range_impl(first_bucket, before_first_it, last_it, disposer, num_erased);
+ }
+ else {
+ bucket_type *b = (&this->priv_buckets()[0]);
+ priv_erase_range_impl(first_bucket, before_first_it, b[first_bucket].end(), disposer, num_erased);
+ if(size_type n = (last_bucket - first_bucket - 1))
+ priv_erase_range_impl(first_bucket + 1, n, disposer, num_erased);
+ priv_erase_range_impl(last_bucket, b[last_bucket].before_begin(), last_it, disposer, num_erased);
+ }
+ }
+
+ static node_ptr dcast_bucket_ptr(typename slist_impl::node_ptr p)
+ { return node_ptr(&static_cast<node&>(*p)); }
+
+ std::size_t priv_stored_or_compute_hash(const value_type &v, detail::true_) const
+ { return node_traits::get_hash(this->get_real_value_traits().to_node_ptr(v)); }
+
+ std::size_t priv_stored_or_compute_hash(const value_type &v, detail::false_) const
+ { return priv_hasher()(v); }
+
+ std::size_t priv_stored_hash(slist_node_ptr n, detail::true_) const
+ { return node_traits::get_hash(dcast_bucket_ptr(n)); }
+
+ std::size_t priv_stored_hash(slist_node_ptr, detail::false_) const
+ {
+ //This code should never be reached!
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(0);
+ return 0;
+ }
+
+ static void priv_store_hash(node_ptr p, std::size_t h, detail::true_)
+ { return node_traits::set_hash(p, h); }
+
+ static void priv_store_hash(node_ptr, std::size_t, detail::false_)
+ {}
+
+ static void priv_clear_group_nodes(bucket_type &b, detail::true_)
+ {
+ siterator it(b.begin()), itend(b.end());
+ while(it != itend){
+ node_ptr to_erase(dcast_bucket_ptr(it.pointed_node()));
+ ++it;
+ group_algorithms::init(to_erase);
+ }
+ }
+
+ static void priv_clear_group_nodes(bucket_type &, detail::false_)
+ {}
+
+ std::size_t priv_get_bucket_num(siterator it)
+ { return priv_get_bucket_num_hash_dispatch(it, store_hash_t()); }
+
+ std::size_t priv_get_bucket_num_hash_dispatch(siterator it, detail::true_)
+ {
+ return this->priv_hash_to_bucket
+ (this->priv_stored_hash(it.pointed_node(), store_hash_t()));
+ }
+
+ std::size_t priv_get_bucket_num_hash_dispatch(siterator it, detail::false_)
+ { return priv_get_bucket_num_no_hash_store(it, optimize_multikey_t()); }
+
+ std::size_t priv_get_bucket_num_no_hash_store(siterator it, detail::true_)
+ {
+ bucket_ptr f(priv_buckets()), l(f + priv_buckets_len() - 1);
+ slist_node_ptr bb = group_functions_t::priv_get_bucket_before_begin
+ ( f->end().pointed_node()
+ , l->end().pointed_node()
+ , dcast_bucket_ptr(it.pointed_node()));
+ //Now get the bucket_impl from the iterator
+ const bucket_type &b = static_cast<const bucket_type&>
+ (bucket_type::slist_type::container_from_end_iterator(bucket_type::s_iterator_to(*bb)));
+ //Now just calculate the index b has in the bucket array
+ return static_cast<size_type>(&b - &*f);
+ }
+
+ std::size_t priv_get_bucket_num_no_hash_store(siterator it, detail::false_)
+ {
+ bucket_ptr f(priv_buckets()), l(f + priv_buckets_len() - 1);
+ slist_node_ptr first_ptr(f->cend().pointed_node())
+ , last_ptr(l->cend().pointed_node());
+
+ //The end node is embedded in the singly linked list:
+ //iterate until we reach it.
+ while(!(first_ptr <= it.pointed_node() && it.pointed_node() <= last_ptr)){
+ ++it;
+ }
+ //Now get the bucket_impl from the iterator
+ const bucket_type &b = static_cast<const bucket_type&>
+ (bucket_type::container_from_end_iterator(it));
+
+ //Now just calculate the index b has in the bucket array
+ return static_cast<std::size_t>(&b - &*f);
+ }
+
+ void priv_init_group(slist_node_ptr n, detail::true_)
+ { group_algorithms::init(dcast_bucket_ptr(n)); }
+
+ void priv_init_group(slist_node_ptr, detail::false_)
+ {}
+
+ void priv_insert_in_group(node_ptr first_in_group, node_ptr n, detail::true_)
+ {
+ if(first_in_group){
+ if(group_algorithms::unique(first_in_group))
+ group_algorithms::link_after(first_in_group, n);
+ else{
+ group_algorithms::link_after(node_traits::get_next(first_in_group), n);
+ }
+ }
+ else{
+ group_algorithms::init_header(n);
+ }
+ }
+
+ void priv_insert_in_group(node_ptr, node_ptr, detail::false_)
+ {}
+
+ siterator priv_get_previous
+ (bucket_type &b, siterator i)
+ { return priv_get_previous(b, i, optimize_multikey_t()); }
+
+ siterator priv_get_previous
+ (bucket_type &b, siterator i, detail::true_)
+ {
+ node_ptr elem(dcast_bucket_ptr(i.pointed_node()));
+ node_ptr prev_in_group(group_traits::get_next(elem));
+ bool first_in_group = node_traits::get_next(prev_in_group) != elem;
+ typename bucket_type::node &n = first_in_group
+ ? *group_functions_t::priv_get_prev_to_first_in_group(b.end().pointed_node(), elem)
+ : *group_traits::get_next(elem)
+ ;
+ return bucket_type::s_iterator_to(n);
+ }
+
+ siterator priv_get_previous
+ (bucket_type &b, siterator i, detail::false_)
+ { return b.previous(i); }
+
+ static siterator priv_get_last(bucket_type &b)
+ { return priv_get_last(b, optimize_multikey_t()); }
+
+ static siterator priv_get_last(bucket_type &b, detail::true_)
+ {
+ //First find the last node of p's group.
+ //This requires checking the first node of the next group or
+ //the bucket node.
+ slist_node_ptr end_ptr(b.end().pointed_node());
+ node_ptr possible_end(node_traits::get_next( dcast_bucket_ptr(end_ptr)));
+ node_ptr last_node_group(possible_end);
+
+ while(end_ptr != possible_end){
+ last_node_group = group_traits::get_next(dcast_bucket_ptr(possible_end));
+ possible_end = node_traits::get_next(last_node_group);
+ }
+ return bucket_type::s_iterator_to(*last_node_group);
+ }
+
+ static siterator priv_get_last(bucket_type &b, detail::false_)
+ { return b.previous(b.end()); }
+
+ siterator priv_get_previous_and_next_in_group
+ (siterator i, node_ptr &nxt_in_group)
+ {
+ siterator prev;
+ node_ptr elem(dcast_bucket_ptr(i.pointed_node()));
+ bucket_ptr f(priv_buckets()), l(f + priv_buckets_len() - 1);
+
+ slist_node_ptr first_end_ptr(f->cend().pointed_node());
+ slist_node_ptr last_end_ptr (l->cend().pointed_node());
+
+ node_ptr nxt(node_traits::get_next(elem));
+ node_ptr prev_in_group(group_traits::get_next(elem));
+ bool last_in_group = (first_end_ptr <= nxt && nxt <= last_end_ptr) ||
+ (group_traits::get_next(nxt) != elem);
+ bool first_in_group = node_traits::get_next(prev_in_group) != elem;
+
+ if(first_in_group){
+ node_ptr start_pos;
+ if(last_in_group){
+ start_pos = elem;
+ nxt_in_group = 0;
+ }
+ else{
+ start_pos = prev_in_group;
+ nxt_in_group = node_traits::get_next(elem);
+ }
+ slist_node_ptr bucket_node;
+ if(store_hash){
+ bucket_node = this->priv_buckets()
+ [this->priv_hash_to_bucket
+ (this->priv_stored_hash(elem, store_hash_t()))
+ ].before_begin().pointed_node();
+ }
+ else{
+ bucket_node = group_functions_t::priv_get_bucket_before_begin
+ (first_end_ptr, last_end_ptr, start_pos);
+ }
+ prev = bucket_type::s_iterator_to
+ (*group_functions_t::priv_get_prev_to_first_in_group(bucket_node, elem));
+ }
+ else{
+ if(last_in_group){
+ nxt_in_group = group_functions_t::priv_get_first_in_group_of_last_in_group(elem);
+ }
+ else{
+ nxt_in_group = node_traits::get_next(elem);
+ }
+ prev = bucket_type::s_iterator_to(*group_traits::get_next(elem));
+ }
+ return prev;
+ }
+
+ template<class Disposer>
+ void priv_erase(const_iterator i, Disposer disposer, detail::true_)
+ {
+ siterator elem(i.slist_it());
+ node_ptr nxt_in_group;
+ siterator prev = priv_get_previous_and_next_in_group(elem, nxt_in_group);
+ bucket_type::s_erase_after_and_dispose(prev, make_node_disposer(disposer));
+ if(nxt_in_group)
+ group_algorithms::unlink_after(nxt_in_group);
+ if(safemode_or_autounlink)
+ group_algorithms::init(dcast_bucket_ptr(elem.pointed_node()));
+ }
+
+ template <class Disposer>
+ void priv_erase(const_iterator i, Disposer disposer, detail::false_)
+ {
+ siterator to_erase(i.slist_it());
+ bucket_type &b = this->priv_buckets()[this->priv_get_bucket_num(to_erase)];
+ siterator prev(priv_get_previous(b, to_erase));
+ b.erase_after_and_dispose(prev, make_node_disposer(disposer));
+ }
+
+ bucket_ptr priv_invalid_bucket() const
+ {
+ const real_bucket_traits &rbt = this->priv_real_bucket_traits();
+ return rbt.bucket_begin() + rbt.bucket_count();
+ }
+
+ siterator priv_invalid_local_it() const
+ { return priv_invalid_bucket()->end(); }
+
+ siterator priv_begin() const
+ { return priv_begin(cache_begin_t()); }
+
+ siterator priv_begin(detail::bool_<false>) const
+ {
+ size_type n = 0;
+ size_type buckets_len = this->priv_buckets_len();
+ for (n = 0; n < buckets_len; ++n){
+ bucket_type &b = this->priv_buckets()[n];
+ if(!b.empty()){
+ return b.begin();
+ }
+ }
+ return priv_invalid_local_it();
+ }
+
+ siterator priv_begin(detail::bool_<true>) const
+ {
+ if(this->data_.internal_.bucket_hash_equal_.cached_begin_ == priv_invalid_bucket()){
+ return priv_invalid_local_it();
+ }
+ else{
+ return this->data_.internal_.bucket_hash_equal_.cached_begin_->begin();
+ }
+ }
+
+ void priv_initialize_cache()
+ { priv_initialize_cache(cache_begin_t()); }
+
+ void priv_initialize_cache(detail::bool_<true>)
+ { this->data_.internal_.bucket_hash_equal_.cached_begin_ = priv_invalid_bucket(); }
+
+ void priv_initialize_cache(detail::bool_<false>)
+ {}
+
+ void priv_insertion_update_cache(size_type insertion_bucket)
+ { priv_insertion_update_cache(insertion_bucket, cache_begin_t()); }
+
+ void priv_insertion_update_cache(size_type insertion_bucket, detail::bool_<true>)
+ {
+ bucket_ptr p = priv_buckets() + insertion_bucket;
+ if(p < this->data_.internal_.bucket_hash_equal_.cached_begin_){
+ this->data_.internal_.bucket_hash_equal_.cached_begin_ = p;
+ }
+ }
+
+ void priv_insertion_update_cache(size_type, detail::bool_<false>)
+ {}
+
+ void priv_erasure_update_cache(size_type first_bucket, size_type last_bucket)
+ { priv_erasure_update_cache(first_bucket, last_bucket, cache_begin_t()); }
+
+ void priv_erasure_update_cache(size_type first_bucket_num, size_type last_bucket_num, detail::bool_<true>)
+ {
+ //If the last bucket is the end, the cache must be updated
+ //to the last position if all
+ if(priv_get_cache_bucket_num() == first_bucket_num &&
+ priv_buckets()[first_bucket_num].empty() ){
+ priv_set_cache(priv_buckets() + last_bucket_num);
+ priv_erasure_update_cache();
+ }
+ }
+
+ void priv_erasure_update_cache(size_type, size_type, detail::bool_<false>)
+ {}
+
+ void priv_erasure_update_cache()
+ { priv_erasure_update_cache(cache_begin_t()); }
+
+ void priv_erasure_update_cache(detail::bool_<true>)
+ {
+ if(constant_time_size && !size()){
+ priv_initialize_cache();
+ }
+ else{
+ size_type current_n = this->data_.internal_.bucket_hash_equal_.cached_begin_ - priv_buckets();
+ for( const size_type num_buckets = this->priv_buckets_len()
+ ; current_n < num_buckets
+ ; ++current_n, ++this->data_.internal_.bucket_hash_equal_.cached_begin_){
+ if(!this->data_.internal_.bucket_hash_equal_.cached_begin_->empty()){
+ return;
+ }
+ }
+ priv_initialize_cache();
+ }
+ }
+
+ void priv_erasure_update_cache(detail::bool_<false>)
+ {}
+
+ void priv_swap_cache(detail::bool_<true>, hashtable_impl &other)
+ {
+ std::swap( this->data_.internal_.bucket_hash_equal_.cached_begin_
+ , other.data_.internal_.bucket_hash_equal_.cached_begin_);
+ }
+
+ void priv_swap_cache(detail::bool_<false>, hashtable_impl &)
+ {}
+
+ bucket_ptr priv_get_cache()
+ { return priv_get_cache(cache_begin_t()); }
+
+ bucket_ptr priv_get_cache(detail::bool_<true>)
+ { return this->data_.internal_.bucket_hash_equal_.cached_begin_; }
+
+ bucket_ptr priv_get_cache(detail::bool_<false>)
+ { return this->priv_buckets(); }
+
+ void priv_set_cache(bucket_ptr p)
+ { priv_set_cache(p, cache_begin_t()); }
+
+ void priv_set_cache(bucket_ptr p, detail::bool_<true>)
+ { this->data_.internal_.bucket_hash_equal_.cached_begin_ = p; }
+
+ void priv_set_cache(bucket_ptr, detail::bool_<false>)
+ {}
+
+ size_type priv_get_cache_bucket_num()
+ { return priv_get_cache_bucket_num(cache_begin_t()); }
+
+ size_type priv_get_cache_bucket_num(detail::bool_<true>)
+ { return this->data_.internal_.bucket_hash_equal_.cached_begin_ - this->priv_buckets(); }
+
+ size_type priv_get_cache_bucket_num(detail::bool_<false>)
+ { return 0u; }
+
+ void priv_clear_buckets()
+ {
+ this->priv_clear_buckets
+ ( priv_get_cache()
+ , this->priv_buckets_len() - (priv_get_cache() - priv_buckets()));
+ }
+
+ void priv_initialize_buckets()
+ { this->priv_clear_buckets(priv_buckets(), this->priv_buckets_len()); }
+
+ void priv_clear_buckets(bucket_ptr buckets_ptr, size_type buckets_len)
+ {
+ for(; buckets_len--; ++buckets_ptr){
+ if(safemode_or_autounlink){
+ priv_clear_group_nodes(*buckets_ptr, optimize_multikey_t());
+ buckets_ptr->clear_and_dispose(detail::init_disposer<node_algorithms>());
+ }
+ else{
+ buckets_ptr->clear();
+ }
+ }
+ priv_initialize_cache();
+ }
+
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ siterator priv_find
+ ( const KeyType &key, KeyHasher hash_func
+ , KeyValueEqual equal_func, size_type &bucket_number, std::size_t &h, siterator &previt) const
+ {
+ h = hash_func(key);
+ return priv_find_with_hash(key, equal_func, bucket_number, h, previt);
+ }
+
+ template<class KeyType, class KeyValueEqual>
+ siterator priv_find_with_hash
+ ( const KeyType &key, KeyValueEqual equal_func, size_type &bucket_number, const std::size_t h, siterator &previt) const
+ {
+ bucket_number = priv_hash_to_bucket(h);
+ bucket_type &b = this->priv_buckets()[bucket_number];
+ previt = b.before_begin();
+ if(constant_time_size && this->empty()){
+ return priv_invalid_local_it();
+ }
+
+ siterator it = previt;
+ ++it;
+
+ while(it != b.end()){
+ const value_type &v = priv_value_from_slist_node(it.pointed_node());
+ if(compare_hash){
+ std::size_t vh = this->priv_stored_or_compute_hash(v, store_hash_t());
+ if(h == vh && equal_func(key, v)){
+ return it;
+ }
+ }
+ else if(equal_func(key, v)){
+ return it;
+ }
+ if(optimize_multikey){
+ previt = bucket_type::s_iterator_to
+ (*group_functions_t::priv_get_last_in_group
+ (dcast_bucket_ptr(it.pointed_node()), optimize_multikey_t()));
+ it = previt;
+ }
+ else{
+ previt = it;
+ }
+ ++it;
+ }
+ previt = b.before_begin();
+ return priv_invalid_local_it();
+ }
+
+ iterator priv_insert_equal_with_hash(reference value, std::size_t hash_value)
+ {
+ size_type bucket_num;
+ siterator prev;
+ siterator it = this->priv_find_with_hash
+ (value, this->priv_equal(), bucket_num, hash_value, prev);
+ return priv_insert_equal_find(value, bucket_num, hash_value, it);
+ }
+
+ iterator priv_insert_equal_find(reference value, size_type bucket_num, std::size_t hash_value, siterator it)
+ {
+ bucket_type &b = this->priv_buckets()[bucket_num];
+ bool found_equal = it != priv_invalid_local_it();
+ if(!found_equal){
+ it = b.before_begin();
+ }
+ //Now store hash if needed
+ node_ptr n = node_ptr(&priv_value_to_node(value));
+ this->priv_store_hash(n, hash_value, store_hash_t());
+ //Checks for some modes
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(n));
+ //Shorcut for optimize_multikey cases
+ if(optimize_multikey){
+ node_ptr first_in_group = found_equal ?
+ dcast_bucket_ptr(it.pointed_node()) : node_ptr(0);
+ this->priv_insert_in_group(first_in_group, n, optimize_multikey_t());
+ }
+ //Update cache and increment size if needed
+ priv_insertion_update_cache(bucket_num);
+ this->priv_size_traits().increment();
+ //Insert the element in the bucket after it
+ return iterator(b.insert_after(it, *n), this);
+ }
+
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<siterator, siterator> priv_equal_range
+ ( const KeyType &key
+ , KeyHasher hash_func
+ , KeyValueEqual equal_func
+ , size_type &bucket_number_first
+ , size_type &bucket_number_second
+ , size_type &count) const
+ {
+ std::size_t h;
+ count = 0;
+ siterator prev;
+ //Let's see if the element is present
+ std::pair<siterator, siterator> to_return
+ ( priv_find(key, hash_func, equal_func, bucket_number_first, h, prev)
+ , priv_invalid_local_it());
+ if(to_return.first == to_return.second){
+ bucket_number_second = bucket_number_first;
+ return to_return;
+ }
+ //If it's present, find the first that it's not equal in
+ //the same bucket
+ bucket_type &b = this->priv_buckets()[bucket_number_first];
+ siterator it = to_return.first;
+ if(optimize_multikey){
+ to_return.second = bucket_type::s_iterator_to
+ (*node_traits::get_next(group_functions_t::priv_get_last_in_group
+ (dcast_bucket_ptr(it.pointed_node()), optimize_multikey_t())));
+ count = std::distance(it, to_return.second);
+ if(to_return.second != b.end()){
+ bucket_number_second = bucket_number_first;
+ return to_return;
+ }
+ }
+ else{
+ ++count;
+ ++it;
+ while(it != b.end()){
+ const value_type &v = priv_value_from_slist_node(it.pointed_node());
+ if(compare_hash){
+ std::size_t hv = this->priv_stored_or_compute_hash(v, store_hash_t());
+ if(hv != h || !equal_func(key, v)){
+ to_return.second = it;
+ bucket_number_second = bucket_number_first;
+ return to_return;
+ }
+ }
+ else if(!equal_func(key, v)){
+ to_return.second = it;
+ bucket_number_second = bucket_number_first;
+ return to_return;
+ }
+ ++it;
+ ++count;
+ }
+ }
+
+ //If we reached the end, find the first, non-empty bucket
+ for(bucket_number_second = bucket_number_first+1
+ ; bucket_number_second != this->priv_buckets_len()
+ ; ++bucket_number_second){
+ bucket_type &b = this->priv_buckets()[bucket_number_second];
+ if(!b.empty()){
+ to_return.second = b.begin();
+ return to_return;
+ }
+ }
+
+ //Otherwise, return the end node
+ to_return.second = priv_invalid_local_it();
+ return to_return;
+ }
+ /// @endcond
+};
+
+/// @cond
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template < class T
+ , bool UniqueKeys
+ , class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none
+ , class O5 = none, class O6 = none
+ , class O7 = none, class O8 = none
+ , class O9 = none, class O10= none
+ >
+#else
+template <class T, bool UniqueKeys, class ...Options>
+#endif
+struct make_hashtable_opt
+{
+ typedef typename pack_options
+ < uset_defaults<T>,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ //Real value traits must be calculated from options
+ typedef typename detail::get_value_traits
+ <T, typename packed_options::value_traits>::type value_traits;
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ typedef typename packed_options::bucket_traits specified_bucket_traits;
+ /// @endcond
+
+ //Real bucket traits must be calculated from options and calculated value_traits
+ typedef typename detail::get_slist_impl
+ <typename detail::reduced_slist_node_traits
+ <typename real_value_traits::node_traits>::type
+ >::type slist_impl;
+
+ typedef typename
+ detail::if_c< detail::is_same
+ < specified_bucket_traits
+ , default_bucket_traits
+ >::value
+ , detail::bucket_traits_impl<slist_impl>
+ , specified_bucket_traits
+ >::type real_bucket_traits;
+
+ typedef detail::usetopt
+ < value_traits
+ , typename packed_options::hash
+ , typename packed_options::equal
+ , typename packed_options::size_type
+ , real_bucket_traits
+ , (std::size_t(UniqueKeys)*detail::hash_bool_flags::unique_keys_pos)
+ | (std::size_t(packed_options::constant_time_size)*detail::hash_bool_flags::constant_time_size_pos)
+ | (std::size_t(packed_options::power_2_buckets)*detail::hash_bool_flags::power_2_buckets_pos)
+ | (std::size_t(packed_options::cache_begin)*detail::hash_bool_flags::cache_begin_pos)
+ | (std::size_t(packed_options::compare_hash)*detail::hash_bool_flags::compare_hash_pos)
+ | (std::size_t(packed_options::incremental)*detail::hash_bool_flags::incremental_pos)
+ > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c hashtable that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none
+ , class O5 = none, class O6 = none
+ , class O7 = none, class O8 = none
+ , class O9 = none, class O10= none
+ >
+#endif
+struct make_hashtable
+{
+ /// @cond
+ typedef hashtable_impl
+ < typename make_hashtable_opt
+ <T, false,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+
+#if defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7, class O8, class O9, class O10>
+#endif
+class hashtable
+ : public make_hashtable<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_hashtable<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::real_value_traits real_value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+ typedef typename Base::bucket_ptr bucket_ptr;
+ typedef typename Base::size_type size_type;
+ typedef typename Base::hasher hasher;
+ typedef typename Base::bucket_traits bucket_traits;
+ typedef typename Base::key_equal key_equal;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
+
+ hashtable ( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : Base(b_traits, hash_func, equal_func, v_traits)
+ {}
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_HASHTABLE_HPP
Added: sandbox/move/boost/intrusive/intrusive_fwd.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/intrusive_fwd.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,531 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_FWD_HPP
+#define BOOST_INTRUSIVE_FWD_HPP
+
+#include <cstddef>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/detail/workaround.hpp>
+
+/// @cond
+
+namespace boost {
+
+namespace intrusive {
+
+struct none;
+
+} //namespace intrusive{
+} //namespace boost{
+
+namespace boost {
+namespace intrusive {
+
+////////////////////////////
+// Node algorithms
+////////////////////////////
+
+//Algorithms predeclarations
+template<class NodeTraits>
+class circular_list_algorithms;
+
+template<class NodeTraits>
+class circular_slist_algorithms;
+
+template<class NodeTraits>
+class rbtree_algorithms;
+
+////////////////////////////
+// Containers
+////////////////////////////
+
+//slist
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ , class O5 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class slist;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class slist_base_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class slist_member_hook;
+
+//list
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class list;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class list_base_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class list_member_hook;
+
+//rbtree/set/multiset
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class rbtree;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class set;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class multiset;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class ...Options>
+#endif
+class set_base_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class ...Options>
+#endif
+class set_member_hook;
+
+//splaytree/splay_set/splay_multiset
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class splaytree;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class splay_set;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class splay_multiset;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class splay_set_base_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class splay_set_member_hook;
+
+//avltree/avl_set/avl_multiset
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class avltree;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class avl_set;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class avl_multiset;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class ...Options>
+#endif
+class avl_set_base_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class ...Options>
+#endif
+class avl_set_member_hook;
+
+
+//treap/treap_set/treap_multiset
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class treap;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class treap_set;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class treap_multiset;
+
+//Default priority comparison functor
+template <class T>
+struct priority_compare;
+
+//sgtree/sg_set/sg_multiset
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class sgtree;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class sg_set;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class sg_multiset;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class bs_set_base_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class bs_set_member_hook;
+
+//hashtable/unordered_set/unordered_multiset
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ , class O5 = none
+ , class O6 = none
+ , class O7 = none
+ , class O8 = none
+ , class O9 = none
+ , class O10 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class hashtable;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ , class O5 = none
+ , class O6 = none
+ , class O7 = none
+ , class O8 = none
+ , class O9 = none
+ , class O10 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class unordered_set;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class T
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ , class O5 = none
+ , class O6 = none
+ , class O7 = none
+ , class O8 = none
+ , class O9 = none
+ , class O10 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+class unordered_multiset;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class ...Options>
+#endif
+class unordered_set_base_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ >
+#else
+template<class ...Options>
+#endif
+class unordered_set_member_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class any_base_hook;
+
+#ifndef BOOST_INTRUSIVE_VARIADIC_TEMPLATES
+template
+ < class O1 = none
+ , class O2 = none
+ , class O3 = none
+ >
+#else
+template<class ...Options>
+#endif
+class any_member_hook;
+
+} //namespace intrusive {
+} //namespace boost {
+
+/// @endcond
+
+#endif //#ifndef BOOST_INTRUSIVE_FWD_HPP
Added: sandbox/move/boost/intrusive/linear_slist_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/linear_slist_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,327 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_LINEAR_SLIST_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_LINEAR_SLIST_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/common_slist_algorithms.hpp>
+#include <cstddef>
+#include <utility>
+
+namespace boost {
+namespace intrusive {
+
+//! linear_slist_algorithms provides basic algorithms to manipulate nodes
+//! forming a linear singly linked list.
+//!
+//! linear_slist_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the linear list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_next(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_next(node_ptr n, node_ptr next);</tt>
+template<class NodeTraits>
+class linear_slist_algorithms
+ /// @cond
+ : public detail::common_slist_algorithms<NodeTraits>
+ /// @endcond
+{
+ /// @cond
+ typedef detail::common_slist_algorithms<NodeTraits> base_t;
+ /// @endcond
+ public:
+ typedef typename NodeTraits::node node;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+ typedef NodeTraits node_traits;
+
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+
+ //! <b>Effects</b>: Constructs an non-used list element, putting the next
+ //! pointer to null:
+ //! <tt>NodeTraits::get_next(this_node) == 0
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void init(node_ptr this_node);
+
+ //! <b>Requires</b>: this_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Returns true is "this_node" is the only node of a circular list:
+ //! or it's a not inserted node:
+ //! <tt>return !NodeTraits::get_next(this_node) || NodeTraits::get_next(this_node) == this_node</tt>
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr this_node);
+
+ //! <b>Effects</b>: Returns true is "this_node" has the same state as if
+ //! it was inited using "init(node_ptr)"
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool inited(const_node_ptr this_node);
+
+ //! <b>Requires</b>: prev_node must be in a circular list or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Unlinks the next node of prev_node from the circular list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink_after(node_ptr prev_node);
+
+ //! <b>Requires</b>: prev_node and last_node must be in a circular list
+ //! or be an empty circular list.
+ //!
+ //! <b>Effects</b>: Unlinks the range (prev_node, last_node) from the linear list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink_after(node_ptr prev_node, node_ptr last_node);
+
+ //! <b>Requires</b>: prev_node must be a node of a linear list.
+ //!
+ //! <b>Effects</b>: Links this_node after prev_node in the linear list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void link_after(node_ptr prev_node, node_ptr this_node);
+
+ //! <b>Requires</b>: b and e must be nodes of the same linear list or an empty range.
+ //! and p must be a node of a different linear list.
+ //!
+ //! <b>Effects</b>: Removes the nodes from (b, e] range from their linear list and inserts
+ //! them after p in p's linear list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void transfer_after(node_ptr p, node_ptr b, node_ptr e);
+
+ #endif //#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+
+ //! <b>Effects</b>: Constructs an empty list, making this_node the only
+ //! node of the circular list:
+ //! <tt>NodeTraits::get_next(this_node) == this_node</tt>.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void init_header(node_ptr this_node)
+ { NodeTraits::set_next(this_node, node_ptr(0)); }
+
+ //! <b>Requires</b>: this_node and prev_init_node must be in the same linear list.
+ //!
+ //! <b>Effects</b>: Returns the previous node of this_node in the linear list starting.
+ //! the search from prev_init_node. The first node checked for equality
+ //! is NodeTraits::get_next(prev_init_node).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements between prev_init_node and this_node.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_previous_node(node_ptr prev_init_node, node_ptr this_node)
+ { return base_t::get_previous_node(prev_init_node, this_node); }
+
+ //! <b>Requires</b>: this_node must be in a linear list or be an empty linear list.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes in a linear list. If the linear list
+ //! is empty, returns 1.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr this_node)
+ {
+ std::size_t result = 0;
+ const_node_ptr p = this_node;
+ do{
+ p = NodeTraits::get_next(p);
+ ++result;
+ } while (p);
+ return result;
+ }
+
+ //! <b>Requires</b>: this_node and other_node must be nodes inserted
+ //! in linear lists or be empty linear lists.
+ //!
+ //! <b>Effects</b>: Moves all the nodes previously chained after this_node after other_node
+ //! and vice-versa.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void swap_trailing_nodes(node_ptr this_node, node_ptr other_node)
+ {
+ node_ptr this_nxt = NodeTraits::get_next(this_node);
+ node_ptr other_nxt = NodeTraits::get_next(other_node);
+ NodeTraits::set_next(this_node, other_nxt);
+ NodeTraits::set_next(other_node, this_nxt);
+ }
+
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
+ //! <b>Returns</b>: The new first node of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: This function is linear to the contained elements.
+ static node_ptr reverse(node_ptr p)
+ {
+ if(!p) return node_ptr(0);
+ node_ptr i = NodeTraits::get_next(p);
+ node_ptr first(p);
+ while(i){
+ node_ptr nxti(NodeTraits::get_next(i));
+ base_t::unlink_after(p);
+ NodeTraits::set_next(i, first);
+ first = i;
+ i = nxti;
+ }
+ return first;
+ }
+
+ //! <b>Effects</b>: Moves the first n nodes starting at p to the end of the list.
+ //!
+ //! <b>Returns</b>: A pair containing the new first and last node of the list or
+ //! if there has been any movement, a null pair if n leads to no movement.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
+ static std::pair<node_ptr, node_ptr> move_first_n_backwards(node_ptr p, std::size_t n)
+ {
+ std::pair<node_ptr, node_ptr> ret(node_ptr(0), node_ptr(0));
+ //Null shift, or count() == 0 or 1, nothing to do
+ if(!n || !p || !NodeTraits::get_next(p)){
+ return ret;
+ }
+
+ node_ptr first = p;
+ bool end_found = false;
+ node_ptr new_last(0);
+ node_ptr old_last(0);
+
+ //Now find the new last node according to the shift count.
+ //If we find 0 before finding the new last node
+ //unlink p, shortcut the search now that we know the size of the list
+ //and continue.
+ for(std::size_t i = 1; i <= n; ++i){
+ new_last = first;
+ first = NodeTraits::get_next(first);
+ if(first == 0){
+ //Shortcut the shift with the modulo of the size of the list
+ n %= i;
+ if(!n) return ret;
+ old_last = new_last;
+ i = 0;
+ //Unlink p and continue the new first node search
+ first = p;
+ //unlink_after(new_last);
+ end_found = true;
+ }
+ }
+
+ //If the p has not been found in the previous loop, find it
+ //starting in the new first node and unlink it
+ if(!end_found){
+ old_last = base_t::get_previous_node(first, node_ptr(0));
+ }
+
+ //Now link p after the new last node
+ NodeTraits::set_next(old_last, p);
+ NodeTraits::set_next(new_last, node_ptr(0));
+ ret.first = first;
+ ret.second = new_last;
+ return ret;
+ }
+
+ //! <b>Effects</b>: Moves the first n nodes starting at p to the beginning of the list.
+ //!
+ //! <b>Returns</b>: A pair containing the new first and last node of the list or
+ //! if there has been any movement, a null pair if n leads to no movement.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements plus the number moved positions.
+ static std::pair<node_ptr, node_ptr> move_first_n_forward(node_ptr p, std::size_t n)
+ {
+ std::pair<node_ptr, node_ptr> ret(node_ptr(0), node_ptr(0));
+ //Null shift, or count() == 0 or 1, nothing to do
+ if(!n || !p || !NodeTraits::get_next(p))
+ return ret;
+
+ node_ptr first = p;
+
+ //Iterate until p is found to know where the current last node is.
+ //If the shift count is less than the size of the list, we can also obtain
+ //the position of the new last node after the shift.
+ node_ptr old_last(first), next_to_it, new_last(p);
+ std::size_t distance = 1;
+ while(!!(next_to_it = node_traits::get_next(old_last))){
+ if(distance++ > n)
+ new_last = node_traits::get_next(new_last);
+ old_last = next_to_it;
+ }
+ //If the shift was bigger or equal than the size, obtain the equivalent
+ //forward shifts and find the new last node.
+ if(distance <= n){
+ //Now find the equivalent forward shifts.
+ //Shortcut the shift with the modulo of the size of the list
+ std::size_t new_before_last_pos = (distance - (n % distance))% distance;
+ //If the shift is a multiple of the size there is nothing to do
+ if(!new_before_last_pos)
+ return ret;
+
+ for( new_last = p
+ ; --new_before_last_pos
+ ; new_last = node_traits::get_next(new_last)){
+ //empty
+ }
+ }
+
+ //Get the first new node
+ node_ptr new_first(node_traits::get_next(new_last));
+ //Now put the old beginning after the old end
+ NodeTraits::set_next(old_last, p);
+ NodeTraits::set_next(new_last, node_ptr(0));
+ ret.first = new_first;
+ ret.second = new_last;
+ return ret;
+ }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_LINEAR_SLIST_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/link_mode.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/link_mode.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,46 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_VALUE_LINK_TYPE_HPP
+#define BOOST_INTRUSIVE_VALUE_LINK_TYPE_HPP
+
+namespace boost {
+namespace intrusive {
+
+//!This enumeration defines the type of value_traits that can be defined
+//!for Boost.Intrusive containers
+enum link_mode_type{
+ //!If this linking policy is specified in a value_traits class
+ //!as the link_mode, containers
+ //!configured with such value_traits won't set the hooks
+ //!of the erased values to a default state. Containers also won't
+ //!check that the hooks of the new values are default initialized.
+ normal_link,
+
+ //!If this linking policy is specified in a value_traits class
+ //!as the link_mode, containers
+ //!configured with such value_traits will set the hooks
+ //!of the erased values to a default state. Containers also will
+ //!check that the hooks of the new values are default initialized.
+ safe_link,
+
+ //!Same as "safe_link" but the user type is an auto-unlink
+ //!type, so the containers with constant-time size features won't be
+ //!compatible with value_traits configured with this policy.
+ //!Containers also know that the a value can be silently erased from
+ //!the container without using any function provided by the containers.
+ auto_unlink
+};
+} //namespace intrusive
+} //namespace boost
+
+#endif //BOOST_INTRUSIVE_VALUE_LINK_TYPE_HPP
Added: sandbox/move/boost/intrusive/list.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/list.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,1488 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_LIST_HPP
+#define BOOST_INTRUSIVE_LIST_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/list_hook.hpp>
+#include <boost/intrusive/circular_list_algorithms.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/clear_on_destructor_base.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <iterator>
+#include <algorithm>
+#include <functional>
+#include <cstddef>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+template <class ValueTraits, class SizeType, bool ConstantTimeSize>
+struct listopt
+{
+ typedef ValueTraits value_traits;
+ typedef SizeType size_type;
+ static const bool constant_time_size = ConstantTimeSize;
+};
+
+
+template <class T>
+struct list_defaults
+ : pack_options
+ < none
+ , base_hook<detail::default_list_hook>
+ , constant_time_size<true>
+ , size_type<std::size_t>
+ >::type
+{};
+
+/// @endcond
+
+//! The class template list is an intrusive container that mimics most of the
+//! interface of std::list as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<> and \c size_type<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class list_impl
+ : private detail::clear_on_destructor_base< list_impl<Config> >
+{
+ template<class C> friend class detail::clear_on_destructor_base;
+ //Public typedefs
+ public:
+ typedef typename Config::value_traits value_traits;
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ /// @endcond
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::const_pointer const_pointer;
+ typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ typedef typename std::iterator_traits<pointer>::difference_type difference_type;
+ typedef typename Config::size_type size_type;
+ typedef list_iterator<list_impl, false> iterator;
+ typedef list_iterator<list_impl, true> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+ typedef circular_list_algorithms<node_traits> node_algorithms;
+
+ static const bool constant_time_size = Config::constant_time_size;
+ static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+ BOOST_STATIC_ASSERT(( stateful_value_traits == false ));
+
+ /// @cond
+
+ private:
+ typedef detail::size_holder<constant_time_size, size_type> size_traits;
+
+ //Non-copyable and non-moveable
+ list_impl (const list_impl&);
+ list_impl &operator =(const list_impl&);
+
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ //Constant-time size is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(constant_time_size &&
+ ((int)real_value_traits::link_mode == (int)auto_unlink)
+ ));
+
+ //Const cast emulation for smart pointers
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ //return node_ptr(detail::get_pointer(ptr)));
+ return const_cast<node*>(detail::get_pointer(ptr));
+ }
+
+ node_ptr get_root_node()
+ { return node_ptr(&data_.root_plus_size_.root_); }
+
+ const_node_ptr get_root_node() const
+ { return const_node_ptr(&data_.root_plus_size_.root_); }
+
+ struct root_plus_size : public size_traits
+ {
+ node root_;
+ };
+
+ struct data_t : public value_traits
+ {
+ typedef typename list_impl::value_traits value_traits;
+ data_t(const value_traits &val_traits)
+ : value_traits(val_traits)
+ {}
+
+ root_plus_size root_plus_size_;
+ } data_;
+
+ size_traits &priv_size_traits()
+ { return data_.root_plus_size_; }
+
+ const size_traits &priv_size_traits() const
+ { return data_.root_plus_size_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<false>) const
+ { return data_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<true>) const
+ { return data_.get_value_traits(*this); }
+
+ real_value_traits &get_real_value_traits(detail::bool_<false>)
+ { return data_; }
+
+ real_value_traits &get_real_value_traits(detail::bool_<true>)
+ { return data_.get_value_traits(*this); }
+
+ /// @endcond
+
+ public:
+
+ const real_value_traits &get_real_value_traits() const
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ real_value_traits &get_real_value_traits()
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ //! <b>Effects</b>: constructs an empty list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: If real_value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
+ list_impl(const value_traits &v_traits = value_traits())
+ : data_(v_traits)
+ {
+ this->priv_size_traits().set_size(size_type(0));
+ node_algorithms::init_header(this->get_root_node());
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //!
+ //! <b>Effects</b>: Constructs a list equal to the range [first,last).
+ //!
+ //! <b>Complexity</b>: Linear in std::distance(b, e). No copy constructors are called.
+ //!
+ //! <b>Throws</b>: If real_value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
+ template<class Iterator>
+ list_impl(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
+ : data_(v_traits)
+ {
+ this->priv_size_traits().set_size(size_type(0));
+ node_algorithms::init_header(this->get_root_node());
+ this->insert(this->cend(), b, e);
+ }
+
+ //! <b>Effects</b>: If it's not a safe-mode or an auto-unlink value_type
+ //! the destructor does nothing
+ //! (ie. no code is generated). Otherwise it detaches all elements from this.
+ //! In this case the objects in the list are not deleted (i.e. no destructors
+ //! are called), but the hooks according to the ValueTraits template parameter
+ //! are set to their default value.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the list, if
+ //! it's a safe-mode or auto-unlink value . Otherwise constant.
+ ~list_impl()
+ {}
+
+ //! <b>Requires</b>: value must be an lvalue.
+ //!
+ //! <b>Effects</b>: Inserts the value in the back of the list.
+ //! No copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ void push_back(reference value)
+ {
+ node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
+ node_algorithms::link_before(this->get_root_node(), to_insert);
+ this->priv_size_traits().increment();
+ }
+
+ //! <b>Requires</b>: value must be an lvalue.
+ //!
+ //! <b>Effects</b>: Inserts the value in the front of the list.
+ //! No copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ void push_front(reference value)
+ {
+ node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
+ node_algorithms::link_before(node_traits::get_next(this->get_root_node()), to_insert);
+ this->priv_size_traits().increment();
+ }
+
+ //! <b>Effects</b>: Erases the last element of the list.
+ //! No destructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the erased element.
+ void pop_back()
+ { return this->pop_back_and_dispose(detail::null_disposer()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the last element of the list.
+ //! No destructors are called.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased element.
+ template<class Disposer>
+ void pop_back_and_dispose(Disposer disposer)
+ {
+ node_ptr to_erase = node_traits::get_previous(this->get_root_node());
+ node_algorithms::unlink(to_erase);
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ }
+
+ //! <b>Effects</b>: Erases the first element of the list.
+ //! No destructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the erased element.
+ void pop_front()
+ { return this->pop_front_and_dispose(detail::null_disposer()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the first element of the list.
+ //! No destructors are called.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased element.
+ template<class Disposer>
+ void pop_front_and_dispose(Disposer disposer)
+ {
+ node_ptr to_erase = node_traits::get_next(this->get_root_node());
+ node_algorithms::unlink(to_erase);
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ }
+
+ //! <b>Effects</b>: Returns a reference to the first element of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ reference front()
+ { return *get_real_value_traits().to_value_ptr(node_traits::get_next(this->get_root_node())); }
+
+ //! <b>Effects</b>: Returns a const_reference to the first element of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reference front() const
+ { return *get_real_value_traits().to_value_ptr(uncast(node_traits::get_next(this->get_root_node()))); }
+
+ //! <b>Effects</b>: Returns a reference to the last element of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ reference back()
+ { return *get_real_value_traits().to_value_ptr(node_traits::get_previous(this->get_root_node())); }
+
+ //! <b>Effects</b>: Returns a const_reference to the last element of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reference back() const
+ { return *get_real_value_traits().to_value_ptr(uncast(node_traits::get_previous(this->get_root_node()))); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ iterator begin()
+ { return iterator(node_traits::get_next(this->get_root_node()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator begin() const
+ { return this->cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cbegin() const
+ { return const_iterator(node_traits::get_next(this->get_root_node()), this); }
+
+ //! <b>Effects</b>: Returns an iterator to the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ iterator end()
+ { return iterator(this->get_root_node(), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator end() const
+ { return this->cend(); }
+
+ //! <b>Effects</b>: Returns a constant iterator to the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cend() const
+ { return const_iterator(uncast(this->get_root_node()), this); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ reverse_iterator rbegin()
+ { return reverse_iterator(this->end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator rbegin() const
+ { return this->crbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ reverse_iterator rend()
+ { return reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator rend() const
+ { return this->crend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reverse_iterator crend() const
+ { return const_reverse_iterator(this->begin()); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of list.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the list associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static list_impl &container_from_end_iterator(iterator end_iterator)
+ { return list_impl::priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of list.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the list associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const list_impl &container_from_end_iterator(const_iterator end_iterator)
+ { return list_impl::priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Effects</b>: Returns the number of the elements contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements contained in the list.
+ //! if constant-time size option is disabled. Constant time otherwise.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ size_type size() const
+ {
+ if(constant_time_size)
+ return this->priv_size_traits().get_size();
+ else
+ return node_algorithms::count(this->get_root_node()) - 1;
+ }
+
+ //! <b>Effects</b>: Returns true if the list contains no elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ bool empty() const
+ { return node_algorithms::unique(this->get_root_node()); }
+
+ //! <b>Effects</b>: Swaps the elements of x and *this.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ void swap(list_impl& other)
+ {
+ node_algorithms::swap_nodes(this->get_root_node(), other.get_root_node());
+ if(constant_time_size){
+ size_type backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(other.priv_size_traits().get_size());
+ other.priv_size_traits().set_size(backup);
+ }
+ }
+
+ //! <b>Effects</b>: Moves backwards all the elements, so that the first
+ //! element becomes the second, the second becomes the third...
+ //! the last element becomes the first one.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of shifts.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ void shift_backwards(size_type n = 1)
+ { node_algorithms::move_forward(this->get_root_node(), n); }
+
+ //! <b>Effects</b>: Moves forward all the elements, so that the second
+ //! element becomes the first, the third becomes the second...
+ //! the first element becomes the last one.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of shifts.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ void shift_forward(size_type n = 1)
+ { node_algorithms::move_backwards(this->get_root_node(), n); }
+
+ //! <b>Effects</b>: Erases the element pointed by i of the list.
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed element,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ iterator erase(const_iterator i)
+ { return this->erase_and_dispose(i, detail::null_disposer()); }
+
+ //! <b>Requires</b>: b and e must be valid iterators to elements in *this.
+ //!
+ //! <b>Effects</b>: Erases the element range pointed by b and e
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
+ //! or auto-unlink value, or constant-time size is enabled. Constant-time otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased elements.
+ iterator erase(const_iterator b, const_iterator e)
+ {
+ if(safemode_or_autounlink || constant_time_size){
+ return this->erase_and_dispose(b, e, detail::null_disposer());
+ }
+ else{
+ node_algorithms::unlink(b.pointed_node(), e.pointed_node());
+ return e.unconst();
+ }
+ }
+
+ //! <b>Requires</b>: b and e must be valid iterators to elements in *this.
+ //! n must be std::distance(b, e).
+ //!
+ //! <b>Effects</b>: Erases the element range pointed by b and e
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
+ //! or auto-unlink value is enabled. Constant-time otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased elements.
+ iterator erase(const_iterator b, const_iterator e, difference_type n)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(b, e) == difference_type(n));
+ if(safemode_or_autounlink || constant_time_size){
+ return this->erase_and_dispose(b, e, detail::null_disposer());
+ }
+ else{
+ if(constant_time_size){
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size() - n);
+ }
+ node_algorithms::unlink(b.pointed_node(), e.pointed_node());
+ return e.unconst();
+ }
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed by i of the list.
+ //! No destructors are called.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed element,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased element.
+ template <class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ {
+ node_ptr to_erase(i.pointed_node());
+ ++i;
+ node_algorithms::unlink(to_erase);
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(this->get_real_value_traits().to_value_ptr(to_erase));
+ return i.unconst();
+ }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element range pointed by b and e
+ //! No destructors are called.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements erased.
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased elements.
+ template <class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ {
+ node_ptr bp(b.pointed_node()), ep(e.pointed_node());
+ node_algorithms::unlink(bp, ep);
+ while(bp != ep){
+ node_ptr to_erase(bp);
+ bp = node_traits::get_next(bp);
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ this->priv_size_traits().decrement();
+ }
+ return e.unconst();
+ }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //! No destructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements of the list.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the erased elements.
+ void clear()
+ {
+ if(safemode_or_autounlink){
+ this->clear_and_dispose(detail::null_disposer());
+ }
+ else{
+ node_algorithms::init_header(this->get_root_node());
+ this->priv_size_traits().set_size(size_type(0));
+ }
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //! No destructors are called.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements of the list.
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased elements.
+ template <class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ {
+ const_iterator it(this->begin()), itend(this->end());
+ while(it != itend){
+ node_ptr to_erase(it.pointed_node());
+ ++it;
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ }
+ node_algorithms::init_header(this->get_root_node());
+ this->priv_size_traits().set_size(0);
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const list_impl &src, Cloner cloner, Disposer disposer)
+ {
+ this->clear_and_dispose(disposer);
+ detail::exception_disposer<list_impl, Disposer>
+ rollback(*this, disposer);
+ const_iterator b(src.begin()), e(src.end());
+ for(; b != e; ++b){
+ this->push_back(*cloner(*b));
+ }
+ rollback.release();
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and p must be a valid iterator of *this.
+ //!
+ //! <b>Effects</b>: Inserts the value before the position pointed by p.
+ //!
+ //! <b>Returns</b>: An iterator to the inserted element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time. No copy constructors are called.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ iterator insert(const_iterator p, reference value)
+ {
+ node_ptr to_insert = this->get_real_value_traits().to_node_ptr(value);
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
+ node_algorithms::link_before(p.pointed_node(), to_insert);
+ this->priv_size_traits().increment();
+ return iterator(to_insert, this);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield
+ //! an lvalue of type value_type and p must be a valid iterator of *this.
+ //!
+ //! <b>Effects</b>: Inserts the range pointed by b and e before the position p.
+ //! No copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements inserted.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ template<class Iterator>
+ void insert(const_iterator p, Iterator b, Iterator e)
+ {
+ for (; b != e; ++b)
+ this->insert(p, *b);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield
+ //! an lvalue of type value_type.
+ //!
+ //! <b>Effects</b>: Clears the list and inserts the range pointed by b and e.
+ //! No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements inserted plus
+ //! linear to the elements contained in the list if it's a safe-mode
+ //! or auto-unlink value.
+ //! Linear to the number of elements inserted in the list otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements.
+ template<class Iterator>
+ void assign(Iterator b, Iterator e)
+ {
+ this->clear();
+ this->insert(this->cend(), b, e);
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Requires</b>: Dereferencing iterator must yield
+ //! an lvalue of type value_type.
+ //!
+ //! <b>Effects</b>: Clears the list and inserts the range pointed by b and e.
+ //! No destructors or copy constructors are called.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements inserted plus
+ //! linear to the elements contained in the list.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements.
+ template<class Iterator, class Disposer>
+ void dispose_and_assign(Disposer disposer, Iterator b, Iterator e)
+ {
+ this->clear_and_dispose(disposer);
+ this->insert(this->cend(), b, e);
+ }
+
+ //! <b>Requires</b>: p must be a valid iterator of *this.
+ //!
+ //! <b>Effects</b>: Transfers all the elements of list x to this list, before the
+ //! the element pointed by p. No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of
+ //! this list. Iterators of this list and all the references are not invalidated.
+ void splice(const_iterator p, list_impl& x)
+ {
+ if(!x.empty()){
+ size_traits &thist = this->priv_size_traits();
+ size_traits &xt = x.priv_size_traits();
+ node_algorithms::transfer
+ (p.pointed_node(), x.begin().pointed_node(), x.end().pointed_node());
+ thist.set_size(thist.get_size() + xt.get_size());
+ xt.set_size(size_type(0));
+ }
+ }
+
+ //! <b>Requires</b>: p must be a valid iterator of *this.
+ //! new_ele must point to an element contained in list x.
+ //!
+ //! <b>Effects</b>: Transfers the value pointed by new_ele, from list x to this list,
+ //! before the the element pointed by p. No destructors or copy constructors are called.
+ //! If p == new_ele or p == ++new_ele, this function is a null operation.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice(const_iterator p, list_impl&x, const_iterator new_ele)
+ {
+ node_algorithms::transfer(p.pointed_node(), new_ele.pointed_node());
+ x.priv_size_traits().decrement();
+ this->priv_size_traits().increment();
+ }
+
+ //! <b>Requires</b>: p must be a valid iterator of *this.
+ //! start and end must point to elements contained in list x.
+ //!
+ //! <b>Effects</b>: Transfers the range pointed by start and end from list x to this list,
+ //! before the the element pointed by p. No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements transferred
+ //! if constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice(const_iterator p, list_impl&x, const_iterator start, const_iterator end)
+ {
+ if(constant_time_size)
+ this->splice(p, x, start, end, std::distance(start, end));
+ else
+ this->splice(p, x, start, end, 1);//distance is a dummy value
+ }
+
+ //! <b>Requires</b>: p must be a valid iterator of *this.
+ //! start and end must point to elements contained in list x.
+ //! n == std::distance(start, end)
+ //!
+ //! <b>Effects</b>: Transfers the range pointed by start and end from list x to this list,
+ //! before the the element pointed by p. No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice(const_iterator p, list_impl&x, const_iterator start, const_iterator end, difference_type n)
+ {
+ if(n){
+ if(constant_time_size){
+ size_traits &thist = this->priv_size_traits();
+ size_traits &xt = x.priv_size_traits();
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(n == std::distance(start, end));
+ node_algorithms::transfer(p.pointed_node(), start.pointed_node(), end.pointed_node());
+ thist.set_size(thist.get_size() + n);
+ xt.set_size(xt.get_size() - n);
+ }
+ else{
+ node_algorithms::transfer(p.pointed_node(), start.pointed_node(), end.pointed_node());
+ }
+ }
+ }
+
+ //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
+ //! The sort is stable, that is, the relative order of equivalent elements is preserved.
+ //!
+ //! <b>Throws</b>: If real_value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or std::less<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Notes</b>: Iterators and references are not invalidated.
+ //!
+ //! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
+ //! is the list's size.
+ void sort()
+ { this->sort(std::less<value_type>()); }
+
+ //! <b>Requires</b>: p must be a comparison function that induces a strict weak ordering
+ //!
+ //! <b>Effects</b>: This function sorts the list *this according to p. The sort is
+ //! stable, that is, the relative order of equivalent elements is preserved.
+ //!
+ //! <b>Throws</b>: If real_value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the predicate throws. Basic guarantee.
+ //!
+ //! <b>Notes</b>: This won't throw if list_base_hook<> or
+ //! list_member_hook are used.
+ //! Iterators and references are not invalidated.
+ //!
+ //! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
+ //! is the list's size.
+ template<class Predicate>
+ void sort(Predicate p)
+ {
+ if(node_traits::get_next(this->get_root_node())
+ != node_traits::get_previous(this->get_root_node())){
+ list_impl carry;
+ list_impl counter[64];
+ int fill = 0;
+ while(!this->empty()){
+ carry.splice(carry.cbegin(), *this, this->cbegin());
+ int i = 0;
+ while(i < fill && !counter[i].empty()) {
+ counter[i].merge(carry, p);
+ carry.swap(counter[i++]);
+ }
+ carry.swap(counter[i]);
+ if(i == fill)
+ ++fill;
+ }
+ for (int i = 1; i < fill; ++i)
+ counter[i].merge(counter[i-1], p);
+ this->swap(counter[fill-1]);
+ }
+ }
+
+ //! <b>Effects</b>: This function removes all of x's elements and inserts them
+ //! in order into *this according to std::less<value_type>. The merge is stable;
+ //! that is, if an element from *this is equivalent to one from x, then the element
+ //! from *this will precede the one from x.
+ //!
+ //! <b>Throws</b>: If std::less<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: This function is linear time: it performs at most
+ //! size() + x.size() - 1 comparisons.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated
+ void merge(list_impl& x)
+ { this->merge(x, std::less<value_type>()); }
+
+ //! <b>Requires</b>: p must be a comparison function that induces a strict weak
+ //! ordering and both *this and x must be sorted according to that ordering
+ //! The lists x and *this must be distinct.
+ //!
+ //! <b>Effects</b>: This function removes all of x's elements and inserts them
+ //! in order into *this. The merge is stable; that is, if an element from *this is
+ //! equivalent to one from x, then the element from *this will precede the one from x.
+ //!
+ //! <b>Throws</b>: If the predicate throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: This function is linear time: it performs at most
+ //! size() + x.size() - 1 comparisons.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ template<class Predicate>
+ void merge(list_impl& x, Predicate p)
+ {
+ const_iterator e(this->cend()), ex(x.cend());
+ const_iterator b(this->cbegin());
+ while(!x.empty()){
+ const_iterator ix(x.cbegin());
+ while (b != e && !p(*ix, *b)){
+ ++b;
+ }
+ if(b == e){
+ //Now transfer the rest to the end of the container
+ this->splice(e, x);
+ break;
+ }
+ else{
+ size_type n(0);
+ do{
+ ++ix; ++n;
+ } while(ix != ex && p(*ix, *b));
+ this->splice(b, x, x.begin(), ix, n);
+ }
+ }
+ }
+
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: This function is linear time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated
+ void reverse()
+ { node_algorithms::reverse(this->get_root_node()); }
+
+ //! <b>Effects</b>: Removes all the elements that compare equal to value.
+ //! No destructors are called.
+ //!
+ //! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ void remove(const_reference value)
+ { this->remove_if(detail::equal_to_value<const_reference>(value)); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Removes all the elements that compare equal to value.
+ //! Disposer::operator()(pointer) is called for every removed element.
+ //!
+ //! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class Disposer>
+ void remove_and_dispose(const_reference value, Disposer disposer)
+ { this->remove_and_dispose_if(detail::equal_to_value<const_reference>(value), disposer); }
+
+ //! <b>Effects</b>: Removes all the elements for which a specified
+ //! predicate is satisfied. No destructors are called.
+ //!
+ //! <b>Throws</b>: If pred throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time. It performs exactly size() calls to the predicate.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class Pred>
+ void remove_if(Pred pred)
+ { this->remove_and_dispose_if(pred, detail::null_disposer()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Removes all the elements for which a specified
+ //! predicate is satisfied.
+ //! Disposer::operator()(pointer) is called for every removed element.
+ //!
+ //! <b>Throws</b>: If pred throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class Pred, class Disposer>
+ void remove_and_dispose_if(Pred pred, Disposer disposer)
+ {
+ const_iterator cur(this->cbegin());
+ const_iterator last(this->cend());
+ while(cur != last) {
+ if(pred(*cur)){
+ cur = this->erase_and_dispose(cur, disposer);
+ }
+ else{
+ ++cur;
+ }
+ }
+ }
+
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! elements that are equal from the list. No destructors are called.
+ //!
+ //! <b>Throws</b>: If std::equal_to<value_type throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time (size()-1 comparisons calls to pred()).
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ void unique()
+ { this->unique_and_dispose(std::equal_to<value_type>(), detail::null_disposer()); }
+
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! elements that satisfy some binary predicate from the list.
+ //! No destructors are called.
+ //!
+ //! <b>Throws</b>: If pred throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time (size()-1 comparisons equality comparisons).
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class BinaryPredicate>
+ void unique(BinaryPredicate pred)
+ { this->unique_and_dispose(pred, detail::null_disposer()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! elements that are equal from the list.
+ //! Disposer::operator()(pointer) is called for every removed element.
+ //!
+ //! <b>Throws</b>: If std::equal_to<value_type throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class Disposer>
+ void unique_and_dispose(Disposer disposer)
+ { this->unique_and_dispose(std::equal_to<value_type>(), disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! elements that satisfy some binary predicate from the list.
+ //! Disposer::operator()(pointer) is called for every removed element.
+ //!
+ //! <b>Throws</b>: If pred throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class BinaryPredicate, class Disposer>
+ void unique_and_dispose(BinaryPredicate pred, Disposer disposer)
+ {
+ const_iterator itend(this->cend());
+ const_iterator cur(this->cbegin());
+
+ if(cur != itend){
+ const_iterator after(cur);
+ ++after;
+ while(after != itend){
+ if(pred(*cur, *after)){
+ after = this->erase_and_dispose(after, disposer);
+ }
+ else{
+ cur = after;
+ ++after;
+ }
+ }
+ }
+ }
+
+ //! <b>Requires</b>: value must be a reference to a value inserted in a list.
+ //!
+ //! <b>Effects</b>: This function returns a const_iterator pointing to the element
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ //! This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(value)));
+ return iterator(real_value_traits::to_node_ptr(value), 0);
+ }
+
+ //! <b>Requires</b>: value must be a const reference to a value inserted in a list.
+ //!
+ //! <b>Effects</b>: This function returns an iterator pointing to the element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ //! This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(const_cast<reference> (value))));
+ return const_iterator(real_value_traits::to_node_ptr(const_cast<reference> (value)), 0);
+ }
+
+ //! <b>Requires</b>: value must be a reference to a value inserted in a list.
+ //!
+ //! <b>Effects</b>: This function returns a const_iterator pointing to the element
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ iterator iterator_to(reference value)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(value)));
+ return iterator(real_value_traits::to_node_ptr(value), this);
+ }
+
+ //! <b>Requires</b>: value must be a const reference to a value inserted in a list.
+ //!
+ //! <b>Effects</b>: This function returns an iterator pointing to the element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ const_iterator iterator_to(const_reference value) const
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(!node_algorithms::inited(real_value_traits::to_node_ptr(const_cast<reference> (value))));
+ return const_iterator(real_value_traits::to_node_ptr(const_cast<reference> (value)), this);
+ }
+
+ /// @cond
+
+ private:
+ static list_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
+ {
+ root_plus_size *r = detail::parent_from_member<root_plus_size, node>
+ ( detail::get_pointer(end_iterator.pointed_node()), &root_plus_size::root_);
+ data_t *d = detail::parent_from_member<data_t, root_plus_size>
+ ( r, &data_t::root_plus_size_);
+ list_impl *s = detail::parent_from_member<list_impl, data_t>(d, &list_impl::data_);
+ return *s;
+ }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const list_impl<T, Options...> &x, const list_impl<T, Options...> &y)
+#else
+(const list_impl<Config> &x, const list_impl<Config> &y)
+#endif
+{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+bool operator==
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const list_impl<T, Options...> &x, const list_impl<T, Options...> &y)
+#else
+(const list_impl<Config> &x, const list_impl<Config> &y)
+#endif
+{
+ typedef list_impl<Config> list_type;
+ typedef typename list_type::const_iterator const_iterator;
+ const bool C = list_type::constant_time_size;
+ if(C && x.size() != y.size()){
+ return false;
+ }
+ const_iterator end1 = x.end();
+
+ const_iterator i1 = x.begin();
+ const_iterator i2 = y.begin();
+ if(C){
+ while (i1 != end1 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1;
+ }
+ else{
+ const_iterator end2 = y.end();
+ while (i1 != end1 && i2 != end2 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1 && i2 == end2;
+ }
+}
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const list_impl<T, Options...> &x, const list_impl<T, Options...> &y)
+#else
+(const list_impl<Config> &x, const list_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const list_impl<T, Options...> &x, const list_impl<T, Options...> &y)
+#else
+(const list_impl<Config> &x, const list_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const list_impl<T, Options...> &x, const list_impl<T, Options...> &y)
+#else
+(const list_impl<Config> &x, const list_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const list_impl<T, Options...> &x, const list_impl<T, Options...> &y)
+#else
+(const list_impl<Config> &x, const list_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(list_impl<T, Options...> &x, list_impl<T, Options...> &y)
+#else
+(list_impl<Config> &x, list_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c list that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_list
+{
+ /// @cond
+ typedef typename pack_options
+ < list_defaults<T>,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef typename detail::get_value_traits
+ <T, typename packed_options::value_traits>::type value_traits;
+
+ typedef list_impl
+ <
+ listopt
+ < value_traits
+ , typename packed_options::size_type
+ , packed_options::constant_time_size
+ >
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3>
+#else
+template<class T, class ...Options>
+#endif
+class list
+ : public make_list<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_list
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type Base;
+ typedef typename Base::real_value_traits real_value_traits;
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
+ public:
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ list(const value_traits &v_traits = value_traits())
+ : Base(v_traits)
+ {}
+
+ template<class Iterator>
+ list(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
+ : Base(b, e, v_traits)
+ {}
+
+ static list &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<list &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const list &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const list &>(Base::container_from_end_iterator(end_iterator)); }
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_LIST_HPP
Added: sandbox/move/boost/intrusive/list_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/list_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,288 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_LIST_HOOK_HPP
+#define BOOST_INTRUSIVE_LIST_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/list_node.hpp>
+#include <boost/intrusive/circular_list_algorithms.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/generic_hook.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+template<class VoidPointer>
+struct get_list_node_algo
+{
+ typedef circular_list_algorithms<list_node_traits<VoidPointer> > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c \c list_base_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_list_base_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_list_node_algo<typename packed_options::void_pointer>
+ , typename packed_options::tag
+ , packed_options::link_mode
+ , detail::ListBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Derive a class from this hook in order to store objects of that class
+//! in an list.
+//!
+//! The hook admits the following options: \c tag<>, \c void_pointer<> and
+//! \c link_mode<>.
+//!
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! unique tag.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class list_base_hook
+ : public make_list_base_hook
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <O1, O2, O3>
+ #else
+ <Options...>
+ #endif
+ ::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ list_base_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ list_base_hook(const list_base_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ list_base_hook& operator=(const list_base_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in an list an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~list_base_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(list_base_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c list::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+//! Helper metafunction to define a \c \c list_member_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_list_member_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_list_node_algo<typename packed_options::void_pointer>
+ , member_tag
+ , packed_options::link_mode
+ , detail::NoBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Store this hook in a class to be inserted
+//! in an list.
+//!
+//! The hook admits the following options: \c void_pointer<> and
+//! \c link_mode<>.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class list_member_hook
+ : public make_list_member_hook
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ <O1, O2, O3>
+ #else
+ <Options...>
+ #endif
+ ::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ list_member_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ list_member_hook(const list_member_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ list_member_hook& operator=(const list_member_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in an list an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~list_member_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(list_member_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c list::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_LIST_HOOK_HPP
Added: sandbox/move/boost/intrusive/member_value_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/member_value_traits.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,65 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_MEMBER_VALUE_TRAITS_HPP
+#define BOOST_INTRUSIVE_MEMBER_VALUE_TRAITS_HPP
+
+#include <boost/intrusive/link_mode.hpp>
+#include <iterator>
+#include <boost/intrusive/detail/parent_from_member.hpp>
+
+namespace boost {
+namespace intrusive {
+
+//!This value traits template is used to create value traits
+//!from user defined node traits where value_traits::value_type will
+//!store a node_traits::node
+template< class T, class NodeTraits
+ , typename NodeTraits::node T::* PtrToMember
+ , link_mode_type LinkMode = safe_link>
+struct member_value_traits
+{
+ public:
+ typedef NodeTraits node_traits;
+ typedef T value_type;
+ typedef typename node_traits::node node;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+ typedef typename boost::pointer_to_other<node_ptr, T>::type pointer;
+ typedef typename boost::pointer_to_other<node_ptr, const T>::type const_pointer;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ static const link_mode_type link_mode = LinkMode;
+
+ static node_ptr to_node_ptr(reference value)
+ { return node_ptr(&(value.*PtrToMember)); }
+
+ static const_node_ptr to_node_ptr(const_reference value)
+ { return node_ptr(&(value.*PtrToMember)); }
+
+ static pointer to_value_ptr(node_ptr n)
+ {
+ return pointer(detail::parent_from_member<value_type, node>
+ (detail::get_pointer(n), PtrToMember));
+ }
+
+ static const_pointer to_value_ptr(const_node_ptr n)
+ {
+ return pointer(detail::parent_from_member<value_type, node>
+ (detail::get_pointer(n), PtrToMember));
+ }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#endif //BOOST_INTRUSIVE_MEMBER_VALUE_TRAITS_HPP
Added: sandbox/move/boost/intrusive/options.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/options.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,794 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_OPTIONS_HPP
+#define BOOST_INTRUSIVE_OPTIONS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/static_assert.hpp>
+
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+struct default_tag;
+struct member_tag;
+
+namespace detail{
+
+struct default_hook_tag{};
+
+#define BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER) \
+struct BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER : public default_hook_tag\
+{\
+ template <class T>\
+ struct apply\
+ { typedef typename T::BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER type; };\
+}\
+
+BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_list_hook);
+BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_slist_hook);
+BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_set_hook);
+BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_uset_hook);
+BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_avl_set_hook);
+BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_splay_set_hook);
+BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION(default_bs_set_hook);
+
+#undef BOOST_INTRUSIVE_DEFAULT_HOOK_MARKER_DEFINITION
+
+template <class ValueTraits>
+struct eval_value_traits
+{
+ typedef typename ValueTraits::value_traits type;
+};
+
+template <class T>
+struct external_bucket_traits_is_true
+{
+ static const bool value = external_bucket_traits_bool<T>::value == 3;
+};
+
+template <class BucketTraits>
+struct eval_bucket_traits
+{
+ typedef typename BucketTraits::bucket_traits type;
+};
+
+template <class T, class BaseHook>
+struct concrete_hook_base_value_traits
+{
+ typedef typename BaseHook::boost_intrusive_tags tags;
+ typedef detail::base_hook_traits
+ < T
+ , typename tags::node_traits
+ , tags::link_mode
+ , typename tags::tag
+ , tags::hook_type> type;
+};
+
+template <class BaseHook>
+struct concrete_hook_base_node_traits
+{ typedef typename BaseHook::boost_intrusive_tags::node_traits type; };
+
+template <class T, class BaseHook>
+struct any_hook_base_value_traits
+{
+ typedef typename BaseHook::boost_intrusive_tags tags;
+ typedef detail::base_hook_traits
+ < T
+ , typename BaseHook::node_traits
+ , tags::link_mode
+ , typename tags::tag
+ , tags::hook_type> type;
+};
+
+template <class BaseHook>
+struct any_hook_base_node_traits
+{ typedef typename BaseHook::node_traits type; };
+
+template<class T, class BaseHook>
+struct get_base_value_traits
+{
+ typedef typename detail::eval_if_c
+ < internal_any_hook_bool_is_true<BaseHook>::value
+ , any_hook_base_value_traits<T, BaseHook>
+ , concrete_hook_base_value_traits<T, BaseHook>
+ >::type type;
+};
+
+template<class BaseHook>
+struct get_base_node_traits
+{
+ typedef typename detail::eval_if_c
+ < internal_any_hook_bool_is_true<BaseHook>::value
+ , any_hook_base_node_traits<BaseHook>
+ , concrete_hook_base_node_traits<BaseHook>
+ >::type type;
+};
+
+template<class T, class MemberHook>
+struct get_member_value_traits
+{
+ typedef typename MemberHook::member_value_traits type;
+};
+
+template<class MemberHook>
+struct get_member_node_traits
+{
+ typedef typename MemberHook::member_value_traits::node_traits type;
+};
+
+template<class T, class SupposedValueTraits>
+struct get_value_traits
+{
+ typedef typename detail::eval_if_c
+ <detail::is_convertible<SupposedValueTraits*, detail::default_hook_tag*>::value
+ ,detail::apply<SupposedValueTraits, T>
+ ,detail::identity<SupposedValueTraits>
+ >::type supposed_value_traits;
+ //...if it's a default hook
+ typedef typename detail::eval_if_c
+ < internal_base_hook_bool_is_true<supposed_value_traits>::value
+ //...get it's internal value traits using
+ //the provided T value type.
+ , get_base_value_traits<T, supposed_value_traits>
+ //...else use it's internal value traits tag
+ //(member hooks and custom value traits are in this group)
+ , detail::eval_if_c
+ < internal_member_value_traits<supposed_value_traits>::value
+ , get_member_value_traits<T, supposed_value_traits>
+ , detail::identity<supposed_value_traits>
+ >
+ >::type type;
+};
+
+template<class ValueTraits>
+struct get_explicit_node_traits
+{
+ typedef typename ValueTraits::node_traits type;
+};
+
+template<class SupposedValueTraits>
+struct get_node_traits
+{
+ typedef SupposedValueTraits supposed_value_traits;
+ //...if it's a base hook
+ typedef typename detail::eval_if_c
+ < internal_base_hook_bool_is_true<supposed_value_traits>::value
+ //...get it's internal value traits using
+ //the provided T value type.
+ , get_base_node_traits<supposed_value_traits>
+ //...else use it's internal value traits tag
+ //(member hooks and custom value traits are in this group)
+ , detail::eval_if_c
+ < internal_member_value_traits<supposed_value_traits>::value
+ , get_member_node_traits<supposed_value_traits>
+ , get_explicit_node_traits<supposed_value_traits>
+ >
+ >::type type;
+};
+
+} //namespace detail{
+
+
+//!This type indicates that no option is being used
+//!and that the default options should be used
+struct none
+{
+ template<class Base>
+ struct pack : Base
+ { };
+};
+
+/// @endcond
+
+//!This option setter specifies if the intrusive
+//!container stores its size as a member to
+//!obtain constant-time size() member.
+template<bool Enabled>
+struct constant_time_size
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool constant_time_size = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the type that
+//!the container will use to store its size.
+template<class SizeType>
+struct size_type
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef SizeType size_type;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the strict weak ordering
+//!comparison functor for the value type
+template<class Compare>
+struct compare
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef Compare compare;
+ };
+/// @endcond
+};
+
+//!This option setter for scapegoat containers specifies if
+//!the intrusive scapegoat container should use a non-variable
+//!alpha value that does not need floating-point operations.
+//!
+//!If activated, the fixed alpha value is 1/sqrt(2). This
+//!option also saves some space in the container since
+//!the alpha value and some additional data does not need
+//!to be stored in the container.
+//!
+//!If the user only needs an alpha value near 1/sqrt(2), this
+//!option also improves performance since avoids logarithm
+//!and division operations when rebalancing the tree.
+template<bool Enabled>
+struct floating_point
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool floating_point = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the equality
+//!functor for the value type
+template<class Equal>
+struct equal
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef Equal equal;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the equality
+//!functor for the value type
+template<class Priority>
+struct priority
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef Priority priority;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the hash
+//!functor for the value type
+template<class Hash>
+struct hash
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef Hash hash;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the relationship between the type
+//!to be managed by the container (the value type) and the node to be
+//!used in the node algorithms. It also specifies the linking policy.
+template<typename ValueTraits>
+struct value_traits
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef ValueTraits value_traits;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the member hook the
+//!container must use.
+template< typename Parent
+ , typename MemberHook
+ , MemberHook Parent::* PtrToMember>
+struct member_hook
+{
+/// @cond
+ typedef detail::member_hook_traits
+ < Parent
+ , MemberHook
+ , PtrToMember
+ > member_value_traits;
+ template<class Base>
+ struct pack : Base
+ {
+ typedef member_value_traits value_traits;
+ };
+/// @endcond
+};
+
+
+//!This option setter specifies that the container
+//!must use the specified base hook
+template<typename BaseHook>
+struct base_hook
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef BaseHook value_traits;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the type of
+//!a void pointer. This will instruct the hook
+//!to use this type of pointer instead of the
+//!default one
+template<class VoidPointer>
+struct void_pointer
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef VoidPointer void_pointer;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the type of
+//!the tag of a base hook. A type cannot have two
+//!base hooks of the same type, so a tag can be used
+//!to differentiate two base hooks with otherwise same type
+template<class Tag>
+struct tag
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef Tag tag;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the link mode
+//!(normal_link, safe_link or auto_unlink)
+template<link_mode_type LinkType>
+struct link_mode
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const link_mode_type link_mode = LinkType;
+ };
+/// @endcond
+};
+
+//!This option setter specifies if the hook
+//!should be optimized for size instead of for speed.
+template<bool Enabled>
+struct optimize_size
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool optimize_size = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies if the list container should
+//!use a linear implementation instead of a circular one.
+template<bool Enabled>
+struct linear
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool linear = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies if the list container should
+//!use a linear implementation instead of a circular one.
+template<bool Enabled>
+struct cache_last
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool cache_last = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies the bucket traits
+//!class for unordered associative containers. When this option is specified,
+//!instead of using the default bucket traits, a user defined holder will be defined
+template<class BucketTraits>
+struct bucket_traits
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ typedef BucketTraits bucket_traits;
+ };
+/// @endcond
+};
+
+//!This option setter specifies if the unordered hook
+//!should offer room to store the hash value.
+//!Storing the hash in the hook will speed up rehashing
+//!processes in applications where rehashing is frequent,
+//!rehashing might throw or the value is heavy to hash.
+template<bool Enabled>
+struct store_hash
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool store_hash = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies if the unordered hook
+//!should offer room to store another link to another node
+//!with the same key.
+//!Storing this link will speed up lookups and insertions on
+//!unordered_multiset containers with a great number of elements
+//!with the same key.
+template<bool Enabled>
+struct optimize_multikey
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool optimize_multikey = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies if the bucket array will be always power of two.
+//!This allows using masks instead of the default modulo operation to determine
+//!the bucket number from the hash value, leading to better performance.
+//!In debug mode, if power of two buckets mode is activated, the bucket length
+//!will be checked to through assertions to assure the bucket length is power of two.
+template<bool Enabled>
+struct power_2_buckets
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool power_2_buckets = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies if the container will cache a pointer to the first
+//!non-empty bucket so that begin() is always constant-time.
+//!This is specially helpful when we can have containers with a few elements
+//!but with big bucket arrays (that is, hashtables with low load factors).
+template<bool Enabled>
+struct cache_begin
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool cache_begin = Enabled;
+ };
+/// @endcond
+};
+
+
+//!This option setter specifies if the container will compare the hash value
+//!before comparing objects. This option can't be specified if store_hash<>
+//!is not true.
+//!This is specially helpful when we have containers with a high load factor.
+//!and the comparison function is much more expensive that comparing already
+//!stored hash values.
+template<bool Enabled>
+struct compare_hash
+{
+/// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool compare_hash = Enabled;
+ };
+/// @endcond
+};
+
+//!This option setter specifies if the hash container will use incremental
+//!hashing. With incremental hashing the cost of hash table expansion is spread
+//!out across each hash table insertion operation, as opposed to be incurred all at once.
+//!Therefore linear hashing is well suited for interactive applications or real-time
+//!appplications where the worst-case insertion time of non-incremental hash containers
+//!(rehashing the whole bucket array) is not admisible.
+template<bool Enabled>
+struct incremental
+{
+ /// @cond
+ template<class Base>
+ struct pack : Base
+ {
+ static const bool incremental = Enabled;
+ };
+ /// @endcond
+};
+
+/// @cond
+
+//To-do: pass to variadic templates
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+
+template<class Prev, class Next>
+struct do_pack
+{
+ //Use "pack" member template to pack options
+ typedef typename Next::template pack<Prev> type;
+};
+
+template<class Prev>
+struct do_pack<Prev, none>
+{
+ //Avoid packing "none" to shorten template names
+ typedef Prev type;
+};
+
+template
+ < class DefaultOptions
+ , class O1 = none
+ , class O2 = none
+ , class O3 = none
+ , class O4 = none
+ , class O5 = none
+ , class O6 = none
+ , class O7 = none
+ , class O8 = none
+ , class O9 = none
+ , class O10 = none
+ , class O11 = none
+ >
+struct pack_options
+{
+ // join options
+ typedef
+ typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < typename do_pack
+ < DefaultOptions
+ , O1
+ >::type
+ , O2
+ >::type
+ , O3
+ >::type
+ , O4
+ >::type
+ , O5
+ >::type
+ , O6
+ >::type
+ , O7
+ >::type
+ , O8
+ >::type
+ , O9
+ >::type
+ , O10
+ >::type
+ , O11
+ >::type
+ type;
+};
+#else
+
+//index_tuple
+template<int... Indexes>
+struct index_tuple{};
+
+//build_number_seq
+template<std::size_t Num, typename Tuple = index_tuple<> >
+struct build_number_seq;
+
+template<std::size_t Num, int... Indexes>
+struct build_number_seq<Num, index_tuple<Indexes...> >
+ : build_number_seq<Num - 1, index_tuple<Indexes..., sizeof...(Indexes)> >
+{};
+
+template<int... Indexes>
+struct build_number_seq<0, index_tuple<Indexes...> >
+{ typedef index_tuple<Indexes...> type; };
+
+template<class ...Types>
+struct typelist
+{};
+
+//invert_typelist
+template<class T>
+struct invert_typelist;
+
+template<int I, typename Tuple>
+struct typelist_element;
+
+template<int I, typename Head, typename... Tail>
+struct typelist_element<I, typelist<Head, Tail...> >
+{
+ typedef typename typelist_element<I-1, typelist<Tail...> >::type type;
+};
+
+template<typename Head, typename... Tail>
+struct typelist_element<0, typelist<Head, Tail...> >
+{
+ typedef Head type;
+};
+
+template<int ...Ints, class ...Types>
+typelist<typename typelist_element<(sizeof...(Types) - 1) - Ints, typelist<Types...> >::type...>
+ inverted_typelist(index_tuple<Ints...>, typelist<Types...>)
+{
+ return typelist<typename typelist_element<(sizeof...(Types) - 1) - Ints, typelist<Types...> >::type...>();
+}
+
+//sizeof_typelist
+template<class Typelist>
+struct sizeof_typelist;
+
+template<class ...Types>
+struct sizeof_typelist< typelist<Types...> >
+{
+ static const std::size_t value = sizeof...(Types);
+};
+
+//invert_typelist_impl
+template<class Typelist, class Indexes>
+struct invert_typelist_impl;
+
+
+template<class Typelist, int ...Ints>
+struct invert_typelist_impl< Typelist, index_tuple<Ints...> >
+{
+ static const std::size_t last_idx = sizeof_typelist<Typelist>::value - 1;
+ typedef typelist
+ <typename typelist_element<last_idx - Ints, Typelist>::type...> type;
+};
+
+template<class Typelist, int Int>
+struct invert_typelist_impl< Typelist, index_tuple<Int> >
+{
+ typedef Typelist type;
+};
+
+template<class Typelist>
+struct invert_typelist_impl< Typelist, index_tuple<> >
+{
+ typedef Typelist type;
+};
+
+//invert_typelist
+template<class Typelist>
+struct invert_typelist;
+
+template<class ...Types>
+struct invert_typelist< typelist<Types...> >
+{
+ typedef typelist<Types...> typelist_t;
+ typedef typename build_number_seq<sizeof...(Types)>::type indexes_t;
+ typedef typename invert_typelist_impl<typelist_t, indexes_t>::type type;
+};
+
+//Do pack
+template<class Typelist>
+struct do_pack;
+
+template<>
+struct do_pack<typelist<> >;
+
+template<class Prev>
+struct do_pack<typelist<Prev> >
+{
+ typedef Prev type;
+};
+
+template<class Prev, class Last>
+struct do_pack<typelist<Prev, Last> >
+{
+ typedef typename Prev::template pack<Last> type;
+};
+
+template<class Prev, class ...Others>
+struct do_pack<typelist<Prev, Others...> >
+{
+ typedef typename Prev::template pack
+ <typename do_pack<typelist<Others...>>::type> type;
+};
+
+
+template<class ...Options>
+struct pack_options
+{
+ typedef typelist<Options...> typelist_t;
+ typedef typename invert_typelist<typelist_t>::type inverted_typelist;
+ typedef typename do_pack<inverted_typelist>::type type;
+};
+
+#endif
+
+struct hook_defaults
+ : public pack_options
+ < none
+ , void_pointer<void*>
+ , link_mode<safe_link>
+ , tag<default_tag>
+ , optimize_size<false>
+ , store_hash<false>
+ , linear<false>
+ , optimize_multikey<false>
+ >::type
+{};
+
+/// @endcond
+
+} //namespace intrusive {
+} //namespace boost {
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_INTRUSIVE_OPTIONS_HPP
Added: sandbox/move/boost/intrusive/pointer_plus_bits.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/pointer_plus_bits.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,82 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_POINTER_PLUS_BITS_HPP
+#define BOOST_INTRUSIVE_POINTER_PLUS_BITS_HPP
+
+#include <boost/intrusive/detail/mpl.hpp> //ls_zeros
+#include <boost/intrusive/detail/assert.hpp> //BOOST_INTRUSIVE_INVARIANT_ASSERT
+
+namespace boost {
+namespace intrusive {
+
+//!This trait class is used to know if a pointer
+//!can embed extra bits of information if
+//!it's going to be used to point to objects
+//!with an alignment of "Alignment" bytes.
+template<class VoidPointer, std::size_t Alignment>
+struct max_pointer_plus_bits
+{
+ static const std::size_t value = 0;
+};
+
+//!This is a specialization for raw pointers.
+//!Raw pointers can embed extra bits in the lower bits
+//!if the alignment is multiple of 2pow(NumBits).
+template<std::size_t Alignment>
+struct max_pointer_plus_bits<void*, Alignment>
+{
+ static const std::size_t value = detail::ls_zeros<Alignment>::value;
+};
+
+//!This is class that is supposed to have static methods
+//!to embed extra bits of information in a pointer.
+//!This is a declaration and there is no default implementation,
+//!because operations to embed the bits change with every pointer type.
+//!
+//!An implementation that detects that a pointer type whose
+//!has_pointer_plus_bits<>::value is non-zero can make use of these
+//!operations to embed the bits in the pointer.
+template<class Pointer, std::size_t NumBits>
+struct pointer_plus_bits;
+
+//!This is the specialization to embed extra bits of information
+//!in a raw pointer. The extra bits are stored in the lower bits of the pointer.
+template<class T, std::size_t NumBits>
+struct pointer_plus_bits<T*, NumBits>
+{
+ static const std::size_t Mask = ((std::size_t(1u) << NumBits) - 1);
+ typedef T* pointer;
+
+ static pointer get_pointer(pointer n)
+ { return pointer(std::size_t(n) & ~Mask); }
+
+ static void set_pointer(pointer &n, pointer p)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(0 == (std::size_t(p) & Mask));
+ n = pointer(std::size_t(p) | (std::size_t(n) & Mask));
+ }
+
+ static std::size_t get_bits(pointer n)
+ { return (std::size_t(n) & Mask); }
+
+ static void set_bits(pointer &n, std::size_t c)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(c <= Mask);
+ n = pointer(std::size_t(get_pointer(n)) | c);
+ }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#endif //BOOST_INTRUSIVE_POINTER_PLUS_BITS_HPP
Added: sandbox/move/boost/intrusive/priority_compare.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/priority_compare.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,39 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2008
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
+#define BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+
+#include <functional>
+
+namespace boost {
+namespace intrusive {
+
+template <class T>
+struct priority_compare
+ : public std::binary_function<T, T, bool>
+{
+ bool operator()(const T &val, const T &val2) const
+ {
+ return priority_order(val, val2);
+ }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_PRIORITY_COMPARE_HPP
Added: sandbox/move/boost/intrusive/rbtree.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/rbtree.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,1643 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_RBTREE_HPP
+#define BOOST_INTRUSIVE_RBTREE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <algorithm>
+#include <cstddef>
+#include <functional>
+#include <iterator>
+#include <utility>
+
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/set_hook.hpp>
+#include <boost/intrusive/detail/rbtree_node.hpp>
+#include <boost/intrusive/detail/tree_node.hpp>
+#include <boost/intrusive/detail/ebo_functor_holder.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/clear_on_destructor_base.hpp>
+#include <boost/intrusive/detail/function_detector.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/rbtree_algorithms.hpp>
+#include <boost/intrusive/link_mode.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+template <class ValueTraits, class Compare, class SizeType, bool ConstantTimeSize>
+struct setopt
+{
+ typedef ValueTraits value_traits;
+ typedef Compare compare;
+ typedef SizeType size_type;
+ static const bool constant_time_size = ConstantTimeSize;
+};
+
+template <class T>
+struct set_defaults
+ : pack_options
+ < none
+ , base_hook<detail::default_set_hook>
+ , constant_time_size<true>
+ , size_type<std::size_t>
+ , compare<std::less<T> >
+ >::type
+{};
+
+/// @endcond
+
+//! The class template rbtree is an intrusive red-black tree container, that
+//! is used to construct intrusive set and multiset containers. The no-throw
+//! guarantee holds only, if the value_compare object
+//! doesn't throw.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class rbtree_impl
+ : private detail::clear_on_destructor_base<rbtree_impl<Config> >
+{
+ template<class C> friend class detail::clear_on_destructor_base;
+ public:
+ typedef typename Config::value_traits value_traits;
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ /// @endcond
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::const_pointer const_pointer;
+ typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef value_type key_type;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ typedef typename std::iterator_traits<pointer>::difference_type difference_type;
+ typedef typename Config::size_type size_type;
+ typedef typename Config::compare value_compare;
+ typedef value_compare key_compare;
+ typedef tree_iterator<rbtree_impl, false> iterator;
+ typedef tree_iterator<rbtree_impl, true> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename boost::pointer_to_other
+ <pointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, const node>::type const_node_ptr;
+ typedef rbtree_algorithms<node_traits> node_algorithms;
+
+ static const bool constant_time_size = Config::constant_time_size;
+ static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+ /// @cond
+ private:
+ typedef detail::size_holder<constant_time_size, size_type> size_traits;
+
+ //noncopyable
+ rbtree_impl (const rbtree_impl&);
+ rbtree_impl operator =(const rbtree_impl&);
+
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ //Constant-time size is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(constant_time_size && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+
+ struct header_plus_size : public size_traits
+ { node header_; };
+
+ struct node_plus_pred_t : public detail::ebo_functor_holder<value_compare>
+ {
+ node_plus_pred_t(const value_compare &comp)
+ : detail::ebo_functor_holder<value_compare>(comp)
+ {}
+ header_plus_size header_plus_size_;
+ };
+
+ struct data_t : public rbtree_impl::value_traits
+ {
+ typedef typename rbtree_impl::value_traits value_traits;
+ data_t(const value_compare & comp, const value_traits &val_traits)
+ : value_traits(val_traits), node_plus_pred_(comp)
+ {}
+ node_plus_pred_t node_plus_pred_;
+ } data_;
+
+ const value_compare &priv_comp() const
+ { return data_.node_plus_pred_.get(); }
+
+ value_compare &priv_comp()
+ { return data_.node_plus_pred_.get(); }
+
+ const node &priv_header() const
+ { return data_.node_plus_pred_.header_plus_size_.header_; }
+
+ node &priv_header()
+ { return data_.node_plus_pred_.header_plus_size_.header_; }
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
+ }
+
+ size_traits &priv_size_traits()
+ { return data_.node_plus_pred_.header_plus_size_; }
+
+ const size_traits &priv_size_traits() const
+ { return data_.node_plus_pred_.header_plus_size_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<false>) const
+ { return data_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<true>) const
+ { return data_.get_value_traits(*this); }
+
+ real_value_traits &get_real_value_traits(detail::bool_<false>)
+ { return data_; }
+
+ real_value_traits &get_real_value_traits(detail::bool_<true>)
+ { return data_.get_value_traits(*this); }
+
+ /// @endcond
+
+ public:
+
+ const real_value_traits &get_real_value_traits() const
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ real_value_traits &get_real_value_traits()
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ typedef typename node_algorithms::insert_commit_data insert_commit_data;
+
+ //! <b>Effects</b>: Constructs an empty tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructorof the value_compare object throws. Basic guarantee.
+ rbtree_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty tree and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is the distance between first and last.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws. Basic guarantee.
+ template<class Iterator>
+ rbtree_impl( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ if(unique)
+ this->insert_unique(b, e);
+ else
+ this->insert_equal(b, e);
+ }
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~rbtree_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return iterator (node_traits::get_left(node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return const_iterator (node_traits::get_left(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return iterator (node_ptr(&priv_header()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return cend(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return const_iterator (uncast(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return const_reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return const_reverse_iterator(begin()); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the rbtree associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static rbtree_impl &container_from_end_iterator(iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the rbtree associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const rbtree_impl &container_from_end_iterator(const_iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: it must be a valid iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static rbtree_impl &container_from_iterator(iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Precondition</b>: it must be a valid end const_iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the tree associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const rbtree_impl &container_from_iterator(const_iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return priv_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return node_algorithms::unique(const_node_ptr(&priv_header())); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the tree.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this
+ //! if constant-time size option is disabled. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ {
+ if(constant_time_size)
+ return this->priv_size_traits().get_size();
+ else{
+ return (size_type)node_algorithms::size(const_node_ptr(&priv_header()));
+ }
+ }
+
+ //! <b>Effects</b>: Swaps the contents of two rbtrees.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the comparison functor's swap call throws.
+ void swap(rbtree_impl& other)
+ {
+ //This can throw
+ using std::swap;
+ swap(priv_comp(), priv_comp());
+ //These can't throw
+ node_algorithms::swap_tree(node_ptr(&priv_header()), node_ptr(&other.priv_header()));
+ if(constant_time_size){
+ size_type backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(other.priv_size_traits().get_size());
+ other.priv_size_traits().set_size(backup);
+ }
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the tree before the upper bound.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, rbtree_impl>
+ key_node_comp(priv_comp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_equal_upper_bound
+ (node_ptr(&priv_header()), to_insert, key_node_comp), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case)
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(const_iterator hint, reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, rbtree_impl>
+ key_node_comp(priv_comp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_equal
+ (node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp), this);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a each element of a range into the tree
+ //! before the upper bound of the key of each element.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_equal(Iterator b, Iterator e)
+ {
+ iterator iend(this->end());
+ for (; b != e; ++b)
+ this->insert_equal(iend, *b);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the tree if the value
+ //! is not already present.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert_unique(reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(value, priv_comp(), commit_data);
+ if(!ret.second)
+ return ret;
+ return std::pair<iterator, bool> (insert_unique_commit(value, commit_data), true);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator
+ //!
+ //! <b>Effects</b>: Tries to insert x into the tree, using "hint" as a hint
+ //! to where it will be inserted.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time (two comparisons in the worst case)
+ //! if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_unique(const_iterator hint, reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(hint, value, priv_comp(), commit_data);
+ if(!ret.second)
+ return ret.first;
+ return insert_unique_commit(value, commit_data);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Tries to insert each element of a range into the tree.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_unique(Iterator b, Iterator e)
+ {
+ if(this->empty()){
+ iterator iend(this->end());
+ for (; b != e; ++b)
+ this->insert_unique(iend, *b);
+ }
+ else{
+ for (; b != e; ++b)
+ this->insert_unique(*b);
+ }
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_unique_check
+ (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ comp(key_value_comp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), key, comp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_unique_check
+ (const_iterator hint, const KeyType &key
+ ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ comp(key_value_comp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), hint.pointed_node(), key, comp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the container between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_unique_commit(reference value, const insert_commit_data &commit_data)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ node_algorithms::insert_unique_commit
+ (node_ptr(&priv_header()), to_insert, commit_data);
+ return iterator(to_insert, this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" tree ordering invariant will be broken.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_before
+ (node_ptr(&priv_header()), pos.pointed_node(), to_insert), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no less
+ //! than the greatest inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ node_algorithms::push_back(node_ptr(&priv_header()), to_insert);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no greater
+ //! than the minimum inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than the minimum inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ node_algorithms::push_front(node_ptr(&priv_header()), to_insert);
+ }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ {
+ const_iterator ret(i);
+ ++ret;
+ node_ptr to_erase(i.pointed_node());
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!node_algorithms::unique(to_erase));
+ node_algorithms::erase(&priv_header(), to_erase);
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ return ret.unconst();
+ }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { size_type n; return private_erase(b, e, n); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return this->erase(value, priv_comp()); }
+
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ {
+ node_ptr to_erase(i.pointed_node());
+ iterator ret(this->erase(i));
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ return ret;
+ }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ {
+ std::pair<iterator,iterator> p = this->equal_range(value);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { size_type n; return private_erase(b, e, n, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ {
+ if(safemode_or_autounlink){
+ this->clear_and_dispose(detail::null_disposer());
+ }
+ else{
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(0);
+ }
+ }
+
+ //! <b>Effects</b>: Erases all of the elements calling disposer(p) for
+ //! each node to be erased.
+ //! <b>Complexity</b>: Average complexity for is at most O(log(size() + N)),
+ //! where N is the number of elements in the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. Calls N times to disposer functor.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ {
+ node_algorithms::clear_and_dispose(node_ptr(&priv_header())
+ , detail::node_disposer<Disposer, rbtree_impl>(disposer, this));
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(0);
+ }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given value
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given value.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type count(const_reference value) const
+ { return this->count(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType &key, KeyValueCompare comp) const
+ {
+ std::pair<const_iterator, const_iterator> ret = this->equal_range(key, comp);
+ return std::distance(ret.first, ret.second);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator lower_bound(const_reference value)
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator lower_bound(const_reference value) const
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator upper_bound(const_reference value)
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator upper_bound(const_reference value) const
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator find(const_reference value)
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ return iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator find(const_reference value) const
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ return const_iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, rbtree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const rbtree_impl &src, Cloner cloner, Disposer disposer)
+ {
+ this->clear_and_dispose(disposer);
+ if(!src.empty()){
+ detail::exception_disposer<rbtree_impl, Disposer>
+ rollback(*this, disposer);
+ node_algorithms::clone
+ (const_node_ptr(&src.priv_header())
+ ,node_ptr(&this->priv_header())
+ ,detail::node_cloner<Cloner, rbtree_impl>(cloner, this)
+ ,detail::node_disposer<Disposer, rbtree_impl>(disposer, this));
+ this->priv_size_traits().set_size(src.priv_size_traits().get_size());
+ this->priv_comp() = src.priv_comp();
+ rollback.release();
+ }
+ }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ {
+ node_ptr to_be_disposed(node_algorithms::unlink_leftmost_without_rebalance
+ (node_ptr(&priv_header())));
+ if(!to_be_disposed)
+ return 0;
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)//If this is commented does not work with normal_link
+ node_algorithms::init(to_be_disposed);
+ return get_real_value_traits().to_value_ptr(to_be_disposed);
+ }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ {
+ node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
+ , node_ptr(&priv_header())
+ , get_real_value_traits().to_node_ptr(with_this));
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return iterator (value_traits::to_node_ptr(value), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return iterator (value_traits::to_node_ptr(value), this); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
+
+ //! <b>Requires</b>: value shall not be in a tree.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { node_algorithms::init(value_traits::to_node_ptr(value)); }
+
+ //! <b>Effects</b>: removes "value" from the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic time.
+ //!
+ //! <b>Note</b>: This static function is only usable with non-constant
+ //! time size containers that have stateless comparison functors.
+ //!
+ //! If the user calls
+ //! this function with a constant time size container or stateful comparison
+ //! functor a compilation error will be issued.
+ static void remove_node(reference value)
+ {
+ BOOST_STATIC_ASSERT((!constant_time_size));
+ node_ptr to_remove(value_traits::to_node_ptr(value));
+ node_algorithms::unlink(to_remove);
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_remove);
+ }
+
+ /// @cond
+ private:
+ template<class Disposer>
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n, Disposer disposer)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase_and_dispose(b++, disposer);
+ return b.unconst();
+ }
+
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase(b++);
+ return b.unconst();
+ }
+ /// @endcond
+
+ private:
+ static rbtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
+ {
+ header_plus_size *r = detail::parent_from_member<header_plus_size, node>
+ ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
+ node_plus_pred_t *n = detail::parent_from_member
+ <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
+ data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
+ rbtree_impl *rb = detail::parent_from_member<rbtree_impl, data_t>(d, &rbtree_impl::data_);
+ return *rb;
+ }
+
+ static rbtree_impl &priv_container_from_iterator(const const_iterator &it)
+ { return priv_container_from_end_iterator(it.end_iterator_from_it()); }
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const rbtree_impl<T, Options...> &x, const rbtree_impl<T, Options...> &y)
+#else
+(const rbtree_impl<Config> &x, const rbtree_impl<Config> &y)
+#endif
+{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+bool operator==
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const rbtree_impl<T, Options...> &x, const rbtree_impl<T, Options...> &y)
+#else
+(const rbtree_impl<Config> &x, const rbtree_impl<Config> &y)
+#endif
+{
+ typedef rbtree_impl<Config> tree_type;
+ typedef typename tree_type::const_iterator const_iterator;
+
+ if(tree_type::constant_time_size && x.size() != y.size()){
+ return false;
+ }
+ const_iterator end1 = x.end();
+ const_iterator i1 = x.begin();
+ const_iterator i2 = y.begin();
+ if(tree_type::constant_time_size){
+ while (i1 != end1 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1;
+ }
+ else{
+ const_iterator end2 = y.end();
+ while (i1 != end1 && i2 != end2 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1 && i2 == end2;
+ }
+}
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const rbtree_impl<T, Options...> &x, const rbtree_impl<T, Options...> &y)
+#else
+(const rbtree_impl<Config> &x, const rbtree_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const rbtree_impl<T, Options...> &x, const rbtree_impl<T, Options...> &y)
+#else
+(const rbtree_impl<Config> &x, const rbtree_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const rbtree_impl<T, Options...> &x, const rbtree_impl<T, Options...> &y)
+#else
+(const rbtree_impl<Config> &x, const rbtree_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const rbtree_impl<T, Options...> &x, const rbtree_impl<T, Options...> &y)
+#else
+(const rbtree_impl<Config> &x, const rbtree_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(rbtree_impl<T, Options...> &x, rbtree_impl<T, Options...> &y)
+#else
+(rbtree_impl<Config> &x, rbtree_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+/// @cond
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+struct make_rbtree_opt
+{
+ typedef typename pack_options
+ < set_defaults<T>,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+ typedef typename detail::get_value_traits
+ <T, typename packed_options::value_traits>::type value_traits;
+
+ typedef setopt
+ < value_traits
+ , typename packed_options::compare
+ , typename packed_options::size_type
+ , packed_options::constant_time_size
+ > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c rbtree that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_rbtree
+{
+ /// @cond
+ typedef rbtree_impl
+ < typename make_rbtree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class rbtree
+ : public make_rbtree<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_rbtree
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::real_value_traits real_value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
+
+ rbtree( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ rbtree( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(unique, b, e, cmp, v_traits)
+ {}
+
+ static rbtree &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<rbtree &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const rbtree &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const rbtree &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static rbtree &container_from_it(iterator it)
+ { return static_cast<rbtree &>(Base::container_from_iterator(it)); }
+
+ static const rbtree &container_from_it(const_iterator it)
+ { return static_cast<const rbtree &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_RBTREE_HPP
Added: sandbox/move/boost/intrusive/rbtree_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/rbtree_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,910 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+// The internal implementation of red-black trees is based on that of SGI STL
+// stl_tree.h file:
+//
+// Copyright (c) 1996,1997
+// Silicon Graphics Computer Systems, Inc.
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation. Silicon Graphics makes no
+// representations about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied warranty.
+//
+//
+// Copyright (c) 1994
+// Hewlett-Packard Company
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation. Hewlett-Packard Company makes no
+// representations about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied warranty.
+//
+// The tree destruction algorithm is based on Julienne Walker and The EC Team code:
+//
+// This code is in the public domain. Anyone may use it or change it in any way that
+// they see fit. The author assumes no responsibility for damages incurred through
+// use of the original code or any variations thereof.
+//
+// It is requested, but not required, that due credit is given to the original author
+// and anyone who has modified the code through a header comment, such as this one.
+
+#ifndef BOOST_INTRUSIVE_RBTREE_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_RBTREE_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+
+#include <cstddef>
+#include <boost/intrusive/intrusive_fwd.hpp>
+
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/tree_algorithms.hpp>
+
+
+namespace boost {
+namespace intrusive {
+
+//! rbtree_algorithms provides basic algorithms to manipulate
+//! nodes forming a red-black tree. The insertion and deletion algorithms are
+//! based on those in Cormen, Leiserson, and Rivest, Introduction to Algorithms
+//! (MIT Press, 1990), except that
+//!
+//! (1) the header node is maintained with links not only to the root
+//! but also to the leftmost node of the tree, to enable constant time
+//! begin(), and to the rightmost node of the tree, to enable linear time
+//! performance when used with the generic set algorithms (set_union,
+//! etc.);
+//!
+//! (2) when a node being deleted has two children its successor node is
+//! relinked into its place, rather than copied, so that the only
+//! pointers invalidated are those referring to the deleted node.
+//!
+//! rbtree_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the circular list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <tt>color</tt>: The type that can store the color of a node
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
+//!
+//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
+//!
+//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
+//!
+//! <tt>static color get_color(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_color(node_ptr n, color c);</tt>
+//!
+//! <tt>static color black();</tt>
+//!
+//! <tt>static color red();</tt>
+template<class NodeTraits>
+class rbtree_algorithms
+{
+ public:
+ typedef NodeTraits node_traits;
+ typedef typename NodeTraits::node node;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+ typedef typename NodeTraits::color color;
+
+ /// @cond
+ private:
+
+ typedef detail::tree_algorithms<NodeTraits> tree_algorithms;
+
+ template<class F>
+ struct rbtree_node_cloner
+ : private detail::ebo_functor_holder<F>
+ {
+ typedef detail::ebo_functor_holder<F> base_t;
+
+ rbtree_node_cloner(F f)
+ : base_t(f)
+ {}
+
+ node_ptr operator()(node_ptr p)
+ {
+ node_ptr n = base_t::get()(p);
+ NodeTraits::set_color(n, NodeTraits::get_color(p));
+ return n;
+ }
+ };
+
+ struct rbtree_erase_fixup
+ {
+ void operator()(node_ptr to_erase, node_ptr successor)
+ {
+ //Swap color of y and z
+ color tmp(NodeTraits::get_color(successor));
+ NodeTraits::set_color(successor, NodeTraits::get_color(to_erase));
+ NodeTraits::set_color(to_erase, tmp);
+ }
+ };
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ }
+ /// @endcond
+
+ public:
+ static node_ptr begin_node(const_node_ptr header)
+ { return tree_algorithms::begin_node(header); }
+
+ static node_ptr end_node(const_node_ptr header)
+ { return tree_algorithms::end_node(header); }
+
+ //! This type is the information that will be
+ //! filled by insert_unique_check
+ typedef typename tree_algorithms::insert_commit_data insert_commit_data;
+
+ //! <b>Requires</b>: header1 and header2 must be the header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //! links to the second tree and header2 will have links to the first tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void swap_tree(node_ptr header1, node_ptr header2)
+ { return tree_algorithms::swap_tree(header1, header2); }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr node2)
+ {
+ if(node1 == node2)
+ return;
+
+ node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
+ swap_nodes(node1, header1, node2, header2);
+ }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees with header header1 and header2.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
+ {
+ if(node1 == node2) return;
+
+ tree_algorithms::swap_nodes(node1, header1, node2, header2);
+ //Swap color
+ color c = NodeTraits::get_color(node1);
+ NodeTraits::set_color(node1, NodeTraits::get_color(node2));
+ NodeTraits::set_color(node2, c);
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing and comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
+ {
+ if(node_to_be_replaced == new_node)
+ return;
+ replace_node(node_to_be_replaced, tree_algorithms::get_header(node_to_be_replaced), new_node);
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! with header "header" and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
+ {
+ tree_algorithms::replace_node(node_to_be_replaced, header, new_node);
+ NodeTraits::set_color(new_node, NodeTraits::get_color(node_to_be_replaced));
+ }
+
+ //! <b>Requires</b>: node is a tree node but not the header.
+ //!
+ //! <b>Effects</b>: Unlinks the node and rebalances the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink(node_ptr node)
+ {
+ node_ptr x = NodeTraits::get_parent(node);
+ if(x){
+ while(!is_header(x))
+ x = NodeTraits::get_parent(x);
+ erase(x, node);
+ }
+ }
+
+ //! <b>Requires</b>: header is the header of a tree.
+ //!
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree, and
+ //! updates the header link to the new leftmost node.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ static node_ptr unlink_leftmost_without_rebalance(node_ptr header)
+ { return tree_algorithms::unlink_leftmost_without_rebalance(header); }
+
+ //! <b>Requires</b>: node is a node of the tree or an node initialized
+ //! by init(...).
+ //!
+ //! <b>Effects</b>: Returns true if the node is initialized by init().
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr node)
+ { return tree_algorithms::unique(node); }
+
+ //! <b>Requires</b>: node is a node of the tree but it's not the header.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes of the subtree.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr node)
+ { return tree_algorithms::count(node); }
+
+ //! <b>Requires</b>: header is the header node of the tree.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes above the header.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t size(const_node_ptr header)
+ { return tree_algorithms::size(header); }
+
+ //! <b>Requires</b>: p is a node from the tree except the header.
+ //!
+ //! <b>Effects</b>: Returns the next node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr next_node(node_ptr p)
+ { return tree_algorithms::next_node(p); }
+
+ //! <b>Requires</b>: p is a node from the tree except the leftmost node.
+ //!
+ //! <b>Effects</b>: Returns the previous node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr prev_node(node_ptr p)
+ { return tree_algorithms::prev_node(p); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: After the function unique(node) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init(node_ptr node)
+ { tree_algorithms::init(node); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: Initializes the header to represent an empty tree.
+ //! unique(header) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init_header(node_ptr header)
+ {
+ tree_algorithms::init_header(header);
+ NodeTraits::set_color(header, NodeTraits::red());
+ }
+
+ //! <b>Requires</b>: header must be the header of a tree, z a node
+ //! of that tree and z != header.
+ //!
+ //! <b>Effects</b>: Erases node "z" from the tree with header "header".
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr erase(node_ptr header, node_ptr z)
+ {
+ typename tree_algorithms::data_for_rebalance info;
+ tree_algorithms::erase(header, z, rbtree_erase_fixup(), info);
+ node_ptr x = info.x;
+ node_ptr x_parent = info.x_parent;
+
+ //Rebalance rbtree
+ if(NodeTraits::get_color(z) != NodeTraits::red()){
+ rebalance_after_erasure(header, x, x_parent);
+ }
+ return z;
+ }
+
+ //! <b>Requires</b>: "cloner" must be a function
+ //! object taking a node_ptr and returning a new cloned node of it. "disposer" must
+ //! take a node_ptr and shouldn't throw.
+ //!
+ //! <b>Effects</b>: First empties target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! Then, duplicates the entire tree pointed by "source_header" cloning each
+ //! source node with <tt>node_ptr Cloner::operator()(node_ptr)</tt> to obtain
+ //! the nodes of the target tree. If "cloner" throws, the cloned target nodes
+ //! are disposed using <tt>void disposer(node_ptr)</tt>.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template <class Cloner, class Disposer>
+ static void clone
+ (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
+ {
+ rbtree_node_cloner<Cloner> new_cloner(cloner);
+ tree_algorithms::clone(source_header, target_header, new_cloner, disposer);
+ }
+
+ //! <b>Requires</b>: "disposer" must be an object function
+ //! taking a node_ptr parameter and shouldn't throw.
+ //!
+ //! <b>Effects</b>: Empties the target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template<class Disposer>
+ static void clear_and_dispose(node_ptr header, Disposer disposer)
+ { tree_algorithms::clear_and_dispose(header, disposer); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is
+ //! not less than "key" according to "comp" or "header" if that element does
+ //! not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr lower_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::lower_bound(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is greater
+ //! than "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr upper_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::upper_bound(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the element that is equivalent to
+ //! "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr find
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::find(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an a pair of node_ptr delimiting a range containing
+ //! all elements that are equivalent to "key" according to "comp" or an
+ //! empty range that indicates the position where those elements would be
+ //! if they there are no equivalent elements.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> equal_range
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::equal_range(header, key, comp); }
+
+ //! <b>Requires</b>: "h" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the upper bound
+ //! according to "comp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal_upper_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp)
+ {
+ tree_algorithms::insert_equal_upper_bound(h, new_node, comp);
+ rebalance_after_insertion(h, new_node);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "h" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the lower bound
+ //! according to "comp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal_lower_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp)
+ {
+ tree_algorithms::insert_equal_lower_bound(h, new_node, comp);
+ rebalance_after_insertion(h, new_node);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
+ //! the "header"'s tree.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case).
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if new_node is inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal
+ (node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp)
+ {
+ tree_algorithms::insert_equal(header, hint, new_node, comp);
+ rebalance_after_insertion(header, new_node);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "pos" must be a valid iterator or header (end) node.
+ //! "pos" must be an iterator pointing to the successor to "new_node"
+ //! once inserted according to the order of already inserted nodes. This function does not
+ //! check "pos" and this precondition must be guaranteed by the caller.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
+ //! tree invariants might be broken.
+ static node_ptr insert_before
+ (node_ptr header, node_ptr pos, node_ptr new_node)
+ {
+ tree_algorithms::insert_before(header, pos, new_node);
+ rebalance_after_insertion(header, new_node);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering no less than the
+ //! greatest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "new_node" is less than the greatest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ static void push_back(node_ptr header, node_ptr new_node)
+ {
+ tree_algorithms::push_back(header, new_node);
+ rebalance_after_insertion(header, new_node);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering, no greater than the
+ //! lowest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "new_node" is greater than the lowest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ static void push_front(node_ptr header, node_ptr new_node)
+ {
+ tree_algorithms::push_front(header, new_node);
+ rebalance_after_insertion(header, new_node);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data)
+ { return tree_algorithms::insert_unique_check(header, key, comp, commit_data); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //! "hint" is node from the "header"'s tree.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" using "hint" as a hint to where it should be
+ //! inserted and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //! If "hint" is the upper_bound the function has constant time
+ //! complexity (two comparisons in the worst case).
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic, but it is
+ //! amortized constant time if new_node should be inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, node_ptr hint, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data)
+ { return tree_algorithms::insert_unique_check(header, hint, key, comp, commit_data); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "commit_data" must have been obtained from a previous call to
+ //! "insert_unique_check". No objects should have been inserted or erased
+ //! from the set between the "insert_unique_check" that filled "commit_data"
+ //! and the call to "insert_commit".
+ //!
+ //!
+ //! <b>Effects</b>: Inserts new_node in the set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ static void insert_unique_commit
+ (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data)
+ {
+ tree_algorithms::insert_unique_commit(header, new_value, commit_data);
+ rebalance_after_insertion(header, new_value);
+ }
+
+ //! <b>Requires</b>: "n" must be a node inserted in a tree.
+ //!
+ //! <b>Effects</b>: Returns a pointer to the header node of the tree.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_header(node_ptr n)
+ { return tree_algorithms::get_header(n); }
+
+ /// @cond
+ private:
+
+ //! <b>Requires</b>: p is a node of a tree.
+ //!
+ //! <b>Effects</b>: Returns true if p is the header of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool is_header(const_node_ptr p)
+ {
+ return NodeTraits::get_color(p) == NodeTraits::red() &&
+ tree_algorithms::is_header(p);
+ //return NodeTraits::get_color(p) == NodeTraits::red() &&
+ // NodeTraits::get_parent(NodeTraits::get_parent(p)) == p;
+ }
+
+ static void rebalance_after_erasure(node_ptr header, node_ptr x, node_ptr x_parent)
+ {
+ while(x != NodeTraits::get_parent(header) && (x == 0 || NodeTraits::get_color(x) == NodeTraits::black())){
+ if(x == NodeTraits::get_left(x_parent)){
+ node_ptr w = NodeTraits::get_right(x_parent);
+ if(NodeTraits::get_color(w) == NodeTraits::red()){
+ NodeTraits::set_color(w, NodeTraits::black());
+ NodeTraits::set_color(x_parent, NodeTraits::red());
+ tree_algorithms::rotate_left(x_parent, header);
+ w = NodeTraits::get_right(x_parent);
+ }
+ if((NodeTraits::get_left(w) == 0 || NodeTraits::get_color(NodeTraits::get_left(w)) == NodeTraits::black()) &&
+ (NodeTraits::get_right(w) == 0 || NodeTraits::get_color(NodeTraits::get_right(w)) == NodeTraits::black())){
+ NodeTraits::set_color(w, NodeTraits::red());
+ x = x_parent;
+ x_parent = NodeTraits::get_parent(x_parent);
+ }
+ else {
+ if(NodeTraits::get_right(w) == 0 || NodeTraits::get_color(NodeTraits::get_right(w)) == NodeTraits::black()){
+ NodeTraits::set_color(NodeTraits::get_left(w), NodeTraits::black());
+ NodeTraits::set_color(w, NodeTraits::red());
+ tree_algorithms::rotate_right(w, header);
+ w = NodeTraits::get_right(x_parent);
+ }
+ NodeTraits::set_color(w, NodeTraits::get_color(x_parent));
+ NodeTraits::set_color(x_parent, NodeTraits::black());
+ if(NodeTraits::get_right(w))
+ NodeTraits::set_color(NodeTraits::get_right(w), NodeTraits::black());
+ tree_algorithms::rotate_left(x_parent, header);
+ break;
+ }
+ }
+ else {
+ // same as above, with right_ <-> left_.
+ node_ptr w = NodeTraits::get_left(x_parent);
+ if(NodeTraits::get_color(w) == NodeTraits::red()){
+ NodeTraits::set_color(w, NodeTraits::black());
+ NodeTraits::set_color(x_parent, NodeTraits::red());
+ tree_algorithms::rotate_right(x_parent, header);
+ w = NodeTraits::get_left(x_parent);
+ }
+ if((NodeTraits::get_right(w) == 0 || NodeTraits::get_color(NodeTraits::get_right(w)) == NodeTraits::black()) &&
+ (NodeTraits::get_left(w) == 0 || NodeTraits::get_color(NodeTraits::get_left(w)) == NodeTraits::black())){
+ NodeTraits::set_color(w, NodeTraits::red());
+ x = x_parent;
+ x_parent = NodeTraits::get_parent(x_parent);
+ }
+ else {
+ if(NodeTraits::get_left(w) == 0 || NodeTraits::get_color(NodeTraits::get_left(w)) == NodeTraits::black()){
+ NodeTraits::set_color(NodeTraits::get_right(w), NodeTraits::black());
+ NodeTraits::set_color(w, NodeTraits::red());
+ tree_algorithms::rotate_left(w, header);
+ w = NodeTraits::get_left(x_parent);
+ }
+ NodeTraits::set_color(w, NodeTraits::get_color(x_parent));
+ NodeTraits::set_color(x_parent, NodeTraits::black());
+ if(NodeTraits::get_left(w))
+ NodeTraits::set_color(NodeTraits::get_left(w), NodeTraits::black());
+ tree_algorithms::rotate_right(x_parent, header);
+ break;
+ }
+ }
+ }
+ if(x)
+ NodeTraits::set_color(x, NodeTraits::black());
+ }
+
+
+ static void rebalance_after_insertion(node_ptr header, node_ptr p)
+ {
+ NodeTraits::set_color(p, NodeTraits::red());
+ while(p != NodeTraits::get_parent(header) && NodeTraits::get_color(NodeTraits::get_parent(p)) == NodeTraits::red()){
+ node_ptr p_parent(NodeTraits::get_parent(p));
+ node_ptr p_parent_parent(NodeTraits::get_parent(p_parent));
+ if(tree_algorithms::is_left_child(p_parent)){
+ node_ptr x = NodeTraits::get_right(p_parent_parent);
+ if(x && NodeTraits::get_color(x) == NodeTraits::red()){
+ NodeTraits::set_color(p_parent, NodeTraits::black());
+ NodeTraits::set_color(p_parent_parent, NodeTraits::red());
+ NodeTraits::set_color(x, NodeTraits::black());
+ p = p_parent_parent;
+ }
+ else {
+ if(!tree_algorithms::is_left_child(p)){
+ p = p_parent;
+ tree_algorithms::rotate_left(p, header);
+ }
+ node_ptr new_p_parent(NodeTraits::get_parent(p));
+ node_ptr new_p_parent_parent(NodeTraits::get_parent(new_p_parent));
+ NodeTraits::set_color(new_p_parent, NodeTraits::black());
+ NodeTraits::set_color(new_p_parent_parent, NodeTraits::red());
+ tree_algorithms::rotate_right(new_p_parent_parent, header);
+ }
+ }
+ else{
+ node_ptr x = NodeTraits::get_left(p_parent_parent);
+ if(x && NodeTraits::get_color(x) == NodeTraits::red()){
+ NodeTraits::set_color(p_parent, NodeTraits::black());
+ NodeTraits::set_color(p_parent_parent, NodeTraits::red());
+ NodeTraits::set_color(x, NodeTraits::black());
+ p = p_parent_parent;
+ }
+ else{
+ if(tree_algorithms::is_left_child(p)){
+ p = p_parent;
+ tree_algorithms::rotate_right(p, header);
+ }
+ node_ptr new_p_parent(NodeTraits::get_parent(p));
+ node_ptr new_p_parent_parent(NodeTraits::get_parent(new_p_parent));
+ NodeTraits::set_color(new_p_parent, NodeTraits::black());
+ NodeTraits::set_color(new_p_parent_parent, NodeTraits::red());
+ tree_algorithms::rotate_left(new_p_parent_parent, header);
+ }
+ }
+ }
+ NodeTraits::set_color(NodeTraits::get_parent(header), NodeTraits::black());
+ }
+ /// @endcond
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_RBTREE_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/set.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/set.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,2333 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_SET_HPP
+#define BOOST_INTRUSIVE_SET_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/rbtree.hpp>
+#include <iterator>
+
+namespace boost {
+namespace intrusive {
+
+//! The class template set is an intrusive container, that mimics most of
+//! the interface of std::set as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class set_impl
+{
+ /// @cond
+ typedef rbtree_impl<Config> tree_type;
+ //! This class is
+ //! non-copyable
+ set_impl (const set_impl&);
+
+ //! This class is
+ //! non-assignable
+ set_impl &operator =(const set_impl&);
+
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the value_compare object throws.
+ set_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty set and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is std::distance(last, first).
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ set_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(true, b, e, cmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~set_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of set.
+ //!
+ //! <b>Effects</b>: Returns a reference to the set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static set_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const set_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static set_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const set_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &set_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the set.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two sets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(set_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const set_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to inserts value into the set.
+ //!
+ //! <b>Returns</b>: If the value
+ //! is not already present inserts it and returns a pair containing the
+ //! iterator to the new value and true. If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert(reference value)
+ { return tree_.insert_unique(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to to insert x into the set, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the
+ //! new element was inserted into the set.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_unique(hint, value); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the set, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the set.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_check
+ (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(key, key_value_comp, commit_data); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the set, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the set.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_check
+ (const_iterator hint, const KeyType &key
+ ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(hint, key, key_value_comp, commit_data); }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the set between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_commit(reference value, const insert_commit_data &commit_data)
+ { return tree_.insert_unique_commit(value, commit_data); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the set.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_unique(b, e); }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate. "value" must not be equal to any
+ //! inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" or "value" is not unique tree ordering and uniqueness
+ //! invariants will be broken respectively.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ { return tree_.insert_before(pos, value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be greater than
+ //! any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than or equal to the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ { tree_.push_back(value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be less
+ //! than any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than or equal to the the mimum inserted key tree ordering or uniqueness
+ //! invariants will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ { tree_.push_front(value); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size()) + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If the comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)). Basic guarantee.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value) const
+ { return tree_.find(value) != end(); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp) != end(); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound(const_reference value) const
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound(const_reference value) const
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find(const_reference value) const
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a set/multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ /// @cond
+ friend bool operator==(const set_impl &x, const set_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const set_impl &x, const set_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const set_impl<T, Options...> &x, const set_impl<T, Options...> &y)
+#else
+(const set_impl<Config> &x, const set_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const set_impl<T, Options...> &x, const set_impl<T, Options...> &y)
+#else
+(const set_impl<Config> &x, const set_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const set_impl<T, Options...> &x, const set_impl<T, Options...> &y)
+#else
+(const set_impl<Config> &x, const set_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const set_impl<T, Options...> &x, const set_impl<T, Options...> &y)
+#else
+(const set_impl<Config> &x, const set_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(set_impl<T, Options...> &x, set_impl<T, Options...> &y)
+#else
+(set_impl<Config> &x, set_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c set that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_set
+{
+ /// @cond
+ typedef set_impl
+ < typename make_rbtree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class set
+ : public make_set<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_set
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ set( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ set( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, v_traits)
+ {}
+
+ static set &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const set &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static set &container_from_iterator(iterator it)
+ { return static_cast<set &>(Base::container_from_iterator(it)); }
+
+ static const set &container_from_iterator(const_iterator it)
+ { return static_cast<const set &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+//! The class template multiset is an intrusive container, that mimics most of
+//! the interface of std::multiset as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class multiset_impl
+{
+ /// @cond
+ typedef rbtree_impl<Config> tree_type;
+
+ //Non-copyable and non-assignable
+ multiset_impl (const multiset_impl&);
+ multiset_impl &operator =(const multiset_impl&);
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ multiset_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty multiset and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is the distance between first and last
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ multiset_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(false, b, e, cmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~multiset_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static multiset_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const multiset_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static multiset_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const multiset_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &multiset_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the multiset.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two multisets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(multiset_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const multiset_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(reference value)
+ { return tree_.insert_equal(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts x into the multiset, using pos as a hint to
+ //! where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_equal(hint, value); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_equal(b, e); }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" tree ordering invariant will be broken.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ { return tree_.insert_before(pos, value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no less
+ //! than the greatest inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ { tree_.push_back(value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no greater
+ //! than the minimum inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than the minimum inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ { tree_.push_front(value); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value) const
+ { return tree_.count(value); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.count(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound(const_reference value) const
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound(const_reference value) const
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find(const_reference value) const
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a set/multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ //! <b>Effects</b>: removes "value" from the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic time.
+ //!
+ //! <b>Note</b>: This static function is only usable with non-constant
+ //! time size containers that have stateless comparison functors.
+ //!
+ //! If the user calls
+ //! this function with a constant time size container or stateful comparison
+ //! functor a compilation error will be issued.
+ static void remove_node(reference value)
+ { tree_type::remove_node(value); }
+
+ /// @cond
+ friend bool operator==(const multiset_impl &x, const multiset_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const multiset_impl &x, const multiset_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const multiset_impl<T, Options...> &x, const multiset_impl<T, Options...> &y)
+#else
+(const multiset_impl<Config> &x, const multiset_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const multiset_impl<T, Options...> &x, const multiset_impl<T, Options...> &y)
+#else
+(const multiset_impl<Config> &x, const multiset_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const multiset_impl<T, Options...> &x, const multiset_impl<T, Options...> &y)
+#else
+(const multiset_impl<Config> &x, const multiset_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const multiset_impl<T, Options...> &x, const multiset_impl<T, Options...> &y)
+#else
+(const multiset_impl<Config> &x, const multiset_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(multiset_impl<T, Options...> &x, multiset_impl<T, Options...> &y)
+#else
+(multiset_impl<Config> &x, multiset_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c multiset that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_multiset
+{
+ /// @cond
+ typedef multiset_impl
+ < typename make_rbtree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class multiset
+ : public make_multiset<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_multiset<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ multiset( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ multiset( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, v_traits)
+ {}
+
+ static multiset &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const multiset &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static multiset &container_from_iterator(iterator it)
+ { return static_cast<multiset &>(Base::container_from_iterator(it)); }
+
+ static const multiset &container_from_iterator(const_iterator it)
+ { return static_cast<const multiset &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SET_HPP
Added: sandbox/move/boost/intrusive/set_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/set_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,298 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_SET_HOOK_HPP
+#define BOOST_INTRUSIVE_SET_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/rbtree_node.hpp>
+#include <boost/intrusive/rbtree_algorithms.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/generic_hook.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+template<class VoidPointer, bool OptimizeSize = false>
+struct get_set_node_algo
+{
+ typedef rbtree_algorithms<rbtree_node_traits<VoidPointer, OptimizeSize> > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c set_base_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none, class O4 = none>
+#endif
+struct make_set_base_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_set_node_algo<typename packed_options::void_pointer
+ ,packed_options::optimize_size>
+ , typename packed_options::tag
+ , packed_options::link_mode
+ , detail::SetBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Derive a class from set_base_hook in order to store objects in
+//! in a set/multiset. set_base_hook holds the data necessary to maintain
+//! the set/multiset and provides an appropriate value_traits class for set/multiset.
+//!
+//! The hook admits the following options: \c tag<>, \c void_pointer<>,
+//! \c link_mode<> and \c optimize_size<>.
+//!
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! unique tag.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c optimize_size<> will tell the hook to optimize the hook for size instead
+//! of speed.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3, class O4>
+#endif
+class set_base_hook
+ : public make_set_base_hook<
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ set_base_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ set_base_hook(const set_base_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ set_base_hook& operator=(const set_base_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~set_base_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(set_base_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+//! Helper metafunction to define a \c set_member_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none, class O4 = none>
+#endif
+struct make_set_member_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_set_node_algo<typename packed_options::void_pointer
+ ,packed_options::optimize_size>
+ , member_tag
+ , packed_options::link_mode
+ , detail::NoBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Put a public data member set_member_hook in order to store objects of this class in
+//! a set/multiset. set_member_hook holds the data necessary for maintaining the
+//! set/multiset and provides an appropriate value_traits class for set/multiset.
+//!
+//! The hook admits the following options: \c void_pointer<>,
+//! \c link_mode<> and \c optimize_size<>.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c optimize_size<> will tell the hook to optimize the hook for size instead
+//! of speed.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3, class O4>
+#endif
+class set_member_hook
+ : public make_set_member_hook<
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ set_member_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ set_member_hook(const set_member_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ set_member_hook& operator=(const set_member_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~set_member_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(set_member_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SET_HOOK_HPP
Added: sandbox/move/boost/intrusive/sg_set.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/sg_set.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,2397 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_SG_SET_HPP
+#define BOOST_INTRUSIVE_SG_SET_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/sgtree.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <iterator>
+
+namespace boost {
+namespace intrusive {
+
+//! The class template sg_set is an intrusive container, that mimics most of
+//! the interface of std::set as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class sg_set_impl
+{
+ /// @cond
+ typedef sgtree_impl<Config> tree_type;
+ //! This class is
+ //! non-copyable
+ sg_set_impl (const sg_set_impl&);
+
+ //! This class is
+ //! non-assignable
+ sg_set_impl &operator =(const sg_set_impl&);
+
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the value_compare object throws.
+ sg_set_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty sg_set and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is std::distance(last, first).
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ sg_set_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(true, b, e, cmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the sg_set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~sg_set_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of sg_set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the sg_set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static sg_set_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<sg_set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &sg_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of sg_set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the sg_set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const sg_set_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<sg_set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &sg_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static sg_set_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<sg_set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &sg_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const sg_set_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<sg_set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &sg_set_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the sg_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the sg_set.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two sets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(sg_set_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const sg_set_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to inserts value into the sg_set.
+ //!
+ //! <b>Returns</b>: If the value
+ //! is not already present inserts it and returns a pair containing the
+ //! iterator to the new value and true. If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert(reference value)
+ { return tree_.insert_unique(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to to insert x into the sg_set, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the
+ //! new element was inserted into the sg_set.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_unique(hint, value); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the sg_set, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the sg_set.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_check
+ (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(key, key_value_comp, commit_data); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the sg_set, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the sg_set.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_check
+ (const_iterator hint, const KeyType &key
+ ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(hint, key, key_value_comp, commit_data); }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the sg_set between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the sg_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_commit(reference value, const insert_commit_data &commit_data)
+ { return tree_.insert_unique_commit(value, commit_data); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the sg_set.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_unique(b, e); }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate. "value" must not be equal to any
+ //! inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" or "value" is not unique tree ordering and uniqueness
+ //! invariants will be broken respectively.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ { return tree_.insert_before(pos, value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be greater than
+ //! any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than or equal to the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ { tree_.push_back(value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be less
+ //! than any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than or equal to the the mimum inserted key tree ordering or uniqueness
+ //! invariants will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ { tree_.push_front(value); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size()) + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If the comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)). Basic guarantee.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value) const
+ { return tree_.find(value) != end(); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp) != end(); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound(const_reference value) const
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound(const_reference value) const
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find(const_reference value) const
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a sg_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the sg_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a sg_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! sg_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a sg_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the sg_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a sg_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! sg_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a sg_set/sg_multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ void rebalance()
+ { tree_.rebalance(); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ iterator rebalance_subtree(iterator root)
+ { return tree_.rebalance_subtree(root); }
+
+ //! <b>Returns</b>: The balance factor (alpha) used in this tree
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ float balance_factor() const
+ { return tree_.balance_factor(); }
+
+ //! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
+ //!
+ //! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
+ //! the tree if the new balance factor is stricter (less) than the old factor.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ void balance_factor(float new_alpha)
+ { tree_.balance_factor(new_alpha); }
+
+ /// @cond
+ friend bool operator==(const sg_set_impl &x, const sg_set_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const sg_set_impl &x, const sg_set_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sg_set_impl<T, Options...> &x, const sg_set_impl<T, Options...> &y)
+#else
+(const sg_set_impl<Config> &x, const sg_set_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sg_set_impl<T, Options...> &x, const sg_set_impl<T, Options...> &y)
+#else
+(const sg_set_impl<Config> &x, const sg_set_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sg_set_impl<T, Options...> &x, const sg_set_impl<T, Options...> &y)
+#else
+(const sg_set_impl<Config> &x, const sg_set_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sg_set_impl<T, Options...> &x, const sg_set_impl<T, Options...> &y)
+#else
+(const sg_set_impl<Config> &x, const sg_set_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(sg_set_impl<T, Options...> &x, sg_set_impl<T, Options...> &y)
+#else
+(sg_set_impl<Config> &x, sg_set_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c sg_set that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_sg_set
+{
+ /// @cond
+ typedef sg_set_impl
+ < typename make_sgtree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class sg_set
+ : public make_sg_set<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_sg_set
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ sg_set( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ sg_set( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, v_traits)
+ {}
+
+ static sg_set &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<sg_set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const sg_set &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const sg_set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static sg_set &container_from_iterator(iterator it)
+ { return static_cast<sg_set &>(Base::container_from_iterator(it)); }
+
+ static const sg_set &container_from_iterator(const_iterator it)
+ { return static_cast<const sg_set &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+//! The class template sg_multiset is an intrusive container, that mimics most of
+//! the interface of std::sg_multiset as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class sg_multiset_impl
+{
+ /// @cond
+ typedef sgtree_impl<Config> tree_type;
+
+ //Non-copyable and non-assignable
+ sg_multiset_impl (const sg_multiset_impl&);
+ sg_multiset_impl &operator =(const sg_multiset_impl&);
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ sg_multiset_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty sg_multiset and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is the distance between first and last
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ sg_multiset_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(false, b, e, cmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the sg_multiset
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~sg_multiset_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of sg_multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the sg_multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static sg_multiset_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<sg_multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &sg_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of sg_multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the sg_multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const sg_multiset_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<sg_multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &sg_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static sg_multiset_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<sg_multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &sg_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const sg_multiset_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<sg_multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &sg_multiset_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the sg_multiset.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two sg_multisets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(sg_multiset_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const sg_multiset_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the sg_multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(reference value)
+ { return tree_.insert_equal(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts x into the sg_multiset, using pos as a hint to
+ //! where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_equal(hint, value); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the sg_multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_equal(b, e); }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" tree ordering invariant will be broken.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ { return tree_.insert_before(pos, value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no less
+ //! than the greatest inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ { tree_.push_back(value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no greater
+ //! than the minimum inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than the minimum inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ { tree_.push_front(value); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value) const
+ { return tree_.count(value); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.count(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound(const_reference value) const
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound(const_reference value) const
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find(const_reference value) const
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a sg_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the sg_multiset
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a sg_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! sg_multiset that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a sg_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the sg_multiset
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a sg_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! sg_multiset that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a sg_multiset/sg_multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ void rebalance()
+ { tree_.rebalance(); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ iterator rebalance_subtree(iterator root)
+ { return tree_.rebalance_subtree(root); }
+
+ //! <b>Returns</b>: The balance factor (alpha) used in this tree
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ float balance_factor() const
+ { return tree_.balance_factor(); }
+
+ //! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
+ //!
+ //! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
+ //! the tree if the new balance factor is stricter (less) than the old factor.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ void balance_factor(float new_alpha)
+ { tree_.balance_factor(new_alpha); }
+
+ /// @cond
+ friend bool operator==(const sg_multiset_impl &x, const sg_multiset_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const sg_multiset_impl &x, const sg_multiset_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sg_multiset_impl<T, Options...> &x, const sg_multiset_impl<T, Options...> &y)
+#else
+(const sg_multiset_impl<Config> &x, const sg_multiset_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sg_multiset_impl<T, Options...> &x, const sg_multiset_impl<T, Options...> &y)
+#else
+(const sg_multiset_impl<Config> &x, const sg_multiset_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sg_multiset_impl<T, Options...> &x, const sg_multiset_impl<T, Options...> &y)
+#else
+(const sg_multiset_impl<Config> &x, const sg_multiset_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sg_multiset_impl<T, Options...> &x, const sg_multiset_impl<T, Options...> &y)
+#else
+(const sg_multiset_impl<Config> &x, const sg_multiset_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(sg_multiset_impl<T, Options...> &x, sg_multiset_impl<T, Options...> &y)
+#else
+(sg_multiset_impl<Config> &x, sg_multiset_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c sg_multiset that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_sg_multiset
+{
+ /// @cond
+ typedef sg_multiset_impl
+ < typename make_sgtree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class sg_multiset
+ : public make_sg_multiset<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_sg_multiset
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ sg_multiset( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ sg_multiset( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, v_traits)
+ {}
+
+ static sg_multiset &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<sg_multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const sg_multiset &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const sg_multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static sg_multiset &container_from_iterator(iterator it)
+ { return static_cast<sg_multiset &>(Base::container_from_iterator(it)); }
+
+ static const sg_multiset &container_from_iterator(const_iterator it)
+ { return static_cast<const sg_multiset &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SG_SET_HPP
Added: sandbox/move/boost/intrusive/sgtree.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/sgtree.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,1876 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// The option that yields to non-floating point 1/sqrt(2) alpha is taken
+// from the scapegoat tree implementation of the PSPP library.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_SGTREE_HPP
+#define BOOST_INTRUSIVE_SGTREE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <algorithm>
+#include <cstddef>
+#include <functional>
+#include <iterator>
+#include <utility>
+#include <cmath>
+#include <cstddef>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/bs_set_hook.hpp>
+#include <boost/intrusive/detail/tree_node.hpp>
+#include <boost/intrusive/detail/ebo_functor_holder.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/clear_on_destructor_base.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/sgtree_algorithms.hpp>
+#include <boost/intrusive/link_mode.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+namespace detail{
+
+//! Returns floor(log(n)/log(sqrt(2))) -> floor(2*log2(n))
+//! Undefined if N is 0.
+//!
+//! This function does not use float point operations.
+inline std::size_t calculate_h_sqrt2 (std::size_t n)
+{
+ std::size_t f_log2 = detail::floor_log2(n);
+ return (2*f_log2) + (n >= detail::sqrt2_pow_2xplus1 (f_log2));
+}
+
+struct h_alpha_sqrt2_t
+{
+ h_alpha_sqrt2_t(void){}
+ std::size_t operator()(std::size_t n) const
+ { return calculate_h_sqrt2(n); }
+};
+
+struct alpha_0_75_by_max_size_t
+{
+ alpha_0_75_by_max_size_t(void){}
+ std::size_t operator()(std::size_t max_tree_size) const
+ {
+ const std::size_t max_tree_size_limit = ((~std::size_t(0))/std::size_t(3));
+ return max_tree_size > max_tree_size_limit ? max_tree_size/4*3 : max_tree_size*3/4;
+ }
+};
+
+struct h_alpha_t
+{
+ h_alpha_t(float inv_minus_logalpha)
+ : inv_minus_logalpha_(inv_minus_logalpha)
+ {}
+
+ std::size_t operator()(std::size_t n) const
+ {
+ //Returns floor(log1/alpha(n)) ->
+ // floor(log(n)/log(1/alpha)) ->
+ // floor(log(n)/(-log(alpha)))
+ //return static_cast<std::size_t>(std::log(float(n))*inv_minus_logalpha_);
+ return static_cast<std::size_t>(detail::fast_log2(float(n))*inv_minus_logalpha_);
+ }
+
+ private:
+ //Since the function will be repeatedly called
+ //precalculate constant data to avoid repeated
+ //calls to log and division.
+ //This will store 1/(-std::log(alpha_))
+ float inv_minus_logalpha_;
+};
+
+struct alpha_by_max_size_t
+{
+ alpha_by_max_size_t(float alpha)
+ : alpha_(alpha)
+ {}
+
+ float operator()(std::size_t max_tree_size) const
+ { return float(max_tree_size)*alpha_; }
+
+ private:
+ float alpha_;
+ float inv_minus_logalpha_;
+};
+
+template<bool Activate>
+struct alpha_holder
+{
+ typedef boost::intrusive::detail::h_alpha_t h_alpha_t;
+ typedef boost::intrusive::detail::alpha_by_max_size_t multiply_by_alpha_t;
+
+ alpha_holder()
+ { set_alpha(0.7f); }
+
+ float get_alpha() const
+ { return alpha_; }
+
+ void set_alpha(float alpha)
+ {
+ alpha_ = alpha;
+ inv_minus_logalpha_ = 1/(-detail::fast_log2(alpha));
+ }
+
+ h_alpha_t get_h_alpha_t() const
+ { return h_alpha_t(inv_minus_logalpha_); }
+
+ multiply_by_alpha_t get_multiply_by_alpha_t() const
+ { return multiply_by_alpha_t(alpha_); }
+
+ private:
+ float alpha_;
+ float inv_minus_logalpha_;
+};
+
+template<>
+struct alpha_holder<false>
+{
+ //This specialization uses alpha = 1/sqrt(2)
+ //without using floating point operations
+ //Downside: alpha CAN't be changed.
+ typedef boost::intrusive::detail::h_alpha_sqrt2_t h_alpha_t;
+ typedef boost::intrusive::detail::alpha_0_75_by_max_size_t multiply_by_alpha_t;
+
+ float get_alpha() const
+ { return 0.70710677f; }
+
+ void set_alpha(float)
+ { //alpha CAN't be changed.
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(0);
+ }
+
+ h_alpha_t get_h_alpha_t() const
+ { return h_alpha_t(); }
+
+ multiply_by_alpha_t get_multiply_by_alpha_t() const
+ { return multiply_by_alpha_t(); }
+};
+
+} //namespace detail{
+
+template <class ValueTraits, class Compare, class SizeType, bool FloatingPoint>
+struct sg_setopt
+{
+ typedef ValueTraits value_traits;
+ typedef Compare compare;
+ typedef SizeType size_type;
+ static const bool floating_point = FloatingPoint;
+};
+
+template <class T>
+struct sg_set_defaults
+ : pack_options
+ < none
+ , base_hook<detail::default_bs_set_hook>
+ , floating_point<true>
+ , size_type<std::size_t>
+ , compare<std::less<T> >
+ >::type
+{};
+
+/// @endcond
+
+//! The class template sgtree is an intrusive scapegoat tree container, that
+//! is used to construct intrusive sg_set and sg_multiset containers.
+//! The no-throw guarantee holds only, if the value_compare object
+//! doesn't throw.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c floating_point<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class sgtree_impl
+ : private detail::clear_on_destructor_base<sgtree_impl<Config> >
+{
+ template<class C> friend class detail::clear_on_destructor_base;
+ public:
+ typedef typename Config::value_traits value_traits;
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ /// @endcond
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::const_pointer const_pointer;
+ typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef value_type key_type;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ typedef typename std::iterator_traits<pointer>::difference_type difference_type;
+ typedef typename Config::size_type size_type;
+ typedef typename Config::compare value_compare;
+ typedef value_compare key_compare;
+ typedef tree_iterator<sgtree_impl, false> iterator;
+ typedef tree_iterator<sgtree_impl, true> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename boost::pointer_to_other
+ <pointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, const node>::type const_node_ptr;
+ typedef sgtree_algorithms<node_traits> node_algorithms;
+
+ static const bool floating_point = Config::floating_point;
+ static const bool constant_time_size = true;
+ static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+
+ /// @cond
+ private:
+ typedef detail::size_holder<true, size_type> size_traits;
+ typedef detail::alpha_holder<floating_point> alpha_traits;
+ typedef typename alpha_traits::h_alpha_t h_alpha_t;
+ typedef typename alpha_traits::multiply_by_alpha_t multiply_by_alpha_t;
+
+ //noncopyable
+ sgtree_impl (const sgtree_impl&);
+ sgtree_impl operator =(const sgtree_impl&);
+
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ BOOST_STATIC_ASSERT(((int)real_value_traits::link_mode != (int)auto_unlink));
+
+ //BOOST_STATIC_ASSERT((
+ // (int)real_value_traits::link_mode != (int)auto_unlink ||
+ // !floating_point
+ // ));
+
+ struct header_plus_alpha : public alpha_traits
+ { node header_; };
+
+ struct node_plus_pred_t : public detail::ebo_functor_holder<value_compare>
+ {
+ node_plus_pred_t(const value_compare &comp)
+ : detail::ebo_functor_holder<value_compare>(comp)
+ {}
+ header_plus_alpha header_plus_alpha_;
+ size_traits size_traits_;
+ };
+
+ struct data_t : public sgtree_impl::value_traits
+ {
+ typedef typename sgtree_impl::value_traits value_traits;
+ data_t(const value_compare & comp, const value_traits &val_traits)
+ : value_traits(val_traits), node_plus_pred_(comp)
+ , max_tree_size_(0)
+ {}
+ node_plus_pred_t node_plus_pred_;
+ size_type max_tree_size_;
+ } data_;
+
+ float priv_alpha() const
+ { return this->priv_alpha_traits().get_alpha(); }
+
+ void priv_alpha(float alpha)
+ { return this->priv_alpha_traits().set_alpha(alpha); }
+
+ const value_compare &priv_comp() const
+ { return data_.node_plus_pred_.get(); }
+
+ value_compare &priv_comp()
+ { return data_.node_plus_pred_.get(); }
+
+ const node &priv_header() const
+ { return data_.node_plus_pred_.header_plus_alpha_.header_; }
+
+ node &priv_header()
+ { return data_.node_plus_pred_.header_plus_alpha_.header_; }
+
+ static node_ptr uncast(const_node_ptr ptr)
+ { return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); }
+
+ size_traits &priv_size_traits()
+ { return data_.node_plus_pred_.size_traits_; }
+
+ const size_traits &priv_size_traits() const
+ { return data_.node_plus_pred_.size_traits_; }
+
+ alpha_traits &priv_alpha_traits()
+ { return data_.node_plus_pred_.header_plus_alpha_; }
+
+ const alpha_traits &priv_alpha_traits() const
+ { return data_.node_plus_pred_.header_plus_alpha_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<false>) const
+ { return data_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<true>) const
+ { return data_.get_value_traits(*this); }
+
+ real_value_traits &get_real_value_traits(detail::bool_<false>)
+ { return data_; }
+
+ real_value_traits &get_real_value_traits(detail::bool_<true>)
+ { return data_.get_value_traits(*this); }
+
+ h_alpha_t get_h_alpha_func() const
+ { return priv_alpha_traits().get_h_alpha_t(); }
+
+ multiply_by_alpha_t get_alpha_by_max_size_func() const
+ { return priv_alpha_traits().get_multiply_by_alpha_t(); }
+
+ /// @endcond
+
+ public:
+
+ const real_value_traits &get_real_value_traits() const
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ real_value_traits &get_real_value_traits()
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ typedef typename node_algorithms::insert_commit_data insert_commit_data;
+
+ //! <b>Effects</b>: Constructs an empty tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructorof the value_compare object throws. Basic guarantee.
+ sgtree_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty tree and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is the distance between first and last.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws. Basic guarantee.
+ template<class Iterator>
+ sgtree_impl( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ if(unique)
+ this->insert_unique(b, e);
+ else
+ this->insert_equal(b, e);
+ }
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~sgtree_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return iterator (node_traits::get_left(node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return const_iterator (node_traits::get_left(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return iterator (node_ptr(&priv_header()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return cend(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return const_iterator (uncast(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return const_reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return const_reverse_iterator(begin()); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of sgtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the sgtree associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static sgtree_impl &container_from_end_iterator(iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of sgtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the sgtree associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const sgtree_impl &container_from_end_iterator(const_iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: it must be a valid iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static sgtree_impl &container_from_iterator(iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Precondition</b>: it must be a valid end const_iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const sgtree_impl &container_from_iterator(const_iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return priv_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return node_algorithms::unique(const_node_ptr(&priv_header())); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the tree.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this
+ //! if constant-time size option is disabled. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ {
+ if(constant_time_size)
+ return this->priv_size_traits().get_size();
+ else{
+ return (size_type)node_algorithms::size(const_node_ptr(&priv_header()));
+ }
+ }
+
+ //! <b>Effects</b>: Swaps the contents of two sgtrees.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the comparison functor's swap call throws.
+ void swap(sgtree_impl& other)
+ {
+ //This can throw
+ using std::swap;
+ swap(priv_comp(), priv_comp());
+ swap(priv_alpha_traits(), priv_alpha_traits());
+ swap(data_.max_tree_size_, other.data_.max_tree_size_);
+ //These can't throw
+ node_algorithms::swap_tree(node_ptr(&priv_header()), node_ptr(&other.priv_header()));
+ if(constant_time_size){
+ size_type backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(other.priv_size_traits().get_size());
+ other.priv_size_traits().set_size(backup);
+ }
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the tree before the upper bound.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, sgtree_impl>
+ key_node_comp(priv_comp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
+ node_ptr p = node_algorithms::insert_equal_upper_bound
+ (node_ptr(&priv_header()), to_insert, key_node_comp
+ , (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
+ data_.max_tree_size_ = (size_type)max_tree_size;
+ return iterator(p, this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case)
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(const_iterator hint, reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, sgtree_impl>
+ key_node_comp(priv_comp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
+ node_ptr p = node_algorithms::insert_equal
+ (node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp
+ , (std::size_t)this->size(), this->get_h_alpha_func(), max_tree_size);
+ data_.max_tree_size_ = (size_type)max_tree_size;
+ return iterator(p, this);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a each element of a range into the tree
+ //! before the upper bound of the key of each element.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_equal(Iterator b, Iterator e)
+ {
+ iterator end(this->end());
+ for (; b != e; ++b)
+ this->insert_equal(end, *b);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the tree if the value
+ //! is not already present.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert_unique(reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(value, priv_comp(), commit_data);
+ if(!ret.second)
+ return ret;
+ return std::pair<iterator, bool> (insert_unique_commit(value, commit_data), true);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator
+ //!
+ //! <b>Effects</b>: Tries to insert x into the tree, using "hint" as a hint
+ //! to where it will be inserted.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time (two comparisons in the worst case)
+ //! if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_unique(const_iterator hint, reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(hint, value, priv_comp(), commit_data);
+ if(!ret.second)
+ return ret.first;
+ return insert_unique_commit(value, commit_data);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Tries to insert each element of a range into the tree.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_unique(Iterator b, Iterator e)
+ {
+ if(this->empty()){
+ iterator end(this->end());
+ for (; b != e; ++b)
+ this->insert_unique(end, *b);
+ }
+ else{
+ for (; b != e; ++b)
+ this->insert_unique(*b);
+ }
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_unique_check
+ (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ comp(key_value_comp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), key, comp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_unique_check
+ (const_iterator hint, const KeyType &key
+ ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ comp(key_value_comp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), hint.pointed_node(), key, comp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the container between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_unique_commit(reference value, const insert_commit_data &commit_data)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
+ node_algorithms::insert_unique_commit
+ ( node_ptr(&priv_header()), to_insert, commit_data
+ , (std::size_t)this->size(), this->get_h_alpha_func(), max_tree_size);
+ data_.max_tree_size_ = (size_type)max_tree_size;
+ return iterator(to_insert, this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate
+ //!
+ //! <b>Effects</b>: Inserts x into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" tree ordering invariant will be broken.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
+ node_ptr p = node_algorithms::insert_before
+ ( node_ptr(&priv_header()), pos.pointed_node(), to_insert
+ , (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
+ data_.max_tree_size_ = (size_type)max_tree_size;
+ return iterator(p, this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no less
+ //! than the greatest inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than the greatest inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
+ node_algorithms::push_back
+ ( node_ptr(&priv_header()), to_insert
+ , (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
+ data_.max_tree_size_ = (size_type)max_tree_size;
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no greater
+ //! than the minimum inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than the minimum inserted key tree ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ std::size_t max_tree_size = (std::size_t)data_.max_tree_size_;
+ node_algorithms::push_front
+ ( node_ptr(&priv_header()), to_insert
+ , (size_type)this->size(), this->get_h_alpha_func(), max_tree_size);
+ data_.max_tree_size_ = (size_type)max_tree_size;
+ }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ {
+ const_iterator ret(i);
+ ++ret;
+ node_ptr to_erase(i.pointed_node());
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!node_algorithms::unique(to_erase));
+ std::size_t max_tree_size = data_.max_tree_size_;
+ node_algorithms::erase
+ ( &priv_header(), to_erase, (std::size_t)this->size()
+ , max_tree_size, this->get_alpha_by_max_size_func());
+ data_.max_tree_size_ = (size_type)max_tree_size;
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ return ret.unconst();
+ }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { size_type n; return private_erase(b, e, n); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return this->erase(value, priv_comp()); }
+
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ {
+ node_ptr to_erase(i.pointed_node());
+ iterator ret(this->erase(i));
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ return ret;
+ }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { size_type n; return private_erase(b, e, n, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ {
+ std::pair<iterator,iterator> p = this->equal_range(value);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ {
+ if(safemode_or_autounlink){
+ this->clear_and_dispose(detail::null_disposer());
+ }
+ else{
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(0);
+ }
+ }
+
+ //! <b>Effects</b>: Erases all of the elements calling disposer(p) for
+ //! each node to be erased.
+ //! <b>Complexity</b>: Average complexity for is at most O(log(size() + N)),
+ //! where N is the number of elements in the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. Calls N times to disposer functor.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ {
+ node_algorithms::clear_and_dispose(node_ptr(&priv_header())
+ , detail::node_disposer<Disposer, sgtree_impl>(disposer, this));
+ this->priv_size_traits().set_size(0);
+ }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given value
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given value.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type count(const_reference value) const
+ { return this->count(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType &key, KeyValueCompare comp) const
+ {
+ std::pair<const_iterator, const_iterator> ret = this->equal_range(key, comp);
+ return std::distance(ret.first, ret.second);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator lower_bound(const_reference value)
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator lower_bound(const_reference value) const
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator upper_bound(const_reference value)
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator upper_bound(const_reference value) const
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator find(const_reference value)
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ return iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator find(const_reference value) const
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ return const_iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, sgtree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const sgtree_impl &src, Cloner cloner, Disposer disposer)
+ {
+ this->clear_and_dispose(disposer);
+ if(!src.empty()){
+ detail::exception_disposer<sgtree_impl, Disposer>
+ rollback(*this, disposer);
+ node_algorithms::clone
+ (const_node_ptr(&src.priv_header())
+ ,node_ptr(&this->priv_header())
+ ,detail::node_cloner<Cloner, sgtree_impl>(cloner, this)
+ ,detail::node_disposer<Disposer, sgtree_impl>(disposer, this));
+ this->priv_size_traits().set_size(src.priv_size_traits().get_size());
+ this->priv_comp() = src.priv_comp();
+ rollback.release();
+ }
+ }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ {
+ node_ptr to_be_disposed(node_algorithms::unlink_leftmost_without_rebalance
+ (node_ptr(&priv_header())));
+ if(!to_be_disposed)
+ return 0;
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)//If this is commented does not work with normal_link
+ node_algorithms::init(to_be_disposed);
+ return get_real_value_traits().to_value_ptr(to_be_disposed);
+ }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ {
+ node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
+ , node_ptr(&priv_header())
+ , get_real_value_traits().to_node_ptr(with_this));
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return iterator (value_traits::to_node_ptr(value), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return iterator (value_traits::to_node_ptr(value), this); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
+
+ //! <b>Requires</b>: value shall not be in a tree.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { node_algorithms::init(value_traits::to_node_ptr(value)); }
+
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ void rebalance()
+ { node_algorithms::rebalance(node_ptr(&priv_header())); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ iterator rebalance_subtree(iterator root)
+ { return iterator(node_algorithms::rebalance_subtree(root.pointed_node()), this); }
+
+ //! <b>Returns</b>: The balance factor (alpha) used in this tree
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ float balance_factor() const
+ { return this->priv_alpha(); }
+
+ //! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
+ //!
+ //! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
+ //! the tree if the new balance factor is stricter (less) than the old factor.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ void balance_factor(float new_alpha)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT((new_alpha > 0.5f && new_alpha < 1.0f));
+ if(new_alpha < 0.5f && new_alpha >= 1.0f) return;
+
+ //The alpha factor CAN't be changed if the fixed, floating operation-less
+ //1/sqrt(2) alpha factor option is activated
+ BOOST_STATIC_ASSERT((floating_point));
+ float old_alpha = this->priv_alpha();
+ this->priv_alpha(new_alpha);
+
+ if(new_alpha < old_alpha){
+ data_.max_tree_size_ = this->size();
+ this->rebalance();
+ }
+ }
+/*
+ //! <b>Effects</b>: removes x from a tree of the appropriate type. It has no effect,
+ //! if x is not in such a tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This static function is only usable with the "safe mode"
+ //! hook and non-constant time size lists. Otherwise, the user must use
+ //! the non-static "erase(reference )" member. If the user calls
+ //! this function with a non "safe mode" or constant time size list
+ //! a compilation error will be issued.
+ template<class T>
+ static void remove_node(T& value)
+ {
+ //This function is only usable for safe mode hooks and non-constant
+ //time lists.
+ //BOOST_STATIC_ASSERT((!(safemode_or_autounlink && constant_time_size)));
+ BOOST_STATIC_ASSERT((!constant_time_size));
+ BOOST_STATIC_ASSERT((boost::is_convertible<T, value_type>::value));
+ node_ptr to_remove(value_traits::to_node_ptr(value));
+ node_algorithms::unlink_and_rebalance(to_remove);
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_remove);
+ }
+*/
+
+ /// @cond
+ private:
+ template<class Disposer>
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n, Disposer disposer)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase_and_dispose(b++, disposer);
+ return b.unconst();
+ }
+
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase(b++);
+ return b.unconst();
+ }
+ /// @endcond
+
+ private:
+ static sgtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
+ {
+ header_plus_alpha *r = detail::parent_from_member<header_plus_alpha, node>
+ ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_alpha::header_);
+ node_plus_pred_t *n = detail::parent_from_member
+ <node_plus_pred_t, header_plus_alpha>(r, &node_plus_pred_t::header_plus_alpha_);
+ data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
+ sgtree_impl *scapegoat = detail::parent_from_member<sgtree_impl, data_t>(d, &sgtree_impl::data_);
+ return *scapegoat;
+ }
+
+ static sgtree_impl &priv_container_from_iterator(const const_iterator &it)
+ { return priv_container_from_end_iterator(it.end_iterator_from_it()); }
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sgtree_impl<T, Options...> &x, const sgtree_impl<T, Options...> &y)
+#else
+(const sgtree_impl<Config> &x, const sgtree_impl<Config> &y)
+#endif
+{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+bool operator==
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sgtree_impl<T, Options...> &x, const sgtree_impl<T, Options...> &y)
+#else
+(const sgtree_impl<Config> &x, const sgtree_impl<Config> &y)
+#endif
+{
+ typedef sgtree_impl<Config> tree_type;
+ typedef typename tree_type::const_iterator const_iterator;
+
+ if(tree_type::constant_time_size && x.size() != y.size()){
+ return false;
+ }
+ const_iterator end1 = x.end();
+ const_iterator i1 = x.begin();
+ const_iterator i2 = y.begin();
+ if(tree_type::constant_time_size){
+ while (i1 != end1 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1;
+ }
+ else{
+ const_iterator end2 = y.end();
+ while (i1 != end1 && i2 != end2 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1 && i2 == end2;
+ }
+}
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sgtree_impl<T, Options...> &x, const sgtree_impl<T, Options...> &y)
+#else
+(const sgtree_impl<Config> &x, const sgtree_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sgtree_impl<T, Options...> &x, const sgtree_impl<T, Options...> &y)
+#else
+(const sgtree_impl<Config> &x, const sgtree_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sgtree_impl<T, Options...> &x, const sgtree_impl<T, Options...> &y)
+#else
+(const sgtree_impl<Config> &x, const sgtree_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const sgtree_impl<T, Options...> &x, const sgtree_impl<T, Options...> &y)
+#else
+(const sgtree_impl<Config> &x, const sgtree_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(sgtree_impl<T, Options...> &x, sgtree_impl<T, Options...> &y)
+#else
+(sgtree_impl<Config> &x, sgtree_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+/// @cond
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#else
+template<class T, class ...Options>
+#endif
+struct make_sgtree_opt
+{
+ typedef typename pack_options
+ < sg_set_defaults<T>,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+ typedef typename detail::get_value_traits
+ <T, typename packed_options::value_traits>::type value_traits;
+
+ typedef sg_setopt
+ < value_traits
+ , typename packed_options::compare
+ , typename packed_options::size_type
+ , packed_options::floating_point
+ > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c sgtree that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_sgtree
+{
+ /// @cond
+ typedef sgtree_impl
+ < typename make_sgtree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class sgtree
+ : public make_sgtree<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_sgtree
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::real_value_traits real_value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
+
+ sgtree( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ sgtree( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(unique, b, e, cmp, v_traits)
+ {}
+
+ static sgtree &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<sgtree &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const sgtree &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const sgtree &>(Base::container_from_end_iterator(end_iterator)); }
+};
+
+#endif
+
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SGTREE_HPP
Added: sandbox/move/boost/intrusive/sgtree_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/sgtree_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,783 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//
+// Scapegoat tree algorithms are taken from the paper titled:
+// "Scapegoat Trees" by Igal Galperin Ronald L. Rivest.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_SGTREE_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_SGTREE_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+
+#include <cstddef>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/tree_algorithms.hpp>
+
+
+namespace boost {
+namespace intrusive {
+
+//! sgtree_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the circular list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
+//!
+//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
+//!
+//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
+template<class NodeTraits>
+class sgtree_algorithms
+{
+ public:
+ typedef typename NodeTraits::node node;
+ typedef NodeTraits node_traits;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+
+ /// @cond
+ private:
+
+ typedef detail::tree_algorithms<NodeTraits> tree_algorithms;
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ }
+ /// @endcond
+
+ public:
+ static node_ptr begin_node(const_node_ptr header)
+ { return tree_algorithms::begin_node(header); }
+
+ static node_ptr end_node(const_node_ptr header)
+ { return tree_algorithms::end_node(header); }
+
+ //! This type is the information that will be
+ //! filled by insert_unique_check
+ struct insert_commit_data
+ : tree_algorithms::insert_commit_data
+ {
+ std::size_t depth;
+ };
+
+ //! <b>Requires</b>: header1 and header2 must be the header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //! links to the second tree and header2 will have links to the first tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void swap_tree(node_ptr header1, node_ptr header2)
+ { return tree_algorithms::swap_tree(header1, header2); }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr node2)
+ {
+ if(node1 == node2)
+ return;
+
+ node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
+ swap_nodes(node1, header1, node2, header2);
+ }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees with header header1 and header2.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
+ { tree_algorithms::swap_nodes(node1, header1, node2, header2); }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing and comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
+ {
+ if(node_to_be_replaced == new_node)
+ return;
+ replace_node(node_to_be_replaced, tree_algorithms::get_header(node_to_be_replaced), new_node);
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! with header "header" and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
+ { tree_algorithms::replace_node(node_to_be_replaced, header, new_node); }
+
+ //! <b>Requires</b>: node is a tree node but not the header.
+ //!
+ //! <b>Effects</b>: Unlinks the node and rebalances the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void unlink(node_ptr node)
+ {
+ node_ptr x = NodeTraits::get_parent(node);
+ if(x){
+ while(!is_header(x))
+ x = NodeTraits::get_parent(x);
+ tree_algorithms::erase(x, node);
+ }
+ }
+
+ //! <b>Requires</b>: header is the header of a tree.
+ //!
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree, and
+ //! updates the header link to the new leftmost node.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ static node_ptr unlink_leftmost_without_rebalance(node_ptr header)
+ { return tree_algorithms::unlink_leftmost_without_rebalance(header); }
+
+ //! <b>Requires</b>: node is a node of the tree or an node initialized
+ //! by init(...).
+ //!
+ //! <b>Effects</b>: Returns true if the node is initialized by init().
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr node)
+ { return tree_algorithms::unique(node); }
+
+ //! <b>Requires</b>: node is a node of the tree but it's not the header.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes of the subtree.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr node)
+ { return tree_algorithms::count(node); }
+
+ //! <b>Requires</b>: header is the header node of the tree.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes above the header.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t size(const_node_ptr header)
+ { return tree_algorithms::size(header); }
+
+ //! <b>Requires</b>: p is a node from the tree except the header.
+ //!
+ //! <b>Effects</b>: Returns the next node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr next_node(node_ptr p)
+ { return tree_algorithms::next_node(p); }
+
+ //! <b>Requires</b>: p is a node from the tree except the leftmost node.
+ //!
+ //! <b>Effects</b>: Returns the previous node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr prev_node(node_ptr p)
+ { return tree_algorithms::prev_node(p); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: After the function unique(node) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init(node_ptr node)
+ { tree_algorithms::init(node); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: Initializes the header to represent an empty tree.
+ //! unique(header) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init_header(node_ptr header)
+ { tree_algorithms::init_header(header); }
+
+ //! <b>Requires</b>: header must be the header of a tree, z a node
+ //! of that tree and z != header.
+ //!
+ //! <b>Effects</b>: Erases node "z" from the tree with header "header".
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class AlphaByMaxSize>
+ static node_ptr erase(node_ptr header, node_ptr z, std::size_t tree_size, std::size_t &max_tree_size, AlphaByMaxSize alpha_by_maxsize)
+ {
+ //typename tree_algorithms::data_for_rebalance info;
+ tree_algorithms::erase(header, z);
+ --tree_size;
+ if (tree_size > 0 &&
+ tree_size < alpha_by_maxsize(max_tree_size)){
+ tree_algorithms::rebalance(header);
+ max_tree_size = tree_size;
+ }
+ return z;
+ }
+
+ //! <b>Requires</b>: "cloner" must be a function
+ //! object taking a node_ptr and returning a new cloned node of it. "disposer" must
+ //! take a node_ptr and shouldn't throw.
+ //!
+ //! <b>Effects</b>: First empties target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! Then, duplicates the entire tree pointed by "source_header" cloning each
+ //! source node with <tt>node_ptr Cloner::operator()(node_ptr)</tt> to obtain
+ //! the nodes of the target tree. If "cloner" throws, the cloned target nodes
+ //! are disposed using <tt>void disposer(node_ptr)</tt>.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template <class Cloner, class Disposer>
+ static void clone
+ (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
+ {
+ tree_algorithms::clone(source_header, target_header, cloner, disposer);
+ }
+
+ //! <b>Requires</b>: "disposer" must be an object function
+ //! taking a node_ptr parameter and shouldn't throw.
+ //!
+ //! <b>Effects</b>: Empties the target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template<class Disposer>
+ static void clear_and_dispose(node_ptr header, Disposer disposer)
+ { tree_algorithms::clear_and_dispose(header, disposer); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is
+ //! not less than "key" according to "comp" or "header" if that element does
+ //! not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr lower_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::lower_bound(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is greater
+ //! than "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr upper_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::upper_bound(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the element that is equivalent to
+ //! "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr find
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::find(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an a pair of node_ptr delimiting a range containing
+ //! all elements that are equivalent to "key" according to "comp" or an
+ //! empty range that indicates the position where those elements would be
+ //! if they there are no equivalent elements.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> equal_range
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::equal_range(header, key, comp); }
+
+ //! <b>Requires</b>: "h" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the upper bound
+ //! according to "comp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare, class H_Alpha>
+ static node_ptr insert_equal_upper_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp
+ ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
+ {
+ std::size_t depth;
+ tree_algorithms::insert_equal_upper_bound(h, new_node, comp, &depth);
+ rebalance_after_insertion(new_node, depth, tree_size+1, h_alpha, max_tree_size);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "h" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the lower bound
+ //! according to "comp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare, class H_Alpha>
+ static node_ptr insert_equal_lower_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp
+ ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
+ {
+ std::size_t depth;
+ tree_algorithms::insert_equal_lower_bound(h, new_node, comp, &depth);
+ rebalance_after_insertion(new_node, depth, tree_size+1, h_alpha, max_tree_size);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
+ //! the "header"'s tree.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case).
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if new_node is inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare, class H_Alpha>
+ static node_ptr insert_equal
+ (node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp
+ ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
+ {
+ std::size_t depth;
+ tree_algorithms::insert_equal(header, hint, new_node, comp, &depth);
+ rebalance_after_insertion(new_node, depth, tree_size+1, h_alpha, max_tree_size);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data)
+ {
+ std::size_t depth;
+ std::pair<node_ptr, bool> ret =
+ tree_algorithms::insert_unique_check(header, key, comp, commit_data, &depth);
+ commit_data.depth = depth;
+ return ret;
+ }
+
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "pos" must be a valid iterator or header (end) node.
+ //! "pos" must be an iterator pointing to the successor to "new_node"
+ //! once inserted according to the order of already inserted nodes. This function does not
+ //! check "pos" and this precondition must be guaranteed by the caller.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
+ //! tree invariants might be broken.
+ template<class H_Alpha>
+ static node_ptr insert_before
+ (node_ptr header, node_ptr pos, node_ptr new_node
+ ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
+ {
+ std::size_t depth;
+ tree_algorithms::insert_before(header, pos, new_node, &depth);
+ rebalance_after_insertion(new_node, depth, tree_size+1, h_alpha, max_tree_size);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering no less than the
+ //! greatest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "new_node" is less than the greatest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ template<class H_Alpha>
+ static void push_back(node_ptr header, node_ptr new_node
+ ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
+ {
+ std::size_t depth;
+ tree_algorithms::push_back(header, new_node, &depth);
+ rebalance_after_insertion(new_node, depth, tree_size+1, h_alpha, max_tree_size);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering, no greater than the
+ //! lowest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "new_node" is greater than the lowest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ template<class H_Alpha>
+ static void push_front(node_ptr header, node_ptr new_node
+ ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
+ {
+ std::size_t depth;
+ tree_algorithms::push_front(header, new_node, &depth);
+ rebalance_after_insertion(new_node, depth, tree_size+1, h_alpha, max_tree_size);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //! "hint" is node from the "header"'s tree.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" using "hint" as a hint to where it should be
+ //! inserted and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //! If "hint" is the upper_bound the function has constant time
+ //! complexity (two comparisons in the worst case).
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic, but it is
+ //! amortized constant time if new_node should be inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, node_ptr hint, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data)
+ {
+ std::size_t depth;
+ std::pair<node_ptr, bool> ret =
+ tree_algorithms::insert_unique_check
+ (header, hint, key, comp, commit_data, &depth);
+ commit_data.depth = depth;
+ return ret;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "commit_data" must have been obtained from a previous call to
+ //! "insert_unique_check". No objects should have been inserted or erased
+ //! from the set between the "insert_unique_check" that filled "commit_data"
+ //! and the call to "insert_commit".
+ //!
+ //!
+ //! <b>Effects</b>: Inserts new_node in the set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ template<class H_Alpha>
+ static void insert_unique_commit
+ (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data
+ ,std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
+ {
+ tree_algorithms::insert_unique_commit(header, new_value, commit_data);
+ rebalance_after_insertion(new_value, commit_data.depth, tree_size+1, h_alpha, max_tree_size);
+ }
+
+ //! <b>Requires</b>: header must be the header of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ static void rebalance(node_ptr header)
+ { tree_algorithms::rebalance(header); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ static node_ptr rebalance_subtree(node_ptr old_root)
+ { return tree_algorithms::rebalance_subtree(old_root); }
+
+ //! <b>Requires</b>: "n" must be a node inserted in a tree.
+ //!
+ //! <b>Effects</b>: Returns a pointer to the header node of the tree.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_header(node_ptr n)
+ { return tree_algorithms::get_header(n); }
+
+ /// @cond
+ private:
+
+ //! <b>Requires</b>: p is a node of a tree.
+ //!
+ //! <b>Effects</b>: Returns true if p is the header of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool is_header(const_node_ptr p)
+ { return tree_algorithms::is_header(p); }
+
+ template<class H_Alpha>
+ static void rebalance_after_insertion
+ ( node_ptr x, std::size_t depth
+ , std::size_t tree_size, H_Alpha h_alpha, std::size_t &max_tree_size)
+ {
+ if(tree_size > max_tree_size)
+ max_tree_size = tree_size;
+
+ if(tree_size != 1 && depth > h_alpha(tree_size)){
+ //Find the first non height-balanced node
+ //as described in the section 4.2 of the paper.
+ //This method is the alternative method described
+ //in the paper. Authors claim that this method
+ //may tend to yield more balanced trees on the average
+ //than the weight balanced method.
+ node_ptr s = x;
+ std::size_t size = 1;
+
+ for(std::size_t i = 1; true; ++i){
+ bool rebalance = false;
+ if(i == depth){
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(tree_size == count(s));
+ rebalance = true;
+ }
+ else if(i > h_alpha(size)){
+ node_ptr s_parent = NodeTraits::get_parent(s);
+ node_ptr s_parent_left = NodeTraits::get_left(s_parent);
+ size += 1 + tree_algorithms::count
+ ( s_parent_left == s ? NodeTraits::get_right(s_parent) : s_parent_left );
+ s = s_parent;
+ rebalance = true;
+ }
+ if(rebalance){
+ rebalance_subtree(s);
+ break;
+ }
+ }
+ }
+ }
+
+ /// @endcond
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SGTREE_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/slist.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/slist.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,2097 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_SLIST_HPP
+#define BOOST_INTRUSIVE_SLIST_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/slist_hook.hpp>
+#include <boost/intrusive/circular_slist_algorithms.hpp>
+#include <boost/intrusive/linear_slist_algorithms.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/clear_on_destructor_base.hpp>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <iterator>
+#include <functional>
+#include <algorithm>
+#include <cstddef> //std::size_t
+#include <utility> //std::pair
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+template <class ValueTraits, class SizeType, bool ConstantTimeSize, bool Linear, bool CacheLast>
+struct slistopt
+{
+ typedef ValueTraits value_traits;
+ typedef SizeType size_type;
+ static const bool constant_time_size = ConstantTimeSize;
+ static const bool linear = Linear;
+ static const bool cache_last = CacheLast;
+};
+
+template<class Node, class NodePtr, bool>
+struct root_plus_last
+{
+ Node root_;
+ NodePtr last_;
+};
+
+template<class Node, class NodePtr>
+struct root_plus_last<Node, NodePtr, false>
+{
+ Node root_;
+};
+
+template <class T>
+struct slist_defaults
+ : pack_options
+ < none
+ , base_hook<detail::default_slist_hook>
+ , constant_time_size<true>
+ , linear<false>
+ , size_type<std::size_t>
+ , cache_last<false>
+ >::type
+{};
+
+/// @endcond
+
+//! The class template slist is an intrusive container, that encapsulates
+//! a singly-linked list. You can use such a list to squeeze the last bit
+//! of performance from your application. Unfortunately, the little gains
+//! come with some huge drawbacks. A lot of member functions can't be
+//! implemented as efficiently as for standard containers. To overcome
+//! this limitation some other member functions with rather unusual semantics
+//! have to be introduced.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<>,
+//! \c linear<> and \c cache_last<>.
+//!
+//! The iterators of slist are forward iterators. slist provides a static
+//! function called "previous" to compute the previous iterator of a given iterator.
+//! This function has linear complexity. To improve the usability esp. with
+//! the '*_after' functions, ++end() == begin() and previous(begin()) == end()
+//! are defined. An new special function "before_begin()" is defined, which returns
+//! an iterator that points one less the beginning of the list: ++before_begin() == begin()
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class slist_impl
+ : private detail::clear_on_destructor_base<slist_impl<Config> >
+{
+ template<class C> friend class detail::clear_on_destructor_base;
+ //Public typedefs
+ public:
+ typedef typename Config::value_traits value_traits;
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ /// @endcond
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::const_pointer const_pointer;
+ typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ typedef typename std::iterator_traits<pointer>::difference_type difference_type;
+ typedef typename Config::size_type size_type;
+ typedef slist_iterator<slist_impl, false> iterator;
+ typedef slist_iterator<slist_impl, true> const_iterator;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename boost::pointer_to_other
+ <pointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <pointer, const node>::type const_node_ptr;
+ typedef typename detail::if_c
+ < Config::linear
+ , linear_slist_algorithms<node_traits>
+ , circular_slist_algorithms<node_traits>
+ >::type node_algorithms;
+
+ static const bool constant_time_size = Config::constant_time_size;
+ static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+ static const bool linear = Config::linear;
+ static const bool cache_last = Config::cache_last;
+
+ /// @cond
+ private:
+ typedef detail::size_holder<constant_time_size, size_type> size_traits;
+
+ //! This class is
+ //! non-copyable
+ slist_impl (const slist_impl&);
+
+ //! This class is
+ //! non-asignable
+ slist_impl &operator =(const slist_impl&);
+
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ //Constant-time size is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(constant_time_size && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+ //Linear singly linked lists are incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(linear && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+ //A list with cached last node is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(cache_last && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+
+ node_ptr get_end_node()
+ { return node_ptr(linear ? node_ptr(0) : this->get_root_node()); }
+
+ const_node_ptr get_end_node() const
+ {
+ return const_node_ptr
+ (linear ? const_node_ptr(0) : this->get_root_node()); }
+
+ node_ptr get_root_node()
+ { return node_ptr(&data_.root_plus_size_.root_); }
+
+ const_node_ptr get_root_node() const
+ { return const_node_ptr(&data_.root_plus_size_.root_); }
+
+ node_ptr get_last_node()
+ { return this->get_last_node(detail::bool_<cache_last>()); }
+
+ const_node_ptr get_last_node() const
+ { return this->get_last_node(detail::bool_<cache_last>()); }
+
+ void set_last_node(node_ptr n)
+ { return this->set_last_node(n, detail::bool_<cache_last>()); }
+
+ static node_ptr get_last_node(detail::bool_<false>)
+ { return node_ptr(0); }
+
+ static void set_last_node(node_ptr, detail::bool_<false>)
+ {}
+
+ node_ptr get_last_node(detail::bool_<true>)
+ { return node_ptr(data_.root_plus_size_.last_); }
+
+ const_node_ptr get_last_node(detail::bool_<true>) const
+ { return const_node_ptr(data_.root_plus_size_.last_); }
+
+ void set_last_node(node_ptr n, detail::bool_<true>)
+ { data_.root_plus_size_.last_ = n; }
+
+ static node_ptr uncast(const_node_ptr ptr)
+ { return node_ptr(const_cast<node*>(detail::get_pointer(ptr))); }
+
+ void set_default_constructed_state()
+ {
+ node_algorithms::init_header(this->get_root_node());
+ this->priv_size_traits().set_size(size_type(0));
+ if(cache_last){
+ this->set_last_node(this->get_root_node());
+ }
+ }
+
+ struct root_plus_size
+ : public size_traits
+ , public root_plus_last<node, node_ptr, cache_last>
+ {};
+
+ struct data_t
+ : public slist_impl::value_traits
+ {
+ typedef typename slist_impl::value_traits value_traits;
+ data_t(const value_traits &val_traits)
+ : value_traits(val_traits)
+ {}
+
+ root_plus_size root_plus_size_;
+ } data_;
+
+ size_traits &priv_size_traits()
+ { return data_.root_plus_size_; }
+
+ const size_traits &priv_size_traits() const
+ { return data_.root_plus_size_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<false>) const
+ { return data_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<true>) const
+ { return data_.get_value_traits(*this); }
+
+ real_value_traits &get_real_value_traits(detail::bool_<false>)
+ { return data_; }
+
+ real_value_traits &get_real_value_traits(detail::bool_<true>)
+ { return data_.get_value_traits(*this); }
+
+ /// @endcond
+
+ public:
+
+ const real_value_traits &get_real_value_traits() const
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ real_value_traits &get_real_value_traits()
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ public:
+ //! <b>Effects</b>: constructs an empty list.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
+ slist_impl(const value_traits &v_traits = value_traits())
+ : data_(v_traits)
+ { this->set_default_constructed_state(); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //!
+ //! <b>Effects</b>: Constructs a list equal to [first,last).
+ //!
+ //! <b>Complexity</b>: Linear in std::distance(b, e). No copy constructors are called.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
+ template<class Iterator>
+ slist_impl(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
+ : data_(v_traits)
+ {
+ this->set_default_constructed_state();
+ this->insert_after(this->cbefore_begin(), b, e);
+ }
+
+ //! <b>Effects</b>: If it's a safe-mode
+ //! or auto-unlink value, the destructor does nothing
+ //! (ie. no code is generated). Otherwise it detaches all elements from this.
+ //! In this case the objects in the list are not deleted (i.e. no destructors
+ //! are called), but the hooks according to the value_traits template parameter
+ //! are set to their default value.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the list, if
+ //! it's a safe-mode or auto-unlink value. Otherwise constant.
+ ~slist_impl()
+ {}
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements of the list.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the erased elements.
+ void clear()
+ {
+ if(safemode_or_autounlink){
+ this->clear_and_dispose(detail::null_disposer());
+ }
+ else{
+ this->set_default_constructed_state();
+ }
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements of the list.
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased elements.
+ template <class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ {
+ const_iterator it(this->begin()), itend(this->end());
+ while(it != itend){
+ node_ptr to_erase(it.pointed_node());
+ ++it;
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ }
+ this->set_default_constructed_state();
+ }
+
+ //! <b>Requires</b>: value must be an lvalue.
+ //!
+ //! <b>Effects</b>: Inserts the value in the front of the list.
+ //! No copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ void push_front(reference value)
+ {
+ node_ptr to_insert = get_real_value_traits().to_node_ptr(value);
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(to_insert));
+ if(cache_last){
+ if(this->empty()){
+ this->set_last_node(to_insert);
+ }
+ }
+ node_algorithms::link_after(this->get_root_node(), to_insert);
+ this->priv_size_traits().increment();
+ }
+
+ //! <b>Requires</b>: value must be an lvalue.
+ //!
+ //! <b>Effects</b>: Inserts the value in the back of the list.
+ //! No copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! This function is only available is cache_last<> is true.
+ void push_back(reference value)
+ {
+ BOOST_STATIC_ASSERT((cache_last != 0));
+ this->insert_after(const_iterator(this->get_last_node(), this), value);
+ }
+
+ //! <b>Effects</b>: Erases the first element of the list.
+ //! No destructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the erased element.
+ void pop_front()
+ { return this->pop_front_and_dispose(detail::null_disposer()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the first element of the list.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased element.
+ template<class Disposer>
+ void pop_front_and_dispose(Disposer disposer)
+ {
+ node_ptr to_erase = node_traits::get_next(this->get_root_node());
+ node_algorithms::unlink_after(this->get_root_node());
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ if(cache_last){
+ if(this->empty()){
+ this->set_last_node(this->get_root_node());
+ }
+ }
+ }
+
+ //! <b>Effects</b>: Returns a reference to the first element of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ reference front()
+ { return *this->get_real_value_traits().to_value_ptr(node_traits::get_next(this->get_root_node())); }
+
+ //! <b>Effects</b>: Returns a const_reference to the first element of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_reference front() const
+ { return *this->get_real_value_traits().to_value_ptr(uncast(node_traits::get_next(this->get_root_node()))); }
+
+ //! <b>Effects</b>: Returns a reference to the last element of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! This function is only available is cache_last<> is true.
+ reference back()
+ {
+ BOOST_STATIC_ASSERT((cache_last != 0));
+ return *this->get_real_value_traits().to_value_ptr(this->get_last_node());
+ }
+
+ //! <b>Effects</b>: Returns a const_reference to the last element of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! This function is only available is cache_last<> is true.
+ const_reference back() const
+ {
+ BOOST_STATIC_ASSERT((cache_last != 0));
+ return *this->get_real_value_traits().to_value_ptr(this->get_last_node());
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ iterator begin()
+ { return iterator (node_traits::get_next(this->get_root_node()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator begin() const
+ { return const_iterator (node_traits::get_next(this->get_root_node()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cbegin() const
+ { return const_iterator(node_traits::get_next(this->get_root_node()), this); }
+
+ //! <b>Effects</b>: Returns an iterator to the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ iterator end()
+ { return iterator(this->get_end_node(), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator end() const
+ { return const_iterator(uncast(this->get_end_node()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the end of the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cend() const
+ { return this->end(); }
+
+ //! <b>Effects</b>: Returns an iterator that points to a position
+ //! before the first element. Equivalent to "end()"
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ iterator before_begin()
+ { return iterator(this->get_root_node(), this); }
+
+ //! <b>Effects</b>: Returns an iterator that points to a position
+ //! before the first element. Equivalent to "end()"
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator before_begin() const
+ { return const_iterator(uncast(this->get_root_node()), this); }
+
+ //! <b>Effects</b>: Returns an iterator that points to a position
+ //! before the first element. Equivalent to "end()"
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ const_iterator cbefore_begin() const
+ { return this->before_begin(); }
+
+ //! <b>Effects</b>: Returns an iterator to the last element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: This function is present only if cached_last<> option is true.
+ iterator last()
+ { return iterator (this->get_last_node(), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: This function is present only if cached_last<> option is true.
+ const_iterator last() const
+ { return const_iterator (this->get_last_node(), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: This function is present only if cached_last<> option is true.
+ const_iterator clast() const
+ { return const_iterator(this->get_last_node(), this); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of slist.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the slist associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static slist_impl &container_from_end_iterator(iterator end_iterator)
+ { return slist_impl::priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of slist.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the slist associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const slist_impl &container_from_end_iterator(const_iterator end_iterator)
+ { return slist_impl::priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Effects</b>: Returns the number of the elements contained in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements contained in the list.
+ //! if constant_time_size is false. Constant time otherwise.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ size_type size() const
+ {
+ if(constant_time_size)
+ return this->priv_size_traits().get_size();
+ else
+ return node_algorithms::count(this->get_root_node()) - 1;
+ }
+
+ //! <b>Effects</b>: Returns true if the list contains no elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ bool empty() const
+ { return node_algorithms::unique(this->get_root_node()); }
+
+ //! <b>Effects</b>: Swaps the elements of x and *this.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements of both lists.
+ //! Constant-time if linear<> and/or cache_last<> options are used.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ void swap(slist_impl& other)
+ {
+ if(cache_last){
+ priv_swap_cache_last(this, &other);
+ }
+ else{
+ this->priv_swap_lists(this->get_root_node(), other.get_root_node(), detail::bool_<linear>());
+ }
+ if(constant_time_size){
+ size_type backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(other.priv_size_traits().get_size());
+ other.priv_size_traits().set_size(backup);
+ }
+ }
+
+ //! <b>Effects</b>: Moves backwards all the elements, so that the first
+ //! element becomes the second, the second becomes the third...
+ //! the last element becomes the first one.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements plus the number shifts.
+ //!
+ //! <b>Note</b>: Iterators Does not affect the validity of iterators and references.
+ void shift_backwards(size_type n = 1)
+ { this->priv_shift_backwards(n, detail::bool_<linear>()); }
+
+ //! <b>Effects</b>: Moves forward all the elements, so that the second
+ //! element becomes the first, the third becomes the second...
+ //! the first element becomes the last one.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements plus the number shifts.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ void shift_forward(size_type n = 1)
+ { this->priv_shift_forward(n, detail::bool_<linear>()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws.
+ template <class Cloner, class Disposer>
+ void clone_from(const slist_impl &src, Cloner cloner, Disposer disposer)
+ {
+ this->clear_and_dispose(disposer);
+ detail::exception_disposer<slist_impl, Disposer>
+ rollback(*this, disposer);
+ const_iterator prev(this->cbefore_begin());
+ const_iterator b(src.begin()), e(src.end());
+ for(; b != e; ++b){
+ prev = this->insert_after(prev, *cloner(*b));
+ }
+ rollback.release();
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and prev_p must point to an element
+ //! contained by the list or to end().
+ //!
+ //! <b>Effects</b>: Inserts the value after the position pointed by prev_p.
+ //! No copy constructor is called.
+ //!
+ //! <b>Returns</b>: An iterator to the inserted element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ iterator insert_after(const_iterator prev_p, reference value)
+ {
+ node_ptr n = get_real_value_traits().to_node_ptr(value);
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(n));
+ node_ptr prev_n(prev_p.pointed_node());
+ node_algorithms::link_after(prev_n, n);
+ if(cache_last && (this->get_last_node() == prev_n)){
+ this->set_last_node(n);
+ }
+ this->priv_size_traits().increment();
+ return iterator (n, this);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield
+ //! an lvalue of type value_type and prev_p must point to an element
+ //! contained by the list or to the end node.
+ //!
+ //! <b>Effects</b>: Inserts the [first, last)
+ //! after the position prev_p.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements inserted.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ template<class Iterator>
+ void insert_after(const_iterator prev_p, Iterator first, Iterator last)
+ {
+ for (; first != last; ++first)
+ prev_p = this->insert_after(prev_p, *first);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and p must point to an element
+ //! contained by the list or to end().
+ //!
+ //! <b>Effects</b>: Inserts the value before the position pointed by p.
+ //! No copy constructor is called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before p.
+ //! Constant-time if cache_last<> is true and p == end().
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ iterator insert(const_iterator p, reference value)
+ { return this->insert_after(this->previous(p), value); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield
+ //! an lvalue of type value_type and p must point to an element
+ //! contained by the list or to the end node.
+ //!
+ //! <b>Effects</b>: Inserts the pointed by b and e
+ //! before the position p. No copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements inserted plus linear
+ //! to the elements before b.
+ //! Linear to the number of elements to insert if cache_last<> option is true and p == end().
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ template<class Iterator>
+ void insert(const_iterator p, Iterator b, Iterator e)
+ { return this->insert_after(this->previous(p), b, e); }
+
+ //! <b>Effects</b>: Erases the element after the element pointed by prev of
+ //! the list. No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ iterator erase_after(const_iterator prev)
+ { return this->erase_after_and_dispose(prev, detail::null_disposer()); }
+
+ //! <b>Effects</b>: Erases the range (before_first, last) from
+ //! the list. No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of erased elements if it's a safe-mode
+ //! , auto-unlink value or constant-time size is activated. Constant time otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ iterator erase_after(const_iterator before_first, const_iterator last)
+ {
+ if(safemode_or_autounlink || constant_time_size){
+ return this->erase_after_and_dispose(before_first, last, detail::null_disposer());
+ }
+ else{
+ node_ptr bfp = before_first.pointed_node();
+ node_ptr lp = last.pointed_node();
+ if(cache_last){
+ if((lp == this->get_end_node())){
+ this->set_last_node(bfp);
+ }
+ }
+ node_algorithms::unlink_after(bfp, lp);
+ return last.unconst();
+ }
+ }
+
+ //! <b>Effects</b>: Erases the range (before_first, last) from
+ //! the list. n must be std::distance(before_first, last) - 1.
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: constant-time if link_mode is normal_link.
+ //! Linear to the elements (last - before_first) otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ iterator erase_after(const_iterator before_first, const_iterator last, difference_type n)
+ {
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(++const_iterator(before_first), last) == difference_type(n));
+ if(safemode_or_autounlink){
+ return this->erase_after(before_first, last);
+ }
+ else{
+ node_ptr bfp = before_first.pointed_node();
+ node_ptr lp = last.pointed_node();
+ if(cache_last){
+ if((lp == this->get_end_node())){
+ this->set_last_node(bfp);
+ }
+ }
+ node_algorithms::unlink_after(bfp, lp);
+ if(constant_time_size){
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size() - n);
+ }
+ return last.unconst();
+ }
+ }
+
+ //! <b>Effects</b>: Erases the element pointed by i of the list.
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed element,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements before i.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ iterator erase(const_iterator i)
+ { return this->erase_after(this->previous(i)); }
+
+ //! <b>Requires</b>: first and last must be valid iterator to elements in *this.
+ //!
+ //! <b>Effects</b>: Erases the range pointed by b and e.
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements before last.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased elements.
+ iterator erase(const_iterator first, const_iterator last)
+ { return this->erase_after(this->previous(first), last); }
+
+ //! <b>Effects</b>: Erases the range [first, last) from
+ //! the list. n must be std::distance(first, last).
+ //! No destructors are called.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: linear to the elements before first if link_mode is normal_link
+ //! and constant_time_size is activated. Linear to the elements before last otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ iterator erase(const_iterator first, const_iterator last, difference_type n)
+ { return this->erase_after(this->previous(first), last, n); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element after the element pointed by prev of
+ //! the list.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased element.
+ template<class Disposer>
+ iterator erase_after_and_dispose(const_iterator prev, Disposer disposer)
+ {
+ const_iterator it(prev);
+ ++it;
+ node_ptr to_erase(it.pointed_node());
+ ++it;
+ node_ptr prev_n(prev.pointed_node());
+ node_algorithms::unlink_after(prev_n);
+ if(cache_last && (to_erase == this->get_last_node())){
+ this->set_last_node(prev_n);
+ }
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ this->priv_size_traits().decrement();
+ return it.unconst();
+ }
+
+ /// @cond
+
+ template<class Disposer>
+ static iterator s_erase_after_and_dispose(const_iterator prev, Disposer disposer)
+ {
+ BOOST_STATIC_ASSERT(((!cache_last)&&(!constant_time_size)&&(!stateful_value_traits)));
+ const_iterator it(prev);
+ ++it;
+ node_ptr to_erase(it.pointed_node());
+ ++it;
+ node_ptr prev_n(prev.pointed_node());
+ node_algorithms::unlink_after(prev_n);
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(real_value_traits::to_value_ptr(to_erase));
+ return it.unconst();
+ }
+
+ static iterator s_erase_after(const_iterator prev)
+ { return s_erase_after_and_dispose(prev, detail::null_disposer()); }
+
+ /// @endcond
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range (before_first, last) from
+ //! the list.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Lineal to the elements (last - before_first + 1).
+ //!
+ //! <b>Note</b>: Invalidates the iterators to the erased element.
+ template<class Disposer>
+ iterator erase_after_and_dispose(const_iterator before_first, const_iterator last, Disposer disposer)
+ {
+ node_ptr bfp(before_first.pointed_node()), lp(last.pointed_node());
+ node_ptr fp(node_traits::get_next(bfp));
+ node_algorithms::unlink_after(bfp, lp);
+ while(fp != lp){
+ node_ptr to_erase(fp);
+ fp = node_traits::get_next(fp);
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ this->priv_size_traits().decrement();
+ }
+ if(cache_last && (node_traits::get_next(bfp) == this->get_end_node())){
+ this->set_last_node(bfp);
+ }
+ return last.unconst();
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed by i of the list.
+ //! No destructors are called.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed element,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements before i.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased element.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return this->erase_after_and_dispose(this->previous(i), disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: first and last must be valid iterator to elements in *this.
+ //! Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed by b and e.
+ //! No destructors are called.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: the first element remaining beyond the removed elements,
+ //! or end() if no such element exists.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of erased elements plus linear
+ //! to the elements before first.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references) to the
+ //! erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator first, const_iterator last, Disposer disposer)
+ { return this->erase_after_and_dispose(this->previous(first), last, disposer); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield
+ //! an lvalue of type value_type.
+ //!
+ //! <b>Effects</b>: Clears the list and inserts the range pointed by b and e.
+ //! No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements inserted plus
+ //! linear to the elements contained in the list if it's a safe-mode
+ //! or auto-unlink value.
+ //! Linear to the number of elements inserted in the list otherwise.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements.
+ template<class Iterator>
+ void assign(Iterator b, Iterator e)
+ {
+ this->clear();
+ this->insert_after(this->cbefore_begin(), b, e);
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Requires</b>: Dereferencing iterator must yield
+ //! an lvalue of type value_type.
+ //!
+ //! <b>Effects</b>: Clears the list and inserts the range pointed by b and e.
+ //! No destructors or copy constructors are called.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements inserted plus
+ //! linear to the elements contained in the list.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements.
+ template<class Iterator, class Disposer>
+ void dispose_and_assign(Disposer disposer, Iterator b, Iterator e)
+ {
+ this->clear_and_dispose(disposer);
+ this->insert_after(this->cbefore_begin(), b, e, disposer);
+ }
+
+ //! <b>Requires</b>: prev is an iterator to an element or x.end()/x.before_begin() in x.
+ //!
+ //! <b>Effects</b>: Transfers all the elements of list x to this list, after the
+ //! the element pointed by prev. No destructors or copy constructors are called.
+ //!
+ //! <b>Returns</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: In general, linear to the elements contained in x.
+ //! Constant-time if cache_last<> option is true and also constant-time if
+ //! linear<> option is true "this" is empty and "last" is not used.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ //!
+ //! <b>Additional note</b>: If the optional parameter "last" is provided, it will be
+ //! assigned to the last spliced element or prev if x is empty.
+ //! This iterator can be used as new "prev" iterator for a new splice_after call.
+ //! that will splice new values after the previously spliced values.
+ void splice_after(const_iterator prev, slist_impl &x, const_iterator *last = 0)
+ {
+ if(x.empty()){
+ if(last) *last = prev;
+ }
+ else if(linear && this->empty()){
+ this->swap(x);
+ if(last) *last = this->previous(this->cend());
+ }
+ else{
+ const_iterator last_x(x.previous(x.end())); //<- constant time if cache_last is active
+ node_ptr prev_n(prev.pointed_node());
+ node_ptr last_x_n(last_x.pointed_node());
+ if(cache_last){
+ x.set_last_node(x.get_root_node());
+ if(node_traits::get_next(prev_n) == this->get_end_node()){
+ this->set_last_node(last_x_n);
+ }
+ }
+ node_algorithms::transfer_after( prev_n, x.before_begin().pointed_node(), last_x_n);
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size() + x.priv_size_traits().get_size());
+ x.priv_size_traits().set_size(size_type(0));
+ if(last) *last = last_x;
+ }
+ }
+
+ //! <b>Requires</b>: prev must point to an element contained by this list or
+ //! to the before_begin() element. prev_ele must point to an element contained in list
+ //! x or must be x.before_begin().
+ //!
+ //! <b>Effects</b>: Transfers the element after prev_ele, from list x to this list,
+ //! after the element pointed by prev. No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator prev_ele)
+ {
+ const_iterator elem = prev_ele;
+ this->splice_after(prev_pos, x, prev_ele, ++elem, 1);
+ }
+
+ //! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
+ //! before_begin(), and before_first and before_last belong to x and
+ //! ++before_first != x.end() && before_last != x.end().
+ //!
+ //! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
+ //! list, after the element pointed by prev_pos.
+ //! No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements transferred
+ //! if constant_time_size is true. Constant-time otherwise.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_first, const_iterator before_last)
+ {
+ if(constant_time_size)
+ this->splice_after(prev_pos, x, before_first, before_last, std::distance(before_first, before_last));
+ else
+ this->priv_splice_after
+ (prev_pos.pointed_node(), x, before_first.pointed_node(), before_last.pointed_node());
+ }
+
+ //! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
+ //! before_begin(), and before_first and before_last belong to x and
+ //! ++before_first != x.end() && before_last != x.end() and
+ //! n == std::distance(before_first, before_last).
+ //!
+ //! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
+ //! list, after the element pointed by p. No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_first, const_iterator before_last, difference_type n)
+ {
+ if(n){
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(before_first, before_last) == n);
+ this->priv_splice_after
+ (prev_pos.pointed_node(), x, before_first.pointed_node(), before_last.pointed_node());
+ if(constant_time_size){
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size() + n);
+ x.priv_size_traits().set_size(x.priv_size_traits().get_size() - n);
+ }
+ }
+ }
+
+ //! <b>Requires</b>: it is an iterator to an element in x.
+ //!
+ //! <b>Effects</b>: Transfers all the elements of list x to this list, before the
+ //! the element pointed by it. No destructors or copy constructors are called.
+ //!
+ //! <b>Returns</b>: Nothing.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements contained in x plus linear to
+ //! the elements before it.
+ //! Linear to the elements before it if cache_last<> option is true.
+ //! Constant-time if cache_last<> option is true and it == end().
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ //!
+ //! <b>Additional note</b>: If the optional parameter "last" is provided, it will be
+ //! assigned to the last spliced element or prev if x is empty.
+ //! This iterator can be used as new "prev" iterator for a new splice_after call.
+ //! that will splice new values after the previously spliced values.
+ void splice(const_iterator it, slist_impl &x, iterator *last = 0)
+ { this->splice_after(this->previous(it), x, last); }
+
+ //! <b>Requires</b>: it p must be a valid iterator of *this.
+ //! elem must point to an element contained in list
+ //! x.
+ //!
+ //! <b>Effects</b>: Transfers the element elem, from list x to this list,
+ //! before the element pointed by pos. No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements before pos and before elem.
+ //! Linear to the elements before elem if cache_last<> option is true and pos == end().
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice(const_iterator pos, slist_impl &x, const_iterator elem)
+ { return this->splice_after(this->previous(pos), x, x.previous(elem)); }
+
+ //! <b>Requires</b>: pos must be a dereferenceable iterator in *this
+ //! and first and last belong to x and first and last a valid range on x.
+ //!
+ //! <b>Effects</b>: Transfers the range [first, last) from list x to this
+ //! list, before the element pointed by pos.
+ //! No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the sum of elements before pos, first, and last
+ //! plus linear to the number of elements transferred if constant_time_size is true.
+ //! Linear to the sum of elements before first, and last
+ //! plus linear to the number of elements transferred if constant_time_size is true
+ //! if cache_last<> is true and pos == end()
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice(const_iterator pos, slist_impl &x, const_iterator first, const_iterator last)
+ { return this->splice_after(this->previous(pos), x, x.previous(first), x.previous(last)); }
+
+ //! <b>Requires</b>: pos must be a dereferenceable iterator in *this
+ //! and first and last belong to x and first and last a valid range on x.
+ //! n == std::distance(first, last).
+ //!
+ //! <b>Effects</b>: Transfers the range [first, last) from list x to this
+ //! list, before the element pointed by pos.
+ //! No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the sum of elements before pos, first, and last.
+ //! Linear to the sum of elements before first and last
+ //! if cache_last<> is true and pos == end().
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void splice(const_iterator pos, slist_impl &x, const_iterator first, const_iterator last, difference_type n)
+ { return this->splice_after(this->previous(pos), x, x.previous(first), x.previous(last), n); }
+
+ //! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
+ //! The sort is stable, that is, the relative order of equivalent elements is preserved.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the predicate throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: The number of comparisons is approximately N log N, where N
+ //! is the list's size.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated
+ template<class Predicate>
+ void sort(Predicate p)
+ {
+ if (node_traits::get_next(node_traits::get_next(this->get_root_node()))
+ != this->get_root_node()) {
+ slist_impl carry;
+ slist_impl counter[64];
+ int fill = 0;
+ const_iterator last_inserted;
+ while(!this->empty()){
+ last_inserted = this->cbegin();
+ carry.splice_after(carry.cbefore_begin(), *this, this->cbefore_begin());
+ int i = 0;
+ while(i < fill && !counter[i].empty()) {
+ carry.swap(counter[i]);
+ carry.merge(counter[i++], p, &last_inserted);
+ }
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(counter[i].empty());
+ const_iterator last_element(carry.previous(last_inserted, carry.end()));
+
+ if(constant_time_size){
+ counter[i].splice_after( counter[i].cbefore_begin(), carry
+ , carry.cbefore_begin(), last_element
+ , carry.size());
+ }
+ else{
+ counter[i].splice_after( counter[i].cbefore_begin(), carry
+ , carry.cbefore_begin(), last_element);
+ }
+ if(i == fill)
+ ++fill;
+ }
+
+ for (int i = 1; i < fill; ++i)
+ counter[i].merge(counter[i-1], p, &last_inserted);
+ --fill;
+ const_iterator last_element(counter[fill].previous(last_inserted, counter[fill].end()));
+ if(constant_time_size){
+ this->splice_after( cbefore_begin(), counter[fill], counter[fill].cbefore_begin()
+ , last_element, counter[fill].size());
+ }
+ else{
+ this->splice_after( cbefore_begin(), counter[fill], counter[fill].cbefore_begin()
+ , last_element);
+ }
+ }
+ }
+
+ //! <b>Requires</b>: p must be a comparison function that induces a strict weak
+ //! ordering and both *this and x must be sorted according to that ordering
+ //! The lists x and *this must be distinct.
+ //!
+ //! <b>Effects</b>: This function removes all of x's elements and inserts them
+ //! in order into *this. The merge is stable; that is, if an element from *this is
+ //! equivalent to one from x, then the element from *this will precede the one from x.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or std::less<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: This function is linear time: it performs at most
+ //! size() + x.size() - 1 comparisons.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ void sort()
+ { this->sort(std::less<value_type>()); }
+
+ //! <b>Requires</b>: p must be a comparison function that induces a strict weak
+ //! ordering and both *this and x must be sorted according to that ordering
+ //! The lists x and *this must be distinct.
+ //!
+ //! <b>Effects</b>: This function removes all of x's elements and inserts them
+ //! in order into *this. The merge is stable; that is, if an element from *this is
+ //! equivalent to one from x, then the element from *this will precede the one from x.
+ //!
+ //! <b>Returns</b>: Nothing.
+ //!
+ //! <b>Throws</b>: If the predicate throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: This function is linear time: it performs at most
+ //! size() + x.size() - 1 comparisons.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ //!
+ //! <b>Additional note</b>: If optional "last" argument is passed, it is assigned
+ //! to an iterator to the last transferred value or end() is x is empty.
+ template<class Predicate>
+ void merge(slist_impl& x, Predicate p, const_iterator *last = 0)
+ {
+ const_iterator e(this->cend()), ex(x.cend()), bb(this->cbefore_begin()),
+ bb_next;
+ if(last) *last = e.unconst();
+ while(!x.empty()){
+ const_iterator ibx_next(x.cbefore_begin()), ibx(ibx_next++);
+ while (++(bb_next = bb) != e && !p(*ibx_next, *bb_next)){
+ bb = bb_next;
+ }
+ if(bb_next == e){
+ //Now transfer the rest to the end of the container
+ this->splice_after(bb, x, last);
+ break;
+ }
+ else{
+ size_type n(0);
+ do{
+ ibx = ibx_next; ++n;
+ } while(++(ibx_next = ibx) != ex && p(*ibx_next, *bb_next));
+ this->splice_after(bb, x, x.before_begin(), ibx, n);
+ if(last) *last = ibx;
+ }
+ }
+ }
+
+ //! <b>Effects</b>: This function removes all of x's elements and inserts them
+ //! in order into *this according to std::less<value_type>. The merge is stable;
+ //! that is, if an element from *this is equivalent to one from x, then the element
+ //! from *this will precede the one from x.
+ //!
+ //! <b>Throws</b>: if std::less<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: This function is linear time: it performs at most
+ //! size() + x.size() - 1 comparisons.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated
+ void merge(slist_impl& x)
+ { this->merge(x, std::less<value_type>()); }
+
+ //! <b>Effects</b>: Reverses the order of elements in the list.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: This function is linear to the contained elements.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated
+ void reverse()
+ {
+ if(cache_last && !this->empty()){
+ this->set_last_node(node_traits::get_next(this->get_root_node()));
+ }
+ this->priv_reverse(detail::bool_<linear>());
+ }
+
+ //! <b>Effects</b>: Removes all the elements that compare equal to value.
+ //! No destructors are called.
+ //!
+ //! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid. This function is
+ //! linear time: it performs exactly size() comparisons for equality.
+ void remove(const_reference value)
+ { this->remove_if(detail::equal_to_value<const_reference>(value)); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Removes all the elements that compare equal to value.
+ //! Disposer::operator()(pointer) is called for every removed element.
+ //!
+ //! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class Disposer>
+ void remove_and_dispose(const_reference value, Disposer disposer)
+ { this->remove_and_dispose_if(detail::equal_to_value<const_reference>(value), disposer); }
+
+ //! <b>Effects</b>: Removes all the elements for which a specified
+ //! predicate is satisfied. No destructors are called.
+ //!
+ //! <b>Throws</b>: If pred throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time. It performs exactly size() calls to the predicate.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class Pred>
+ void remove_if(Pred pred)
+ { this->remove_and_dispose_if(pred, detail::null_disposer()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Removes all the elements for which a specified
+ //! predicate is satisfied.
+ //! Disposer::operator()(pointer) is called for every removed element.
+ //!
+ //! <b>Throws</b>: If pred throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time. It performs exactly size() comparisons for equality.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class Pred, class Disposer>
+ void remove_and_dispose_if(Pred pred, Disposer disposer)
+ {
+ const_iterator bcur(this->before_begin()), cur(this->begin()), e(this->end());
+
+ while(cur != e){
+ if (pred(*cur)){
+ cur = this->erase_after_and_dispose(bcur, disposer);
+ }
+ else{
+ bcur = cur;
+ ++cur;
+ }
+ }
+ if(cache_last){
+ this->set_last_node(bcur.pointed_node());
+ }
+ }
+
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! elements that are equal from the list. No destructors are called.
+ //!
+ //! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time (size()-1) comparisons calls to pred()).
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ void unique()
+ { this->unique_and_dispose(std::equal_to<value_type>(), detail::null_disposer()); }
+
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! elements that satisfy some binary predicate from the list.
+ //! No destructors are called.
+ //!
+ //! <b>Throws</b>: If the predicate throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class BinaryPredicate>
+ void unique(BinaryPredicate pred)
+ { this->unique_and_dispose(pred, detail::null_disposer()); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! elements that satisfy some binary predicate from the list.
+ //! Disposer::operator()(pointer) is called for every removed element.
+ //!
+ //! <b>Throws</b>: If std::equal_to<value_type> throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class Disposer>
+ void unique_and_dispose(Disposer disposer)
+ { this->unique(std::equal_to<value_type>(), disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Removes adjacent duplicate elements or adjacent
+ //! elements that satisfy some binary predicate from the list.
+ //! Disposer::operator()(pointer) is called for every removed element.
+ //!
+ //! <b>Throws</b>: If the predicate throws. Basic guarantee.
+ //!
+ //! <b>Complexity</b>: Linear time (size()-1) comparisons equality comparisons.
+ //!
+ //! <b>Note</b>: The relative order of elements that are not removed is unchanged,
+ //! and iterators to elements that are not removed remain valid.
+ template<class BinaryPredicate, class Disposer>
+ void unique_and_dispose(BinaryPredicate pred, Disposer disposer)
+ {
+ const_iterator end_n(this->cend());
+ const_iterator bcur(this->cbegin());
+ if(bcur != end_n){
+ const_iterator cur(bcur);
+ ++cur;
+ while(cur != end_n) {
+ if (pred(*bcur, *cur)){
+ cur = this->erase_after_and_dispose(bcur, disposer);
+ }
+ else{
+ bcur = cur;
+ ++cur;
+ }
+ }
+ if(cache_last){
+ this->set_last_node(bcur.pointed_node());
+ }
+ }
+ }
+
+ //! <b>Requires</b>: value must be a reference to a value inserted in a list.
+ //!
+ //! <b>Effects</b>: This function returns a const_iterator pointing to the element
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ //! This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(value)));
+ return iterator (value_traits::to_node_ptr(value), 0);
+ }
+
+ //! <b>Requires</b>: value must be a const reference to a value inserted in a list.
+ //!
+ //! <b>Effects</b>: This function returns an iterator pointing to the element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ //! This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(const_cast<reference> (value))));
+ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
+ }
+
+ //! <b>Requires</b>: value must be a reference to a value inserted in a list.
+ //!
+ //! <b>Effects</b>: This function returns a const_iterator pointing to the element
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ iterator iterator_to(reference value)
+ {
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(value)));
+ return iterator (value_traits::to_node_ptr(value), this);
+ }
+
+ //! <b>Requires</b>: value must be a const reference to a value inserted in a list.
+ //!
+ //! <b>Effects</b>: This function returns an iterator pointing to the element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators and references are not invalidated.
+ const_iterator iterator_to(const_reference value) const
+ {
+ //BOOST_INTRUSIVE_INVARIANT_ASSERT (!node_algorithms::inited(value_traits::to_node_ptr(const_cast<reference> (value))));
+ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this);
+ }
+
+ //! <b>Returns</b>: The iterator to the element before i in the list.
+ //! Returns the end-iterator, if either i is the begin-iterator or the
+ //! list is empty.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before i.
+ //! Constant if cache_last<> is true and i == end().
+ iterator previous(iterator i)
+ { return this->previous(this->cbefore_begin(), i); }
+
+ //! <b>Returns</b>: The const_iterator to the element before i in the list.
+ //! Returns the end-const_iterator, if either i is the begin-const_iterator or
+ //! the list is empty.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before i.
+ //! Constant if cache_last<> is true and i == end().
+ const_iterator previous(const_iterator i) const
+ { return this->previous(this->cbefore_begin(), i); }
+
+ //! <b>Returns</b>: The iterator to the element before i in the list,
+ //! starting the search on element after prev_from.
+ //! Returns the end-iterator, if either i is the begin-iterator or the
+ //! list is empty.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before i.
+ //! Constant if cache_last<> is true and i == end().
+ iterator previous(const_iterator prev_from, iterator i)
+ { return this->previous(prev_from, const_iterator(i)).unconst(); }
+
+ //! <b>Returns</b>: The const_iterator to the element before i in the list,
+ //! starting the search on element after prev_from.
+ //! Returns the end-const_iterator, if either i is the begin-const_iterator or
+ //! the list is empty.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements before i.
+ //! Constant if cache_last<> is true and i == end().
+ const_iterator previous(const_iterator prev_from, const_iterator i) const
+ {
+ if(cache_last && (i.pointed_node() == this->get_end_node())){
+ return const_iterator(uncast(this->get_last_node()), this);
+ }
+ return const_iterator
+ (node_algorithms::get_previous_node
+ (prev_from.pointed_node(), i.pointed_node()), this);
+ }
+
+ //! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
+ //! before_begin(), and before_first and before_last belong to x and
+ //! ++before_first != x.end() && before_last != x.end().
+ //!
+ //! <b>Effects</b>: Transfers the range (before_first, before_last] to this
+ //! list, after the element pointed by prev_pos.
+ //! No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements transferred
+ //! if constant_time_size is true. Constant-time otherwise.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void incorporate_after(const_iterator prev_from, node_ptr first, node_ptr before_last)
+ {
+ if(constant_time_size)
+ this->incorporate_after(prev_from, first, before_last, std::distance(first, before_last)+1);
+ else
+ this->priv_incorporate_after
+ (prev_from.pointed_node(), first, before_last);
+ }
+
+ //! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
+ //! before_begin(), and before_first and before_last belong to x and
+ //! ++before_first != x.end() && before_last != x.end() and
+ //! n == std::distance(first, before_last) + 1.
+ //!
+ //! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
+ //! list, after the element pointed by p. No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ void incorporate_after(const_iterator prev_pos, node_ptr first, node_ptr before_last, difference_type n)
+ {
+ if(n){
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(iterator(first, this), iterator(before_last, this))+1 == n);
+ this->priv_incorporate_after(prev_pos.pointed_node(), first, before_last);
+ if(constant_time_size){
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size() + n);
+ }
+ }
+ }
+
+ private:
+ void priv_splice_after(node_ptr prev_pos_n, slist_impl &x, node_ptr before_first_n, node_ptr before_last_n)
+ {
+ if (before_first_n != before_last_n && prev_pos_n != before_first_n && prev_pos_n != before_last_n)
+ {
+ if(cache_last){
+ if(node_traits::get_next(prev_pos_n) == this->get_end_node()){
+ this->set_last_node(before_last_n);
+ }
+ if(node_traits::get_next(before_last_n) == x.get_end_node()){
+ x.set_last_node(before_first_n);
+ }
+ }
+ node_algorithms::transfer_after(prev_pos_n, before_first_n, before_last_n);
+ }
+ }
+
+ void priv_incorporate_after(node_ptr prev_pos_n, node_ptr first_n, node_ptr before_last_n)
+ {
+ if(cache_last){
+ if(node_traits::get_next(prev_pos_n) == this->get_end_node()){
+ this->set_last_node(before_last_n);
+ }
+ }
+ node_algorithms::incorporate_after(prev_pos_n, first_n, before_last_n);
+ }
+
+ void priv_reverse(detail::bool_<false>)
+ { node_algorithms::reverse(this->get_root_node()); }
+
+ void priv_reverse(detail::bool_<true>)
+ {
+ node_ptr new_first = node_algorithms::reverse
+ (node_traits::get_next(this->get_root_node()));
+ node_traits::set_next(this->get_root_node(), new_first);
+ }
+
+ void priv_shift_backwards(size_type n, detail::bool_<false>)
+ {
+ node_ptr last = node_algorithms::move_forward(this->get_root_node(), (std::size_t)n);
+ if(cache_last && last){
+ this->set_last_node(last);
+ }
+ }
+
+ void priv_shift_backwards(size_type n, detail::bool_<true>)
+ {
+ std::pair<node_ptr, node_ptr> ret(
+ node_algorithms::move_first_n_forward
+ (node_traits::get_next(this->get_root_node()), (std::size_t)n));
+ if(ret.first){
+ node_traits::set_next(this->get_root_node(), ret.first);
+ if(cache_last){
+ this->set_last_node(ret.second);
+ }
+ }
+ }
+
+ void priv_shift_forward(size_type n, detail::bool_<false>)
+ {
+ node_ptr last = node_algorithms::move_backwards(this->get_root_node(), (std::size_t)n);
+ if(cache_last && last){
+ this->set_last_node(last);
+ }
+ }
+
+ void priv_shift_forward(size_type n, detail::bool_<true>)
+ {
+ std::pair<node_ptr, node_ptr> ret(
+ node_algorithms::move_first_n_backwards
+ (node_traits::get_next(this->get_root_node()), (std::size_t)n));
+ if(ret.first){
+ node_traits::set_next(this->get_root_node(), ret.first);
+ if(cache_last){
+ this->set_last_node(ret.second);
+ }
+ }
+ }
+
+ static void priv_swap_cache_last(slist_impl *this_impl, slist_impl *other_impl)
+ {
+ bool other_was_empty = false;
+ if(this_impl->empty()){
+ //Check if both are empty or
+ if(other_impl->empty())
+ return;
+ //If this is empty swap pointers
+ slist_impl *tmp = this_impl;
+ this_impl = other_impl;
+ other_impl = tmp;
+ other_was_empty = true;
+ }
+ else{
+ other_was_empty = other_impl->empty();
+ }
+
+ //Precondition: this is not empty
+ node_ptr other_old_last(other_impl->get_last_node());
+ node_ptr other_bfirst(other_impl->get_root_node());
+ node_ptr this_bfirst(this_impl->get_root_node());
+ node_ptr this_old_last(this_impl->get_last_node());
+
+ //Move all nodes from this to other's beginning
+ node_algorithms::transfer_after(other_bfirst, this_bfirst, this_old_last);
+ other_impl->set_last_node(this_old_last);
+
+ if(other_was_empty){
+ this_impl->set_last_node(this_bfirst);
+ }
+ else{
+ //Move trailing nodes from other to this
+ node_algorithms::transfer_after(this_bfirst, this_old_last, other_old_last);
+ this_impl->set_last_node(other_old_last);
+ }
+ }
+
+ //circular version
+ static void priv_swap_lists(node_ptr this_node, node_ptr other_node, detail::bool_<false>)
+ { node_algorithms::swap_nodes(this_node, other_node); }
+
+ //linear version
+ static void priv_swap_lists(node_ptr this_node, node_ptr other_node, detail::bool_<true>)
+ { node_algorithms::swap_trailing_nodes(this_node, other_node); }
+
+ static slist_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
+ {
+ //Obtaining the container from the end iterator is not possible with linear
+ //singly linked lists (because "end" is represented by the null pointer)
+ BOOST_STATIC_ASSERT(!linear);
+ root_plus_size *r = detail::parent_from_member<root_plus_size, node>
+ ( detail::get_pointer(end_iterator.pointed_node()), (&root_plus_size::root_));
+ data_t *d = detail::parent_from_member<data_t, root_plus_size>
+ ( r, &data_t::root_plus_size_);
+ slist_impl *s = detail::parent_from_member<slist_impl, data_t>(d, &slist_impl::data_);
+ return *s;
+ }
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const slist_impl<T, Options...> &x, const slist_impl<T, Options...> &y)
+#else
+(const slist_impl<Config> &x, const slist_impl<Config> &y)
+#endif
+{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+bool operator==
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const slist_impl<T, Options...> &x, const slist_impl<T, Options...> &y)
+#else
+(const slist_impl<Config> &x, const slist_impl<Config> &y)
+#endif
+{
+ typedef slist_impl<Config> slist_type;
+ typedef typename slist_type::const_iterator const_iterator;
+ const bool C = slist_type::constant_time_size;
+ if(C && x.size() != y.size()){
+ return false;
+ }
+ const_iterator end1 = x.end();
+
+ const_iterator i1 = x.begin();
+ const_iterator i2 = y.begin();
+ if(C){
+ while (i1 != end1 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1;
+ }
+ else{
+ const_iterator end2 = y.end();
+ while (i1 != end1 && i2 != end2 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1 && i2 == end2;
+ }
+}
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const slist_impl<T, Options...> &x, const slist_impl<T, Options...> &y)
+#else
+(const slist_impl<Config> &x, const slist_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const slist_impl<T, Options...> &x, const slist_impl<T, Options...> &y)
+#else
+(const slist_impl<Config> &x, const slist_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const slist_impl<T, Options...> &x, const slist_impl<T, Options...> &y)
+#else
+(const slist_impl<Config> &x, const slist_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const slist_impl<T, Options...> &x, const slist_impl<T, Options...> &y)
+#else
+(const slist_impl<Config> &x, const slist_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(slist_impl<T, Options...> &x, slist_impl<T, Options...> &y)
+#else
+(slist_impl<Config> &x, slist_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c slist that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none, class O3 = none, class O4 = none, class O5 = none>
+#endif
+struct make_slist
+{
+ /// @cond
+ typedef typename pack_options
+ < slist_defaults<T>,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+ typedef typename detail::get_value_traits
+ <T, typename packed_options::value_traits>::type value_traits;
+ typedef slist_impl
+ <
+ slistopt
+ < value_traits
+ , typename packed_options::size_type
+ , packed_options::constant_time_size
+ , packed_options::linear
+ , packed_options::cache_last
+ >
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4, class O5>
+#else
+template<class T, class ...Options>
+#endif
+class slist
+ : public make_slist<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_slist
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5
+ #else
+ Options...
+ #endif
+ >::type Base;
+ typedef typename Base::real_value_traits real_value_traits;
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
+ public:
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ slist(const value_traits &v_traits = value_traits())
+ : Base(v_traits)
+ {}
+
+ template<class Iterator>
+ slist(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
+ : Base(b, e, v_traits)
+ {}
+
+ static slist &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<slist &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const slist &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const slist &>(Base::container_from_end_iterator(end_iterator)); }
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SLIST_HPP
Added: sandbox/move/boost/intrusive/slist_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/slist_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,292 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_SLIST_HOOK_HPP
+#define BOOST_INTRUSIVE_SLIST_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/slist_node.hpp>
+#include <boost/intrusive/circular_slist_algorithms.hpp>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/generic_hook.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+template<class VoidPointer>
+struct get_slist_node_algo
+{
+ typedef circular_slist_algorithms<slist_node_traits<VoidPointer> > type;
+};
+
+/// @endcond
+
+//! Helper metafunction to define a \c slist_base_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_slist_base_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_slist_node_algo<typename packed_options::void_pointer>
+ , typename packed_options::tag
+ , packed_options::link_mode
+ , detail::SlistBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Derive a class from slist_base_hook in order to store objects in
+//! in an list. slist_base_hook holds the data necessary to maintain the
+//! list and provides an appropriate value_traits class for list.
+//!
+//! The hook admits the following options: \c tag<>, \c void_pointer<> and
+//! \c link_mode<>.
+//!
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! unique tag.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class slist_base_hook
+ : public make_slist_base_hook<
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ slist_base_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ slist_base_hook(const slist_base_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ slist_base_hook& operator=(const slist_base_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in an slist an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~slist_base_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(slist_base_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c slist::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+//! Helper metafunction to define a \c slist_member_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_slist_member_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_slist_node_algo<typename packed_options::void_pointer>
+ , member_tag
+ , packed_options::link_mode
+ , detail::NoBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Put a public data member slist_member_hook in order to store objects of this class in
+//! an list. slist_member_hook holds the data necessary for maintaining the list and
+//! provides an appropriate value_traits class for list.
+//!
+//! The hook admits the following options: \c void_pointer<> and
+//! \c link_mode<>.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class slist_member_hook
+ : public make_slist_member_hook<
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ slist_member_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ slist_member_hook(const slist_member_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ slist_member_hook& operator=(const slist_member_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in an slist an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~slist_member_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(slist_member_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c slist::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SLIST_HOOK_HPP
Added: sandbox/move/boost/intrusive/splay_set.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/splay_set.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,2365 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_SPLAY_SET_HPP
+#define BOOST_INTRUSIVE_SPLAY_SET_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/splaytree.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <iterator>
+
+namespace boost {
+namespace intrusive {
+
+//! The class template splay_set is an intrusive container, that mimics most of
+//! the interface of std::set as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class splay_set_impl
+{
+ /// @cond
+ typedef splaytree_impl<Config> tree_type;
+ //! This class is
+ //! non-copyable
+ splay_set_impl (const splay_set_impl&);
+
+ //! This class is
+ //! non-assignable
+ splay_set_impl &operator =(const splay_set_impl&);
+
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the value_compare object throws.
+ splay_set_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty splay_set and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise amortized N * log N, where N is std::distance(last, first).
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ splay_set_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(true, b, e, cmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the splay_set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~splay_set_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of splay_set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the splay_set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static splay_set_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<splay_set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &splay_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of splay_set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the splay_set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const splay_set_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<splay_set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &splay_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static splay_set_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<splay_set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &splay_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const splay_set_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<splay_set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &splay_set_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the splay_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the splay_set.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two splay_sets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(splay_set_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const splay_set_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to inserts value into the splay_set.
+ //!
+ //! <b>Returns</b>: If the value
+ //! is not already present inserts it and returns a pair containing the
+ //! iterator to the new value and true. If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert(reference value)
+ { return tree_.insert_unique(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to to insert x into the splay_set, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the
+ //! new element was inserted into the splay_set.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_unique(hint, value); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the splay_set, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the splay_set.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_check
+ (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(key, key_value_comp, commit_data); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the splay_set, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the splay_set.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_check
+ (const_iterator hint, const KeyType &key
+ ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(hint, key, key_value_comp, commit_data); }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the splay_set between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the splay_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_commit(reference value, const insert_commit_data &commit_data)
+ { return tree_.insert_unique_commit(value, commit_data); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the splay_set.
+ //!
+ //! <b>Complexity</b>: Insert range is amortized O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_unique(b, e); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is amortized
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size()) + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If the comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + this->count(value)). Basic guarantee.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value)
+ { return tree_.find(value) != end(); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp) != end(); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count_dont_splay(const_reference value)const
+ { return tree_.find_dont_splay(value) != end(); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count_dont_splay(const KeyType& key, KeyValueCompare comp)const
+ { return tree_.find_dont_splay(key, comp) != end(); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound_dont_splay(const_reference value) const
+ { return tree_.lower_bound_dont_splay(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound_dont_splay(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound_dont_splay(const_reference value) const
+ { return tree_.upper_bound_dont_splay(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound_dont_splay(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find_dont_splay(const_reference value) const
+ { return tree_.find_dont_splay(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find_dont_splay(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range_dont_splay(const_reference value) const
+ { return tree_.equal_range_dont_splay(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range_dont_splay(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a splay_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the splay_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a splay_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! splay_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a splay_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the splay_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a splay_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! splay_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a splay_set/multisplay_set.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ //! <b>Requires</b>: i must be a valid iterator of *this.
+ //!
+ //! <b>Effects</b>: Rearranges the splay set so that the element pointed by i
+ //! is placed as the root of the tree, improving future searches of this value.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void splay_up(iterator i)
+ { tree_.splay_up(i); }
+
+ //! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
+ //! with a key equivalent to value the element is placed as the root of the
+ //! tree. If the element is not present returns the last node compared with the key.
+ //! If the tree is empty, end() is returned.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
+ //!
+ //! <b>Throws</b>: If the comparison functor throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ iterator splay_down(const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_.splay_down(key, comp); }
+
+ //! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
+ //! with a key equivalent to value the element is placed as the root of the
+ //! tree.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ iterator splay_down(const value_type &value)
+ { return tree_.splay_down(value); }
+
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ void rebalance()
+ { tree_.rebalance(); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ iterator rebalance_subtree(iterator root)
+ { return tree_.rebalance_subtree(root); }
+
+ /// @cond
+ friend bool operator==(const splay_set_impl &x, const splay_set_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const splay_set_impl &x, const splay_set_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splay_set_impl<T, Options...> &x, const splay_set_impl<T, Options...> &y)
+#else
+(const splay_set_impl<Config> &x, const splay_set_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splay_set_impl<T, Options...> &x, const splay_set_impl<T, Options...> &y)
+#else
+(const splay_set_impl<Config> &x, const splay_set_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splay_set_impl<T, Options...> &x, const splay_set_impl<T, Options...> &y)
+#else
+(const splay_set_impl<Config> &x, const splay_set_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splay_set_impl<T, Options...> &x, const splay_set_impl<T, Options...> &y)
+#else
+(const splay_set_impl<Config> &x, const splay_set_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(splay_set_impl<T, Options...> &x, splay_set_impl<T, Options...> &y)
+#else
+(splay_set_impl<Config> &x, splay_set_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c splay_set that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_splay_set
+{
+ /// @cond
+ typedef splay_set_impl
+ < typename make_splaytree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class splay_set
+ : public make_splay_set<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_splay_set
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ splay_set( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ splay_set( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, v_traits)
+ {}
+
+ static splay_set &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<splay_set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const splay_set &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const splay_set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static splay_set &container_from_iterator(iterator it)
+ { return static_cast<splay_set &>(Base::container_from_iterator(it)); }
+
+ static const splay_set &container_from_iterator(const_iterator it)
+ { return static_cast<const splay_set &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+//! The class template splay_multiset is an intrusive container, that mimics most of
+//! the interface of std::multiset as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class splay_multiset_impl
+{
+ /// @cond
+ typedef splaytree_impl<Config> tree_type;
+
+ //Non-copyable and non-assignable
+ splay_multiset_impl (const splay_multiset_impl&);
+ splay_multiset_impl &operator =(const splay_multiset_impl&);
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ splay_multiset_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty splay_multiset and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise amortized N * log N, where N is the distance between first and last.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ splay_multiset_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(false, b, e, cmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~splay_multiset_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of splay_multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the splay_multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static splay_multiset_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<splay_multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &splay_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of splay_multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the splay_multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const splay_multiset_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<splay_multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &splay_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static splay_multiset_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<splay_multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &splay_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const splay_multiset_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<splay_multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &splay_multiset_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the splay_multiset.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two splay_multisets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(splay_multiset_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const splay_multiset_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the splay_multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(reference value)
+ { return tree_.insert_equal(this->end(), value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts x into the splay_multiset, using pos as a hint to
+ //! where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_equal(hint, value); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the splay_multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Insert range is amortized O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_equal(b, e); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is amortized
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is amortized
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value)
+ { return tree_.count(value); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp)
+ { return tree_.count(key, comp); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count_dont_splay(const_reference value) const
+ { return tree_.count_dont_splay(value); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.count_dont_splay(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound_dont_splay(const_reference value) const
+ { return tree_.lower_bound_dont_splay(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound_dont_splay(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound_dont_splay(const_reference value) const
+ { return tree_.upper_bound_dont_splay(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound_dont_splay(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find_dont_splay(const_reference value) const
+ { return tree_.find_dont_splay(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find_dont_splay(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range_dont_splay(const_reference value) const
+ { return tree_.equal_range_dont_splay(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range_dont_splay(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range_dont_splay(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a set/splay_multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ //! <b>Requires</b>: i must be a valid iterator of *this.
+ //!
+ //! <b>Effects</b>: Rearranges the splay set so that the element pointed by i
+ //! is placed as the root of the tree, improving future searches of this value.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void splay_up(iterator i)
+ { tree_.splay_up(i); }
+
+ //! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
+ //! with a key equivalent to value the element is placed as the root of the
+ //! tree. If the element is not present returns the last node compared with the key.
+ //! If the tree is empty, end() is returned.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
+ //!
+ //! <b>Throws</b>: If the comparison functor throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ iterator splay_down(const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_.splay_down(key, comp); }
+
+ //! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
+ //! with a key equivalent to value the element is placed as the root of the
+ //! tree.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ iterator splay_down(const value_type &value)
+ { return tree_.splay_down(value); }
+
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ void rebalance()
+ { tree_.rebalance(); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ iterator rebalance_subtree(iterator root)
+ { return tree_.rebalance_subtree(root); }
+
+ /// @cond
+ friend bool operator==(const splay_multiset_impl &x, const splay_multiset_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const splay_multiset_impl &x, const splay_multiset_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splay_multiset_impl<T, Options...> &x, const splay_multiset_impl<T, Options...> &y)
+#else
+(const splay_multiset_impl<Config> &x, const splay_multiset_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splay_multiset_impl<T, Options...> &x, const splay_multiset_impl<T, Options...> &y)
+#else
+(const splay_multiset_impl<Config> &x, const splay_multiset_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splay_multiset_impl<T, Options...> &x, const splay_multiset_impl<T, Options...> &y)
+#else
+(const splay_multiset_impl<Config> &x, const splay_multiset_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splay_multiset_impl<T, Options...> &x, const splay_multiset_impl<T, Options...> &y)
+#else
+(const splay_multiset_impl<Config> &x, const splay_multiset_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(splay_multiset_impl<T, Options...> &x, splay_multiset_impl<T, Options...> &y)
+#else
+(splay_multiset_impl<Config> &x, splay_multiset_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c splay_multiset that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_splay_multiset
+{
+ /// @cond
+ typedef splay_multiset_impl
+ < typename make_splaytree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class splay_multiset
+ : public make_splay_multiset<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_splay_multiset
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ splay_multiset( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ splay_multiset( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, v_traits)
+ {}
+
+ static splay_multiset &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<splay_multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const splay_multiset &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const splay_multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static splay_multiset &container_from_iterator(iterator it)
+ { return static_cast<splay_multiset &>(Base::container_from_iterator(it)); }
+
+ static const splay_multiset &container_from_iterator(const_iterator it)
+ { return static_cast<const splay_multiset &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SPLAY_SET_HPP
Added: sandbox/move/boost/intrusive/splay_set_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/splay_set_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,290 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_SPLAY_SET_HOOK_HPP
+#define BOOST_INTRUSIVE_SPLAY_SET_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/tree_node.hpp>
+#include <boost/intrusive/splaytree_algorithms.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/generic_hook.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+template<class VoidPointer>
+struct get_splay_set_node_algo
+{
+ typedef splaytree_algorithms<tree_node_traits<VoidPointer> > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c splay_set_base_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_splay_set_base_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_splay_set_node_algo<typename packed_options::void_pointer>
+ , typename packed_options::tag
+ , packed_options::link_mode
+ , detail::SplaySetBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Derive a class from splay_set_base_hook in order to store objects in
+//! in a splay_set/splay_multiset. splay_set_base_hook holds the data necessary to maintain
+//! the splay_set/splay_multiset and provides an appropriate value_traits class for splay_set/splay_multiset.
+//!
+//! The hook admits the following options: \c tag<>, \c void_pointer<>,
+//! \c link_mode<> and \c optimize_size<>.
+//!
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! unique tag.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class splay_set_base_hook
+ : public make_splay_set_base_hook<
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ splay_set_base_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ splay_set_base_hook(const splay_set_base_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ splay_set_base_hook& operator=(const splay_set_base_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~splay_set_base_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(splay_set_base_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+//! Helper metafunction to define a \c splay_set_member_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none>
+#endif
+struct make_splay_set_member_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_splay_set_node_algo<typename packed_options::void_pointer>
+ , member_tag
+ , packed_options::link_mode
+ , detail::NoBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Put a public data member splay_set_member_hook in order to store objects of this
+//! class in a splay_set/splay_multiset. splay_set_member_hook holds the data
+//! necessary for maintaining the splay_set/splay_multiset and provides an appropriate
+//! value_traits class for splay_set/splay_multiset.
+//!
+//! The hook admits the following options: \c void_pointer<>,
+//! \c link_mode<> and \c optimize_size<>.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3>
+#endif
+class splay_set_member_hook
+ : public make_splay_set_member_hook<
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3
+ #else
+ Options...
+ #endif
+ >::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ splay_set_member_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ splay_set_member_hook(const splay_set_member_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ splay_set_member_hook& operator=(const splay_set_member_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in a set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~splay_set_member_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(splay_set_member_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SPLAY_SET_HOOK_HPP
Added: sandbox/move/boost/intrusive/splaytree.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/splaytree.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,1651 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_SPLAYTREE_HPP
+#define BOOST_INTRUSIVE_SPLAYTREE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <functional>
+#include <iterator>
+#include <utility>
+#include <cstddef>
+#include <algorithm>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/splay_set_hook.hpp>
+#include <boost/intrusive/detail/tree_node.hpp>
+#include <boost/intrusive/detail/ebo_functor_holder.hpp>
+#include <boost/intrusive/detail/clear_on_destructor_base.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/splaytree_algorithms.hpp>
+#include <boost/intrusive/link_mode.hpp>
+
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+template <class ValueTraits, class Compare, class SizeType, bool ConstantTimeSize>
+struct splaysetopt
+{
+ typedef ValueTraits value_traits;
+ typedef Compare compare;
+ typedef SizeType size_type;
+ static const bool constant_time_size = ConstantTimeSize;
+};
+
+template <class T>
+struct splay_set_defaults
+ : pack_options
+ < none
+ , base_hook<detail::default_splay_set_hook>
+ , constant_time_size<true>
+ , size_type<std::size_t>
+ , compare<std::less<T> >
+ >::type
+{};
+
+/// @endcond
+
+//! The class template splaytree is an intrusive splay tree container that
+//! is used to construct intrusive splay_set and splay_multiset containers. The no-throw
+//! guarantee holds only, if the value_compare object
+//! doesn't throw.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<> and
+//! \c compare<>.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class splaytree_impl
+ : private detail::clear_on_destructor_base<splaytree_impl<Config> >
+{
+ template<class C> friend class detail::clear_on_destructor_base;
+ public:
+ typedef typename Config::value_traits value_traits;
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ /// @endcond
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::const_pointer const_pointer;
+ typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef value_type key_type;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ typedef typename std::iterator_traits<pointer>::difference_type difference_type;
+ typedef typename Config::size_type size_type;
+ typedef typename Config::compare value_compare;
+ typedef value_compare key_compare;
+ typedef tree_iterator<splaytree_impl, false> iterator;
+ typedef tree_iterator<splaytree_impl, true> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename boost::pointer_to_other
+ <pointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, const node>::type const_node_ptr;
+ typedef splaytree_algorithms<node_traits> node_algorithms;
+
+ static const bool constant_time_size = Config::constant_time_size;
+ static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+
+ /// @cond
+ private:
+ typedef detail::size_holder<constant_time_size, size_type> size_traits;
+
+ //noncopyable
+ splaytree_impl (const splaytree_impl&);
+ splaytree_impl operator =(const splaytree_impl&);
+
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ //Constant-time size is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(constant_time_size && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+
+ struct header_plus_size : public size_traits
+ { node header_; };
+
+ struct node_plus_pred_t : public detail::ebo_functor_holder<value_compare>
+ {
+ node_plus_pred_t(const value_compare &comp)
+ : detail::ebo_functor_holder<value_compare>(comp)
+ {}
+ header_plus_size header_plus_size_;
+ };
+
+ struct data_t : public splaytree_impl::value_traits
+ {
+ typedef typename splaytree_impl::value_traits value_traits;
+ data_t(const value_compare & comp, const value_traits &val_traits)
+ : value_traits(val_traits), node_plus_pred_(comp)
+ {}
+ node_plus_pred_t node_plus_pred_;
+ } data_;
+
+ const value_compare &priv_comp() const
+ { return data_.node_plus_pred_.get(); }
+
+ value_compare &priv_comp()
+ { return data_.node_plus_pred_.get(); }
+
+ const node &priv_header() const
+ { return data_.node_plus_pred_.header_plus_size_.header_; }
+
+ node &priv_header()
+ { return data_.node_plus_pred_.header_plus_size_.header_; }
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
+ }
+
+ size_traits &priv_size_traits()
+ { return data_.node_plus_pred_.header_plus_size_; }
+
+ const size_traits &priv_size_traits() const
+ { return data_.node_plus_pred_.header_plus_size_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<false>) const
+ { return data_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<true>) const
+ { return data_.get_value_traits(*this); }
+
+ real_value_traits &get_real_value_traits(detail::bool_<false>)
+ { return data_; }
+
+ real_value_traits &get_real_value_traits(detail::bool_<true>)
+ { return data_.get_value_traits(*this); }
+
+ /// @endcond
+
+ public:
+
+ const real_value_traits &get_real_value_traits() const
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ real_value_traits &get_real_value_traits()
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ typedef typename node_algorithms::insert_commit_data insert_commit_data;
+
+ //! <b>Effects</b>: Constructs an empty tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructorof the value_compare object throws. Basic guarantee.
+ splaytree_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty tree and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise amortized N * log N, where N is the distance between first and last.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws. Basic guarantee.
+ template<class Iterator>
+ splaytree_impl ( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ if(unique)
+ this->insert_unique(b, e);
+ else
+ this->insert_equal(b, e);
+ }
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~splaytree_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return iterator(node_algorithms::begin_node(&priv_header()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return const_iterator(node_algorithms::begin_node(&priv_header()), this); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return iterator (node_ptr(&priv_header()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return cend(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return const_iterator (uncast(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return const_reverse_iterator(end()); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return const_reverse_iterator(begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return const_reverse_iterator(begin()); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of splaytree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the splaytree associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static splaytree_impl &container_from_end_iterator(iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of splaytree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the splaytree associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const splaytree_impl &container_from_end_iterator(const_iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: it must be a valid iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static splaytree_impl &container_from_iterator(iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Precondition</b>: it must be a valid end const_iterator
+ //! of rbtree.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the tree associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const splaytree_impl &container_from_iterator(const_iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return priv_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return this->cbegin() == this->cend(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the tree.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this
+ //! if constant-time size option is disabled. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ {
+ if(constant_time_size){
+ return this->priv_size_traits().get_size();
+ }
+ else{
+ return (size_type)node_algorithms::size(const_node_ptr(&priv_header()));
+ }
+ }
+
+ //! <b>Effects</b>: Swaps the contents of two splaytrees.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the comparison functor's swap call throws.
+ void swap(splaytree_impl& other)
+ {
+ //This can throw
+ using std::swap;
+ swap(priv_comp(), priv_comp());
+ //These can't throw
+ node_algorithms::swap_tree(node_ptr(&priv_header()), node_ptr(&other.priv_header()));
+ if(constant_time_size){
+ size_type backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(other.priv_size_traits().get_size());
+ other.priv_size_traits().set_size(backup);
+ }
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the tree before the lower bound.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is amortized
+ //! logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, splaytree_impl>
+ key_node_comp(priv_comp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_equal_lower_bound
+ (node_ptr(&priv_header()), to_insert, key_node_comp), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case)
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(const_iterator hint, reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, splaytree_impl>
+ key_node_comp(priv_comp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_equal
+ (node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp), this);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a each element of a range into the tree
+ //! before the upper bound of the key of each element.
+ //!
+ //! <b>Complexity</b>: Insert range is in general amortized O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_equal(Iterator b, Iterator e)
+ {
+ if(this->empty()){
+ iterator end(this->end());
+ for (; b != e; ++b)
+ this->insert_equal(end, *b);
+ }
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the tree if the value
+ //! is not already present.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert_unique(reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(value, priv_comp(), commit_data);
+ if(!ret.second)
+ return ret;
+ return std::pair<iterator, bool> (insert_unique_commit(value, commit_data), true);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator
+ //!
+ //! <b>Effects</b>: Tries to insert x into the tree, using "hint" as a hint
+ //! to where it will be inserted.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic in general, but it is amortized
+ //! constant time (two comparisons in the worst case)
+ //! if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_unique(const_iterator hint, reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(hint, value, priv_comp(), commit_data);
+ if(!ret.second)
+ return ret.first;
+ return insert_unique_commit(value, commit_data);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Tries to insert each element of a range into the tree.
+ //!
+ //! <b>Complexity</b>: Insert range is in general amortized O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_unique(Iterator b, Iterator e)
+ {
+ for (; b != e; ++b)
+ this->insert_unique(*b);
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_unique_check
+ (const KeyType &key, KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ comp(key_value_comp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), key, comp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare. The difference is that
+ //! key_value_comp compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp ordering function throws. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator, bool> insert_unique_check
+ (const_iterator hint, const KeyType &key
+ ,KeyValueCompare key_value_comp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ comp(key_value_comp, this);
+ std::pair<node_ptr, bool> ret =
+ node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), hint.pointed_node(), key, comp, commit_data);
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the container between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_unique_commit(reference value, const insert_commit_data &commit_data)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ node_algorithms::insert_unique_commit
+ (node_ptr(&priv_header()), to_insert, commit_data);
+ return iterator(to_insert, this);
+ }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ {
+ const_iterator ret(i);
+ ++ret;
+ node_ptr to_erase(i.pointed_node());
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!node_algorithms::unique(to_erase));
+ node_algorithms::erase(&priv_header(), to_erase);
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ return ret.unconst();
+ }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is amortized
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { size_type n; return private_erase(b, e, n); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return this->erase(value, priv_comp()); }
+
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ {
+ node_ptr to_erase(i.pointed_node());
+ iterator ret(this->erase(i));
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ return ret;
+ }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is amortized
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { size_type n; return private_erase(b, e, n, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ {
+ std::pair<iterator,iterator> p = this->equal_range(value);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Amortized O(log(size() + N).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ {
+ if(safemode_or_autounlink){
+ this->clear_and_dispose(detail::null_disposer());
+ }
+ else{
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(0);
+ }
+ }
+
+ //! <b>Effects</b>: Erases all of the elements calling disposer(p) for
+ //! each node to be erased.
+ //! <b>Complexity</b>: Amortized O(log(size() + N)),
+ //! where N is the number of elements in the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. Calls N times to disposer functor.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ {
+ node_algorithms::clear_and_dispose(node_ptr(&priv_header())
+ , detail::node_disposer<Disposer, splaytree_impl>(disposer, this));
+ this->priv_size_traits().set_size(0);
+ }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given value
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given value.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type count(const_reference value)
+ { return this->count(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType &key, KeyValueCompare comp)
+ {
+ std::pair<const_iterator, const_iterator> ret = this->equal_range(key, comp);
+ return std::distance(ret.first, ret.second);
+ }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given value
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given value.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type count_dont_splay(const_reference value) const
+ { return this->count_dont_splay(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ size_type count_dont_splay(const KeyType &key, KeyValueCompare comp) const
+ {
+ std::pair<const_iterator, const_iterator> ret = this->equal_range_dont_splay(key, comp);
+ return std::distance(ret.first, ret.second);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator lower_bound(const_reference value)
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator lower_bound_dont_splay(const_reference value) const
+ { return this->lower_bound_dont_splay(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound_dont_splay(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp, false), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator upper_bound(const_reference value)
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator upper_bound_dont_splay(const_reference value) const
+ { return this->upper_bound_dont_splay(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound_dont_splay(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::upper_bound_dont_splay
+ (const_node_ptr(&priv_header()), key, key_node_comp, false), this);
+ }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator find(const_reference value)
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ return iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator find_dont_splay(const_reference value) const
+ { return this->find_dont_splay(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find_dont_splay(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ return const_iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp, false), this);
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<const_iterator, const_iterator>
+ equal_range_dont_splay(const_reference value) const
+ { return this->equal_range_dont_splay(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range_dont_splay(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp, false));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const splaytree_impl &src, Cloner cloner, Disposer disposer)
+ {
+ this->clear_and_dispose(disposer);
+ if(!src.empty()){
+ detail::exception_disposer<splaytree_impl, Disposer>
+ rollback(*this, disposer);
+ node_algorithms::clone
+ (const_node_ptr(&src.priv_header())
+ ,node_ptr(&this->priv_header())
+ ,detail::node_cloner<Cloner, splaytree_impl>(cloner, this)
+ ,detail::node_disposer<Disposer, splaytree_impl>(disposer, this));
+ this->priv_size_traits().set_size(src.priv_size_traits().get_size());
+ this->priv_comp() = src.priv_comp();
+ rollback.release();
+ }
+ }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ {
+ node_ptr to_be_disposed(node_algorithms::unlink_leftmost_without_rebalance
+ (node_ptr(&priv_header())));
+ if(!to_be_disposed)
+ return 0;
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)//If this is commented does not work with normal_link
+ node_algorithms::init(to_be_disposed);
+ return get_real_value_traits().to_value_ptr(to_be_disposed);
+ }
+
+ //! <b>Requires</b>: i must be a valid iterator of *this.
+ //!
+ //! <b>Effects</b>: Rearranges the splay set so that the element pointed by i
+ //! is placed as the root of the tree, improving future searches of this value.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void splay_up(iterator i)
+ { return node_algorithms::splay_up(i.pointed_node(), &priv_header()); }
+
+ //! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
+ //! with a key equivalent to value the element is placed as the root of the
+ //! tree. If the element is not present returns the last node compared with the key.
+ //! If the tree is empty, end() is returned.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
+ //!
+ //! <b>Throws</b>: If the comparison functor throws.
+ template<class KeyType, class KeyValueCompare>
+ iterator splay_down(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, splaytree_impl>
+ key_node_comp(comp, this);
+ node_ptr r = node_algorithms::splay_down(&priv_header(), key, key_node_comp);
+ return iterator(r, this);
+ }
+
+ //! <b>Effects</b>: Rearranges the splay set so that if *this stores an element
+ //! with a key equivalent to value the element is placed as the root of the
+ //! tree.
+ //!
+ //! <b>Complexity</b>: Amortized logarithmic.
+ //!
+ //! <b>Returns</b>: An iterator to the new root of the tree, end() if the tree is empty.
+ //!
+ //! <b>Throws</b>: If the predicate throws.
+ iterator splay_down(const value_type &value)
+ { return this->splay_down(value, priv_comp()); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ {
+ node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
+ , node_ptr(&priv_header())
+ , get_real_value_traits().to_node_ptr(with_this));
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return iterator (value_traits::to_node_ptr(value), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return iterator (value_traits::to_node_ptr(value), this); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
+
+ //! <b>Requires</b>: value shall not be in a tree.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { node_algorithms::init(value_traits::to_node_ptr(value)); }
+
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ void rebalance()
+ { node_algorithms::rebalance(node_ptr(&priv_header())); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ iterator rebalance_subtree(iterator root)
+ { return iterator(node_algorithms::rebalance_subtree(root.pointed_node()), this); }
+
+/*
+ //! <b>Effects</b>: removes x from a tree of the appropriate type. It has no effect,
+ //! if x is not in such a tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This static function is only usable with the "safe mode"
+ //! hook and non-constant time size lists. Otherwise, the user must use
+ //! the non-static "erase(reference )" member. If the user calls
+ //! this function with a non "safe mode" or constant time size list
+ //! a compilation error will be issued.
+ template<class T>
+ static void remove_node(T& value)
+ {
+ //This function is only usable for safe mode hooks and non-constant
+ //time lists.
+ //BOOST_STATIC_ASSERT((!(safemode_or_autounlink && constant_time_size)));
+ BOOST_STATIC_ASSERT((!constant_time_size));
+ BOOST_STATIC_ASSERT((boost::is_convertible<T, value_type>::value));
+ node_ptr to_remove(value_traits::to_node_ptr(value));
+ node_algorithms::unlink_and_rebalance(to_remove);
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_remove);
+ }
+*/
+
+ /// @cond
+ private:
+ template<class Disposer>
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n, Disposer disposer)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase_and_dispose(b++, disposer);
+ return b.unconst();
+ }
+
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase(b++);
+ return b.unconst();
+ }
+ /// @endcond
+
+ private:
+ static splaytree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
+ {
+ header_plus_size *r = detail::parent_from_member<header_plus_size, node>
+ ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
+ node_plus_pred_t *n = detail::parent_from_member
+ <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
+ data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
+ splaytree_impl *rb = detail::parent_from_member<splaytree_impl, data_t>(d, &splaytree_impl::data_);
+ return *rb;
+ }
+
+ static splaytree_impl &priv_container_from_iterator(const const_iterator &it)
+ { return priv_container_from_end_iterator(it.end_iterator_from_it()); }
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splaytree_impl<T, Options...> &x, const splaytree_impl<T, Options...> &y)
+#else
+(const splaytree_impl<Config> &x, const splaytree_impl<Config> &y)
+#endif
+{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+bool operator==
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splaytree_impl<T, Options...> &x, const splaytree_impl<T, Options...> &y)
+#else
+(const splaytree_impl<Config> &x, const splaytree_impl<Config> &y)
+#endif
+{
+ typedef splaytree_impl<Config> tree_type;
+ typedef typename tree_type::const_iterator const_iterator;
+
+ if(tree_type::constant_time_size && x.size() != y.size()){
+ return false;
+ }
+ const_iterator end1 = x.end();
+ const_iterator i1 = x.begin();
+ const_iterator i2 = y.begin();
+ if(tree_type::constant_time_size){
+ while (i1 != end1 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1;
+ }
+ else{
+ const_iterator end2 = y.end();
+ while (i1 != end1 && i2 != end2 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1 && i2 == end2;
+ }
+}
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splaytree_impl<T, Options...> &x, const splaytree_impl<T, Options...> &y)
+#else
+(const splaytree_impl<Config> &x, const splaytree_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splaytree_impl<T, Options...> &x, const splaytree_impl<T, Options...> &y)
+#else
+(const splaytree_impl<Config> &x, const splaytree_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splaytree_impl<T, Options...> &x, const splaytree_impl<T, Options...> &y)
+#else
+(const splaytree_impl<Config> &x, const splaytree_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const splaytree_impl<T, Options...> &x, const splaytree_impl<T, Options...> &y)
+#else
+(const splaytree_impl<Config> &x, const splaytree_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(splaytree_impl<T, Options...> &x, splaytree_impl<T, Options...> &y)
+#else
+(splaytree_impl<Config> &x, splaytree_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+/// @cond
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#else
+template<class T, class ...Options>
+#endif
+struct make_splaytree_opt
+{
+ typedef typename pack_options
+ < splay_set_defaults<T>,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+ typedef typename detail::get_value_traits
+ <T, typename packed_options::value_traits>::type value_traits;
+
+ typedef splaysetopt
+ < value_traits
+ , typename packed_options::compare
+ , typename packed_options::size_type
+ , packed_options::constant_time_size
+ > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c splaytree that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_splaytree
+{
+ /// @cond
+ typedef splaytree_impl
+ < typename make_splaytree_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class splaytree
+ : public make_splaytree<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_splaytree
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::real_value_traits real_value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
+
+ splaytree( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, v_traits)
+ {}
+
+ template<class Iterator>
+ splaytree( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(unique, b, e, cmp, v_traits)
+ {}
+
+ static splaytree &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<splaytree &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const splaytree &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const splaytree &>(Base::container_from_end_iterator(end_iterator)); }
+};
+
+#endif
+
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SPLAYTREE_HPP
Added: sandbox/move/boost/intrusive/splaytree_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/splaytree_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,976 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+// The implementation of splay trees is based on the article and code published
+// in C++ Users Journal "Implementing Splay Trees in C++" (September 1, 2005).
+//
+// The code has been modified and (supposely) improved by Ion Gaztanaga.
+// Here is the header of the file used as base code:
+//
+// splay_tree.h -- implementation of a STL complatible splay tree.
+//
+// Copyright (c) 2004 Ralf Mattethat
+//
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
+// This software is provided "as is" without express or implied
+// warranty, and with no claim as to its suitability for any purpose.
+//
+// Please send questions, comments, complaints, performance data, etc to
+// ralf.mattethat_at_[hidden]
+//
+// Requirements for element type
+// * must be copy-constructible
+// * destructor must not throw exception
+//
+// Methods marked with note A only throws an exception if the evaluation of the
+// predicate throws an exception. If an exception is thrown the call has no
+// effect on the containers state
+//
+// Methods marked with note B only throws an exception if the coppy constructor
+// or assignment operator of the predicate throws an exception. If an exception
+// is thrown the call has no effect on the containers state
+//
+// iterators are only invalidated, if the element pointed to by the iterator
+// is deleted. The same goes for element references
+//
+
+#ifndef BOOST_INTRUSIVE_SPLAYTREE_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_SPLAYTREE_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <cstddef>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/tree_algorithms.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+namespace detail {
+
+template<class NodeTraits>
+struct splaydown_rollback
+{
+ typedef typename NodeTraits::node_ptr node_ptr;
+ splaydown_rollback( const node_ptr *pcur_subtree, node_ptr header
+ , node_ptr leftmost , node_ptr rightmost)
+ : pcur_subtree_(pcur_subtree) , header_(header)
+ , leftmost_(leftmost) , rightmost_(rightmost)
+ {}
+
+ void release()
+ { pcur_subtree_ = 0; }
+
+ ~splaydown_rollback()
+ {
+ if(pcur_subtree_){
+ //Exception can only be thrown by comp, but
+ //tree invariants still hold. *pcur_subtree is the current root
+ //so link it to the header.
+ NodeTraits::set_parent(*pcur_subtree_, header_);
+ NodeTraits::set_parent(header_, *pcur_subtree_);
+ //Recover leftmost/rightmost pointers
+ NodeTraits::set_left (header_, leftmost_);
+ NodeTraits::set_right(header_, rightmost_);
+ }
+ }
+ const node_ptr *pcur_subtree_;
+ node_ptr header_, leftmost_, rightmost_;
+};
+
+} //namespace detail {
+/// @endcond
+
+//! A splay tree is an implementation of a binary search tree. The tree is
+//! self balancing using the splay algorithm as described in
+//!
+//! "Self-Adjusting Binary Search Trees
+//! by Daniel Dominic Sleator and Robert Endre Tarjan
+//! AT&T Bell Laboratories, Murray Hill, NJ
+//! Journal of the ACM, Vol 32, no 3, July 1985, pp 652-686
+
+//! splaytree_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the circular list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
+//!
+//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
+//!
+//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
+template<class NodeTraits>
+class splaytree_algorithms
+{
+ /// @cond
+ private:
+ typedef detail::tree_algorithms<NodeTraits> tree_algorithms;
+ /// @endcond
+
+ public:
+ typedef typename NodeTraits::node node;
+ typedef NodeTraits node_traits;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+
+ //! This type is the information that will be
+ //! filled by insert_unique_check
+ typedef typename tree_algorithms::insert_commit_data insert_commit_data;
+
+ /// @cond
+ private:
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ }
+ /// @endcond
+
+ public:
+ static node_ptr begin_node(const_node_ptr header)
+ { return tree_algorithms::begin_node(header); }
+
+ static node_ptr end_node(const_node_ptr header)
+ { return tree_algorithms::end_node(header); }
+
+ //! <b>Requires</b>: node is a node of the tree or an node initialized
+ //! by init(...).
+ //!
+ //! <b>Effects</b>: Returns true if the node is initialized by init().
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr node)
+ { return tree_algorithms::unique(node); }
+
+ static void unlink(node_ptr node)
+ { tree_algorithms::unlink(node); }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr node2)
+ {
+ if(node1 == node2)
+ return;
+
+ node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
+ swap_nodes(node1, header1, node2, header2);
+ }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees with header header1 and header2.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
+ { tree_algorithms::swap_nodes(node1, header1, node2, header2); }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing and comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
+ {
+ if(node_to_be_replaced == new_node)
+ return;
+ replace_node(node_to_be_replaced, tree_algorithms::get_header(node_to_be_replaced), new_node);
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! with header "header" and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
+ { tree_algorithms::replace_node(node_to_be_replaced, header, new_node); }
+
+ //! <b>Requires</b>: p is a node from the tree except the header.
+ //!
+ //! <b>Effects</b>: Returns the next node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr next_node(node_ptr p)
+ { return tree_algorithms::next_node(p); }
+
+ //! <b>Requires</b>: p is a node from the tree except the leftmost node.
+ //!
+ //! <b>Effects</b>: Returns the previous node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr prev_node(node_ptr p)
+ { return tree_algorithms::prev_node(p); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: After the function unique(node) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init(node_ptr node)
+ { tree_algorithms::init(node); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: Initializes the header to represent an empty tree.
+ //! unique(header) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init_header(node_ptr header)
+ { tree_algorithms::init_header(header); }
+
+ //! <b>Requires</b>: "disposer" must be an object function
+ //! taking a node_ptr parameter and shouldn't throw.
+ //!
+ //! <b>Effects</b>: Empties the target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template<class Disposer>
+ static void clear_and_dispose(node_ptr header, Disposer disposer)
+ { tree_algorithms::clear_and_dispose(header, disposer); }
+
+ //! <b>Requires</b>: node is a node of the tree but it's not the header.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes of the subtree.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr node)
+ { return tree_algorithms::count(node); }
+
+ //! <b>Requires</b>: header is the header node of the tree.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes above the header.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t size(const_node_ptr header)
+ { return tree_algorithms::size(header); }
+
+ //! <b>Requires</b>: header1 and header2 must be the header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //! links to the second tree and header2 will have links to the first tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void swap_tree(node_ptr header1, node_ptr header2)
+ { return tree_algorithms::swap_tree(header1, header2); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "commit_data" must have been obtained from a previous call to
+ //! "insert_unique_check". No objects should have been inserted or erased
+ //! from the set between the "insert_unique_check" that filled "commit_data"
+ //! and the call to "insert_commit".
+ //!
+ //!
+ //! <b>Effects</b>: Inserts new_node in the set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ static void insert_unique_commit
+ (node_ptr header, node_ptr new_value, const insert_commit_data &commit_data)
+ { tree_algorithms::insert_unique_commit(header, new_value, commit_data); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (node_ptr header, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data)
+ {
+ splay_down(header, key, comp);
+ return tree_algorithms::insert_unique_check(header, key, comp, commit_data);
+ }
+
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (node_ptr header, node_ptr hint, const KeyType &key
+ ,KeyNodePtrCompare comp, insert_commit_data &commit_data)
+ {
+ splay_down(header, key, comp);
+ return tree_algorithms::insert_unique_check(header, hint, key, comp, commit_data);
+ }
+
+ static bool is_header(const_node_ptr p)
+ { return tree_algorithms::is_header(p); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the element that is equivalent to
+ //! "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr find
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp, bool splay = true)
+ {
+ if(splay)
+ splay_down(uncast(header), key, comp);
+ node_ptr end = uncast(header);
+ node_ptr y = lower_bound(header, key, comp, false);
+ node_ptr r = (y == end || comp(key, y)) ? end : y;
+ return r;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an a pair of node_ptr delimiting a range containing
+ //! all elements that are equivalent to "key" according to "comp" or an
+ //! empty range that indicates the position where those elements would be
+ //! if they there are no equivalent elements.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> equal_range
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp, bool splay = true)
+ {
+ //if(splay)
+ //splay_down(uncast(header), key, comp);
+ std::pair<node_ptr, node_ptr> ret =
+ tree_algorithms::equal_range(header, key, comp);
+
+ if(splay)
+ splay_up(ret.first, uncast(header));
+ return ret;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is
+ //! not less than "key" according to "comp" or "header" if that element does
+ //! not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr lower_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp, bool splay = true)
+ {
+ //if(splay)
+ //splay_down(uncast(header), key, comp);
+ node_ptr y = tree_algorithms::lower_bound(header, key, comp);
+ if(splay)
+ splay_up(y, uncast(header));
+ return y;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is greater
+ //! than "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr upper_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp, bool splay = true)
+ {
+ //if(splay)
+ //splay_down(uncast(header), key, comp);
+ node_ptr y = tree_algorithms::upper_bound(header, key, comp);
+ if(splay)
+ splay_up(y, uncast(header));
+ return y;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
+ //! the "header"'s tree.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case).
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if new_node is inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal
+ (node_ptr header, node_ptr hint, node_ptr new_node, NodePtrCompare comp)
+ {
+ splay_down(header, new_node, comp);
+ return tree_algorithms::insert_equal(header, hint, new_node, comp);
+ }
+
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "pos" must be a valid iterator or header (end) node.
+ //! "pos" must be an iterator pointing to the successor to "new_node"
+ //! once inserted according to the order of already inserted nodes. This function does not
+ //! check "pos" and this precondition must be guaranteed by the caller.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
+ //! tree invariants might be broken.
+ static node_ptr insert_before
+ (node_ptr header, node_ptr pos, node_ptr new_node)
+ {
+ tree_algorithms::insert_before(header, pos, new_node);
+ splay_up(new_node, header);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering no less than the
+ //! greatest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "new_node" is less than the greatest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ static void push_back(node_ptr header, node_ptr new_node)
+ {
+ tree_algorithms::push_back(header, new_node);
+ splay_up(new_node, header);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering, no greater than the
+ //! lowest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: If "new_node" is greater than the lowest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ static void push_front(node_ptr header, node_ptr new_node)
+ {
+ tree_algorithms::push_front(header, new_node);
+ splay_up(new_node, header);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the upper bound
+ //! according to "comp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal_upper_bound
+ (node_ptr header, node_ptr new_node, NodePtrCompare comp)
+ {
+ splay_down(header, new_node, comp);
+ return tree_algorithms::insert_equal_upper_bound(header, new_node, comp);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the lower bound
+ //! according to "comp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare>
+ static node_ptr insert_equal_lower_bound
+ (node_ptr header, node_ptr new_node, NodePtrCompare comp)
+ {
+ splay_down(header, new_node, comp);
+ return tree_algorithms::insert_equal_lower_bound(header, new_node, comp);
+ }
+
+ //! <b>Requires</b>: "cloner" must be a function
+ //! object taking a node_ptr and returning a new cloned node of it. "disposer" must
+ //! take a node_ptr and shouldn't throw.
+ //!
+ //! <b>Effects</b>: First empties target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! Then, duplicates the entire tree pointed by "source_header" cloning each
+ //! source node with <tt>node_ptr Cloner::operator()(node_ptr)</tt> to obtain
+ //! the nodes of the target tree. If "cloner" throws, the cloned target nodes
+ //! are disposed using <tt>void disposer(node_ptr)</tt>.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template <class Cloner, class Disposer>
+ static void clone
+ (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
+ { tree_algorithms::clone(source_header, target_header, cloner, disposer); }
+
+ // delete node | complexity : constant | exception : nothrow
+ static void erase(node_ptr header, node_ptr z, bool splay = true)
+ {
+// node_base* n = t->right;
+// if( t->left != 0 ){
+// node_base* l = t->previous();
+// splay_up( l , t );
+// n = t->left;
+// n->right = t->right;
+// if( n->right != 0 )
+// n->right->parent = n;
+// }
+//
+// if( n != 0 )
+// n->parent = t->parent;
+//
+// if( t->parent->left == t )
+// t->parent->left = n;
+// else // must be ( t->parent->right == t )
+// t->parent->right = n;
+//
+// if( data_->parent == t )
+// data_->parent = find_leftmost();
+ //posibility 1
+ if(splay && NodeTraits::get_left(z)){
+ splay_up(prev_node(z), header);
+ }
+ /*
+ //possibility 2
+ if(splay && NodeTraits::get_left(z) != 0 ){
+ node_ptr l = NodeTraits::get_left(z);
+ splay_up(l, header);
+ }*//*
+ if(splay && NodeTraits::get_left(z) != 0 ){
+ node_ptr l = prev_node(z);
+ splay_up_impl(l, z);
+ }*/
+ /*
+ //possibility 4
+ if(splay){
+ splay_up(z, header);
+ }*/
+
+ //if(splay)
+ //splay_up(z, header);
+ tree_algorithms::erase(header, z);
+ }
+
+ // bottom-up splay, use data_ as parent for n | complexity : logarithmic | exception : nothrow
+ static void splay_up(node_ptr n, node_ptr header)
+ {
+ if(n == header){ // do a splay for the right most node instead
+ // this is to boost performance of equal_range/count on equivalent containers in the case
+ // where there are many equal elements at the end
+ n = NodeTraits::get_right(header);
+ }
+
+ node_ptr t = header;
+
+ if( n == t ) return;
+
+ for( ;; ){
+ node_ptr p(NodeTraits::get_parent(n));
+ node_ptr g(NodeTraits::get_parent(p));
+
+ if( p == t ) break;
+
+ if( g == t ){
+ // zig
+ rotate(n);
+ }
+ else if ((NodeTraits::get_left(p) == n && NodeTraits::get_left(g) == p) ||
+ (NodeTraits::get_right(p) == n && NodeTraits::get_right(g) == p) ){
+ // zig-zig
+ rotate(p);
+ rotate(n);
+ }
+ else{
+ // zig-zag
+ rotate(n);
+ rotate(n);
+ }
+ }
+ }
+
+ // top-down splay | complexity : logarithmic | exception : strong, note A
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr splay_down(node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ {
+ if(!NodeTraits::get_parent(header))
+ return header;
+ //Most splay tree implementations use a dummy/null node to implement.
+ //this function. This has some problems for a generic library like Intrusive:
+ //
+ // * The node might not have a default constructor.
+ // * The default constructor could throw.
+ //
+ //We already have a header node. Leftmost and rightmost nodes of the tree
+ //are not changed when splaying (because the invariants of the tree don't
+ //change) We can back up them, use the header as the null node and
+ //reassign old values after the function has been completed.
+ node_ptr t = NodeTraits::get_parent(header);
+ //Check if tree has a single node
+ if(!NodeTraits::get_left(t) && !NodeTraits::get_right(t))
+ return t;
+ //Backup leftmost/rightmost
+ node_ptr leftmost (NodeTraits::get_left(header));
+ node_ptr rightmost(NodeTraits::get_right(header));
+ {
+ detail::splaydown_rollback<NodeTraits> rollback(&t, header, leftmost, rightmost);
+ node_ptr null = header;
+ node_ptr l = null;
+ node_ptr r = null;
+
+ for( ;; ){
+ if(comp(key, t)){
+ if(NodeTraits::get_left(t) == 0 )
+ break;
+ if(comp(key, NodeTraits::get_left(t))){
+ t = tree_algorithms::rotate_right(t);
+
+ if(NodeTraits::get_left(t) == 0)
+ break;
+ link_right(t, r);
+ }
+ else if(comp(NodeTraits::get_left(t), key)){
+ link_right(t, r);
+
+ if(NodeTraits::get_right(t) == 0 )
+ break;
+ link_left(t, l);
+ }
+ else{
+ link_right(t, r);
+ }
+ }
+ else if(comp(t, key)){
+ if(NodeTraits::get_right(t) == 0 )
+ break;
+
+ if(comp(NodeTraits::get_right(t), key)){
+ t = tree_algorithms::rotate_left( t );
+
+ if(NodeTraits::get_right(t) == 0 )
+ break;
+ link_left(t, l);
+ }
+ else if(comp(key, NodeTraits::get_right(t))){
+ link_left(t, l);
+
+ if(NodeTraits::get_left(t) == 0)
+ break;
+
+ link_right(t, r);
+ }
+ else{
+ link_left(t, l);
+ }
+ }
+ else{
+ break;
+ }
+ }
+
+ assemble(t, l, r, null);
+ rollback.release();
+ }
+
+ //t is the current root
+ NodeTraits::set_parent(header, t);
+ NodeTraits::set_parent(t, header);
+ //Recover leftmost/rightmost pointers
+ NodeTraits::set_left (header, leftmost);
+ NodeTraits::set_right(header, rightmost);
+ return t;
+ }
+
+ //! <b>Requires</b>: header must be the header of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ static void rebalance(node_ptr header)
+ { tree_algorithms::rebalance(header); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ static node_ptr rebalance_subtree(node_ptr old_root)
+ { return tree_algorithms::rebalance_subtree(old_root); }
+
+
+ //! <b>Requires</b>: "n" must be a node inserted in a tree.
+ //!
+ //! <b>Effects</b>: Returns a pointer to the header node of the tree.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_header(node_ptr n)
+ { return tree_algorithms::get_header(n); }
+
+ private:
+
+ /// @cond
+
+ // assemble the three sub-trees into new tree pointed to by t | complexity : constant | exception : nothrow
+ static void assemble( node_ptr t, node_ptr l, node_ptr r, const_node_ptr null_node )
+ {
+ NodeTraits::set_right(l, NodeTraits::get_left(t));
+ NodeTraits::set_left(r, NodeTraits::get_right(t));
+
+ if(NodeTraits::get_right(l) != 0){
+ NodeTraits::set_parent(NodeTraits::get_right(l), l);
+ }
+
+ if(NodeTraits::get_left(r) != 0){
+ NodeTraits::set_parent(NodeTraits::get_left(r), r);
+ }
+
+ NodeTraits::set_left (t, NodeTraits::get_right(null_node));
+ NodeTraits::set_right(t, NodeTraits::get_left(null_node));
+
+ if( NodeTraits::get_left(t) != 0 ){
+ NodeTraits::set_parent(NodeTraits::get_left(t), t);
+ }
+
+ if( NodeTraits::get_right(t) ){
+ NodeTraits::set_parent(NodeTraits::get_right(t), t);
+ }
+ }
+
+ // break link to left child node and attach it to left tree pointed to by l | complexity : constant | exception : nothrow
+ static void link_left(node_ptr& t, node_ptr& l)
+ {
+ NodeTraits::set_right(l, t);
+ NodeTraits::set_parent(t, l);
+ l = t;
+ t = NodeTraits::get_right(t);
+ }
+
+ // break link to right child node and attach it to right tree pointed to by r | complexity : constant | exception : nothrow
+ static void link_right(node_ptr& t, node_ptr& r)
+ {
+ NodeTraits::set_left(r, t);
+ NodeTraits::set_parent(t, r);
+ r = t;
+ t = NodeTraits::get_left(t);
+ }
+
+ // rotate n with its parent | complexity : constant | exception : nothrow
+ static void rotate(node_ptr n)
+ {
+ node_ptr p = NodeTraits::get_parent(n);
+ node_ptr g = NodeTraits::get_parent(p);
+ //Test if g is header before breaking tree
+ //invariants that would make is_header invalid
+ bool g_is_header = is_header(g);
+
+ if(NodeTraits::get_left(p) == n){
+ NodeTraits::set_left(p, NodeTraits::get_right(n));
+ if(NodeTraits::get_left(p) != 0)
+ NodeTraits::set_parent(NodeTraits::get_left(p), p);
+ NodeTraits::set_right(n, p);
+ }
+ else{ // must be ( p->right == n )
+ NodeTraits::set_right(p, NodeTraits::get_left(n));
+ if(NodeTraits::get_right(p) != 0)
+ NodeTraits::set_parent(NodeTraits::get_right(p), p);
+ NodeTraits::set_left(n, p);
+ }
+
+ NodeTraits::set_parent(p, n);
+ NodeTraits::set_parent(n, g);
+
+ if(g_is_header){
+ if(NodeTraits::get_parent(g) == p)
+ NodeTraits::set_parent(g, n);
+ else{//must be ( g->right == p )
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(0);
+ NodeTraits::set_right(g, n);
+ }
+ }
+ else{
+ if(NodeTraits::get_left(g) == p)
+ NodeTraits::set_left(g, n);
+ else //must be ( g->right == p )
+ NodeTraits::set_right(g, n);
+ }
+ }
+
+ /// @endcond
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_SPLAYTREE_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/treap.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/treap.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,1746 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2008
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_TRIE_HPP
+#define BOOST_INTRUSIVE_TRIE_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <algorithm>
+#include <cstddef>
+#include <functional>
+#include <iterator>
+#include <utility>
+
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/bs_set_hook.hpp>
+#include <boost/intrusive/detail/tree_node.hpp>
+#include <boost/intrusive/detail/ebo_functor_holder.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/detail/clear_on_destructor_base.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/intrusive/treap_algorithms.hpp>
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/priority_compare.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+template <class ValueTraits, class Compare, class PrioCompare, class SizeType, bool ConstantTimeSize>
+struct treap_setopt
+{
+ typedef ValueTraits value_traits;
+ typedef Compare compare;
+ typedef PrioCompare priority_compare;
+ typedef SizeType size_type;
+ static const bool constant_time_size = ConstantTimeSize;
+};
+
+template <class T>
+struct treap_set_defaults
+ : pack_options
+ < none
+ , base_hook<detail::default_bs_set_hook>
+ , constant_time_size<true>
+ , size_type<std::size_t>
+ , compare<std::less<T> >
+ , priority<boost::intrusive::priority_compare<T> >
+ >::type
+{};
+
+/// @endcond
+
+//! The class template treap is an intrusive treap container that
+//! is used to construct intrusive set and multiset containers. The no-throw
+//! guarantee holds only, if the value_compare object and priority_compare object
+//! don't throw.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<>,
+//! \c compare<> and \c priority_compare<>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class treap_impl
+ : private detail::clear_on_destructor_base<treap_impl<Config> >
+{
+ template<class C> friend class detail::clear_on_destructor_base;
+ public:
+ typedef typename Config::value_traits value_traits;
+ /// @cond
+ static const bool external_value_traits =
+ detail::external_value_traits_is_true<value_traits>::value;
+ typedef typename detail::eval_if_c
+ < external_value_traits
+ , detail::eval_value_traits<value_traits>
+ , detail::identity<value_traits>
+ >::type real_value_traits;
+ /// @endcond
+ typedef typename real_value_traits::pointer pointer;
+ typedef typename real_value_traits::const_pointer const_pointer;
+ typedef typename std::iterator_traits<pointer>::value_type value_type;
+ typedef value_type key_type;
+ typedef typename std::iterator_traits<pointer>::reference reference;
+ typedef typename std::iterator_traits<const_pointer>::reference const_reference;
+ typedef typename std::iterator_traits<pointer>::difference_type difference_type;
+ typedef typename Config::size_type size_type;
+ typedef typename Config::compare value_compare;
+ typedef typename Config::priority_compare priority_compare;
+ typedef value_compare key_compare;
+ typedef tree_iterator<treap_impl, false> iterator;
+ typedef tree_iterator<treap_impl, true> const_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef typename real_value_traits::node_traits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename boost::pointer_to_other
+ <pointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <node_ptr, const node>::type const_node_ptr;
+ typedef treap_algorithms<node_traits> node_algorithms;
+
+ static const bool constant_time_size = Config::constant_time_size;
+ static const bool stateful_value_traits = detail::is_stateful_value_traits<real_value_traits>::value;
+
+ /// @cond
+ private:
+ typedef detail::size_holder<constant_time_size, size_type> size_traits;
+
+ //noncopyable
+ treap_impl (const treap_impl&);
+ treap_impl operator =(const treap_impl&);
+
+ enum { safemode_or_autounlink =
+ (int)real_value_traits::link_mode == (int)auto_unlink ||
+ (int)real_value_traits::link_mode == (int)safe_link };
+
+ //Constant-time size is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(constant_time_size && ((int)real_value_traits::link_mode == (int)auto_unlink)));
+
+ struct header_plus_size : public size_traits
+ { node header_; };
+
+ struct node_plus_pred_t : public detail::ebo_functor_holder<value_compare>
+ {
+ node_plus_pred_t(const value_compare &comp, const priority_compare &p_comp)
+ : detail::ebo_functor_holder<value_compare>(comp)
+ , header_plus_priority_size_(p_comp)
+ {}
+ struct header_plus_priority_size
+ : public detail::ebo_functor_holder<priority_compare>
+ {
+ header_plus_priority_size(const priority_compare &p_comp)
+ : detail::ebo_functor_holder<priority_compare>(p_comp)
+ {}
+ header_plus_size header_plus_size_;
+ } header_plus_priority_size_;
+ };
+
+ struct data_t : public treap_impl::value_traits
+ {
+ typedef typename treap_impl::value_traits value_traits;
+ data_t(const value_compare & comp, const priority_compare &pcomp, const value_traits &val_traits)
+ : value_traits(val_traits), node_plus_pred_(comp, pcomp)
+ {}
+ node_plus_pred_t node_plus_pred_;
+ } data_;
+
+ const value_compare &priv_comp() const
+ { return data_.node_plus_pred_.get(); }
+
+ value_compare &priv_comp()
+ { return data_.node_plus_pred_.get(); }
+
+ const priority_compare &priv_pcomp() const
+ { return data_.node_plus_pred_.header_plus_priority_size_.get(); }
+
+ priority_compare &priv_pcomp()
+ { return data_.node_plus_pred_.header_plus_priority_size_.get(); }
+
+ const node &priv_header() const
+ { return data_.node_plus_pred_.header_plus_priority_size_.header_plus_size_.header_; }
+
+ node &priv_header()
+ { return data_.node_plus_pred_.header_plus_priority_size_.header_plus_size_.header_; }
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
+ }
+
+ size_traits &priv_size_traits()
+ { return data_.node_plus_pred_.header_plus_priority_size_.header_plus_size_; }
+
+ const size_traits &priv_size_traits() const
+ { return data_.node_plus_pred_.header_plus_priority_size_.header_plus_size_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<false>) const
+ { return data_; }
+
+ const real_value_traits &get_real_value_traits(detail::bool_<true>) const
+ { return data_.get_value_traits(*this); }
+
+ real_value_traits &get_real_value_traits(detail::bool_<false>)
+ { return data_; }
+
+ real_value_traits &get_real_value_traits(detail::bool_<true>)
+ { return data_.get_value_traits(*this); }
+
+ /// @endcond
+
+ public:
+
+ const real_value_traits &get_real_value_traits() const
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ real_value_traits &get_real_value_traits()
+ { return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
+
+ typedef typename node_algorithms::insert_commit_data insert_commit_data;
+
+ //! <b>Effects</b>: Constructs an empty treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee.
+ treap_impl( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, pcmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty treap and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is the distance between first and last.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare/priority_compare objects
+ //! throw. Basic guarantee.
+ template<class Iterator>
+ treap_impl( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : data_(cmp, pcmp, v_traits)
+ {
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(size_type(0));
+ if(unique)
+ this->insert_unique(b, e);
+ else
+ this->insert_equal(b, e);
+ }
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the set
+ //! are not deleted (i.e. no destructors are called), but the nodes according to
+ //! the value_traits template parameter are reinitialized and thus can be reused.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this
+ //! if constant-time size option is disabled. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~treap_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return iterator (node_traits::get_left(node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return this->cbegin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return const_iterator (node_traits::get_left(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return iterator (node_ptr(&priv_header()), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return this->cend(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return const_iterator (uncast(const_node_ptr(&priv_header())), this); }
+
+
+ //! <b>Effects</b>: Returns an iterator pointing to the highest priority object of the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator top()
+ { return this->empty() ? this->end() : iterator (node_traits::get_parent(node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the treap..
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator top() const
+ { return this->ctop(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the treap..
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator ctop() const
+ { return this->empty() ? this->cend() : const_iterator (node_traits::get_parent(const_node_ptr(&priv_header())), this); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return reverse_iterator(this->end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return const_reverse_iterator(this->end()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return const_reverse_iterator(this->end()); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return reverse_iterator(this->begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return const_reverse_iterator(this->begin()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return const_reverse_iterator(this->begin()); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the highest priority object of the
+ //! reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rtop()
+ { return reverse_iterator(this->top()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority objec
+ //! of the reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rtop() const
+ { return const_reverse_iterator(this->top()); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority object
+ //! of the reversed treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crtop() const
+ { return const_reverse_iterator(this->top()); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of treap.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the treap associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static treap_impl &container_from_end_iterator(iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of treap.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the treap associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const treap_impl &container_from_end_iterator(const_iterator end_iterator)
+ { return priv_container_from_end_iterator(end_iterator); }
+
+ //! <b>Precondition</b>: it must be a valid iterator
+ //! of treap.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the treap associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static treap_impl &container_from_iterator(iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Precondition</b>: it must be a valid end const_iterator
+ //! of treap.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the treap associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const treap_impl &container_from_iterator(const_iterator it)
+ { return priv_container_from_iterator(it); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return this->priv_comp(); }
+
+ //! <b>Effects</b>: Returns the priority_compare object used by the treap.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If priority_compare copy-constructor throws.
+ priority_compare priority_comp() const
+ { return this->priv_pcomp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return node_algorithms::unique(const_node_ptr(&priv_header())); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the treap.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this
+ //! if constant-time size option is disabled. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ {
+ if(constant_time_size)
+ return this->priv_size_traits().get_size();
+ else{
+ return (size_type)node_algorithms::size(const_node_ptr(&priv_header()));
+ }
+ }
+
+ //! <b>Effects</b>: Swaps the contents of two treaps.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the comparison functor's swap call throws.
+ void swap(treap_impl& other)
+ {
+ //This can throw
+ using std::swap;
+ swap(priv_comp(), priv_comp());
+ swap(priv_pcomp(), priv_pcomp());
+ //These can't throw
+ node_algorithms::swap_tree(node_ptr(&priv_header()), node_ptr(&other.priv_header()));
+ if(constant_time_size){
+ size_type backup = this->priv_size_traits().get_size();
+ this->priv_size_traits().set_size(other.priv_size_traits().get_size());
+ other.priv_size_traits().set_size(backup);
+ }
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the treap before the upper bound.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare functions throw. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, treap_impl>
+ key_node_comp(priv_comp(), this);
+ detail::key_nodeptr_comp<priority_compare, treap_impl>
+ key_node_pcomp(priv_pcomp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_equal_upper_bound
+ (node_ptr(&priv_header()), to_insert, key_node_comp, key_node_pcomp), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator.
+ //!
+ //! <b>Effects</b>: Inserts x into the treap, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case)
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare functions throw. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_equal(const_iterator hint, reference value)
+ {
+ detail::key_nodeptr_comp<value_compare, treap_impl>
+ key_node_comp(priv_comp(), this);
+ detail::key_nodeptr_comp<priority_compare, treap_impl>
+ key_node_pcomp(priv_pcomp(), this);
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ return iterator(node_algorithms::insert_equal
+ (node_ptr(&priv_header()), hint.pointed_node(), to_insert, key_node_comp, key_node_pcomp), this);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a each element of a range into the treap
+ //! before the upper bound of the key of each element.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare functions throw.
+ //! Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_equal(Iterator b, Iterator e)
+ {
+ iterator end(this->end());
+ for (; b != e; ++b)
+ this->insert_equal(end, *b);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the treap if the value
+ //! is not already present.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare functions throw.
+ //! Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert_unique(reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(value, priv_comp(), priv_pcomp(), commit_data);
+ if(!ret.second)
+ return ret;
+ return std::pair<iterator, bool> (insert_unique_commit(value, commit_data), true);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and "hint" must be
+ //! a valid iterator
+ //!
+ //! <b>Effects</b>: Tries to insert x into the treap, using "hint" as a hint
+ //! to where it will be inserted.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time (two comparisons in the worst case)
+ //! if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare functions throw.
+ //! Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert_unique(const_iterator hint, reference value)
+ {
+ insert_commit_data commit_data;
+ std::pair<iterator, bool> ret = insert_unique_check(hint, value, priv_comp(), priv_pcomp(), commit_data);
+ if(!ret.second)
+ return ret.first;
+ return insert_unique_commit(value, commit_data);
+ }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Tries to insert each element of a range into the treap.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare functions throw.
+ //! Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert_unique(Iterator b, Iterator e)
+ {
+ if(this->empty()){
+ iterator end(this->end());
+ for (; b != e; ++b)
+ this->insert_unique(end, *b);
+ }
+ else{
+ for (; b != e; ++b)
+ this->insert_unique(*b);
+ }
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare.
+ //! key_value_pcomp must be a comparison function that induces
+ //! the same strict weak ordering as priority_compare. The difference is that
+ //! key_value_pcomp and key_value_comp compare an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If the key_value_comp or key_value_pcomp
+ //! ordering functions throw. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare, class KeyValuePrioCompare>
+ std::pair<iterator, bool> insert_unique_check
+ ( const KeyType &key, KeyValueCompare key_value_comp
+ , KeyValuePrioCompare key_value_pcomp, insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ comp(key_value_comp, this);
+ detail::key_nodeptr_comp<KeyValuePrioCompare, treap_impl>
+ pcomp(key_value_pcomp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), key, comp, pcomp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare.
+ //! key_value_pcomp must be a comparison function that induces
+ //! the same strict weak ordering as priority_compare. The difference is that
+ //! key_value_pcomp and key_value_comp compare an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the container, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the key_value_comp or key_value_pcomp
+ //! ordering functions throw. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the container.
+ template<class KeyType, class KeyValueCompare, class KeyValuePrioCompare>
+ std::pair<iterator, bool> insert_unique_check
+ ( const_iterator hint, const KeyType &key
+ , KeyValueCompare key_value_comp
+ , KeyValuePrioCompare key_value_pcomp
+ , insert_commit_data &commit_data)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ comp(key_value_comp, this);
+ detail::key_nodeptr_comp<KeyValuePrioCompare, treap_impl>
+ pcomp(key_value_pcomp, this);
+ std::pair<node_ptr, bool> ret =
+ (node_algorithms::insert_unique_check
+ (node_ptr(&priv_header()), hint.pointed_node(), key, comp, pcomp, commit_data));
+ return std::pair<iterator, bool>(iterator(ret.first, this), ret.second);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the container between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the avl_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_unique_commit(reference value, const insert_commit_data &commit_data)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ node_algorithms::insert_unique_commit(node_ptr(&priv_header()), to_insert, commit_data);
+ return iterator(to_insert, this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate
+ //!
+ //! <b>Effects</b>: Inserts x into the treap before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" treap ordering invariant will be broken.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ detail::key_nodeptr_comp<priority_compare, treap_impl>
+ pcomp(priv_pcomp(), this);
+ return iterator(node_algorithms::insert_before
+ (node_ptr(&priv_header()), pos.pointed_node(), to_insert, pcomp), this);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no less
+ //! than the greatest inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the treap in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than the greatest inserted key treap ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ detail::key_nodeptr_comp<priority_compare, treap_impl>
+ pcomp(priv_pcomp(), this);
+ node_algorithms::push_back(node_ptr(&priv_header()), to_insert, pcomp);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no greater
+ //! than the minimum inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the treap in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than the minimum inserted key treap ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ {
+ node_ptr to_insert(get_real_value_traits().to_node_ptr(value));
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::unique(to_insert));
+ this->priv_size_traits().increment();
+ detail::key_nodeptr_comp<priority_compare, treap_impl>
+ pcomp(priv_pcomp(), this);
+ node_algorithms::push_front(node_ptr(&priv_header()), to_insert, pcomp);
+ }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ {
+ const_iterator ret(i);
+ ++ret;
+ node_ptr to_erase(i.pointed_node());
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(!node_algorithms::unique(to_erase));
+ detail::key_nodeptr_comp<priority_compare, treap_impl>
+ key_node_pcomp(priv_pcomp(), this);
+ node_algorithms::erase(&priv_header(), to_erase, key_node_pcomp);
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)
+ node_algorithms::init(to_erase);
+ return ret.unconst();
+ }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { size_type n; return private_erase(b, e, n); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return this->erase(value, priv_comp()); }
+
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: if the internal priority_compare function throws.
+ //! Equivalent guarantee to <i>while(beg != end) erase(beg++);</i>
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ {
+ node_ptr to_erase(i.pointed_node());
+ iterator ret(this->erase(i));
+ disposer(get_real_value_traits().to_value_ptr(to_erase));
+ return ret;
+ }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: if the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { size_type n; return private_erase(b, e, n, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: if the priority_compare function throws then weak guarantee and heap invariants are broken.
+ //! The safest thing would be to clear or destroy the container.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ {
+ std::pair<iterator,iterator> p = this->equal_range(value);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + N).
+ //!
+ //! <b>Throws</b>: if the priority_compare function throws then weak guarantee and heap invariants are broken.
+ //! The safest thing would be to clear or destroy the container.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ {
+ std::pair<iterator,iterator> p = this->equal_range(key, comp);
+ size_type n;
+ private_erase(p.first, p.second, n, disposer);
+ return n;
+ }
+
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ {
+ if(safemode_or_autounlink){
+ this->clear_and_dispose(detail::null_disposer());
+ }
+ else{
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(0);
+ }
+ }
+
+ //! <b>Effects</b>: Erases all of the elements calling disposer(p) for
+ //! each node to be erased.
+ //! <b>Complexity</b>: Average complexity for is at most O(log(size() + N)),
+ //! where N is the number of elements in the container.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. Calls N times to disposer functor.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ {
+ node_algorithms::clear_and_dispose(node_ptr(&priv_header())
+ , detail::node_disposer<Disposer, treap_impl>(disposer, this));
+ node_algorithms::init_header(&priv_header());
+ this->priv_size_traits().set_size(0);
+ }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given value
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given value.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type count(const_reference value) const
+ { return this->count(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType &key, KeyValueCompare comp) const
+ {
+ std::pair<const_iterator, const_iterator> ret = this->equal_range(key, comp);
+ return std::distance(ret.first, ret.second);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator lower_bound(const_reference value)
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator lower_bound(const_reference value) const
+ { return this->lower_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::lower_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator upper_bound(const_reference value)
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ return iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator upper_bound(const_reference value) const
+ { return this->upper_bound(value, priv_comp()); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k according to comp or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ return const_iterator(node_algorithms::upper_bound
+ (const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator find(const_reference value)
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ return iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator find(const_reference value) const
+ { return this->find(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ return const_iterator
+ (node_algorithms::find(const_node_ptr(&priv_header()), key, key_node_comp), this);
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType &key, KeyValueCompare comp)
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<iterator, iterator>(iterator(ret.first, this), iterator(ret.second, this));
+ }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return this->equal_range(value, priv_comp()); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType &key, KeyValueCompare comp) const
+ {
+ detail::key_nodeptr_comp<KeyValueCompare, treap_impl>
+ key_node_comp(comp, this);
+ std::pair<node_ptr, node_ptr> ret
+ (node_algorithms::equal_range(const_node_ptr(&priv_header()), key, key_node_comp));
+ return std::pair<const_iterator, const_iterator>(const_iterator(ret.first, this), const_iterator(ret.second, this));
+ }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const treap_impl &src, Cloner cloner, Disposer disposer)
+ {
+ this->clear_and_dispose(disposer);
+ if(!src.empty()){
+ detail::exception_disposer<treap_impl, Disposer>
+ rollback(*this, disposer);
+ node_algorithms::clone
+ (const_node_ptr(&src.priv_header())
+ ,node_ptr(&this->priv_header())
+ ,detail::node_cloner<Cloner, treap_impl>(cloner, this)
+ ,detail::node_disposer<Disposer, treap_impl>(disposer, this));
+ this->priv_size_traits().set_size(src.priv_size_traits().get_size());
+ this->priv_comp() = src.priv_comp();
+ rollback.release();
+ }
+ }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the treap.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the treap and the treap can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the treap.
+ pointer unlink_leftmost_without_rebalance()
+ {
+ node_ptr to_be_disposed(node_algorithms::unlink_leftmost_without_rebalance
+ (node_ptr(&priv_header())));
+ if(!to_be_disposed)
+ return 0;
+ this->priv_size_traits().decrement();
+ if(safemode_or_autounlink)//If this is commented does not work with normal_link
+ node_algorithms::init(to_be_disposed);
+ return get_real_value_traits().to_value_ptr(to_be_disposed);
+ }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any treap.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! treap with with_this. The treap does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering and priority rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ {
+ node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
+ , node_ptr(&priv_header())
+ , get_real_value_traits().to_node_ptr(with_this));
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return iterator (value_traits::to_node_ptr(value), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ {
+ BOOST_STATIC_ASSERT((!stateful_value_traits));
+ return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), 0);
+ }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return iterator (value_traits::to_node_ptr(value), this); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return const_iterator (value_traits::to_node_ptr(const_cast<reference> (value)), this); }
+
+ //! <b>Requires</b>: value shall not be in a treap.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { node_algorithms::init(value_traits::to_node_ptr(value)); }
+
+ /// @cond
+ private:
+ template<class Disposer>
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n, Disposer disposer)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase_and_dispose(b++, disposer);
+ return b.unconst();
+ }
+
+ iterator private_erase(const_iterator b, const_iterator e, size_type &n)
+ {
+ for(n = 0; b != e; ++n)
+ this->erase(b++);
+ return b.unconst();
+ }
+ /// @endcond
+
+ private:
+ static treap_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
+ {
+ header_plus_size *r = detail::parent_from_member<header_plus_size, node>
+ ( detail::get_pointer(end_iterator.pointed_node()), &header_plus_size::header_);
+ typename node_plus_pred_t::header_plus_priority_size *n =
+ detail::parent_from_member
+ < typename node_plus_pred_t::header_plus_priority_size
+ , header_plus_size>
+ (r, &node_plus_pred_t::header_plus_priority_size::header_plus_size_);
+ node_plus_pred_t *pn = detail::parent_from_member
+ < node_plus_pred_t
+ , typename node_plus_pred_t::header_plus_priority_size>
+ (n, &node_plus_pred_t::header_plus_priority_size_);
+ data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(pn, &data_t::node_plus_pred_);
+ treap_impl *tr = detail::parent_from_member<treap_impl, data_t>(d, &treap_impl::data_);
+ return *tr;
+ }
+
+ static treap_impl &priv_container_from_iterator(const const_iterator &it)
+ { return priv_container_from_end_iterator(it.end_iterator_from_it()); }
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_impl<T, Options...> &x, const treap_impl<T, Options...> &y)
+#else
+(const treap_impl<Config> &x, const treap_impl<Config> &y)
+#endif
+{ return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end()); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+bool operator==
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_impl<T, Options...> &x, const treap_impl<T, Options...> &y)
+#else
+(const treap_impl<Config> &x, const treap_impl<Config> &y)
+#endif
+{
+ typedef treap_impl<Config> tree_type;
+ typedef typename tree_type::const_iterator const_iterator;
+
+ if(tree_type::constant_time_size && x.size() != y.size()){
+ return false;
+ }
+ const_iterator end1 = x.end();
+ const_iterator i1 = x.begin();
+ const_iterator i2 = y.begin();
+ if(tree_type::constant_time_size){
+ while (i1 != end1 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1;
+ }
+ else{
+ const_iterator end2 = y.end();
+ while (i1 != end1 && i2 != end2 && *i1 == *i2) {
+ ++i1;
+ ++i2;
+ }
+ return i1 == end1 && i2 == end2;
+ }
+}
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_impl<T, Options...> &x, const treap_impl<T, Options...> &y)
+#else
+(const treap_impl<Config> &x, const treap_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_impl<T, Options...> &x, const treap_impl<T, Options...> &y)
+#else
+(const treap_impl<Config> &x, const treap_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_impl<T, Options...> &x, const treap_impl<T, Options...> &y)
+#else
+(const treap_impl<Config> &x, const treap_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_impl<T, Options...> &x, const treap_impl<T, Options...> &y)
+#else
+(const treap_impl<Config> &x, const treap_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(treap_impl<T, Options...> &x, treap_impl<T, Options...> &y)
+#else
+(treap_impl<Config> &x, treap_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+/// @cond
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none
+ >
+#else
+template<class T, class ...Options>
+#endif
+struct make_treap_opt
+{
+ typedef typename pack_options
+ < treap_set_defaults<T>,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+ typedef typename detail::get_value_traits
+ <T, typename packed_options::value_traits>::type value_traits;
+
+ typedef treap_setopt
+ < value_traits
+ , typename packed_options::compare
+ , typename packed_options::priority
+ , typename packed_options::size_type
+ , packed_options::constant_time_size
+ > type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c treap that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_trie
+{
+ /// @cond
+ typedef treap_impl
+ < typename make_treap_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class treap
+ : public make_trie<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_trie
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::priority_compare priority_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::real_value_traits real_value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename real_value_traits::value_type, T>::value));
+
+ treap( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, pcmp, v_traits)
+ {}
+
+ template<class Iterator>
+ treap( bool unique, Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(unique, b, e, cmp, pcmp, v_traits)
+ {}
+
+ static treap &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<treap &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const treap &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const treap &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static treap &container_from_it(iterator it)
+ { return static_cast<treap &>(Base::container_from_iterator(it)); }
+
+ static const treap &container_from_it(const_iterator it)
+ { return static_cast<const treap &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_TRIE_HPP
Added: sandbox/move/boost/intrusive/treap_algorithms.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/treap_algorithms.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,894 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_TREAP_ALGORITHMS_HPP
+#define BOOST_INTRUSIVE_TREAP_ALGORITHMS_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+
+#include <cstddef>
+#include <boost/intrusive/intrusive_fwd.hpp>
+
+#include <boost/intrusive/detail/assert.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/tree_algorithms.hpp>
+#include <algorithm>
+
+
+namespace boost {
+namespace intrusive {
+
+//! treap_algorithms provides basic algorithms to manipulate
+//! nodes forming a treap.
+//!
+//! (1) the header node is maintained with links not only to the root
+//! but also to the leftmost node of the tree, to enable constant time
+//! begin(), and to the rightmost node of the tree, to enable linear time
+//! performance when used with the generic set algorithms (set_union,
+//! etc.);
+//!
+//! (2) when a node being deleted has two children its successor node is
+//! relinked into its place, rather than copied, so that the only
+//! pointers invalidated are those referring to the deleted node.
+//!
+//! treap_algorithms is configured with a NodeTraits class, which encapsulates the
+//! information about the node to be manipulated. NodeTraits must support the
+//! following interface:
+//!
+//! <b>Typedefs</b>:
+//!
+//! <tt>node</tt>: The type of the node that forms the circular list
+//!
+//! <tt>node_ptr</tt>: A pointer to a node
+//!
+//! <tt>const_node_ptr</tt>: A pointer to a const node
+//!
+//! <b>Static functions</b>:
+//!
+//! <tt>static node_ptr get_parent(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_parent(node_ptr n, node_ptr parent);</tt>
+//!
+//! <tt>static node_ptr get_left(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_left(node_ptr n, node_ptr left);</tt>
+//!
+//! <tt>static node_ptr get_right(const_node_ptr n);</tt>
+//!
+//! <tt>static void set_right(node_ptr n, node_ptr right);</tt>
+template<class NodeTraits>
+class treap_algorithms
+{
+ public:
+ typedef NodeTraits node_traits;
+ typedef typename NodeTraits::node node;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+
+ /// @cond
+ private:
+
+ class remove_on_destroy
+ {
+ remove_on_destroy(const remove_on_destroy&);
+ remove_on_destroy& operator=(const remove_on_destroy&);
+ public:
+ remove_on_destroy(node_ptr header, node_ptr z)
+ : header_(header), z_(z), remove_it_(true)
+ {}
+ ~remove_on_destroy()
+ {
+ if(remove_it_){
+ tree_algorithms::erase(header_, z_);
+ }
+ }
+
+ void release()
+ { remove_it_ = false; }
+
+ const node_ptr header_;
+ const node_ptr z_;
+ bool remove_it_;
+ };
+
+ class rerotate_on_destroy
+ {
+ rerotate_on_destroy(const remove_on_destroy&);
+ rerotate_on_destroy& operator=(const rerotate_on_destroy&);
+
+ public:
+ rerotate_on_destroy(node_ptr header, node_ptr p, std::size_t &n)
+ : header_(header), p_(p), n_(n), remove_it_(true)
+ {}
+
+ ~rerotate_on_destroy()
+ {
+ if(remove_it_){
+ rotate_up_n(header_, p_, n_);
+ }
+ }
+
+ void release()
+ { remove_it_ = false; }
+
+ const node_ptr header_;
+ const node_ptr p_;
+ std::size_t &n_;
+ bool remove_it_;
+ };
+
+ static void rotate_up_n(const node_ptr header, const node_ptr p, std::size_t n)
+ {
+ for( node_ptr p_parent = NodeTraits::get_parent(p)
+ ; n--
+ ; p_parent = NodeTraits::get_parent(p)){
+ //Check if left child
+ if(p == NodeTraits::get_left(p_parent)){
+ tree_algorithms::rotate_right(p_parent, header);
+ }
+ else{ //Right child
+ tree_algorithms::rotate_left(p_parent, header);
+ }
+ }
+ }
+
+ typedef detail::tree_algorithms<NodeTraits> tree_algorithms;
+
+ static node_ptr uncast(const_node_ptr ptr)
+ {
+ return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer(ptr)));
+ }
+ /// @endcond
+
+ public:
+ static node_ptr begin_node(const_node_ptr header)
+ { return tree_algorithms::begin_node(header); }
+
+ static node_ptr end_node(const_node_ptr header)
+ { return tree_algorithms::end_node(header); }
+
+ //! This type is the information that will be
+ //! filled by insert_unique_check
+ struct insert_commit_data
+ /// @cond
+ : public tree_algorithms::insert_commit_data
+ /// @endcond
+ {
+ /// @cond
+ std::size_t rotations;
+ /// @endcond
+ };
+
+ //! <b>Requires</b>: header1 and header2 must be the header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two trees. After the function header1 will contain
+ //! links to the second tree and header2 will have links to the first tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static void swap_tree(node_ptr header1, node_ptr header2)
+ { return tree_algorithms::swap_tree(header1, header2); }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr node2)
+ {
+ if(node1 == node2)
+ return;
+
+ node_ptr header1(tree_algorithms::get_header(node1)), header2(tree_algorithms::get_header(node2));
+ swap_nodes(node1, header1, node2, header2);
+ }
+
+ //! <b>Requires</b>: node1 and node2 can't be header nodes
+ //! of two trees with header header1 and header2.
+ //!
+ //! <b>Effects</b>: Swaps two nodes. After the function node1 will be inserted
+ //! in the position node2 before the function. node2 will be inserted in the
+ //! position node1 had before the function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! node1 and node2 are not equivalent according to the ordering rules.
+ //!
+ //!Experimental function
+ static void swap_nodes(node_ptr node1, node_ptr header1, node_ptr node2, node_ptr header2)
+ { tree_algorithms::swap_nodes(node1, header1, node2, header2); }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing and comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr new_node)
+ {
+ if(node_to_be_replaced == new_node)
+ return;
+ replace_node(node_to_be_replaced, tree_algorithms::get_header(node_to_be_replaced), new_node);
+ }
+
+ //! <b>Requires</b>: node_to_be_replaced must be inserted in a tree
+ //! with header "header" and new_node must not be inserted in a tree.
+ //!
+ //! <b>Effects</b>: Replaces node_to_be_replaced in its position in the
+ //! tree with new_node. The tree does not need to be rebalanced
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! new_node is not equivalent to node_to_be_replaced according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ //!
+ //!Experimental function
+ static void replace_node(node_ptr node_to_be_replaced, node_ptr header, node_ptr new_node)
+ { tree_algorithms::replace_node(node_to_be_replaced, header, new_node); }
+
+ //! <b>Requires</b>: node is a tree node but not the header.
+ //!
+ //! <b>Effects</b>: Unlinks the node and rebalances the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: If "pcomp" throws, strong guarantee
+ template<class NodePtrPriorityCompare>
+ static void unlink(node_ptr node, NodePtrPriorityCompare pcomp)
+ {
+ node_ptr x = NodeTraits::get_parent(node);
+ if(x){
+ while(!is_header(x))
+ x = NodeTraits::get_parent(x);
+ erase(x, node, pcomp);
+ }
+ }
+
+ //! <b>Requires</b>: header is the header of a tree.
+ //!
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree, and
+ //! updates the header link to the new leftmost node.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ static node_ptr unlink_leftmost_without_rebalance(node_ptr header)
+ { return tree_algorithms::unlink_leftmost_without_rebalance(header); }
+
+ //! <b>Requires</b>: node is a node of the tree or an node initialized
+ //! by init(...).
+ //!
+ //! <b>Effects</b>: Returns true if the node is initialized by init().
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool unique(const_node_ptr node)
+ { return tree_algorithms::unique(node); }
+
+ //! <b>Requires</b>: node is a node of the tree but it's not the header.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes of the subtree.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t count(const_node_ptr node)
+ { return tree_algorithms::count(node); }
+
+ //! <b>Requires</b>: header is the header node of the tree.
+ //!
+ //! <b>Effects</b>: Returns the number of nodes above the header.
+ //!
+ //! <b>Complexity</b>: Linear time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static std::size_t size(const_node_ptr header)
+ { return tree_algorithms::size(header); }
+
+ //! <b>Requires</b>: p is a node from the tree except the header.
+ //!
+ //! <b>Effects</b>: Returns the next node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr next_node(node_ptr p)
+ { return tree_algorithms::next_node(p); }
+
+ //! <b>Requires</b>: p is a node from the tree except the leftmost node.
+ //!
+ //! <b>Effects</b>: Returns the previous node of the tree.
+ //!
+ //! <b>Complexity</b>: Average constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr prev_node(node_ptr p)
+ { return tree_algorithms::prev_node(p); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: After the function unique(node) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init(node_ptr node)
+ { tree_algorithms::init(node); }
+
+ //! <b>Requires</b>: node must not be part of any tree.
+ //!
+ //! <b>Effects</b>: Initializes the header to represent an empty tree.
+ //! unique(header) == true.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Nodes</b>: If node is inserted in a tree, this function corrupts the tree.
+ static void init_header(node_ptr header)
+ {
+ tree_algorithms::init_header(header);
+ }
+
+ //! <b>Requires</b>: header must be the header of a tree, z a node
+ //! of that tree and z != header.
+ //!
+ //! <b>Effects</b>: Erases node "z" from the tree with header "header".
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: If "pcomp" throws, strong guarantee.
+ template<class NodePtrPriorityCompare>
+ static node_ptr erase(node_ptr header, node_ptr z, NodePtrPriorityCompare pcomp)
+ {
+ rebalance_for_erasure(header, z, pcomp);
+ tree_algorithms::erase(header, z);
+// assert(check_invariant(header, pcomp));
+ return z;
+ }
+
+ //! <b>Requires</b>: "cloner" must be a function
+ //! object taking a node_ptr and returning a new cloned node of it. "disposer" must
+ //! take a node_ptr and shouldn't throw.
+ //!
+ //! <b>Effects</b>: First empties target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! Then, duplicates the entire tree pointed by "source_header" cloning each
+ //! source node with <tt>node_ptr Cloner::operator()(node_ptr)</tt> to obtain
+ //! the nodes of the target tree. If "cloner" throws, the cloned target nodes
+ //! are disposed using <tt>void disposer(node_ptr)</tt>.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template <class Cloner, class Disposer>
+ static void clone
+ (const_node_ptr source_header, node_ptr target_header, Cloner cloner, Disposer disposer)
+ {
+ tree_algorithms::clone(source_header, target_header, cloner, disposer);
+ }
+
+ //! <b>Requires</b>: "disposer" must be an object function
+ //! taking a node_ptr parameter and shouldn't throw.
+ //!
+ //! <b>Effects</b>: Empties the target tree calling
+ //! <tt>void disposer::operator()(node_ptr)</tt> for every node of the tree
+ //! except the header.
+ //!
+ //! <b>Complexity</b>: Linear to the number of element of the source tree plus the.
+ //! number of elements of tree target tree when calling this function.
+ //!
+ //! <b>Throws</b>: If cloner functor throws. If this happens target nodes are disposed.
+ template<class Disposer>
+ static void clear_and_dispose(node_ptr header, Disposer disposer)
+ { tree_algorithms::clear_and_dispose(header, disposer); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is
+ //! not less than "key" according to "comp" or "header" if that element does
+ //! not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr lower_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::lower_bound(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the first element that is greater
+ //! than "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr upper_bound
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::upper_bound(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an node_ptr to the element that is equivalent to
+ //! "key" according to "comp" or "header" if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static node_ptr find
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::find(header, key, comp); }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
+ //!
+ //! <b>Effects</b>: Returns an a pair of node_ptr delimiting a range containing
+ //! all elements that are equivalent to "key" according to "comp" or an
+ //! empty range that indicates the position where those elements would be
+ //! if they there are no equivalent elements.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class KeyType, class KeyNodePtrCompare>
+ static std::pair<node_ptr, node_ptr> equal_range
+ (const_node_ptr header, const KeyType &key, KeyNodePtrCompare comp)
+ { return tree_algorithms::equal_range(header, key, comp); }
+
+ //! <b>Requires</b>: "h" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //! NodePtrPriorityCompare is a priority function object that induces a strict weak
+ //! ordering compatible with the one used to create the
+ //! the tree. NodePtrPriorityCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the upper bound
+ //! according to "comp" and rotates the tree according to "pcomp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throw or "pcomp" throw.
+ template<class NodePtrCompare, class NodePtrPriorityCompare>
+ static node_ptr insert_equal_upper_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
+ {
+ insert_commit_data commit_data;
+ tree_algorithms::insert_equal_upper_bound_check(h, new_node, comp, commit_data);
+ rebalance_check_and_commit(h, new_node, pcomp, commit_data);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "h" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs.
+ //! NodePtrPriorityCompare is a priority function object that induces a strict weak
+ //! ordering compatible with the one used to create the
+ //! the tree. NodePtrPriorityCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before the upper bound
+ //! according to "comp" and rotates the tree according to "pcomp".
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ template<class NodePtrCompare, class NodePtrPriorityCompare>
+ static node_ptr insert_equal_lower_bound
+ (node_ptr h, node_ptr new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
+ {
+ insert_commit_data commit_data;
+ tree_algorithms::insert_equal_lower_bound_check(h, new_node, comp, commit_data);
+ rebalance_check_and_commit(h, new_node, pcomp, commit_data);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! NodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares two node_ptrs. "hint" is node from
+ //! the "header"'s tree.
+ //! NodePtrPriorityCompare is a priority function object that induces a strict weak
+ //! ordering compatible with the one used to create the
+ //! the tree. NodePtrPriorityCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree, using "hint" as a hint to
+ //! where it will be inserted. If "hint" is the upper_bound
+ //! the insertion takes constant time (two comparisons in the worst case).
+ //! Rotates the tree according to "pcomp".
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if new_node is inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throw or "pcomp" throw.
+ template<class NodePtrCompare, class NodePtrPriorityCompare>
+ static node_ptr insert_equal
+ (node_ptr h, node_ptr hint, node_ptr new_node, NodePtrCompare comp, NodePtrPriorityCompare pcomp)
+ {
+ insert_commit_data commit_data;
+ tree_algorithms::insert_equal_check(h, hint, new_node, comp, commit_data);
+ rebalance_check_and_commit(h, new_node, pcomp, commit_data);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "pos" must be a valid node of the tree (including header end) node.
+ //! "pos" must be a node pointing to the successor to "new_node"
+ //! once inserted according to the order of already inserted nodes. This function does not
+ //! check "pos" and this precondition must be guaranteed by the caller.
+ //! NodePtrPriorityCompare is a priority function object that induces a strict weak
+ //! ordering compatible with the one used to create the
+ //! the tree. NodePtrPriorityCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts new_node into the tree before "pos"
+ //! and rotates the tree according to "pcomp".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: If "pcomp" throws, strong guarantee.
+ //!
+ //! <b>Note</b>: If "pos" is not the successor of the newly inserted "new_node"
+ //! tree invariants might be broken.
+ template<class NodePtrPriorityCompare>
+ static node_ptr insert_before
+ (node_ptr header, node_ptr pos, node_ptr new_node, NodePtrPriorityCompare pcomp)
+ {
+ insert_commit_data commit_data;
+ tree_algorithms::insert_before_check(header, pos, commit_data);
+ rebalance_check_and_commit(header, new_node, pcomp, commit_data);
+ return new_node;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering no less than the
+ //! greatest inserted key.
+ //! NodePtrPriorityCompare is a priority function object that induces a strict weak
+ //! ordering compatible with the one used to create the
+ //! the tree. NodePtrPriorityCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the last position
+ //! and rotates the tree according to "pcomp".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: If "pcomp" throws, strong guarantee.
+ //!
+ //! <b>Note</b>: If "new_node" is less than the greatest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ template<class NodePtrPriorityCompare>
+ static void push_back(node_ptr header, node_ptr new_node, NodePtrPriorityCompare pcomp)
+ {
+ insert_commit_data commit_data;
+ tree_algorithms::push_back_check(header, commit_data);
+ rebalance_check_and_commit(header, new_node, pcomp, commit_data);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "new_node" must be, according to the used ordering, no greater than the
+ //! lowest inserted key.
+ //! NodePtrPriorityCompare is a priority function object that induces a strict weak
+ //! ordering compatible with the one used to create the
+ //! the tree. NodePtrPriorityCompare compares two node_ptrs.
+ //!
+ //! <b>Effects</b>: Inserts x into the tree in the first position
+ //! and rotates the tree according to "pcomp".
+ //!
+ //! <b>Complexity</b>: Constant-time.
+ //!
+ //! <b>Throws</b>: If "pcomp" throws, strong guarantee.
+ //!
+ //! <b>Note</b>: If "new_node" is greater than the lowest inserted key
+ //! tree invariants are broken. This function is slightly faster than
+ //! using "insert_before".
+ template<class NodePtrPriorityCompare>
+ static void push_front(node_ptr header, node_ptr new_node, NodePtrPriorityCompare pcomp)
+ {
+ insert_commit_data commit_data;
+ tree_algorithms::push_front_check(header, commit_data);
+ rebalance_check_and_commit(header, new_node, pcomp, commit_data);
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare, class KeyNodePtrPrioCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, const KeyType &key
+ ,KeyNodePtrCompare comp, KeyNodePtrPrioCompare pcomp
+ ,insert_commit_data &commit_data)
+ {
+ std::pair<node_ptr, bool> ret =
+ tree_algorithms::insert_unique_check(header, key, comp, commit_data);
+ if(ret.second)
+ rebalance_after_insertion_check(header, commit_data.node, key, pcomp, commit_data.rotations);
+ return ret;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! KeyNodePtrCompare is a function object that induces a strict weak
+ //! ordering compatible with the strict weak ordering used to create the
+ //! the tree. NodePtrCompare compares KeyType with a node_ptr.
+ //! "hint" is node from the "header"'s tree.
+ //!
+ //! <b>Effects</b>: Checks if there is an equivalent node to "key" in the
+ //! tree according to "comp" using "hint" as a hint to where it should be
+ //! inserted and obtains the needed information to realize
+ //! a constant-time node insertion if there is no equivalent node.
+ //! If "hint" is the upper_bound the function has constant time
+ //! complexity (two comparisons in the worst case).
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing a node_ptr to the already present node
+ //! and false. If there is not equivalent key can be inserted returns true
+ //! in the returned pair's boolean and fills "commit_data" that is meant to
+ //! be used with the "insert_commit" function to achieve a constant-time
+ //! insertion function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic, but it is
+ //! amortized constant time if new_node should be inserted immediately before "hint".
+ //!
+ //! <b>Throws</b>: If "comp" throws.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a node is expensive and the user does not want to have two equivalent nodes
+ //! in the tree: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the node and this function offers the possibility to use that part
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the node and use
+ //! "insert_commit" to insert the node in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_unique_commit" only
+ //! if no more objects are inserted or erased from the set.
+ template<class KeyType, class KeyNodePtrCompare, class KeyNodePtrPrioCompare>
+ static std::pair<node_ptr, bool> insert_unique_check
+ (const_node_ptr header, node_ptr hint, const KeyType &key
+ ,KeyNodePtrCompare comp, KeyNodePtrPrioCompare pcomp, insert_commit_data &commit_data)
+ {
+ std::pair<node_ptr, bool> ret =
+ tree_algorithms::insert_unique_check(header, hint, key, comp, commit_data);
+ if(ret.second)
+ rebalance_after_insertion_check(header, commit_data.node, key, pcomp, commit_data.rotations);
+ return ret;
+ }
+
+ //! <b>Requires</b>: "header" must be the header node of a tree.
+ //! "commit_data" must have been obtained from a previous call to
+ //! "insert_unique_check". No objects should have been inserted or erased
+ //! from the set between the "insert_unique_check" that filled "commit_data"
+ //! and the call to "insert_commit".
+ //!
+ //!
+ //! <b>Effects</b>: Inserts new_node in the set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_unique_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ static void insert_unique_commit
+ (node_ptr header, node_ptr new_node, const insert_commit_data &commit_data)
+ {
+ tree_algorithms::insert_unique_commit(header, new_node, commit_data);
+ rebalance_after_insertion_commit(header, new_node, commit_data.rotations);
+ }
+
+ //! <b>Requires</b>: "n" must be a node inserted in a tree.
+ //!
+ //! <b>Effects</b>: Returns a pointer to the header node of the tree.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static node_ptr get_header(node_ptr n)
+ { return tree_algorithms::get_header(n); }
+
+ /// @cond
+ private:
+
+ //! <b>Requires</b>: p is a node of a tree.
+ //!
+ //! <b>Effects</b>: Returns true if p is the header of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static bool is_header(const_node_ptr p)
+ {
+ return tree_algorithms::is_header(p);
+ }
+
+ template<class NodePtrPriorityCompare>
+ static void rebalance_for_erasure(node_ptr header, node_ptr z, NodePtrPriorityCompare pcomp)
+ {
+ std::size_t n = 0;
+ rerotate_on_destroy rb(header, z, n);
+
+ node_ptr z_left = NodeTraits::get_left(z);
+ node_ptr z_right = NodeTraits::get_right(z);
+ while(z_left || z_right){
+ if(!z_right || (z_left && pcomp(z_left, z_right))){
+ tree_algorithms::rotate_right(z, header);
+ }
+ else{
+ tree_algorithms::rotate_left(z, header);
+ }
+ ++n;
+ z_left = NodeTraits::get_left(z);
+ z_right = NodeTraits::get_right(z);
+ }
+ rb.release();
+ }
+
+ template<class NodePtrPriorityCompare>
+ static void rebalance_check_and_commit
+ (node_ptr h, node_ptr new_node, NodePtrPriorityCompare pcomp, insert_commit_data &commit_data)
+ {
+ rebalance_after_insertion_check(h, commit_data.node, new_node, pcomp, commit_data.rotations);
+ //No-throw
+ tree_algorithms::insert_unique_commit(h, new_node, commit_data);
+ rebalance_after_insertion_commit(h, new_node, commit_data.rotations);
+ }
+
+
+ template<class Key, class KeyNodePriorityCompare>
+ static void rebalance_after_insertion_check
+ ( const_node_ptr header, const_node_ptr upnode, const Key &k
+ , KeyNodePriorityCompare pcomp, std::size_t &num_rotations)
+ {
+ //First check rotations since pcomp can throw
+ num_rotations = 0;
+ std::size_t n = 0;
+ while(upnode != header && pcomp(k, upnode)){
+ ++n;
+ upnode = NodeTraits::get_parent(upnode);
+ }
+ num_rotations = n;
+ }
+
+ static void rebalance_after_insertion_commit(node_ptr header, node_ptr p, std::size_t n)
+ {
+ // Now execute n rotations
+ for( node_ptr p_parent = NodeTraits::get_parent(p)
+ ; n--
+ ; p_parent = NodeTraits::get_parent(p)){
+ //Check if left child
+ if(p == NodeTraits::get_left(p_parent)){
+ tree_algorithms::rotate_right(p_parent, header);
+ }
+ else{ //Right child
+ tree_algorithms::rotate_left(p_parent, header);
+ }
+ }
+ }
+
+ template<class NodePtrPriorityCompare>
+ static bool check_invariant(const_node_ptr header, NodePtrPriorityCompare pcomp)
+ {
+ node_ptr beg = begin_node(header);
+ node_ptr end = end_node(header);
+
+ while(beg != end){
+ node_ptr p = NodeTraits::get_parent(beg);
+ if(p != header){
+ if(pcomp(beg, p))
+ return false;
+ }
+ beg = next_node(beg);
+ }
+ return true;
+ }
+
+ /// @endcond
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_TREAP_ALGORITHMS_HPP
Added: sandbox/move/boost/intrusive/treap_set.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/treap_set.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,2543 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_TRIE_SET_HPP
+#define BOOST_INTRUSIVE_TRIE_SET_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/treap.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <iterator>
+
+namespace boost {
+namespace intrusive {
+
+//! The class template treap_set is an intrusive container, that mimics most of
+//! the interface of std::set as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<>,
+//! \c compare<> and \c priority_compare<>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class treap_set_impl
+{
+ /// @cond
+ typedef treap_impl<Config> tree_type;
+ //! This class is
+ //! non-copyable
+ treap_set_impl (const treap_set_impl&);
+
+ //! This class is
+ //! non-assignable
+ treap_set_impl &operator =(const treap_set_impl&);
+
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::priority_compare priority_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the value_compare object throws.
+ treap_set_impl( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, pcmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty treap_set and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is std::distance(last, first).
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare object throws.
+ template<class Iterator>
+ treap_set_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(true, b, e, cmp, pcmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the treap_set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~treap_set_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the highest priority object of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator top()
+ { return tree_.top(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the tree..
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator top() const
+ { return this->ctop(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the tree..
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator ctop() const
+ { return tree_.ctop(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the highest priority object of the
+ //! reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rtop()
+ { return tree_.rtop(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority objec
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rtop() const
+ { return tree_.crtop(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority object
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crtop() const
+ { return tree_.crtop(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of treap_set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the treap_set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static treap_set_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<treap_set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &treap_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of treap_set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the treap_set associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const treap_set_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<treap_set_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &treap_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static treap_set_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<treap_set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &treap_set_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of set.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the set associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ static const treap_set_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<treap_set_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &treap_set_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the priority_compare object used by the treap_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If priority_compare copy-constructor throws.
+ priority_compare priority_comp() const
+ { return tree_.priority_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the treap_set.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two sets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(treap_set_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const treap_set_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to inserts value into the treap_set.
+ //!
+ //! <b>Returns</b>: If the value
+ //! is not already present inserts it and returns a pair containing the
+ //! iterator to the new value and true. If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare ordering function throw.
+ //! Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert(reference value)
+ { return tree_.insert_unique(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to to insert x into the treap_set, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the
+ //! new element was inserted into the treap_set.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare ordering
+ //! functions throw. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_unique(hint, value); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare.
+ //! key_value_pcomp must be a comparison function that induces
+ //! the same strict weak ordering as priority_compare. The difference is that
+ //! key_value_pcomp and key_value_comp compare an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the treap_set, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average complexity is at most logarithmic.
+ //!
+ //! <b>Throws</b>: If key_value_comp or key_value_pcomp ordering function throw.
+ //! Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that
+ //! part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This gives a total
+ //! logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the treap_set.
+ template<class KeyType, class KeyValueCompare, class KeyValuePriorityCompare>
+ std::pair<iterator, bool> insert_check
+ ( const KeyType &key, KeyValueCompare key_value_comp, KeyValuePriorityCompare key_value_pcomp
+ , insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(key, key_value_comp, key_value_pcomp, commit_data); }
+
+ //! <b>Requires</b>: key_value_comp must be a comparison function that induces
+ //! the same strict weak ordering as value_compare.
+ //! key_value_pcomp must be a comparison function that induces
+ //! the same strict weak ordering as priority_compare. The difference is that
+ //! key_value_pcomp and key_value_comp compare an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the treap_set, using
+ //! a user provided key instead of the value itself, using "hint"
+ //! as a hint to where it will be inserted.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it's amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If key_value_comp or key_value_pcomp ordering function throw.
+ //! Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! constructing that is used to impose the order is much cheaper to construct
+ //! than the value_type and this function offers the possibility to use that key
+ //! to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time. This can give a total
+ //! constant-time complexity to the insertion: check(O(1)) + commit(O(1)).
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the treap_set.
+ template<class KeyType, class KeyValueCompare, class KeyValuePriorityCompare>
+ std::pair<iterator, bool> insert_check
+ ( const_iterator hint, const KeyType &key
+ , KeyValueCompare key_value_comp, KeyValuePriorityCompare key_value_pcomp
+ , insert_commit_data &commit_data)
+ { return tree_.insert_unique_check(hint, key, key_value_comp, key_value_pcomp, commit_data); }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the treap_set between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the treap_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ iterator insert_commit(reference value, const insert_commit_data &commit_data)
+ { return tree_.insert_unique_commit(value, commit_data); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the treap_set.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare ordering function
+ //! throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_unique(b, e); }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate. "value" must not be equal to any
+ //! inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the treap before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" treap ordering invariant will be broken.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ { return tree_.insert_before(pos, value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be greater than
+ //! any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the treap in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than the greatest inserted key treap ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ { tree_.push_back(value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be less
+ //! than any inserted key according to the predicate.
+ //!
+ //! <b>Effects</b>: Inserts x into the treap in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than the minimum inserted key treap ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ { tree_.push_front(value); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size()) + this->count(value)).
+ //!
+ //! <b>Throws</b>: If internal value_compare or priority_compare
+ //! ordering functions throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp or internal priority_compare
+ //! ordering functions throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)). Basic guarantee.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp or internal priority_compare ordering functions throw.
+ //! Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value) const
+ { return tree_.find(value) != end(); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp) != end(); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound(const_reference value) const
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound(const_reference value) const
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find(const_reference value) const
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a treap_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the treap_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a treap_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! treap_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a treap_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the treap_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a treap_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! treap_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a treap_set/treap_multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ void rebalance()
+ { tree_.rebalance(); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ iterator rebalance_subtree(iterator root)
+ { return tree_.rebalance_subtree(root); }
+
+ //! <b>Returns</b>: The balance factor (alpha) used in this tree
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ float balance_factor() const
+ { return tree_.balance_factor(); }
+
+ //! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
+ //!
+ //! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
+ //! the tree if the new balance factor is stricter (less) than the old factor.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ void balance_factor(float new_alpha)
+ { tree_.balance_factor(new_alpha); }
+
+ /// @cond
+ friend bool operator==(const treap_set_impl &x, const treap_set_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const treap_set_impl &x, const treap_set_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_set_impl<T, Options...> &x, const treap_set_impl<T, Options...> &y)
+#else
+(const treap_set_impl<Config> &x, const treap_set_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_set_impl<T, Options...> &x, const treap_set_impl<T, Options...> &y)
+#else
+(const treap_set_impl<Config> &x, const treap_set_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_set_impl<T, Options...> &x, const treap_set_impl<T, Options...> &y)
+#else
+(const treap_set_impl<Config> &x, const treap_set_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_set_impl<T, Options...> &x, const treap_set_impl<T, Options...> &y)
+#else
+(const treap_set_impl<Config> &x, const treap_set_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(treap_set_impl<T, Options...> &x, treap_set_impl<T, Options...> &y)
+#else
+(treap_set_impl<Config> &x, treap_set_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c treap_set that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_treap_set
+{
+ /// @cond
+ typedef treap_set_impl
+ < typename make_treap_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class treap_set
+ : public make_treap_set<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_treap_set
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::priority_compare priority_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ treap_set( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, pcmp, v_traits)
+ {}
+
+ template<class Iterator>
+ treap_set( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, pcmp, v_traits)
+ {}
+
+ static treap_set &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<treap_set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const treap_set &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const treap_set &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static treap_set &container_from_iterator(iterator it)
+ { return static_cast<treap_set &>(Base::container_from_iterator(it)); }
+
+ static const treap_set &container_from_iterator(const_iterator it)
+ { return static_cast<const treap_set &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+//! The class template treap_multiset is an intrusive container, that mimics most of
+//! the interface of std::treap_multiset as described in the C++ standard.
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<>,
+//! \c compare<> and \c priority_compare<>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class treap_multiset_impl
+{
+ /// @cond
+ typedef treap_impl<Config> tree_type;
+
+ //Non-copyable and non-assignable
+ treap_multiset_impl (const treap_multiset_impl&);
+ treap_multiset_impl &operator =(const treap_multiset_impl&);
+ typedef tree_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::value_compare value_compare;
+ typedef typename implementation_defined::priority_compare priority_compare;
+ typedef typename implementation_defined::key_compare key_compare;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::reverse_iterator reverse_iterator;
+ typedef typename implementation_defined::const_reverse_iterator const_reverse_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ tree_type tree_;
+ /// @endcond
+
+ public:
+ //! <b>Effects</b>: Constructs an empty treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor of the value_compare/priority_compare objects throw.
+ treap_multiset_impl( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(cmp, pcmp, v_traits)
+ {}
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
+ //! cmp must be a comparison function that induces a strict weak ordering.
+ //!
+ //! <b>Effects</b>: Constructs an empty treap_multiset and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: Linear in N if [b, e) is already sorted using
+ //! comp and otherwise N * log N, where N is the distance between first and last
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor/operator() of the value_compare/priority_compare objects throw.
+ template<class Iterator>
+ treap_multiset_impl( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : tree_(false, b, e, cmp, pcmp, v_traits)
+ {}
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the treap_multiset
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~treap_multiset_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return tree_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning of the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return tree_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return tree_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return tree_.cend(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the highest priority object of the tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator top()
+ { return tree_.top(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the tree..
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator top() const
+ { return this->ctop(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the highest priority object of the tree..
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator ctop() const
+ { return tree_.ctop(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the beginning of the
+ //! reversed treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rbegin()
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rbegin() const
+ { return tree_.rbegin(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the beginning
+ //! of the reversed treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crbegin() const
+ { return tree_.crbegin(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the end
+ //! of the reversed treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rend()
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rend() const
+ { return tree_.rend(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the end
+ //! of the reversed treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crend() const
+ { return tree_.crend(); }
+
+ //! <b>Effects</b>: Returns a reverse_iterator pointing to the highest priority object of the
+ //! reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ reverse_iterator rtop()
+ { return tree_.rtop(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority objec
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator rtop() const
+ { return tree_.crtop(); }
+
+ //! <b>Effects</b>: Returns a const_reverse_iterator pointing to the highest priority object
+ //! of the reversed tree.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_reverse_iterator crtop() const
+ { return tree_.crtop(); }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end iterator
+ //! of treap_multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the treap_multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static treap_multiset_impl &container_from_end_iterator(iterator end_iterator)
+ {
+ return *detail::parent_from_member<treap_multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &treap_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: end_iterator must be a valid end const_iterator
+ //! of treap_multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the treap_multiset associated to the end iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const treap_multiset_impl &container_from_end_iterator(const_iterator end_iterator)
+ {
+ return *detail::parent_from_member<treap_multiset_impl, tree_type>
+ ( &tree_type::container_from_end_iterator(end_iterator)
+ , &treap_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static treap_multiset_impl &container_from_iterator(iterator it)
+ {
+ return *detail::parent_from_member<treap_multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &treap_multiset_impl::tree_);
+ }
+
+ //! <b>Precondition</b>: it must be a valid const_iterator of multiset.
+ //!
+ //! <b>Effects</b>: Returns a const reference to the multiset associated to the iterator
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ static const treap_multiset_impl &container_from_iterator(const_iterator it)
+ {
+ return *detail::parent_from_member<treap_multiset_impl, tree_type>
+ ( &tree_type::container_from_iterator(it)
+ , &treap_multiset_impl::tree_);
+ }
+
+ //! <b>Effects</b>: Returns the key_compare object used by the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_compare copy-constructor throws.
+ key_compare key_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the value_compare object used by the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_compare copy-constructor throws.
+ value_compare value_comp() const
+ { return tree_.value_comp(); }
+
+ //! <b>Effects</b>: Returns the priority_compare object used by the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If priority_compare copy-constructor throws.
+ priority_compare priority_comp() const
+ { return tree_.priority_comp(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return tree_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the treap_multiset.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if,
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return tree_.size(); }
+
+ //! <b>Effects</b>: Swaps the contents of two treap_multisets.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison functor
+ //! found using ADL throws. Strong guarantee.
+ void swap(treap_multiset_impl& other)
+ { tree_.swap(other.tree_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes equivalent to the original nodes.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. Copies the predicate from the source container.
+ //!
+ //! If cloner throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner throws or predicate copy assignment throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const treap_multiset_impl &src, Cloner cloner, Disposer disposer)
+ { tree_.clone_from(src.tree_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the treap_multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Average complexity for insert element is at
+ //! most logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare ordering
+ //! function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(reference value)
+ { return tree_.insert_equal(value); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts x into the treap_multiset, using pos as a hint to
+ //! where it will be inserted.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Logarithmic in general, but it is amortized
+ //! constant time if t is inserted immediately before hint.
+ //!
+ //! <b>Throws</b>: If internal value_compare or priority_compare ordering functions throw.
+ //! Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(const_iterator hint, reference value)
+ { return tree_.insert_equal(hint, value); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Inserts a range into the treap_multiset.
+ //!
+ //! <b>Returns</b>: An iterator that points to the position where the new
+ //! element was inserted.
+ //!
+ //! <b>Complexity</b>: Insert range is in general O(N * log(N)), where N is the
+ //! size of the range. However, it is linear in N if the range is already sorted
+ //! by value_comp().
+ //!
+ //! <b>Throws</b>: If internal value_compare or priority_compare ordering functions throw.
+ //! Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { tree_.insert_equal(b, e); }
+
+ //! <b>Requires</b>: value must be an lvalue, "pos" must be
+ //! a valid iterator (or end) and must be the succesor of value
+ //! once inserted according to the predicate
+ //!
+ //! <b>Effects</b>: Inserts x into the treap before "pos".
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if "pos" is not
+ //! the successor of "value" treap ordering invariant will be broken.
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ iterator insert_before(const_iterator pos, reference value)
+ { return tree_.insert_before(pos, value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no less
+ //! than the greatest inserted key.
+ //!
+ //! <b>Effects</b>: Inserts x into the treap in the last position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! less than the greatest inserted key treap ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_back(reference value)
+ { tree_.push_back(value); }
+
+ //! <b>Requires</b>: value must be an lvalue, and it must be no greater
+ //! than the minimum inserted key
+ //!
+ //! <b>Effects</b>: Inserts x into the treap in the first position.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: This function does not check preconditions so if value is
+ //! greater than the minimum inserted key treap ordering invariant will be broken.
+ //! This function is slightly more efficient than using "insert_before".
+ //! This is a low-level function to be used only for performance reasons
+ //! by advanced users.
+ void push_front(reference value)
+ { tree_.push_front(value); }
+
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator i)
+ { return tree_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return tree_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare or priority_compare ordering
+ //! functiona throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return tree_.erase(value); }
+
+ //! <b>Effects</b>: Erases all the elements that compare equal with
+ //! the given key and the given comparison functor.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp or internal priority_compare ordering functions throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyValueCompare>
+ size_type erase(const KeyType& key, KeyValueCompare comp
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase(key, comp); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased element.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by pos.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase element is constant time.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return tree_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Returns</b>: An iterator to the element after the erased elements.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average complexity for erase range is at most
+ //! O(log(size() + N)), where N is the number of elements in the range.
+ //!
+ //! <b>Throws</b>: If the internal priority_compare function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return tree_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(value)).
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return tree_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "comp".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: O(log(size() + this->count(key, comp)).
+ //!
+ //! <b>Throws</b>: If comp or internal priority_compare ordering functions throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyValueCompare, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyValueCompare comp, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<KeyValueCompare, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return tree_.erase_and_dispose(key, comp, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return tree_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return tree_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ size_type count(const_reference value) const
+ { return tree_.count(value); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the same key
+ //! compared with the given comparison functor.
+ //!
+ //! <b>Complexity</b>: Logarithmic to the number of elements contained plus lineal
+ //! to number of objects with the given key.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ template<class KeyType, class KeyValueCompare>
+ size_type count(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.count(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator lower_bound(const_reference value)
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator lower_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns a const iterator to the first element whose
+ //! key is not less than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator lower_bound(const_reference value) const
+ { return tree_.lower_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is not less than k or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator lower_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.lower_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator upper_bound(const_reference value)
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator upper_bound(const KeyType& key, KeyValueCompare comp)
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Returns an iterator to the first element whose
+ //! key is greater than k or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator upper_bound(const_reference value) const
+ { return tree_.upper_bound(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Returns a const_iterator to the first element whose
+ //! key according to the comparison functor is greater than key or
+ //! end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator upper_bound(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.upper_bound(key, comp); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ iterator find(const_reference value)
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ iterator find(const KeyType& key, KeyValueCompare comp)
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ const_iterator find(const_reference value) const
+ { return tree_.find(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" according to the comparison functor or end() if that element
+ //! does not exist.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ const_iterator find(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.find(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyValueCompare comp)
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k or
+ //! an empty range that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If the internal value_compare ordering function throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return tree_.equal_range(value); }
+
+ //! <b>Requires</b>: comp must imply the same element order as
+ //! value_compare. Usually key is the part of the value_type
+ //! that is used in the ordering functor.
+ //!
+ //! <b>Effects</b>: Finds a range containing all elements whose key is k
+ //! according to the comparison functor or an empty range
+ //! that indicates the position where those elements would be
+ //! if they there is no elements with key k.
+ //!
+ //! <b>Complexity</b>: Logarithmic.
+ //!
+ //! <b>Throws</b>: If comp ordering function throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyValueCompare>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyValueCompare comp) const
+ { return tree_.equal_range(key, comp); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a treap_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the treap_multiset
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static iterator s_iterator_to(reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a treap_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! treap_multiset that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_iterator s_iterator_to(const_reference value)
+ { return tree_type::s_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a treap_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator i belonging to the treap_multiset
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator iterator_to(reference value)
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a treap_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator i belonging to the
+ //! treap_multiset that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator iterator_to(const_reference value) const
+ { return tree_.iterator_to(value); }
+
+ //! <b>Requires</b>: value shall not be in a treap_multiset/treap_multiset.
+ //!
+ //! <b>Effects</b>: init_node puts the hook of a value in a well-known default
+ //! state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Note</b>: This function puts the hook in the well-known default state
+ //! used by auto_unlink and safe hooks.
+ static void init_node(reference value)
+ { tree_type::init_node(value); }
+
+ //! <b>Effects</b>: Unlinks the leftmost node from the tree.
+ //!
+ //! <b>Complexity</b>: Average complexity is constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function breaks the tree and the tree can
+ //! only be used for more unlink_leftmost_without_rebalance calls.
+ //! This function is normally used to achieve a step by step
+ //! controlled destruction of the tree.
+ pointer unlink_leftmost_without_rebalance()
+ { return tree_.unlink_leftmost_without_rebalance(); }
+
+ //! <b>Requires</b>: replace_this must be a valid iterator of *this
+ //! and with_this must not be inserted in any tree.
+ //!
+ //! <b>Effects</b>: Replaces replace_this in its position in the
+ //! tree with with_this. The tree does not need to be rebalanced.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This function will break container ordering invariants if
+ //! with_this is not equivalent to *replace_this according to the
+ //! ordering rules. This function is faster than erasing and inserting
+ //! the node, since no rebalancing or comparison is needed.
+ void replace_node(iterator replace_this, reference with_this)
+ { tree_.replace_node(replace_this, with_this); }
+
+ //! <b>Effects</b>: Rebalances the tree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear.
+ void rebalance()
+ { tree_.rebalance(); }
+
+ //! <b>Requires</b>: old_root is a node of a tree.
+ //!
+ //! <b>Effects</b>: Rebalances the subtree rooted at old_root.
+ //!
+ //! <b>Returns</b>: The new root of the subtree.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ iterator rebalance_subtree(iterator root)
+ { return tree_.rebalance_subtree(root); }
+
+ //! <b>Returns</b>: The balance factor (alpha) used in this tree
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Constant.
+ float balance_factor() const
+ { return tree_.balance_factor(); }
+
+ //! <b>Requires</b>: new_alpha must be a value between 0.5 and 1.0
+ //!
+ //! <b>Effects</b>: Establishes a new balance factor (alpha) and rebalances
+ //! the tree if the new balance factor is stricter (less) than the old factor.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the elements in the subtree.
+ void balance_factor(float new_alpha)
+ { tree_.balance_factor(new_alpha); }
+
+ /// @cond
+ friend bool operator==(const treap_multiset_impl &x, const treap_multiset_impl &y)
+ { return x.tree_ == y.tree_; }
+
+ friend bool operator<(const treap_multiset_impl &x, const treap_multiset_impl &y)
+ { return x.tree_ < y.tree_; }
+ /// @endcond
+};
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator!=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_multiset_impl<T, Options...> &x, const treap_multiset_impl<T, Options...> &y)
+#else
+(const treap_multiset_impl<Config> &x, const treap_multiset_impl<Config> &y)
+#endif
+{ return !(x == y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_multiset_impl<T, Options...> &x, const treap_multiset_impl<T, Options...> &y)
+#else
+(const treap_multiset_impl<Config> &x, const treap_multiset_impl<Config> &y)
+#endif
+{ return y < x; }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator<=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_multiset_impl<T, Options...> &x, const treap_multiset_impl<T, Options...> &y)
+#else
+(const treap_multiset_impl<Config> &x, const treap_multiset_impl<Config> &y)
+#endif
+{ return !(y < x); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline bool operator>=
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(const treap_multiset_impl<T, Options...> &x, const treap_multiset_impl<T, Options...> &y)
+#else
+(const treap_multiset_impl<Config> &x, const treap_multiset_impl<Config> &y)
+#endif
+{ return !(x < y); }
+
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+inline void swap
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+(treap_multiset_impl<T, Options...> &x, treap_multiset_impl<T, Options...> &y)
+#else
+(treap_multiset_impl<Config> &x, treap_multiset_impl<Config> &y)
+#endif
+{ x.swap(y); }
+
+//! Helper metafunction to define a \c treap_multiset that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none>
+#endif
+struct make_treap_multiset
+{
+ /// @cond
+ typedef treap_multiset_impl
+ < typename make_treap_opt<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+class treap_multiset
+ : public make_treap_multiset<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_treap_multiset
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ public:
+ typedef typename Base::value_compare value_compare;
+ typedef typename Base::priority_compare priority_compare;
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename value_traits::value_type, T>::value));
+
+ treap_multiset( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(cmp, pcmp, v_traits)
+ {}
+
+ template<class Iterator>
+ treap_multiset( Iterator b, Iterator e
+ , const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, cmp, pcmp, v_traits)
+ {}
+
+ static treap_multiset &container_from_end_iterator(iterator end_iterator)
+ { return static_cast<treap_multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static const treap_multiset &container_from_end_iterator(const_iterator end_iterator)
+ { return static_cast<const treap_multiset &>(Base::container_from_end_iterator(end_iterator)); }
+
+ static treap_multiset &container_from_iterator(iterator it)
+ { return static_cast<treap_multiset &>(Base::container_from_iterator(it)); }
+
+ static const treap_multiset &container_from_iterator(const_iterator it)
+ { return static_cast<const treap_multiset &>(Base::container_from_iterator(it)); }
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_TRIE_SET_HPP
Added: sandbox/move/boost/intrusive/trivial_value_traits.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/trivial_value_traits.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,43 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP
+#define BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP
+
+#include <boost/intrusive/link_mode.hpp>
+
+namespace boost {
+namespace intrusive {
+
+//!This value traits template is used to create value traits
+//!from user defined node traits where value_traits::value_type and
+//!node_traits::node should be equal
+template<class NodeTraits, link_mode_type LinkMode = normal_link>
+struct trivial_value_traits
+{
+ typedef NodeTraits node_traits;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+ typedef typename node_traits::node value_type;
+ typedef node_ptr pointer;
+ typedef const_node_ptr const_pointer;
+ static const link_mode_type link_mode = LinkMode;
+ static node_ptr to_node_ptr (value_type &value) { return node_ptr(&value); }
+ static const_node_ptr to_node_ptr (const value_type &value) { return const_node_ptr(&value); }
+ static pointer to_value_ptr(node_ptr n) { return pointer(n); }
+ static const_pointer to_value_ptr(const_node_ptr n) { return const_pointer(n); }
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#endif //BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP
Added: sandbox/move/boost/intrusive/unordered_set.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/unordered_set.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,2084 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_UNORDERED_SET_HPP
+#define BOOST_INTRUSIVE_UNORDERED_SET_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/hashtable.hpp>
+#include <iterator>
+
+namespace boost {
+namespace intrusive {
+
+//! The class template unordered_set is an intrusive container, that mimics most of
+//! the interface of std::tr1::unordered_set as described in the C++ TR1.
+//!
+//! unordered_set is a semi-intrusive container: each object to be stored in the
+//! container must contain a proper hook, but the container also needs
+//! additional auxiliary memory to work: unordered_set needs a pointer to an array
+//! of type `bucket_type` to be passed in the constructor. This bucket array must
+//! have at least the same lifetime as the container. This makes the use of
+//! unordered_set more complicated than purely intrusive containers.
+//! `bucket_type` is default-constructible, copyable and assignable
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
+//! \c bucket_traits<>, power_2_buckets<> and cache_begin<>.
+//!
+//! unordered_set only provides forward iterators but it provides 4 iterator types:
+//! iterator and const_iterator to navigate through the whole container and
+//! local_iterator and const_local_iterator to navigate through the values
+//! stored in a single bucket. Local iterators are faster and smaller.
+//!
+//! It's not recommended to use non constant-time size unordered_sets because several
+//! key functions, like "empty()", become non-constant time functions. Non
+//! constant-time size unordered_sets are mainly provided to support auto-unlink hooks.
+//!
+//! unordered_set, unlike std::unordered_set, does not make automatic rehashings nor
+//! offers functions related to a load factor. Rehashing can be explicitly requested
+//! and the user must provide a new bucket array that will be used from that moment.
+//!
+//! Since no automatic rehashing is done, iterators are never invalidated when
+//! inserting or erasing elements. Iterators are only invalidated when rehasing.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class unordered_set_impl
+{
+ /// @cond
+ private:
+ typedef hashtable_impl<Config> table_type;
+
+ //! This class is
+ //! non-copyable
+ unordered_set_impl (const unordered_set_impl&);
+
+ //! This class is
+ //! non-assignable
+ unordered_set_impl &operator =(const unordered_set_impl&);
+
+ typedef table_type implementation_defined;
+ /// @endcond
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::bucket_traits bucket_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::key_type key_type;
+ typedef typename implementation_defined::key_equal key_equal;
+ typedef typename implementation_defined::hasher hasher;
+ typedef typename implementation_defined::bucket_type bucket_type;
+ typedef typename implementation_defined::bucket_ptr bucket_ptr;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::local_iterator local_iterator;
+ typedef typename implementation_defined::const_local_iterator const_local_iterator;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ table_type table_;
+ /// @endcond
+
+ public:
+
+ //! <b>Requires</b>: buckets must not be being used by any other resource.
+ //!
+ //! <b>Effects</b>: Constructs an empty unordered_set_impl, storing a reference
+ //! to the bucket array and copies of the hasher and equal functors.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor or invocation of Hash or Equal throws.
+ //!
+ //! <b>Notes</b>: buckets array must be disposed only after
+ //! *this is disposed.
+ unordered_set_impl( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : table_(b_traits, hash_func, equal_func, v_traits)
+ {}
+
+ //! <b>Requires</b>: buckets must not be being used by any other resource
+ //! and Dereferencing iterator must yield an lvalue of type value_type.
+ //!
+ //! <b>Effects</b>: Constructs an empty unordered_set and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: If N is std::distance(b, e): Average case is O(N)
+ //! (with a good hash function and with buckets_len >= N),worst case O(N2).
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor or invocation of hasher or key_equal throws.
+ //!
+ //! <b>Notes</b>: buckets array must be disposed only after
+ //! *this is disposed.
+ template<class Iterator>
+ unordered_set_impl( Iterator b
+ , Iterator e
+ , const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : table_(b_traits, hash_func, equal_func, v_traits)
+ { table_.insert_unique(b, e); }
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_set
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the unordered_set, if
+ //! it's a safe-mode or auto-unlink value. Otherwise constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~unordered_set_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
+ //! constant time with worst case (empty unordered_set) O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return table_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
+ //! of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
+ //! constant time with worst case (empty unordered_set) O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return table_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
+ //! of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
+ //! constant time with worst case (empty unordered_set) O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return table_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return table_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return table_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return table_.cend(); }
+
+ //! <b>Effects</b>: Returns the hasher object used by the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If hasher copy-constructor throws.
+ hasher hash_function() const
+ { return table_.hash_function(); }
+
+ //! <b>Effects</b>: Returns the key_equal object used by the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_equal copy-constructor throws.
+ key_equal key_eq() const
+ { return table_.key_eq(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: if constant-time size and cache_last options are disabled,
+ //! average constant time (worst case, with empty() == true: O(this->bucket_count()).
+ //! Otherwise constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return table_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the unordered_set.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return table_.size(); }
+
+ //! <b>Requires</b>: the hasher and the equality function unqualified swap
+ //! call should not throw.
+ //!
+ //! <b>Effects</b>: Swaps the contents of two unordered_sets.
+ //! Swaps also the contained bucket array and equality and hasher functors.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison or hash functors
+ //! found using ADL throw. Basic guarantee.
+ void swap(unordered_set_impl& other)
+ { table_.swap(other.table_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes that compare equal and produce the same
+ //! hash than the original node.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. The hash function and the equality
+ //! predicate are copied from the source.
+ //!
+ //! If store_hash option is true, this method does not use the hash function.
+ //!
+ //! If any operation throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner or hasher throw or hash or equality predicate copying
+ //! throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const unordered_set_impl &src, Cloner cloner, Disposer disposer)
+ { table_.clone_from(src.table_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Tries to inserts value into the unordered_set.
+ //!
+ //! <b>Returns</b>: If the value
+ //! is not already present inserts it and returns a pair containing the
+ //! iterator to the new value and true. If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ std::pair<iterator, bool> insert(reference value)
+ { return table_.insert_unique(value); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Equivalent to this->insert(t) for each element in [b, e).
+ //!
+ //! <b>Complexity</b>: Average case O(N), where N is std::distance(b, e).
+ //! Worst case O(N*this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { table_.insert_unique(b, e); }
+
+ //! <b>Requires</b>: "hasher" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hasher" hashes the given key instead of the value_type.
+ //!
+ //! "key_value_equal" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "key_value_equal" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Checks if a value can be inserted in the unordered_set, using
+ //! a user provided key instead of the value itself.
+ //!
+ //! <b>Returns</b>: If there is an equivalent value
+ //! returns a pair containing an iterator to the already present value
+ //! and false. If the value can be inserted returns true in the returned
+ //! pair boolean and fills "commit_data" that is meant to be used with
+ //! the "insert_commit" function.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hasher or key_value_equal throw. Strong guarantee.
+ //!
+ //! <b>Notes</b>: This function is used to improve performance when constructing
+ //! a value_type is expensive: if there is an equivalent value
+ //! the constructed object must be discarded. Many times, the part of the
+ //! node that is used to impose the hash or the equality is much cheaper to
+ //! construct than the value_type and this function offers the possibility to
+ //! use that the part to check if the insertion will be successful.
+ //!
+ //! If the check is successful, the user can construct the value_type and use
+ //! "insert_commit" to insert the object in constant-time.
+ //!
+ //! "commit_data" remains valid for a subsequent "insert_commit" only if no more
+ //! objects are inserted or erased from the unordered_set.
+ //!
+ //! After a successful rehashing insert_commit_data remains valid.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<iterator, bool> insert_check
+ (const KeyType &key, KeyHasher hasher, KeyValueEqual key_value_equal, insert_commit_data &commit_data)
+ { return table_.insert_unique_check(key, hasher, key_value_equal, commit_data); }
+
+ //! <b>Requires</b>: value must be an lvalue of type value_type. commit_data
+ //! must have been obtained from a previous call to "insert_check".
+ //! No objects should have been inserted or erased from the unordered_set between
+ //! the "insert_check" that filled "commit_data" and the call to "insert_commit".
+ //!
+ //! <b>Effects</b>: Inserts the value in the unordered_set using the information obtained
+ //! from the "commit_data" that a previous "insert_check" filled.
+ //!
+ //! <b>Returns</b>: An iterator to the newly inserted object.
+ //!
+ //! <b>Complexity</b>: Constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Notes</b>: This function has only sense if a "insert_check" has been
+ //! previously executed to fill "commit_data". No value should be inserted or
+ //! erased between the "insert_check" and "insert_commit" calls.
+ //!
+ //! After a successful rehashing insert_commit_data remains valid.
+ iterator insert_commit(reference value, const insert_commit_data &commit_data)
+ { return table_.insert_unique_commit(value, commit_data); }
+
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased element. No destructors are called.
+ iterator erase(const_iterator i)
+ { return table_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average case O(std::distance(b, e)),
+ //! worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return table_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return table_.erase(value); }
+
+ //! <b>Requires</b>: "hasher" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hasher" hashes the given key instead of the value_type.
+ //!
+ //! "key_value_equal" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "key_value_equal" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Erases all the elements that have the same hash and
+ //! compare equal with the given key.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ size_type erase(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
+ { return table_.erase(key, hash_func, equal_func); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<Disposer, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return table_.erase_and_dispose(i, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average case O(std::distance(b, e)),
+ //! worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return table_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return table_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "equal_func".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyHasher, class KeyValueEqual, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func, Disposer disposer)
+ { return table_.erase_and_dispose(key, hash_func, equal_func, disposer); }
+
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return table_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all of the elements.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return table_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given value
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ size_type count(const_reference value) const
+ { return table_.find(value) != end(); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ size_type count(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
+ { return table_.find(key, hash_func, equal_func) != end(); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element is equal to
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ iterator find(const_reference value)
+ { return table_.find(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the given hasher and equality functor or end() if
+ //! that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
+ { return table_.find(key, hash_func, equal_func); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ const_iterator find(const_reference value) const
+ { return table_.find(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the given hasher and equality functor or end() if
+ //! that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ const_iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
+ { return table_.find(key, hash_func, equal_func); }
+
+ //! <b>Effects</b>: Returns a range containing all elements with values equivalent
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return table_.equal_range(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns a range containing all elements with equivalent
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(key, hash_func, hash_func)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or the equal_func throw.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<iterator,iterator> equal_range(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
+ { return table_.equal_range(key, hash_func, equal_func); }
+
+ //! <b>Effects</b>: Returns a range containing all elements with values equivalent
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return table_.equal_range(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "equal_func" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "equal_func" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns a range containing all elements with equivalent
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the hash_func or equal_func throw.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
+ { return table_.equal_range(key, hash_func, equal_func); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator belonging to the unordered_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the internal hash function throws.
+ iterator iterator_to(reference value)
+ { return table_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator belonging to the
+ //! unordered_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the internal hash function throws.
+ const_iterator iterator_to(const_reference value) const
+ { return table_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static local_iterator s_local_iterator_to(reference value)
+ { return table_type::s_local_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
+ //! the unordered_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_local_iterator s_local_iterator_to(const_reference value)
+ { return table_type::s_local_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ local_iterator local_iterator_to(reference value)
+ { return table_.local_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
+ //! the unordered_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_local_iterator local_iterator_to(const_reference value) const
+ { return table_.local_iterator_to(value); }
+
+ //! <b>Effects</b>: Returns the number of buckets passed in the constructor
+ //! or the last rehash function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type bucket_count() const
+ { return table_.bucket_count(); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns the number of elements in the nth bucket.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type bucket_size(size_type n) const
+ { return table_.bucket_size(n); }
+
+ //! <b>Effects</b>: Returns the index of the bucket in which elements
+ //! with keys equivalent to k would be found, if any such element existed.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the hash functor throws.
+ //!
+ //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
+ size_type bucket(const value_type& k) const
+ { return table_.bucket(k); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! <b>Effects</b>: Returns the index of the bucket in which elements
+ //! with keys equivalent to k would be found, if any such element existed.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If hash_func throws.
+ //!
+ //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
+ template<class KeyType, class KeyHasher>
+ size_type bucket(const KeyType& k, KeyHasher hash_func) const
+ { return table_.bucket(k, hash_func); }
+
+ //! <b>Effects</b>: Returns the bucket array pointer passed in the constructor
+ //! or the last rehash function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bucket_ptr bucket_pointer() const
+ { return table_.bucket_pointer(); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ local_iterator begin(size_type n)
+ { return table_.begin(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator begin(size_type n) const
+ { return table_.begin(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator cbegin(size_type n) const
+ { return table_.cbegin(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ local_iterator end(size_type n)
+ { return table_.end(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator end(size_type n) const
+ { return table_.end(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator cend(size_type n) const
+ { return table_.cend(n); }
+
+ //! <b>Requires</b>: new_buckets must be a pointer to a new bucket array
+ //! or the same as the old bucket array. new_size is the length of the
+ //! the array pointed by new_buckets. If new_buckets == this->bucket_pointer()
+ //! n can be bigger or smaller than this->bucket_count().
+ //!
+ //! <b>Effects</b>: Updates the internal reference with the new bucket erases
+ //! the values from the old bucket and inserts then in the new one.
+ //!
+ //! If store_hash option is true, this method does not use the hash function.
+ //!
+ //! <b>Complexity</b>: Average case linear in this->size(), worst case quadratic.
+ //!
+ //! <b>Throws</b>: If the hasher functor throws. Basic guarantee.
+ void rehash(const bucket_traits &new_bucket_traits)
+ { table_.rehash(new_bucket_traits); }
+
+ //! <b>Requires</b>:
+ //!
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
+ //!
+ //! <b>Note</b>: this method is only available if incremental<true> option is activated.
+ bool incremental_rehash(bool grow = true)
+ { return table_.incremental_rehash(grow); }
+
+ //! <b>Note</b>: this method is only available if incremental<true> option is activated.
+ bool incremental_rehash(const bucket_traits &new_bucket_traits)
+ { return table_.incremental_rehash(new_bucket_traits); }
+
+ //! <b>Requires</b>:
+ //!
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
+ size_type split_count() const
+ { return table_.split_count(); }
+
+ //! <b>Effects</b>: Returns the nearest new bucket count optimized for
+ //! the container that is bigger than n. This suggestion can be used
+ //! to create bucket arrays with a size that will usually improve
+ //! container's performance. If such value does not exist, the
+ //! higher possible value is returned.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static size_type suggested_upper_bucket_count(size_type n)
+ { return table_type::suggested_upper_bucket_count(n); }
+
+ //! <b>Effects</b>: Returns the nearest new bucket count optimized for
+ //! the container that is smaller than n. This suggestion can be used
+ //! to create bucket arrays with a size that will usually improve
+ //! container's performance. If such value does not exist, the
+ //! lower possible value is returned.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static size_type suggested_lower_bucket_count(size_type n)
+ { return table_type::suggested_lower_bucket_count(n); }
+};
+
+//! Helper metafunction to define an \c unordered_set that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none
+ , class O5 = none, class O6 = none
+ , class O7 = none, class O8 = none
+ , class O9 = none, class O10= none
+ >
+#endif
+struct make_unordered_set
+{
+ /// @cond
+ typedef unordered_set_impl
+ < typename make_hashtable_opt
+ <T, true,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7, class O8, class O9, class O10>
+#else
+template<class T, class ...Options>
+#endif
+class unordered_set
+ : public make_unordered_set<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_unordered_set
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type Base;
+
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
+
+ public:
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::bucket_traits bucket_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+ typedef typename Base::bucket_ptr bucket_ptr;
+ typedef typename Base::size_type size_type;
+ typedef typename Base::hasher hasher;
+ typedef typename Base::key_equal key_equal;
+
+ unordered_set ( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : Base(b_traits, hash_func, equal_func, v_traits)
+ {}
+
+ template<class Iterator>
+ unordered_set ( Iterator b
+ , Iterator e
+ , const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, b_traits, hash_func, equal_func, v_traits)
+ {}
+};
+
+#endif
+
+
+//! The class template unordered_multiset is an intrusive container, that mimics most of
+//! the interface of std::tr1::unordered_multiset as described in the C++ TR1.
+//!
+//! unordered_multiset is a semi-intrusive container: each object to be stored in the
+//! container must contain a proper hook, but the container also needs
+//! additional auxiliary memory to work: unordered_multiset needs a pointer to an array
+//! of type `bucket_type` to be passed in the constructor. This bucket array must
+//! have at least the same lifetime as the container. This makes the use of
+//! unordered_multiset more complicated than purely intrusive containers.
+//! `bucket_type` is default-constructible, copyable and assignable
+//!
+//! The template parameter \c T is the type to be managed by the container.
+//! The user can specify additional options and if no options are provided
+//! default options are used.
+//!
+//! The container supports the following options:
+//! \c base_hook<>/member_hook<>/value_traits<>,
+//! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
+//! \c bucket_traits<>, power_2_buckets<> and cache_begin<>.
+//!
+//! unordered_multiset only provides forward iterators but it provides 4 iterator types:
+//! iterator and const_iterator to navigate through the whole container and
+//! local_iterator and const_local_iterator to navigate through the values
+//! stored in a single bucket. Local iterators are faster and smaller.
+//!
+//! It's not recommended to use non constant-time size unordered_multisets because several
+//! key functions, like "empty()", become non-constant time functions. Non
+//! constant-time size unordered_multisets are mainly provided to support auto-unlink hooks.
+//!
+//! unordered_multiset, unlike std::unordered_set, does not make automatic rehashings nor
+//! offers functions related to a load factor. Rehashing can be explicitly requested
+//! and the user must provide a new bucket array that will be used from that moment.
+//!
+//! Since no automatic rehashing is done, iterators are never invalidated when
+//! inserting or erasing elements. Iterators are only invalidated when rehasing.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+template<class T, class ...Options>
+#else
+template<class Config>
+#endif
+class unordered_multiset_impl
+{
+ /// @cond
+ private:
+ typedef hashtable_impl<Config> table_type;
+ /// @endcond
+
+ //! This class is
+ //! non-copyable
+ unordered_multiset_impl (const unordered_multiset_impl&);
+
+ //! This class is
+ //! non-assignable
+ unordered_multiset_impl &operator =(const unordered_multiset_impl&);
+
+ typedef table_type implementation_defined;
+
+ public:
+ typedef typename implementation_defined::value_type value_type;
+ typedef typename implementation_defined::value_traits value_traits;
+ typedef typename implementation_defined::bucket_traits bucket_traits;
+ typedef typename implementation_defined::pointer pointer;
+ typedef typename implementation_defined::const_pointer const_pointer;
+ typedef typename implementation_defined::reference reference;
+ typedef typename implementation_defined::const_reference const_reference;
+ typedef typename implementation_defined::difference_type difference_type;
+ typedef typename implementation_defined::size_type size_type;
+ typedef typename implementation_defined::key_type key_type;
+ typedef typename implementation_defined::key_equal key_equal;
+ typedef typename implementation_defined::hasher hasher;
+ typedef typename implementation_defined::bucket_type bucket_type;
+ typedef typename implementation_defined::bucket_ptr bucket_ptr;
+ typedef typename implementation_defined::iterator iterator;
+ typedef typename implementation_defined::const_iterator const_iterator;
+ typedef typename implementation_defined::insert_commit_data insert_commit_data;
+ typedef typename implementation_defined::local_iterator local_iterator;
+ typedef typename implementation_defined::const_local_iterator const_local_iterator;
+ typedef typename implementation_defined::node_traits node_traits;
+ typedef typename implementation_defined::node node;
+ typedef typename implementation_defined::node_ptr node_ptr;
+ typedef typename implementation_defined::const_node_ptr const_node_ptr;
+ typedef typename implementation_defined::node_algorithms node_algorithms;
+
+ /// @cond
+ private:
+ table_type table_;
+ /// @endcond
+
+ public:
+
+ //! <b>Requires</b>: buckets must not be being used by any other resource.
+ //!
+ //! <b>Effects</b>: Constructs an empty unordered_multiset, storing a reference
+ //! to the bucket array and copies of the hasher and equal functors.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor or invocation of Hash or Equal throws.
+ //!
+ //! <b>Notes</b>: buckets array must be disposed only after
+ //! *this is disposed.
+ unordered_multiset_impl ( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : table_(b_traits, hash_func, equal_func, v_traits)
+ {}
+
+ //! <b>Requires</b>: buckets must not be being used by any other resource
+ //! and Dereferencing iterator must yield an lvalue of type value_type.
+ //!
+ //! <b>Effects</b>: Constructs an empty unordered_multiset and inserts elements from
+ //! [b, e).
+ //!
+ //! <b>Complexity</b>: If N is std::distance(b, e): Average case is O(N)
+ //! (with a good hash function and with buckets_len >= N),worst case O(N2).
+ //!
+ //! <b>Throws</b>: If value_traits::node_traits::node
+ //! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
+ //! or the copy constructor or invocation of hasher or key_equal throws.
+ //!
+ //! <b>Notes</b>: buckets array must be disposed only after
+ //! *this is disposed.
+ template<class Iterator>
+ unordered_multiset_impl ( Iterator b
+ , Iterator e
+ , const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : table_(b_traits, hash_func, equal_func, v_traits)
+ { table_.insert_equal(b, e); }
+
+ //! <b>Effects</b>: Detaches all elements from this. The objects in the unordered_multiset
+ //! are not deleted (i.e. no destructors are called).
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements in the unordered_multiset, if
+ //! it's a safe-mode or auto-unlink value. Otherwise constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~unordered_multiset_impl()
+ {}
+
+ //! <b>Effects</b>: Returns an iterator pointing to the beginning of the unordered_multiset.
+ //!
+ //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
+ //! constant time with worst case (empty unordered_set) O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator begin()
+ { return table_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
+ //! of the unordered_multiset.
+ //!
+ //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
+ //! constant time with worst case (empty unordered_set) O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator begin() const
+ { return table_.begin(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the beginning
+ //! of the unordered_multiset.
+ //!
+ //! <b>Complexity</b>: Constant time if `cache_begin<>` is true. Amortized
+ //! constant time with worst case (empty unordered_set) O(this->bucket_count())
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cbegin() const
+ { return table_.cbegin(); }
+
+ //! <b>Effects</b>: Returns an iterator pointing to the end of the unordered_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ iterator end()
+ { return table_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator end() const
+ { return table_.end(); }
+
+ //! <b>Effects</b>: Returns a const_iterator pointing to the end of the unordered_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_iterator cend() const
+ { return table_.cend(); }
+
+ //! <b>Effects</b>: Returns the hasher object used by the unordered_set.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If hasher copy-constructor throws.
+ hasher hash_function() const
+ { return table_.hash_function(); }
+
+ //! <b>Effects</b>: Returns the key_equal object used by the unordered_multiset.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If key_equal copy-constructor throws.
+ key_equal key_eq() const
+ { return table_.key_eq(); }
+
+ //! <b>Effects</b>: Returns true if the container is empty.
+ //!
+ //! <b>Complexity</b>: if constant-time size and cache_last options are disabled,
+ //! average constant time (worst case, with empty() == true: O(this->bucket_count()).
+ //! Otherwise constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bool empty() const
+ { return table_.empty(); }
+
+ //! <b>Effects</b>: Returns the number of elements stored in the unordered_multiset.
+ //!
+ //! <b>Complexity</b>: Linear to elements contained in *this if
+ //! constant-time size option is enabled. Constant-time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type size() const
+ { return table_.size(); }
+
+ //! <b>Requires</b>: the hasher and the equality function unqualified swap
+ //! call should not throw.
+ //!
+ //! <b>Effects</b>: Swaps the contents of two unordered_multisets.
+ //! Swaps also the contained bucket array and equality and hasher functors.
+ //!
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the swap() call for the comparison or hash functors
+ //! found using ADL throw. Basic guarantee.
+ void swap(unordered_multiset_impl& other)
+ { table_.swap(other.table_); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //! Cloner should yield to nodes that compare equal and produce the same
+ //! hash than the original node.
+ //!
+ //! <b>Effects</b>: Erases all the elements from *this
+ //! calling Disposer::operator()(pointer), clones all the
+ //! elements from src calling Cloner::operator()(const_reference )
+ //! and inserts them on *this. The hash function and the equality
+ //! predicate are copied from the source.
+ //!
+ //! If store_hash option is true, this method does not use the hash function.
+ //!
+ //! If any operation throws, all cloned elements are unlinked and disposed
+ //! calling Disposer::operator()(pointer).
+ //!
+ //! <b>Complexity</b>: Linear to erased plus inserted elements.
+ //!
+ //! <b>Throws</b>: If cloner or hasher throw or hash or equality predicate copying
+ //! throws. Basic guarantee.
+ template <class Cloner, class Disposer>
+ void clone_from(const unordered_multiset_impl &src, Cloner cloner, Disposer disposer)
+ { table_.clone_from(src.table_, cloner, disposer); }
+
+ //! <b>Requires</b>: value must be an lvalue
+ //!
+ //! <b>Effects</b>: Inserts value into the unordered_multiset.
+ //!
+ //! <b>Returns</b>: An iterator to the new inserted value.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Strong guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ iterator insert(reference value)
+ { return table_.insert_equal(value); }
+
+ //! <b>Requires</b>: Dereferencing iterator must yield an lvalue
+ //! of type value_type.
+ //!
+ //! <b>Effects</b>: Equivalent to this->insert(t) for each element in [b, e).
+ //!
+ //! <b>Complexity</b>: Average case is O(N), where N is the
+ //! size of the range.
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Does not affect the validity of iterators and references.
+ //! No copy-constructors are called.
+ template<class Iterator>
+ void insert(Iterator b, Iterator e)
+ { table_.insert_equal(b, e); }
+
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased element. No destructors are called.
+ iterator erase(const_iterator i)
+ { return table_.erase(i); }
+
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //!
+ //! <b>Complexity</b>: Average case O(std::distance(b, e)),
+ //! worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ iterator erase(const_iterator b, const_iterator e)
+ { return table_.erase(b, e); }
+
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ size_type erase(const_reference value)
+ { return table_.erase(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "key_value_equal" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "key_value_equal" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Erases all the elements that have the same hash and
+ //! compare equal with the given key.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the hash_func or the equal_func functors throws.
+ //! Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ size_type erase(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
+ { return table_.erase(key, hash_func, equal_func); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the element pointed to by i.
+ //! Disposer::operator()(pointer) is called for the removed element.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer
+ /// @cond
+ , typename detail::enable_if_c<!detail::is_convertible<Disposer, const_iterator>::value >::type * = 0
+ /// @endcond
+ )
+ { return table_.erase_and_dispose(i, disposer); }
+
+ #if !defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator i, Disposer disposer)
+ { return this->erase_and_dispose(const_iterator(i), disposer); }
+ #endif
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases the range pointed to by b end e.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Complexity</b>: Average case O(std::distance(b, e)),
+ //! worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class Disposer>
+ iterator erase_and_dispose(const_iterator b, const_iterator e, Disposer disposer)
+ { return table_.erase_and_dispose(b, e, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given value.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ size_type erase_and_dispose(const_reference value, Disposer disposer)
+ { return table_.erase_and_dispose(value, disposer); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements with the given key.
+ //! according to the comparison functor "equal_func".
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Returns</b>: The number of erased elements.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If hash_func or equal_func throw. Basic guarantee.
+ //!
+ //! <b>Note</b>: Invalidates the iterators
+ //! to the erased elements.
+ template<class KeyType, class KeyHasher, class KeyValueEqual, class Disposer>
+ size_type erase_and_dispose(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func, Disposer disposer)
+ { return table_.erase_and_dispose(key, hash_func, equal_func, disposer); }
+
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! if it's a safe-mode or auto-unlink value_type. Constant time otherwise.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ void clear()
+ { return table_.clear(); }
+
+ //! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
+ //!
+ //! <b>Effects</b>: Erases all the elements of the container.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements on the container.
+ //! Disposer::operator()(pointer) is called for the removed elements.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: Invalidates the iterators (but not the references)
+ //! to the erased elements. No destructors are called.
+ template<class Disposer>
+ void clear_and_dispose(Disposer disposer)
+ { return table_.clear_and_dispose(disposer); }
+
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ size_type count(const_reference value) const
+ { return table_.count(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "key_value_equal" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "key_value_equal" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns the number of contained elements with the given key
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ size_type count(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
+ { return table_.count(key, hash_func, equal_func); }
+
+ //! <b>Effects</b>: Finds an iterator to the first element whose value is
+ //! "value" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ iterator find(const_reference value)
+ { return table_.find(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "key_value_equal" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "key_value_equal" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the given hasher and equality functor or end() if
+ //! that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
+ { return table_.find(key, hash_func, equal_func); }
+
+ //! <b>Effects</b>: Finds a const_iterator to the first element whose key is
+ //! "key" or end() if that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ const_iterator find(const_reference value) const
+ { return table_.find(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "key_value_equal" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "key_value_equal" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Finds an iterator to the first element whose key is
+ //! "key" according to the given hasher and equality functor or end() if
+ //! that element does not exist.
+ //!
+ //! <b>Complexity</b>: Average case O(1), worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ const_iterator find(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
+ { return table_.find(key, hash_func, equal_func); }
+
+ //! <b>Effects</b>: Returns a range containing all elements with values equivalent
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ std::pair<iterator,iterator> equal_range(const_reference value)
+ { return table_.equal_range(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "key_value_equal" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "key_value_equal" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns a range containing all elements with equivalent
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<iterator,iterator> equal_range
+ (const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func)
+ { return table_.equal_range(key, hash_func, equal_func); }
+
+ //! <b>Effects</b>: Returns a range containing all elements with values equivalent
+ //! to value. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(value)). Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ std::pair<const_iterator, const_iterator>
+ equal_range(const_reference value) const
+ { return table_.equal_range(value); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! "key_value_equal" must be a equality function that induces
+ //! the same equality as key_equal. The difference is that
+ //! "key_value_equal" compares an arbitrary key with the contained values.
+ //!
+ //! <b>Effects</b>: Returns a range containing all elements with equivalent
+ //! keys. Returns std::make_pair(this->end(), this->end()) if no such
+ //! elements exist.
+ //!
+ //! <b>Complexity</b>: Average case O(this->count(key, hash_func, equal_func)).
+ //! Worst case O(this->size()).
+ //!
+ //! <b>Throws</b>: If the internal hasher or the equality functor throws.
+ //!
+ //! <b>Note</b>: This function is used when constructing a value_type
+ //! is expensive and the value_type can be compared with a cheaper
+ //! key type. Usually this key is part of the value_type.
+ template<class KeyType, class KeyHasher, class KeyValueEqual>
+ std::pair<const_iterator, const_iterator>
+ equal_range(const KeyType& key, KeyHasher hash_func, KeyValueEqual equal_func) const
+ { return table_.equal_range(key, hash_func, equal_func); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid iterator belonging to the unordered_multiset
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the hash function throws.
+ iterator iterator_to(reference value)
+ { return table_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_multiset of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_iterator belonging to the
+ //! unordered_multiset that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the hash function throws.
+ const_iterator iterator_to(const_reference value) const
+ { return table_.iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static local_iterator s_local_iterator_to(reference value)
+ { return table_type::s_local_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
+ //! the unordered_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: This static function is available only if the <i>value traits</i>
+ //! is stateless.
+ static const_local_iterator s_local_iterator_to(const_reference value)
+ { return table_type::s_local_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid local_iterator belonging to the unordered_set
+ //! that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ local_iterator local_iterator_to(reference value)
+ { return table_.local_iterator_to(value); }
+
+ //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
+ //! appropriate type. Otherwise the behavior is undefined.
+ //!
+ //! <b>Effects</b>: Returns: a valid const_local_iterator belonging to
+ //! the unordered_set that points to the value
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ const_local_iterator local_iterator_to(const_reference value) const
+ { return table_.local_iterator_to(value); }
+
+ //! <b>Effects</b>: Returns the number of buckets passed in the constructor
+ //! or the last rehash function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type bucket_count() const
+ { return table_.bucket_count(); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns the number of elements in the nth bucket.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ size_type bucket_size(size_type n) const
+ { return table_.bucket_size(n); }
+
+ //! <b>Effects</b>: Returns the index of the bucket in which elements
+ //! with keys equivalent to k would be found, if any such element existed.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the hash functor throws.
+ //!
+ //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
+ size_type bucket(const value_type& k) const
+ { return table_.bucket(k); }
+
+ //! <b>Requires</b>: "hash_func" must be a hash function that induces
+ //! the same hash values as the stored hasher. The difference is that
+ //! "hash_func" hashes the given key instead of the value_type.
+ //!
+ //! <b>Effects</b>: Returns the index of the bucket in which elements
+ //! with keys equivalent to k would be found, if any such element existed.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: If the hash functor throws.
+ //!
+ //! <b>Note</b>: the return value is in the range [0, this->bucket_count()).
+ template<class KeyType, class KeyHasher>
+ size_type bucket(const KeyType& k, const KeyHasher &hash_func) const
+ { return table_.bucket(k, hash_func); }
+
+ //! <b>Effects</b>: Returns the bucket array pointer passed in the constructor
+ //! or the last rehash function.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ bucket_ptr bucket_pointer() const
+ { return table_.bucket_pointer(); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ local_iterator begin(size_type n)
+ { return table_.begin(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator begin(size_type n) const
+ { return table_.begin(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the beginning
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator cbegin(size_type n) const
+ { return table_.cbegin(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ local_iterator end(size_type n)
+ { return table_.end(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator end(size_type n) const
+ { return table_.end(n); }
+
+ //! <b>Requires</b>: n is in the range [0, this->bucket_count()).
+ //!
+ //! <b>Effects</b>: Returns a const_local_iterator pointing to the end
+ //! of the sequence stored in the bucket n.
+ //!
+ //! <b>Complexity</b>: Constant.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Note</b>: [this->begin(n), this->end(n)) is a valid range
+ //! containing all of the elements in the nth bucket.
+ const_local_iterator cend(size_type n) const
+ { return table_.cend(n); }
+
+ //! <b>Requires</b>: new_buckets must be a pointer to a new bucket array
+ //! or the same as the old bucket array. new_size is the length of the
+ //! the array pointed by new_buckets. If new_buckets == this->bucket_pointer()
+ //! n can be bigger or smaller than this->bucket_count().
+ //!
+ //! <b>Effects</b>: Updates the internal reference with the new bucket erases
+ //! the values from the old bucket and inserts then in the new one.
+ //!
+ //! If store_hash option is true, this method does not use the hash function.
+ //!
+ //! <b>Complexity</b>: Average case linear in this->size(), worst case quadratic.
+ //!
+ //! <b>Throws</b>: If the hasher functor throws.
+ void rehash(const bucket_traits &new_bucket_traits)
+ { table_.rehash(new_bucket_traits); }
+
+ //! <b>Requires</b>:
+ //!
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
+ //!
+ //! <b>Note</b>: this method is only available if incremental<true> option is activated.
+ bool incremental_rehash(bool grow = true)
+ { return table_.incremental_rehash(grow); }
+
+ //! <b>Note</b>: this method is only available if incremental<true> option is activated.
+ bool incremental_rehash(const bucket_traits &new_bucket_traits)
+ { return table_.incremental_rehash(new_bucket_traits); }
+
+ //! <b>Requires</b>:
+ //!
+ //! <b>Effects</b>:
+ //!
+ //! <b>Complexity</b>:
+ //!
+ //! <b>Throws</b>:
+ size_type split_count() const
+ { return table_.split_count(); }
+
+ //! <b>Effects</b>: Returns the nearest new bucket count optimized for
+ //! the container that is bigger than n. This suggestion can be used
+ //! to create bucket arrays with a size that will usually improve
+ //! container's performance. If such value does not exist, the
+ //! higher possible value is returned.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static size_type suggested_upper_bucket_count(size_type n)
+ { return table_type::suggested_upper_bucket_count(n); }
+
+ //! <b>Effects</b>: Returns the nearest new bucket count optimized for
+ //! the container that is smaller than n. This suggestion can be used
+ //! to create bucket arrays with a size that will usually improve
+ //! container's performance. If such value does not exist, the
+ //! lower possible value is returned.
+ //!
+ //! <b>Complexity</b>: Amortized constant time.
+ //!
+ //! <b>Throws</b>: Nothing.
+ static size_type suggested_lower_bucket_count(size_type n)
+ { return table_type::suggested_lower_bucket_count(n); }
+};
+
+//! Helper metafunction to define an \c unordered_multiset that yields to the same type when the
+//! same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class ...Options>
+#else
+template<class T, class O1 = none, class O2 = none
+ , class O3 = none, class O4 = none
+ , class O5 = none, class O6 = none
+ , class O7 = none, class O8 = none
+ , class O9 = none, class O10= none
+ >
+#endif
+struct make_unordered_multiset
+{
+ /// @cond
+ typedef unordered_multiset_impl
+ < typename make_hashtable_opt
+ <T, false,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+#ifndef BOOST_INTRUSIVE_DOXYGEN_INVOKED
+
+#if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4, class O5, class O6, class O7, class O8, class O9, class O10>
+#else
+template<class T, class ...Options>
+#endif
+class unordered_multiset
+ : public make_unordered_multiset<T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type
+{
+ typedef typename make_unordered_multiset
+ <T,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6, O7, O8, O9, O10
+ #else
+ Options...
+ #endif
+ >::type Base;
+ //Assert if passed value traits are compatible with the type
+ BOOST_STATIC_ASSERT((detail::is_same<typename Base::value_traits::value_type, T>::value));
+
+ public:
+ typedef typename Base::value_traits value_traits;
+ typedef typename Base::bucket_traits bucket_traits;
+ typedef typename Base::iterator iterator;
+ typedef typename Base::const_iterator const_iterator;
+ typedef typename Base::bucket_ptr bucket_ptr;
+ typedef typename Base::size_type size_type;
+ typedef typename Base::hasher hasher;
+ typedef typename Base::key_equal key_equal;
+
+ unordered_multiset( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : Base(b_traits, hash_func, equal_func, v_traits)
+ {}
+
+ template<class Iterator>
+ unordered_multiset( Iterator b
+ , Iterator e
+ , const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
+ : Base(b, e, b_traits, hash_func, equal_func, v_traits)
+ {}
+};
+
+#endif
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_UNORDERED_SET_HPP
Added: sandbox/move/boost/intrusive/unordered_set_hook.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/boost/intrusive/unordered_set_hook.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,425 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_UNORDERED_SET_HOOK_HPP
+#define BOOST_INTRUSIVE_UNORDERED_SET_HOOK_HPP
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/intrusive_fwd.hpp>
+#include <boost/intrusive/detail/utilities.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include <boost/intrusive/slist_hook.hpp>
+#include <boost/intrusive/options.hpp>
+#include <boost/intrusive/detail/generic_hook.hpp>
+
+namespace boost {
+namespace intrusive {
+
+/// @cond
+
+template<class VoidPointer, bool StoreHash, bool OptimizeMultiKey>
+struct unordered_node
+ : public slist_node<VoidPointer>
+{
+ typedef typename boost::pointer_to_other
+ < VoidPointer
+ , unordered_node<VoidPointer, StoreHash, OptimizeMultiKey>
+ >::type node_ptr;
+ node_ptr prev_in_group_;
+ std::size_t hash_;
+};
+
+template<class VoidPointer>
+struct unordered_node<VoidPointer, false, true>
+ : public slist_node<VoidPointer>
+{
+ typedef typename boost::pointer_to_other
+ < VoidPointer
+ , unordered_node<VoidPointer, false, true>
+ >::type node_ptr;
+ node_ptr prev_in_group_;
+};
+
+template<class VoidPointer>
+struct unordered_node<VoidPointer, true, false>
+ : public slist_node<VoidPointer>
+{
+ typedef typename boost::pointer_to_other
+ < VoidPointer
+ , unordered_node<VoidPointer, true, false>
+ >::type node_ptr;
+ std::size_t hash_;
+};
+
+template<class VoidPointer, bool StoreHash, bool OptimizeMultiKey>
+struct unordered_node_traits
+ : public slist_node_traits<VoidPointer>
+{
+ typedef slist_node_traits<VoidPointer> reduced_slist_node_traits;
+ typedef unordered_node<VoidPointer, StoreHash, OptimizeMultiKey> node;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, node>::type node_ptr;
+ typedef typename boost::pointer_to_other
+ <VoidPointer, const node>::type const_node_ptr;
+
+ static const bool store_hash = StoreHash;
+ static const bool optimize_multikey = OptimizeMultiKey;
+
+ static node_ptr get_next(const_node_ptr n)
+ { return node_ptr(&static_cast<node &>(*n->next_)); }
+
+ static void set_next(node_ptr n, node_ptr next)
+ { n->next_ = next; }
+
+ static node_ptr get_prev_in_group(const_node_ptr n)
+ { return n->prev_in_group_; }
+
+ static void set_prev_in_group(node_ptr n, node_ptr prev)
+ { n->prev_in_group_ = prev; }
+
+ static std::size_t get_hash(const_node_ptr n)
+ { return n->hash_; }
+
+ static void set_hash(node_ptr n, std::size_t h)
+ { n->hash_ = h; }
+};
+
+template<class NodeTraits>
+struct unordered_group_adapter
+{
+ typedef typename NodeTraits::node node;
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+
+ static node_ptr get_next(const_node_ptr n)
+ { return NodeTraits::get_prev_in_group(n); }
+
+ static void set_next(node_ptr n, node_ptr next)
+ { NodeTraits::set_prev_in_group(n, next); }
+};
+
+template<class NodeTraits>
+struct unordered_algorithms
+ : public circular_slist_algorithms<NodeTraits>
+{
+ typedef circular_slist_algorithms<NodeTraits> base_type;
+ typedef unordered_group_adapter<NodeTraits> group_traits;
+ typedef circular_slist_algorithms<group_traits> group_algorithms;
+
+ static void init(typename base_type::node_ptr n)
+ {
+ base_type::init(n);
+ group_algorithms::init(n);
+ }
+
+ static void init_header(typename base_type::node_ptr n)
+ {
+ base_type::init_header(n);
+ group_algorithms::init_header(n);
+ }
+
+ static void unlink(typename base_type::node_ptr n)
+ {
+ base_type::unlink(n);
+ group_algorithms::unlink(n);
+ }
+};
+
+template<class VoidPointer, bool StoreHash, bool OptimizeMultiKey>
+struct get_uset_node_algo
+{
+ typedef typename detail::if_c
+ < (StoreHash || OptimizeMultiKey)
+ , unordered_node_traits<VoidPointer, StoreHash, OptimizeMultiKey>
+ , slist_node_traits<VoidPointer>
+ >::type node_traits_type;
+ typedef typename detail::if_c
+ < OptimizeMultiKey
+ , unordered_algorithms<node_traits_type>
+ , circular_slist_algorithms<node_traits_type>
+ >::type type;
+};
+/// @endcond
+
+//! Helper metafunction to define a \c unordered_set_base_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none, class O4 = none>
+#endif
+struct make_unordered_set_base_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_uset_node_algo<typename packed_options::void_pointer
+ , packed_options::store_hash
+ , packed_options::optimize_multikey
+ >
+ , typename packed_options::tag
+ , packed_options::link_mode
+ , detail::UsetBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Derive a class from unordered_set_base_hook in order to store objects in
+//! in an unordered_set/unordered_multi_set. unordered_set_base_hook holds the data necessary to maintain
+//! the unordered_set/unordered_multi_set and provides an appropriate value_traits class for unordered_set/unordered_multi_set.
+//!
+//! The hook admits the following options: \c tag<>, \c void_pointer<>,
+//! \c link_mode<>, \c store_hash<> and \c optimize_multikey<>.
+//!
+//! \c tag<> defines a tag to identify the node.
+//! The same tag value can be used in different classes, but if a class is
+//! derived from more than one \c list_base_hook, then each \c list_base_hook needs its
+//! unique tag.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c store_hash<> will tell the hook to store the hash of the value
+//! to speed up rehashings.
+//!
+//! \c optimize_multikey<> will tell the hook to store a link to form a group
+//! with other value with the same value to speed up searches and insertions
+//! in unordered_multisets with a great number of with equivalent keys.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3, class O4>
+#endif
+class unordered_set_base_hook
+ : public make_unordered_set_base_hook<
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ unordered_set_base_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ unordered_set_base_hook(const unordered_set_base_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ unordered_set_base_hook& operator=(const unordered_set_base_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in an unordered_set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~unordered_set_base_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(unordered_set_base_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c unordered_set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+
+//! Helper metafunction to define a \c unordered_set_member_hook that yields to the same
+//! type when the same options (either explicitly or implicitly) are used.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1 = none, class O2 = none, class O3 = none, class O4 = none>
+#endif
+struct make_unordered_set_member_hook
+{
+ /// @cond
+ typedef typename pack_options
+ < hook_defaults,
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type packed_options;
+
+ typedef detail::generic_hook
+ < get_uset_node_algo< typename packed_options::void_pointer
+ , packed_options::store_hash
+ , packed_options::optimize_multikey
+ >
+ , member_tag
+ , packed_options::link_mode
+ , detail::NoBaseHook
+ > implementation_defined;
+ /// @endcond
+ typedef implementation_defined type;
+};
+
+//! Put a public data member unordered_set_member_hook in order to store objects of this class in
+//! an unordered_set/unordered_multi_set. unordered_set_member_hook holds the data necessary for maintaining the
+//! unordered_set/unordered_multi_set and provides an appropriate value_traits class for unordered_set/unordered_multi_set.
+//!
+//! The hook admits the following options: \c void_pointer<>,
+//! \c link_mode<> and \c store_hash<>.
+//!
+//! \c void_pointer<> is the pointer type that will be used internally in the hook
+//! and the the container configured to use this hook.
+//!
+//! \c link_mode<> will specify the linking mode of the hook (\c normal_link,
+//! \c auto_unlink or \c safe_link).
+//!
+//! \c store_hash<> will tell the hook to store the hash of the value
+//! to speed up rehashings.
+#if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED) || defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class ...Options>
+#else
+template<class O1, class O2, class O3, class O4>
+#endif
+class unordered_set_member_hook
+ : public make_unordered_set_member_hook<
+ #if !defined(BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+ >::type
+{
+ #if defined(BOOST_INTRUSIVE_DOXYGEN_INVOKED)
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state.
+ //!
+ //! <b>Throws</b>: Nothing.
+ unordered_set_member_hook();
+
+ //! <b>Effects</b>: If link_mode is \c auto_unlink or \c safe_link
+ //! initializes the node to an unlinked state. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing a copy-constructor
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ unordered_set_member_hook(const unordered_set_member_hook& );
+
+ //! <b>Effects</b>: Empty function. The argument is ignored.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Rationale</b>: Providing an assignment operator
+ //! makes classes using the hook STL-compliant without forcing the
+ //! user to do some additional work. \c swap can be used to emulate
+ //! move-semantics.
+ unordered_set_member_hook& operator=(const unordered_set_member_hook& );
+
+ //! <b>Effects</b>: If link_mode is \c normal_link, the destructor does
+ //! nothing (ie. no code is generated). If link_mode is \c safe_link and the
+ //! object is stored in an unordered_set an assertion is raised. If link_mode is
+ //! \c auto_unlink and \c is_linked() is true, the node is unlinked.
+ //!
+ //! <b>Throws</b>: Nothing.
+ ~unordered_set_member_hook();
+
+ //! <b>Effects</b>: Swapping two nodes swaps the position of the elements
+ //! related to those nodes in one or two containers. That is, if the node
+ //! this is part of the element e1, the node x is part of the element e2
+ //! and both elements are included in the containers s1 and s2, then after
+ //! the swap-operation e1 is in s2 at the position of e2 and e2 is in s1
+ //! at the position of e1. If one element is not in a container, then
+ //! after the swap-operation the other element is not in a container.
+ //! Iterators to e1 and e2 related to those nodes are invalidated.
+ //!
+ //! <b>Complexity</b>: Constant
+ //!
+ //! <b>Throws</b>: Nothing.
+ void swap_nodes(unordered_set_member_hook &other);
+
+ //! <b>Precondition</b>: link_mode must be \c safe_link or \c auto_unlink.
+ //!
+ //! <b>Returns</b>: true, if the node belongs to a container, false
+ //! otherwise. This function can be used to test whether \c unordered_set::iterator_to
+ //! will return a valid iterator.
+ //!
+ //! <b>Complexity</b>: Constant
+ bool is_linked() const;
+
+ //! <b>Effects</b>: Removes the node if it's inserted in a container.
+ //! This function is only allowed if link_mode is \c auto_unlink.
+ //!
+ //! <b>Throws</b>: Nothing.
+ void unlink();
+ #endif
+};
+
+} //namespace intrusive
+} //namespace boost
+
+#include <boost/intrusive/detail/config_end.hpp>
+
+#endif //BOOST_INTRUSIVE_UNORDERED_SET_HOOK_HPP
Modified: sandbox/move/boost/move/move.hpp
==============================================================================
--- sandbox/move/boost/move/move.hpp (original)
+++ sandbox/move/boost/move/move.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -141,9 +141,9 @@
}
template <class T>
-typename enable_if<is_movable<T>, rv<T>&>::type move(const rv<T>& x)
+typename enable_if<is_movable<T>, rv<T>&>::type move(rv<T>& x)
{
- return const_cast<rv<T>& >(x);
+ return x;
}
//////////////////////////////////////////////////////////////////////////////
@@ -159,21 +159,6 @@
return const_cast<T&>(x);
}
-/*
-template <class T>
-typename enable_if<boost::move_detail::is_rv<T>, T &>::type
-forward(typename move_detail::identity<T>::type &x)
-{
- return x;
-}
-
-template <class T>
-typename disable_if<boost::move_detail::is_rv<T>, T &>::type
- forward(typename move_detail::identity<T>::type &x)
-{
- return x;
-}
-*/
template <class T>
typename disable_if<boost::move_detail::is_rv<T>, const T &>::type
forward(const typename move_detail::identity<T>::type &x)
@@ -181,17 +166,6 @@
return x;
}
-//////////////////////////////////////////////////////////////////////////////
-//
-// BOOST_ENABLE_MOVE_EMULATION
-//
-//////////////////////////////////////////////////////////////////////////////
-#define BOOST_ENABLE_MOVE_EMULATION(TYPE)\
- operator boost::rv<TYPE>&() \
- { return *static_cast<boost::rv<TYPE>* >(this); }\
-//
-
-
#define BOOST_RV_REF(TYPE)\
boost::rv< TYPE >& \
//
@@ -204,9 +178,68 @@
boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
//
+#define BOOST_COPY_ASSIGN_REF(TYPE)\
+ const boost::rv< TYPE >& \
+//
+
+#define BOOST_COPY_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+ const boost::rv< TYPE<ARG1, ARG2> >& \
+//
+
+#define BOOST_COPY_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+ const boost::rv< TYPE<ARG1, ARG2, ARG3> >& \
+//
+
#define BOOST_FWD_REF(TYPE)\
const TYPE & \
//
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// BOOST_ENABLE_MOVE_EMULATION
+//
+//////////////////////////////////////////////////////////////////////////////
+#define BOOST_ENABLE_MOVE_EMULATION(TYPE)\
+ operator boost::rv<TYPE>&() \
+ { return *reinterpret_cast<boost::rv<TYPE>* >(this); }\
+ operator const boost::rv<TYPE>&() const \
+ { return *reinterpret_cast<const boost::rv<TYPE>* >(this); }\
+//
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// BOOST_MOVABLE_BUT_NOT_COPYABLE
+//
+//////////////////////////////////////////////////////////////////////////////
+#define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
+ private:\
+ TYPE(TYPE &);\
+ TYPE& operator=(TYPE &);\
+ public:\
+ operator boost::rv<TYPE>&() \
+ { return *reinterpret_cast<boost::rv<TYPE>* >(this); }\
+ operator const boost::rv<TYPE>&() const \
+ { return *reinterpret_cast<const boost::rv<TYPE>* >(this); }\
+ private:\
+//
+
+//////////////////////////////////////////////////////////////////////////////
+//
+// BOOST_COPYABLE_AND_MOVABLE
+//
+//////////////////////////////////////////////////////////////////////////////
+#define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
+ public:\
+ TYPE& operator=(TYPE &t)\
+ { this->operator=(static_cast<const ::boost::rv<TYPE> &>(const_cast<const TYPE &>(t))); return *this;}\
+ public:\
+ operator ::boost::rv<TYPE>&() \
+ { return *reinterpret_cast< ::boost::rv<TYPE>* >(this); }\
+ operator const ::boost::rv<TYPE>&() const \
+ { return *reinterpret_cast<const ::boost::rv<TYPE>* >(this); }\
+ private:\
+//
+
} //namespace boost
#else //BOOST_HAS_RVALUE_REFS
@@ -311,17 +344,35 @@
//
//////////////////////////////////////////////////////////////////////////////
-//! This macro expands to a typedef named boost_move_emulation_t for compilers with rvalue references.
-//! Otherwise expands to:
-//! \code
-//! operator boost::rv<TYPE>&()
-//! { return static_cast<boost::rv<TYPE>& >(*this); }
-//! \endcode
+///@cond
+
#define BOOST_ENABLE_MOVE_EMULATION(TYPE)\
typedef int boost_move_emulation_t;
\
//
+/// @endcond
+
+//! This macro marks a type as movable but not copyable, disabling copy construction
+//! and assignment. The user will need to write a move constructor/assignment as explained
+//! in the documentation to fully write a movable but not copyable class.
+#define BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)\
+ public:\
+ typedef int boost_move_emulation_t;\
+ private:\
+ TYPE(const TYPE &);\
+ TYPE& operator=(const TYPE &);\
+//
+
+//! This macro marks a type as copyable and movable.
+//! The user will need to write a move constructor/assignment and a copy assignment
+//! as explained in the documentation to fully write a copyable and movable class.
+#define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
+ typedef int boost_move_emulation_t;
+//
+
+/// @cond
+
#define BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
TYPE<ARG1, ARG2> && \
//
@@ -330,14 +381,35 @@
TYPE<ARG1, ARG2, ARG3> && \
//
-//! This macro expands to <i>T&&</i> for compilers with rvalue references.
-//! Otherwise expands to <i>boost::rv<T> &</i>.
+/// @endcond
+
+//!This macro is used to achieve portable syntax in move
+//!constructors and assignments for classes marked as
+//!BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE
#define BOOST_RV_REF(TYPE)\
TYPE && \
//
-//! This macro expands to <i>T&&</i> for compilers with rvalue references.
-//! Otherwise expands to <i>const T &</i>.
+//!This macro is used to achieve portable syntax in copy
+//!assignment for classes marked as BOOST_COPYABLE_AND_MOVABLE.
+#define BOOST_COPY_ASSIGN_REF(TYPE)\
+ const TYPE & \
+//
+
+/// @cond
+
+#define BOOST_COPY_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)\
+ const TYPE<ARG1, ARG2> & \
+//
+
+#define BOOST_COPY_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)\
+ TYPE<ARG1, ARG2, ARG3>& \
+//
+
+/// @endcond
+
+//! This macro is used to implement portable perfect forwarding
+//! as explained in the documentation.
#define BOOST_FWD_REF(TYPE)\
TYPE && \
//
@@ -764,8 +836,14 @@
return std::uninitialized_copy(f, l, r);
}
-///has_trivial_destructor_after_move<> == true_type
-///specialization for optimizations
+//! If this traits yields to true
+//! (<i>has_trivial_destructor_after_move <T>::value == true</i>)
+//! menas that after moved, there is no need to call T's destructor.
+//! This optimization is used to improve containers' performance.
+//!
+//! By default this trais is true if the type has trivial destructor,
+//! every class should specialize this trait if it wants to improve performance
+//! when inserted in containers.
template <class T>
struct has_trivial_destructor_after_move
: public boost::has_trivial_destructor<T>
Added: sandbox/move/libs/container/doc/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/Jamfile.v2 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,45 @@
+# Boost.Container library documentation Jamfile ---------------------------------
+#
+# Copyright Ion Gaztanaga 2009. Use, modification and
+# distribution is subject to the Boost Software License, Version
+# 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+#
+# See http://www.boost.org for updates, documentation, and revision history.
+
+import doxygen ;
+import quickbook ;
+
+doxygen autodoc
+ :
+ [ glob ../../../boost/container/*.hpp ]
+ :
+ <doxygen:param>EXTRACT_ALL=NO
+ <doxygen:param>HIDE_UNDOC_MEMBERS=YES
+ <doxygen:param>EXTRACT_PRIVATE=NO
+ <doxygen:param>ENABLE_PREPROCESSING=YES
+ <doxygen:param>EXPAND_ONLY_PREDEF=YES
+ <doxygen:param>MACRO_EXPANSION=YES
+ <doxygen:param>"PREDEFINED=\"BOOST_CONTAINER_DOXYGEN_INVOKED\" \\
+ \"BOOST_ENABLE_MOVE_EMULATION(a)= \" \\
+ \"BOOST_RV_REF(T)=T &&\" \\
+ \"BOOST_COPY_ASSIGN_REF(T)=const T &\" \\
+ \"BOOST_RV_REF_2_TEMPL_ARGS(T,a,b)=T<a, b> &&\" \\
+ \"BOOST_RV_REF_3_TEMPL_ARGS(T,a,b,c)=T<a,b,c>T<a,b,c> &&\" \\
+ \"BOOST_FWD_REF(a)=a &&\""
+ <xsl:param>"boost.doxygen.reftitle=Boost.Container Reference"
+ ;
+
+xml container : container.qbk ;
+
+boostbook standalone
+ :
+ container
+ :
+ <xsl:param>boost.root=../../../..
+ <xsl:param>boost.libraries=../../../../libs/libraries.htm
+ <xsl:param>generate.section.toc.level=3
+ <xsl:param>chunk.first.sections=1
+ <dependency>autodoc
+ <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html
+ ;
Added: sandbox/move/libs/container/doc/container.qbk
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/container.qbk 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,138 @@
+[/
+ / Copyright (c) 2009-2009 Ion Gaztanaga
+ /
+ / Distributed under the Boost Software License, Version 1.0. (See accompanying
+ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ /]
+
+[library Boost.Container
+ [quickbook 1.3]
+ [authors [Gaztañaga, Ion]]
+ [copyright 2009-2009 Ion Gaztañaga]
+ [id container]
+ [dirname container]
+ [purpose Containers library]
+ [license
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ [@http://www.boost.org/LICENSE_1_0.txt])
+ ]
+]
+
+[warning This library is NOT an official Boost library]
+
+[important To be able to use this library you also need [*Boost.Move] ]
+
+[section:intro Introduction]
+
+[*Boost.Container] library implements several well-known containers, including
+STL containers. The aim of the library is to offers advanced features not present
+in standard containers or to offer the latest standard draft features for compilers
+that comply with C++03.
+
+In short, what does [*Boost.Container] offer?
+
+* Move semantics are implemented, including move emulation for pre-C++0x compilers.
+* New advanced features (e.g. placement insertion, recursive containers) are present.
+* Containers support stateful allocators and are compatible with [*Boost.Interprocess]
+ (they can be safely placed in shared memory).
+* The library offers new useful containers:
+ * [classref boost::container::flat_map flat_map],
+ [classref boost::container::flat_map flat_set],
+ [classref boost::container::flat_map flat_multiset] and
+ [classref boost::container::flat_map flat_multiset]: drop-in
+ replacements for standard associative containers but more memory friendly and with faster
+ searches.
+ * [classref boost::container::stable_vector stable_vector]: a std::list and std::vector hybrid
+ with random-access iterators that offers iterator stability in insertions and erasures.
+ * [classref boost::container::slist slist]: the classic pre-standard singly linked list container.
+
+[section:introduction_building_container Building Boost.Container]
+
+There is no need to compile [*Boost.Container], since it's
+a header only library. Just include your Boost header directory in your
+compiler include path.
+
+[endsect]
+
+[section:tested_compilers Tested compilers]
+
+[*Boost.Container] requires a decent C++98 compatibility. Some compilers known to work are:
+
+* Visual C++ >= 7.1.
+* GCC >= 3.4.
+* Intel C++ >= 9.0
+
+[endsect]
+
+[endsect]
+
+[section:move_containers Move-aware containers]
+
+All containers offered by [*Boost.Container] can store movable-only types
+and actual requirements for `value_type` depend on each container operations.
+Following C++0x draft, many operations now require movable or default constructible
+types instead of copy constructible types.
+
+Containers themselves are also movable, with no-throw guarantee if allocator
+or predicate (if present) copy operations are no-throw. This allows
+high performance operations when transfering data between vectors.
+Let's see an example:
+
+[import ../example/doc_move_containers.cpp]
+[doc_move_containers]
+
+[endsect]
+
+[section:emplace Emplace: Placement insertion]
+
+All containers offered by [*Boost.Container] implement placement insertion,
+which means that the objects can be built directly from user arguments
+without creating any temporary object. Expensive to move types are perfect
+candidates for these emplace functions and in case of node containers
+([classref boost::container::list list], [classref boost::container::set set], ...)
+emplace allows storing non-movable and non-copyable types in containers! Let's
+see an example:
+
+[import ../example/doc_emplace.cpp]
+[doc_emplace]
+
+[endsect]
+
+
+[section:recursive_containers Recursive containers]
+
+All containers offered by [*Boost.Container] can be used in recursive data
+structures, something that is not guaranteed by the standard. Programmers
+can write the following data structures:
+
+[import ../example/doc_recursive_containers.cpp]
+[doc_recursive_containers]
+
+[endsect]
+
+
+[section:other_features Other features]
+
+* Default constructors don't allocate memory which improves performance and
+ usually implies a no-throw guarantee (if predicate's default constructor doesn't throw).
+
+* Small string optimization for [classref boost::container::basic_string basic_string],
+ with an internal buffer of 11/23 bytes (32/64 bit systems)
+ [*without] increasing the usual `sizeof` of the string (3 words).
+
+[endsect]
+
+[section:acknowledgements_notes Acknowledgements, notes and links]
+
+[section:thanks_to Thanks to...]
+
+[endsect]
+
+[endsect]
+
+[section:release_notes Release Notes]
+
+[endsect]
+
+[xinclude autodoc.xml]
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id278368.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id278368.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.deque_hpp" title="Header <boost/container/deque.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id278357.html" title="Macro BOOST_PP_LOCAL_MACRO">
+<link rel="next" href="boost/container/flat_map.html" title="Class template flat_map">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id278357.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.deque_hpp"><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="boost/container/flat_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id278368"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id278357.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.deque_hpp"><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="boost/container/flat_map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id284069.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id284069.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.flat_map_hpp" title="Header <boost/container/flat_map.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id284058.html" title="Macro BOOST_PP_LOCAL_MACRO">
+<link rel="next" href="boost/container/flat_set.html" title="Class template flat_set">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id284058.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.flat_map_hpp"><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="boost/container/flat_set.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id284069"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id284058.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.flat_map_hpp"><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="boost/container/flat_set.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id289293.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id289293.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.flat_set_hpp" title="Header <boost/container/flat_set.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id289281.html" title="Macro BOOST_PP_LOCAL_MACRO">
+<link rel="next" href="boost/container/list.html" title="Class template list">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id289281.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.flat_set_hpp"><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="boost/container/list.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id289293"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id289281.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.flat_set_hpp"><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="boost/container/list.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id292993.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id292993.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.list_hpp" title="Header <boost/container/list.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id292981.html" title="Macro BOOST_PP_LOCAL_MACRO">
+<link rel="next" href="boost/container/map.html" title="Class template map">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id292981.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.list_hpp"><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="boost/container/map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id292993"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id292981.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.list_hpp"><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="boost/container/map.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id298411.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id298411.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.map_hpp" title="Header <boost/container/map.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id298399.html" title="Macro BOOST_PP_LOCAL_MACRO">
+<link rel="next" href="boost/container/set.html" title="Class template set">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id298399.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.map_hpp"><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="boost/container/set.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id298411"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id298399.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.map_hpp"><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="boost/container/set.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id303345.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id303345.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.set_hpp" title="Header <boost/container/set.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id303333.html" title="Macro BOOST_PP_LOCAL_MACRO">
+<link rel="next" href="boost/container/slist.html" title="Class template slist">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id303333.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.set_hpp"><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="boost/container/slist.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id303345"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id303333.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.set_hpp"><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="boost/container/slist.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id307572.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id307572.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.slist_hpp" title="Header <boost/container/slist.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id307560.html" title="Macro BOOST_PP_LOCAL_MACRO">
+<link rel="next" href="stable_vector.html" title="Class template stable_vector">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id307560.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.slist_hpp"><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="stable_vector.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id307572"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id307560.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.slist_hpp"><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="stable_vector.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id308752.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id308752.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.stable_vector_hpp" title="Header <boost/container/stable_vector.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id308740.html" title="Macro BOOST_PP_LOCAL_MACRO">
+<link rel="next" href="boost/container/basic_string.html" title="Class template basic_string">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id308740.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.stable_vector_hpp"><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="boost/container/basic_string.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id308752"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id308740.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.stable_vector_hpp"><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="boost/container/basic_string.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id318445.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_LIMITS_id318445.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,46 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_LIMITS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.vector_hpp" title="Header <boost/container/vector.hpp>">
+<link rel="prev" href="BOOST_PP_LOCAL_MACRO_id318433.html" title="Macro BOOST_PP_LOCAL_MACRO">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id318433.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.vector_hpp"><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>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_LIMITS_id318445"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_LIMITS</span></h2>
+<p>BOOST_PP_LOCAL_LIMITS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_LIMITS</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_PP_LOCAL_MACRO_id318433.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.vector_hpp"><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>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id278357.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id278357.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.deque_hpp" title="Header <boost/container/deque.hpp>">
+<link rel="prev" href="boost/container/deque.html" title="Class template deque">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id278368.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/deque.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.deque_hpp"><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="BOOST_PP_LOCAL_LIMITS_id278368.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id278357"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/deque.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.deque_hpp"><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="BOOST_PP_LOCAL_LIMITS_id278368.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id284058.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id284058.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.flat_map_hpp" title="Header <boost/container/flat_map.hpp>">
+<link rel="prev" href="boost/container/flat_multimap.html" title="Class template flat_multimap">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id284069.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/flat_multimap.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.flat_map_hpp"><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="BOOST_PP_LOCAL_LIMITS_id284069.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id284058"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/flat_multimap.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.flat_map_hpp"><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="BOOST_PP_LOCAL_LIMITS_id284069.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id289281.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id289281.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.flat_set_hpp" title="Header <boost/container/flat_set.hpp>">
+<link rel="prev" href="boost/container/flat_multiset.html" title="Class template flat_multiset">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id289293.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/flat_multiset.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.flat_set_hpp"><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="BOOST_PP_LOCAL_LIMITS_id289293.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id289281"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/flat_multiset.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.flat_set_hpp"><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="BOOST_PP_LOCAL_LIMITS_id289293.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id292981.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id292981.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.list_hpp" title="Header <boost/container/list.hpp>">
+<link rel="prev" href="boost/container/list.html" title="Class template list">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id292993.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/list.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.list_hpp"><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="BOOST_PP_LOCAL_LIMITS_id292993.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id292981"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/list.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.list_hpp"><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="BOOST_PP_LOCAL_LIMITS_id292993.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id298399.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id298399.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.map_hpp" title="Header <boost/container/map.hpp>">
+<link rel="prev" href="boost/container/multimap.html" title="Class template multimap">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id298411.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/multimap.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.map_hpp"><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="BOOST_PP_LOCAL_LIMITS_id298411.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id298399"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/multimap.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.map_hpp"><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="BOOST_PP_LOCAL_LIMITS_id298411.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id303333.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id303333.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.set_hpp" title="Header <boost/container/set.hpp>">
+<link rel="prev" href="boost/container/multiset.html" title="Class template multiset">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id303345.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/multiset.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.set_hpp"><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="BOOST_PP_LOCAL_LIMITS_id303345.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id303333"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/multiset.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.set_hpp"><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="BOOST_PP_LOCAL_LIMITS_id303345.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id307560.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id307560.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.slist_hpp" title="Header <boost/container/slist.hpp>">
+<link rel="prev" href="boost/container/slist.html" title="Class template slist">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id307572.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/slist.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.slist_hpp"><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="BOOST_PP_LOCAL_LIMITS_id307572.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id307560"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/slist.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.slist_hpp"><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="BOOST_PP_LOCAL_LIMITS_id307572.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id308740.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id308740.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.stable_vector_hpp" title="Header <boost/container/stable_vector.hpp>">
+<link rel="prev" href="stable_vector.html" title="Class template stable_vector">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id308752.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="stable_vector.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.stable_vector_hpp"><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="BOOST_PP_LOCAL_LIMITS_id308752.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id308740"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="stable_vector.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.stable_vector_hpp"><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="BOOST_PP_LOCAL_LIMITS_id308752.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id318433.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/BOOST_PP_LOCAL_MACRO_id318433.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_PP_LOCAL_MACRO</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.vector_hpp" title="Header <boost/container/vector.hpp>">
+<link rel="prev" href="boost/container/vector.html" title="Class template vector">
+<link rel="next" href="BOOST_PP_LOCAL_LIMITS_id318445.html" title="Macro BOOST_PP_LOCAL_LIMITS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/vector.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.vector_hpp"><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="BOOST_PP_LOCAL_LIMITS_id318445.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_PP_LOCAL_MACRO_id318433"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_PP_LOCAL_MACRO</span></h2>
+<p>BOOST_PP_LOCAL_MACRO — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_PP_LOCAL_MACRO(n)</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/vector.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.vector_hpp"><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="BOOST_PP_LOCAL_LIMITS_id318445.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/basic_string.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/basic_string.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,736 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template basic_string</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.string_hpp" title="Header <boost/container/string.hpp>">
+<link rel="prev" href="stable_vector.html" title="Class template stable_vector">
+<link rel="next" href="string.html" title="Type definition string">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="stable_vector.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.string_hpp"><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="string.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.basic_string"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template basic_string</span></h2>
+<p>boost::container::basic_string — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+<span class="bold"><strong>class</strong></span> basic_string {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> A allocator_type;
+ <span class="bold"><strong>typedef</strong></span> allocator_type <a name="boost.container.basic_string.stored_allocator_type"></a>stored_allocator_type; <span class="emphasis"><em>// The stored allocator type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> CharT <a name="boost.container.basic_string.value_type"></a>value_type; <span class="emphasis"><em>// The type of object, CharT, stored in the string. </em></span>
+ <span class="bold"><strong>typedef</strong></span> Traits <a name="boost.container.basic_string.traits_type"></a>traits_type; <span class="emphasis"><em>// The second template parameter Traits. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::pointer <a name="boost.container.basic_string.pointer"></a>pointer; <span class="emphasis"><em>// Pointer to CharT. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::const_pointer <a name="boost.container.basic_string.const_pointer"></a>const_pointer; <span class="emphasis"><em>// Const pointer to CharT. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::reference <a name="boost.container.basic_string.reference"></a>reference; <span class="emphasis"><em>// Reference to CharT. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::const_reference <a name="boost.container.basic_string.const_reference"></a>const_reference; <span class="emphasis"><em>// Const reference to CharT. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::size_type <a name="boost.container.basic_string.size_type"></a>size_type; <span class="emphasis"><em>// An unsigned integral type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::difference_type <a name="boost.container.basic_string.difference_type"></a>difference_type; <span class="emphasis"><em>// A signed integral type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> pointer <a name="boost.container.basic_string.iterator"></a>iterator; <span class="emphasis"><em>// Iterator used to iterate through a string. It's a Random Access Iterator. </em></span>
+ <span class="bold"><strong>typedef</strong></span> const_pointer <a name="boost.container.basic_string.const_iterator"></a>const_iterator; <span class="emphasis"><em>// Const iterator used to iterate through a string. It's a Random Access Iterator. </em></span>
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< iterator > <a name="boost.container.basic_string.reverse_iterator"></a>reverse_iterator; <span class="emphasis"><em>// Iterator used to iterate backwards through a string. </em></span>
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< const_iterator > <a name="boost.container.basic_string.const_reverse_iterator"></a>const_reverse_iterator; <span class="emphasis"><em>// Const iterator used to iterate backwards through a string. </em></span>
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ basic_string(reserve_t, std::size_t,
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ basic_string(<span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ basic_string(<span class="bold"><strong>const</strong></span> basic_string &);
+ basic_string(basic_string &&);
+ basic_string(<span class="bold"><strong>const</strong></span> basic_string &, size_type, size_type = npos,
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ basic_string(<span class="bold"><strong>const</strong></span> CharT *, size_type,
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ basic_string(<span class="bold"><strong>const</strong></span> CharT *, <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ basic_string(size_type, CharT, <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ basic_string(InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ basic_string& operator=(<span class="bold"><strong>const</strong></span> basic_string &);
+ basic_string& operator=(basic_string &&);
+ basic_string& operator=(<span class="bold"><strong>const</strong></span> CharT *);
+ basic_string& operator=(CharT);
+ ~basic_string();
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> length() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type, CharT) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reserve(size_type) ;
+ <span class="type">size_type</span> capacity() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> operator[](size_type) ;
+ <span class="type">const_reference</span> operator[](size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> at(size_type) ;
+ <span class="type">const_reference</span> at(size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">basic_string &</span> operator+=(<span class="bold"><strong>const</strong></span> basic_string &) ;
+ <span class="type">basic_string &</span> operator+=(<span class="bold"><strong>const</strong></span> CharT *) ;
+ <span class="type">basic_string &</span> operator+=(CharT) ;
+ <span class="type">basic_string &</span> append(<span class="bold"><strong>const</strong></span> basic_string &) ;
+ <span class="type">basic_string &</span> append(<span class="bold"><strong>const</strong></span> basic_string &, size_type, size_type) ;
+ <span class="type">basic_string &</span> append(<span class="bold"><strong>const</strong></span> CharT *, size_type) ;
+ <span class="type">basic_string &</span> append(<span class="bold"><strong>const</strong></span> CharT *) ;
+ <span class="type">basic_string &</span> append(size_type, CharT) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIter> <span class="type">basic_string &</span> append(InputIter, InputIter) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(CharT) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_back() ;
+ <span class="type">basic_string &</span> assign(<span class="bold"><strong>const</strong></span> basic_string &) ;
+ <span class="type">basic_string &</span> assign(basic_string &&) ;
+ <span class="type">basic_string &</span> assign(<span class="bold"><strong>const</strong></span> basic_string &, size_type, size_type) ;
+ <span class="type">basic_string &</span> assign(<span class="bold"><strong>const</strong></span> CharT *, size_type) ;
+ <span class="type">basic_string &</span> assign(<span class="bold"><strong>const</strong></span> CharT *) ;
+ <span class="type">basic_string &</span> assign(size_type, CharT) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIter> <span class="type">basic_string &</span> assign(InputIter, InputIter) ;
+ <span class="type">basic_string &</span> assign(<span class="bold"><strong>const</strong></span> CharT *, <span class="bold"><strong>const</strong></span> CharT *) ;
+ <span class="type">basic_string &</span> insert(size_type, <span class="bold"><strong>const</strong></span> basic_string &) ;
+ <span class="type">basic_string &</span>
+ insert(size_type, <span class="bold"><strong>const</strong></span> basic_string &, size_type, size_type) ;
+ <span class="type">basic_string &</span> insert(size_type, <span class="bold"><strong>const</strong></span> CharT *, size_type) ;
+ <span class="type">basic_string &</span> insert(size_type, <span class="bold"><strong>const</strong></span> CharT *) ;
+ <span class="type">basic_string &</span> insert(size_type, size_type, CharT) ;
+ <span class="type">iterator</span> insert(iterator, CharT) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(iterator, std::size_t, CharT) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIter> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(iterator, InputIter, InputIter) ;
+ <span class="type">basic_string &</span> erase(size_type = 0, size_type = npos) ;
+ <span class="type">iterator</span> erase(iterator) ;
+ <span class="type">iterator</span> erase(iterator, iterator) ;
+ <span class="type">basic_string &</span> replace(size_type, size_type, <span class="bold"><strong>const</strong></span> basic_string &) ;
+ <span class="type">basic_string &</span>
+ replace(size_type, size_type, <span class="bold"><strong>const</strong></span> basic_string &, size_type, size_type) ;
+ <span class="type">basic_string &</span> replace(size_type, size_type, <span class="bold"><strong>const</strong></span> CharT *, size_type) ;
+ <span class="type">basic_string &</span> replace(size_type, size_type, <span class="bold"><strong>const</strong></span> CharT *) ;
+ <span class="type">basic_string &</span> replace(size_type, size_type, size_type, CharT) ;
+ <span class="type">basic_string &</span> replace(iterator, iterator, <span class="bold"><strong>const</strong></span> basic_string &) ;
+ <span class="type">basic_string &</span> replace(iterator, iterator, <span class="bold"><strong>const</strong></span> CharT *, size_type) ;
+ <span class="type">basic_string &</span> replace(iterator, iterator, <span class="bold"><strong>const</strong></span> CharT *) ;
+ <span class="type">basic_string &</span> replace(iterator, iterator, size_type, CharT) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIter>
+ <span class="type">basic_string &</span> replace(iterator, iterator, InputIter, InputIter) ;
+ <span class="type">size_type</span> copy(CharT *, size_type, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(basic_string &) ;
+ <span class="type"><span class="bold"><strong>const</strong></span> CharT *</span> c_str() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> CharT *</span> data() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find(<span class="bold"><strong>const</strong></span> basic_string &, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find(<span class="bold"><strong>const</strong></span> CharT *, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find(<span class="bold"><strong>const</strong></span> CharT *, size_type, size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find(CharT, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> rfind(<span class="bold"><strong>const</strong></span> basic_string &, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> rfind(<span class="bold"><strong>const</strong></span> CharT *, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> rfind(<span class="bold"><strong>const</strong></span> CharT *, size_type, size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> rfind(CharT, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_first_of(<span class="bold"><strong>const</strong></span> basic_string &, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_first_of(<span class="bold"><strong>const</strong></span> CharT *, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_first_of(<span class="bold"><strong>const</strong></span> CharT *, size_type, size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_first_of(CharT, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_last_of(<span class="bold"><strong>const</strong></span> basic_string &, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_last_of(<span class="bold"><strong>const</strong></span> CharT *, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_last_of(<span class="bold"><strong>const</strong></span> CharT *, size_type, size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_last_of(CharT, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_first_not_of(<span class="bold"><strong>const</strong></span> basic_string &, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_first_not_of(<span class="bold"><strong>const</strong></span> CharT *, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_first_not_of(<span class="bold"><strong>const</strong></span> CharT *, size_type, size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_first_not_of(CharT, size_type = 0) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_last_not_of(<span class="bold"><strong>const</strong></span> basic_string &, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_last_not_of(<span class="bold"><strong>const</strong></span> CharT *, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_last_not_of(<span class="bold"><strong>const</strong></span> CharT *, size_type, size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> find_last_not_of(CharT, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type">basic_string</span> substr(size_type = 0, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>int</strong></span></span> compare(<span class="bold"><strong>const</strong></span> basic_string &) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>int</strong></span></span> compare(size_type, size_type, <span class="bold"><strong>const</strong></span> basic_string &) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>int</strong></span></span> compare(size_type, size_type, <span class="bold"><strong>const</strong></span> basic_string &, size_type,
+ size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>int</strong></span></span> compare(<span class="bold"><strong>const</strong></span> CharT *) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>int</strong></span></span> compare(size_type, size_type, <span class="bold"><strong>const</strong></span> CharT *, size_type = npos) <span class="bold"><strong>const</strong></span>;
+ <span class="bold"><strong>static</strong></span> <span class="type"><span class="bold"><strong>const</strong></span> size_type</span> npos;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id545074"></a><h2>Description</h2>
+<p>The basic_string class represents a Sequence of characters. It contains all the usual operations of a Sequence, and, additionally, it contains standard string operations such as search and concatenation.</p>
+<p>The basic_string class is parameterized by character type, and by that type's Character Traits.</p>
+<p>This class has performance characteristics very much like vector<>, meaning, for example, that it does not perform reference-count or copy-on-write, and that concatenation of two strings is an O(N) operation.</p>
+<p>Some of basic_string's member functions use an unusual method of specifying positions and ranges. In addition to the conventional method using iterators, many of basic_string's member functions use a single value pos of type size_type to represent a position (in which case the position is begin() + pos, and many of basic_string's member functions use two values, pos and n, to represent a range. In that case pos is the beginning of the range and n is its size. That is, the range is [begin() + pos, begin() + pos + n).</p>
+<p>Note that the C++ standard does not specify the complexity of basic_string operations. In this implementation, basic_string has performance characteristics very similar to those of vector: access to a single character is O(1), while copy and concatenation are O(N).</p>
+<p>In this implementation, begin(), end(), rbegin(), rend(), operator[], c_str(), and data() do not invalidate iterators. In this implementation, iterators are only invalidated by member functions that explicitly change the string's contents. </p>
+<div class="refsect2" lang="en">
+<a name="id545126"></a><h3>
+<a name="boost.container.basic_stringtypes"></a><code class="computeroutput">basic_string</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol type="1"><li>
+<p>
+<span class="bold"><strong>typedef</strong></span> A <a name="boost.container.basic_string.allocator_type"></a>allocator_type;</p>
+<p>The allocator type </p>
+</li></ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id545176"></a><h3>
+<a name="boost.container.basic_stringconstruct-copy-destruct"></a><code class="computeroutput">basic_string</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id315817-bb"></a>basic_string(reserve_t, std::size_t n,
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre></li>
+<li>
+<pre class="literallayout"><a name="id315844-bb"></a>basic_string(<span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a basic_string taking the allocator as parameter.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id315877-bb"></a>basic_string(<span class="bold"><strong>const</strong></span> basic_string & s);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a basic_string.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x == *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id315920-bb"></a>basic_string(basic_string && s);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructor. Moves mx's resources to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id315962-bb"></a>basic_string(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos, size_type n = npos,
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a basic_string taking the allocator as parameter, and is initialized by a specific number of characters of the s string. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id316017-bb"></a>basic_string(<span class="bold"><strong>const</strong></span> CharT * s, size_type n,
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a basic_string taking the allocator as parameter, and is initialized by a specific number of characters of the s c-string. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id316056-bb"></a>basic_string(<span class="bold"><strong>const</strong></span> CharT * s, <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a basic_string taking the allocator as parameter, and is initialized by the null-terminated s c-string. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id316088-bb"></a>basic_string(size_type n, CharT c,
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a basic_string taking the allocator as parameter, and is initialized by n copies of c. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id316128-bb"></a>basic_string(InputIterator f, InputIterator l,
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a basic_string taking the allocator as parameter, and a range of iterators. </p>
+</li>
+<li>
+<pre class="literallayout">basic_string& <a name="id316207-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> basic_string & s);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a string.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x == *this.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements x contains. </p>
+</li>
+<li>
+<pre class="literallayout">basic_string& <a name="id316249-bb"></a><span class="bold"><strong>operator</strong></span>=(basic_string && ms);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructor. Moves mx's resources to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout">basic_string& <a name="id316291-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> CharT * s);</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout">basic_string& <a name="id316309-bb"></a><span class="bold"><strong>operator</strong></span>=(CharT c);</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><a name="id316176-bb"></a>~basic_string();</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Destroys the basic_string. All used memory is deallocated.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id545860"></a><h3>
+<a name="id311795-bb"></a><code class="computeroutput">basic_string</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id311800-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id311838-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id311878-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id311916-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id311955-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id311994-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id312033-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id312072-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id312112-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the internal allocator.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id312151-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id312190-bb"></a>length() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id312228-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id312267-bb"></a>resize(size_type n, CharT c) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts or erases elements at the end such that the size becomes n. New elements are copy constructed from x.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the difference between size() and new_size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id312323-bb"></a>resize(size_type n) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts or erases elements at the end such that the size becomes n. New elements are default constructed.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the difference between size() and new_size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id312372-bb"></a>reserve(size_type res_arg) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: If n is less than or equal to capacity(), this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation allocation throws or T's copy constructor throws. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id312414-bb"></a>capacity() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Number of elements for which memory has been allocated. capacity() is always greater than or equal to size().</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id312453-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the vector. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id312493-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the vector contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id312531-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: size() < n.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the nth element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id312587-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: size() < n.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the nth element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id312642-bb"></a>at(size_type n) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: size() < n.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the nth element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::range_error if n >= size()</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id312698-bb"></a>at(size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: size() < n.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the nth element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::range_error if n >= size()</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id312754-bb"></a><span class="bold"><strong>operator</strong></span>+=(<span class="bold"><strong>const</strong></span> basic_string & s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id312788-bb"></a><span class="bold"><strong>operator</strong></span>+=(<span class="bold"><strong>const</strong></span> CharT * s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id312818-bb"></a><span class="bold"><strong>operator</strong></span>+=(CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id312848-bb"></a>append(<span class="bold"><strong>const</strong></span> basic_string & s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id312882-bb"></a>append(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos, size_type n) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id312931-bb"></a>append(<span class="bold"><strong>const</strong></span> CharT * s, size_type n) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id312969-bb"></a>append(<span class="bold"><strong>const</strong></span> CharT * s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id312998-bb"></a>append(size_type n, CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIter>
+ <span class="type">basic_string &</span> <a name="id313035-bb"></a>append(InputIter first, InputIter last) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id313082-bb"></a>push_back(CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id313109-bb"></a>pop_back() ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313128-bb"></a>assign(<span class="bold"><strong>const</strong></span> basic_string & s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313162-bb"></a>assign(basic_string && ms) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313195-bb"></a>assign(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos, size_type n) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313244-bb"></a>assign(<span class="bold"><strong>const</strong></span> CharT * s, size_type n) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313281-bb"></a>assign(<span class="bold"><strong>const</strong></span> CharT * s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313311-bb"></a>assign(size_type n, CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIter>
+ <span class="type">basic_string &</span> <a name="id313348-bb"></a>assign(InputIter first, InputIter last) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313394-bb"></a>assign(<span class="bold"><strong>const</strong></span> CharT * f, <span class="bold"><strong>const</strong></span> CharT * l) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313432-bb"></a>insert(size_type pos, <span class="bold"><strong>const</strong></span> basic_string & s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span>
+<a name="id313473-bb"></a>insert(size_type pos, <span class="bold"><strong>const</strong></span> basic_string & s, size_type beg, size_type n) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313530-bb"></a>insert(size_type pos, <span class="bold"><strong>const</strong></span> CharT * s, size_type n) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313575-bb"></a>insert(size_type pos, <span class="bold"><strong>const</strong></span> CharT * s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313612-bb"></a>insert(size_type pos, size_type n, CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id313656-bb"></a>insert(iterator position, CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id313690-bb"></a>insert(iterator position, std::size_t n, CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIter>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id313732-bb"></a>insert(iterator p, InputIter first, InputIter last) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313783-bb"></a>erase(size_type pos = 0, size_type n = npos) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id313826-bb"></a>erase(iterator position) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id313853-bb"></a>erase(iterator first, iterator last) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id313887-bb"></a>replace(size_type pos, size_type n, <span class="bold"><strong>const</strong></span> basic_string & s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span>
+<a name="id313936-bb"></a>replace(size_type pos1, size_type n1, <span class="bold"><strong>const</strong></span> basic_string & s, size_type pos2,
+ size_type n2) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span>
+<a name="id314000-bb"></a>replace(size_type pos, size_type n1, <span class="bold"><strong>const</strong></span> CharT * s, size_type n2) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id314053-bb"></a>replace(size_type pos, size_type n1, <span class="bold"><strong>const</strong></span> CharT * s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id314098-bb"></a>replace(size_type pos, size_type n1, size_type n2, CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id314150-bb"></a>replace(iterator first, iterator last, <span class="bold"><strong>const</strong></span> basic_string & s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span>
+<a name="id314200-bb"></a>replace(iterator first, iterator last, <span class="bold"><strong>const</strong></span> CharT * s, size_type n) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id314252-bb"></a>replace(iterator first, iterator last, <span class="bold"><strong>const</strong></span> CharT * s) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string &</span> <a name="id314297-bb"></a>replace(iterator first, iterator last, size_type n, CharT c) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIter>
+ <span class="type">basic_string &</span>
+ <a name="id314350-bb"></a>replace(iterator first, iterator last, InputIter f, InputIter l) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314411-bb"></a>copy(CharT * s, size_type n, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id314456-bb"></a>swap(basic_string & x) ;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> CharT *</span> <a name="id314485-bb"></a>c_str() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: Returns a pointer to a null-terminated array of characters representing the string's contents. For any string s it is guaranteed that the first s.size() characters in the array pointed to by s.c_str() are equal to the character in s, and that s.c_str()[s.size()] is a null character. Note, however, that it not necessarily the first null character. Characters within a string are permitted to be null. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> CharT *</span> <a name="id314512-bb"></a>data() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: Returns a pointer to an array of characters, not necessarily null-terminated, representing the string's contents. data() is permitted, but not required, to be identical to c_str(). The first size() characters of that array are guaranteed to be identical to the characters in *this. The return value of data() is never a null pointer, even if size() is zero. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314538-bb"></a>find(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches for s as a substring of *this, beginning at character pos of *this. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314582-bb"></a>find(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches for a null-terminated character array as a substring of *this, beginning at character pos of *this. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314622-bb"></a>find(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos, size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches for the first n characters of s as a substring of *this, beginning at character pos of *this. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314666-bb"></a>find(CharT c, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches for the character c, beginning at character position pos. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314705-bb"></a>rfind(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward for s as a substring of *this, beginning at character position min(pos, size()) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314749-bb"></a>rfind(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward for a null-terminated character array as a substring of *this, beginning at character min(pos, size()) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314789-bb"></a>rfind(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos, size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward for the first n characters of s as a substring of *this, beginning at character position min(pos, size()). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314834-bb"></a>rfind(CharT c, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward for a null-terminated character array as a substring of *this, beginning at character min(pos, size()). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314873-bb"></a>find_first_of(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches within *this, beginning at pos, for the first character that is equal to any character within s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314918-bb"></a>find_first_of(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches within *this, beginning at pos, for the first character that is equal to any character within s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id314958-bb"></a>find_first_of(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos, size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches within *this, beginning at pos, for the first character that is equal to any character within the first n characters of s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315002-bb"></a>find_first_of(CharT c, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches within *this, beginning at pos, for the first character that is equal to c. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315042-bb"></a>find_last_of(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward within *this, beginning at min(pos, size()), for the first character that is equal to any character within s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315087-bb"></a>find_last_of(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward *this, beginning at min(pos, size()), for the first character that is equal to any character within s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315127-bb"></a>find_last_of(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos, size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward within *this, beginning at min(pos, size()), for the first character that is equal to any character within the first n characters of s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315172-bb"></a>find_last_of(CharT c, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward *this, beginning at min(pos, size()), for the first character that is equal to c. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315212-bb"></a>find_first_not_of(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches within *this, beginning at pos, for the first character that is not equal to any character within s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315256-bb"></a>find_first_not_of(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches within *this, beginning at pos, for the first character that is not equal to any character within s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315296-bb"></a>find_first_not_of(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos, size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches within *this, beginning at pos, for the first character that is not equal to any character within the first n characters of s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315342-bb"></a>find_first_not_of(CharT c, size_type pos = 0) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches within *this, beginning at pos, for the first character that is not equal to c. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315381-bb"></a>find_last_not_of(<span class="bold"><strong>const</strong></span> basic_string & s, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward within *this, beginning at min(pos, size()), for the first character that is not equal to any character within s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315426-bb"></a>find_last_not_of(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward *this, beginning at min(pos, size()), for the first character that is not equal to any character within s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315466-bb"></a>find_last_not_of(<span class="bold"><strong>const</strong></span> CharT * s, size_type pos, size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward within *this, beginning at min(pos, size()), for the first character that is not equal to any character within the first n characters of s. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id315512-bb"></a>find_last_not_of(CharT c, size_type pos = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Searches backward *this, beginning at min(pos, size()), for the first character that is not equal to c. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">basic_string</span> <a name="id315552-bb"></a>substr(size_type pos = 0, size_type n = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>int</strong></span></span> <a name="id315593-bb"></a>compare(<span class="bold"><strong>const</strong></span> basic_string & s) <span class="bold"><strong>const</strong></span>;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>int</strong></span></span> <a name="id315624-bb"></a>compare(size_type pos1, size_type n1, <span class="bold"><strong>const</strong></span> basic_string & s) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Three-way lexicographical comparison of s and a substring of *this. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>int</strong></span></span> <a name="id315672-bb"></a>compare(size_type pos1, size_type n1, <span class="bold"><strong>const</strong></span> basic_string & s,
+ size_type pos2, size_type n2) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Three-way lexicographical comparison of a substring of s and a substring of *this. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>int</strong></span></span> <a name="id315736-bb"></a>compare(<span class="bold"><strong>const</strong></span> CharT * s) <span class="bold"><strong>const</strong></span>;</pre>
+<span class="bold"><strong>Effects</strong></span>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>int</strong></span></span> <a name="id315762-bb"></a>compare(size_type pos1, size_type n1, <span class="bold"><strong>const</strong></span> CharT * s,
+ size_type n2 = npos) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Three-way lexicographical comparison of the first min(len, traits::length(s) characters of s and a substring of *this. </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="stable_vector.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.string_hpp"><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="string.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/deque.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/deque.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,192 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template deque</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.deque_hpp" title="Header <boost/container/deque.hpp>">
+<link rel="prev" href="ordered_unique_range.html" title="Global ordered_unique_range">
+<link rel="next" href="flat_map.html" title="Class template flat_map">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_unique_range.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.deque_hpp"><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="flat_map.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.deque"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template deque</span></h2>
+<p>boost::container::deque — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> deque {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> Base::iterator <a name="boost.container.deque.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> Base::const_iterator <a name="boost.container.deque.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< const_iterator > <a name="boost.container.deque.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< iterator > <a name="boost.container.deque.reverse_iterator"></a>reverse_iterator;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ deque(<span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ deque(<span class="bold"><strong>const</strong></span> deque &);
+ deque(deque &&);
+ deque(size_type, <span class="bold"><strong>const</strong></span> value_type &,
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ deque(size_type);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt>
+ deque(InpIt, InpIt, <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ deque& operator=(<span class="bold"><strong>const</strong></span> deque &);
+ deque& operator=(deque &&);
+ ~deque();
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> operator[](size_type) ;
+ <span class="type">const_reference</span> operator[](size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> priv_range_check(size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> at(size_type) ;
+ <span class="type">const_reference</span> at(size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> front() ;
+ <span class="type">reference</span> back() ;
+ <span class="type">const_reference</span> front() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reference</span> back() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(deque &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> assign(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <span class="type"><span class="bold"><strong>void</strong></span></span> assign(InpIt, InpIt) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(value_type &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_front(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_front(value_type &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_back() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_front() ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(const_iterator, value_type &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, size_type, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, InpIt, InpIt) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> emplace_back(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> emplace_front(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(const_iterator, Args &&...) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id479416"></a><h2>Description</h2>
+<p>Deque class </p>
+<div class="refsect2" lang="en">
+<a name="id479423"></a><h3>
+<a name="boost.container.dequeconstruct-copy-destruct"></a><code class="computeroutput">deque</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id279240-bb"></a>deque(<span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre></li>
+<li><pre class="literallayout"><a name="id279252-bb"></a>deque(<span class="bold"><strong>const</strong></span> deque & x);</pre></li>
+<li><pre class="literallayout"><a name="id279265-bb"></a>deque(deque && mx);</pre></li>
+<li><pre class="literallayout"><a name="id279277-bb"></a>deque(size_type n, <span class="bold"><strong>const</strong></span> value_type & value,
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre></li>
+<li><pre class="literallayout"><a name="id279305-bb"></a>deque(size_type n);</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt>
+ <a name="id279314-bb"></a>deque(InpIt first, InpIt last, <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre></li>
+<li><pre class="literallayout">deque& <a name="id279352-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> deque & x);</pre></li>
+<li><pre class="literallayout">deque& <a name="id279365-bb"></a><span class="bold"><strong>operator</strong></span>=(deque && x);</pre></li>
+<li><pre class="literallayout"><a name="id279350-bb"></a>~deque();</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id479733"></a><h3>
+<a name="id155784-bb"></a><code class="computeroutput">deque</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="type">allocator_type</span> <a name="id155789-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id155799-bb"></a>begin() ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id155809-bb"></a>end() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id155819-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id155828-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id155838-bb"></a>rbegin() ;</pre></li>
+<li><pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id155848-bb"></a>rend() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id155858-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id245031-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id245041-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id245051-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id245061-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id245071-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id245081-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id245098-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245116-bb"></a>priv_range_check(size_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id245133-bb"></a>at(size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id245151-bb"></a>at(size_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id245168-bb"></a>front() ;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id245178-bb"></a>back() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id245188-bb"></a>front() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id245198-bb"></a>back() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">size_type</span> <a name="id245208-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">size_type</span> <a name="id245217-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id245227-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245237-bb"></a>swap(deque & x) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245257-bb"></a>assign(size_type n, <span class="bold"><strong>const</strong></span> T & val) ;</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245282-bb"></a>assign(InpIt first, InpIt last) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245316-bb"></a>push_back(<span class="bold"><strong>const</strong></span> value_type & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245333-bb"></a>push_back(value_type && t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245350-bb"></a>push_front(<span class="bold"><strong>const</strong></span> value_type & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245368-bb"></a>push_front(value_type && t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245385-bb"></a>pop_back() ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id245395-bb"></a>pop_front() ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id245405-bb"></a>insert(const_iterator position, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id278950-bb"></a>insert(const_iterator position, value_type && mx) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id278975-bb"></a>insert(const_iterator pos, size_type n, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id279007-bb"></a>insert(const_iterator pos, InpIt first, InpIt last) ;</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id279048-bb"></a>emplace_back(Args &&... args) ;</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id279078-bb"></a>emplace_front(Args &&... args) ;</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id279108-bb"></a>emplace(const_iterator p, Args &&... args) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id279145-bb"></a>resize(size_type new_size, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id279170-bb"></a>resize(size_type new_size) ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id279188-bb"></a>erase(const_iterator pos) ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id279205-bb"></a>erase(const_iterator first, const_iterator last) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id279230-bb"></a>clear() ;</pre></li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_unique_range.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.deque_hpp"><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="flat_map.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/flat_map.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/flat_map.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,490 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template flat_map</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.flat_map_hpp" title="Header <boost/container/flat_map.hpp>">
+<link rel="prev" href="deque.html" title="Class template deque">
+<link rel="next" href="flat_multimap.html" title="Class template flat_multimap">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="deque.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.flat_map_hpp"><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="flat_multimap.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.flat_map"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template flat_map</span></h2>
+<p>boost::container::flat_map — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> flat_map {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_type <a name="boost.container.flat_map.key_type"></a>key_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_type <a name="boost.container.flat_map.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::pointer <a name="boost.container.flat_map.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_pointer <a name="boost.container.flat_map.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reference <a name="boost.container.flat_map.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reference <a name="boost.container.flat_map.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_compare <a name="boost.container.flat_map.value_compare"></a>value_compare;
+ <span class="bold"><strong>typedef</strong></span> T <a name="boost.container.flat_map.mapped_type"></a>mapped_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_compare <a name="boost.container.flat_map.key_compare"></a>key_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::iterator <a name="boost.container.flat_map.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_iterator <a name="boost.container.flat_map.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reverse_iterator <a name="boost.container.flat_map.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reverse_iterator <a name="boost.container.flat_map.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::size_type <a name="boost.container.flat_map.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::difference_type <a name="boost.container.flat_map.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::allocator_type <a name="boost.container.flat_map.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::stored_allocator_type <a name="boost.container.flat_map.stored_allocator_type"></a>stored_allocator_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ flat_map(<span class="bold"><strong>const</strong></span> Pred & = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ flat_map(InputIterator, InputIterator, <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ flat_map(ordered_unique_range_t, InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ flat_map(<span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > &);
+ flat_map(flat_map &&);
+ flat_map& operator=(<span class="bold"><strong>const</strong></span> flat_map &);
+ flat_map& operator=(flat_map &&);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">key_compare</span> key_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">value_compare</span> value_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">T &</span> operator[](<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">T &</span> operator[](key_type &&) ;
+ <span class="type">T &</span> at(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type"><span class="bold"><strong>const</strong></span> T &</span> at(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(flat_map &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(value_type &&) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(impl_value_type &&) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(const_iterator, value_type &&) ;
+ <span class="type">iterator</span> insert(const_iterator, impl_value_type &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_hint(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">size_type</span> erase(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> shrink_to_fit() ;
+ <span class="type">iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> count(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< iterator, iterator ></span> equal_range(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">std::pair< const_iterator, const_iterator ></span>
+ equal_range(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> capacity() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reserve(size_type) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id484194"></a><h2>Description</h2>
+<p>A flat_map is a kind of associative container that supports unique keys (contains at most one of each key value) and provides for fast retrieval of values of another type T based on the keys. The flat_map class supports random-access iterators.</p>
+<p>A flat_map satisfies all of the requirements of a container and of a reversible container and of an associative container. A flat_map also provides most operations described for unique keys. For a flat_map<Key,T> the key_type is Key and the value_type is std::pair<Key,T> (unlike std::map<Key, T> which value_type is std::pair<<span class="bold"><strong>const</strong></span> Key, T>).</p>
+<p>Pred is the ordering function for Keys (e.g. std::less<Key>).</p>
+<p>Alloc is the allocator to allocate the value_types (e.g. allocator< std::pair<Key, T> >).</p>
+<p>flat_map is similar to std::map but it's implemented like an ordered vector. This means that inserting a new element into a flat_map invalidates previous iterators and references</p>
+<p>Erasing an element of a flat_map invalidates iterators and references pointing to elements that come after (their keys are bigger) the erased element. </p>
+<div class="refsect2" lang="en">
+<a name="id484242"></a><h3>
+<a name="boost.container.flat_mapconstruct-copy-destruct"></a><code class="computeroutput">flat_map</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id282081-bb"></a>flat_map(<span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_map using the specified comparison object and allocator.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id282124-bb"></a>flat_map(InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_map using the specified comparison object and allocator, and inserts elements from the range [first ,last ).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id282194-bb"></a>flat_map(ordered_unique_range_t, InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_map using the specified comparison object and allocator, and inserts elements from the ordered unique range [first ,last). This function is more efficient than the normal range creation for ordered ranges.</p>
+<p><span class="bold"><strong>Requires</strong></span>: [first ,last) must be ordered according to the predicate and must be unique values.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id282282-bb"></a>flat_map(<span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a flat_map.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id282316-bb"></a>flat_map(flat_map && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a flat_map. Constructs *this using x's resources.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Construct.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x is emptied. </p>
+</li>
+<li>
+<pre class="literallayout">flat_map& <a name="id282358-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> flat_map & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this a copy of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout">flat_map& <a name="id282391-bb"></a><span class="bold"><strong>operator</strong></span>=(flat_map && mx);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a flat_map. Constructs *this using x's resources.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Construct.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x is emptied. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id484690"></a><h3>
+<a name="id279915-bb"></a><code class="computeroutput">flat_map</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">key_compare</span> <a name="id279919-bb"></a>key_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the comparison object out of which a was constructed.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">value_compare</span> <a name="id279950-bb"></a>value_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an object of value_compare constructed out of the comparison object.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id279980-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator that was passed to the object's constructor.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id280010-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id280021-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id280031-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id280070-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id280109-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id280148-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id280187-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id280226-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id280264-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id280304-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id280343-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id280382-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id280422-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id280461-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id280500-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id280539-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id280578-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">T &</span> <a name="id280616-bb"></a><span class="bold"><strong>operator</strong></span>[](<span class="bold"><strong>const</strong></span> key_type & k) ;</pre>
+<p>Effects: If there is no key equivalent to x in the flat_map, inserts value_type(x, T()) into the flat_map.</p>
+<p>Returns: A reference to the mapped_type corresponding to x in *this.</p>
+<p>Complexity: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">T &</span> <a name="id280648-bb"></a><span class="bold"><strong>operator</strong></span>[](key_type && mk) ;</pre>
+<p>Effects: If there is no key equivalent to x in the flat_map, inserts value_type(move(x), T()) into the flat_map (the key is move-constructed)</p>
+<p>Returns: A reference to the mapped_type corresponding to x in *this.</p>
+<p>Complexity: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">T &</span> <a name="id280679-bb"></a>at(<span class="bold"><strong>const</strong></span> key_type & k) ;</pre>
+<p>Returns: A reference to the element whose key is equivalent to x. Throws: An exception object of type out_of_range if no such element is present. Complexity: logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> T &</span> <a name="id280704-bb"></a>at(<span class="bold"><strong>const</strong></span> key_type & k) <span class="bold"><strong>const</strong></span>;</pre>
+<p>Returns: A reference to the element whose key is equivalent to x. Throws: An exception object of type out_of_range if no such element is present. Complexity: logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id280728-bb"></a>swap(flat_map & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id280776-bb"></a>insert(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts x if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id280836-bb"></a>insert(value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id280898-bb"></a>insert(impl_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id280960-bb"></a>insert(const_iterator position, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container if and only if there is no element in the container with key equivalent to the key of x. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id281029-bb"></a>insert(const_iterator position, value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an element move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id281094-bb"></a>insert(const_iterator position, impl_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an element move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id281162-bb"></a>insert(InputIterator first, InputIterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: i, j are not iterators into *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: inserts each element from the range [i,j) if and only if there is no element with key equivalent to the key of that element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: N log(size()+N) (N is the distance from i to j) search time plus N*size() insertion time.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id281237-bb"></a>emplace(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id281311-bb"></a>emplace_hint(const_iterator hint, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the container if and only if there is no element in the container with key equivalent to the key of x. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id281393-bb"></a>erase(const_iterator position) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by position.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns end().</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements with keys bigger than position</p>
+<p><span class="bold"><strong>Note</strong></span>: Invalidates elements with keys not less than the erased element. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id281452-bb"></a>erase(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all elements in the container with key equivalent to x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns the number of erased elements.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus erasure time linear to the elements with bigger keys. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id281500-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements in the range [first, last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: size()*N where N is the distance from first to last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus erasure time linear to the elements with bigger keys. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id281565-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: erase(a.begin(),a.end()).</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: size() == 0.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: linear in size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id281603-bb"></a>shrink_to_fit() ;</pre>
+<span class="bold"><strong>Effects</strong></span><p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id281643-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id281681-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const_iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.s </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id281720-bb"></a>count(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The number of elements with key equivalent to x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id281758-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id281796-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id281835-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id281874-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, iterator ></span> <a name="id281912-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< const_iterator, const_iterator ></span>
+<a name="id281950-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id281989-bb"></a>capacity() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Number of elements for which memory has been allocated. capacity() is always greater than or equal to size().</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id282029-bb"></a>reserve(size_type count) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: If n is less than or equal to capacity(), this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Note</strong></span>: If capacity() is less than "count", iterators and references to to values might be invalidated. </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="deque.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.flat_map_hpp"><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="flat_multimap.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/flat_multimap.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/flat_multimap.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,432 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template flat_multimap</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.flat_map_hpp" title="Header <boost/container/flat_map.hpp>">
+<link rel="prev" href="flat_map.html" title="Class template flat_map">
+<link rel="next" href="flat_set.html" title="Class template flat_set">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="flat_map.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.flat_map_hpp"><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="flat_set.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.flat_multimap"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template flat_multimap</span></h2>
+<p>boost::container::flat_multimap — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> flat_multimap {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_type <a name="boost.container.flat_multimap.key_type"></a>key_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_type <a name="boost.container.flat_multimap.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::pointer <a name="boost.container.flat_multimap.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_pointer <a name="boost.container.flat_multimap.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reference <a name="boost.container.flat_multimap.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reference <a name="boost.container.flat_multimap.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_compare <a name="boost.container.flat_multimap.value_compare"></a>value_compare;
+ <span class="bold"><strong>typedef</strong></span> T <a name="boost.container.flat_multimap.mapped_type"></a>mapped_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_compare <a name="boost.container.flat_multimap.key_compare"></a>key_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::iterator <a name="boost.container.flat_multimap.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_iterator <a name="boost.container.flat_multimap.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reverse_iterator <a name="boost.container.flat_multimap.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reverse_iterator <a name="boost.container.flat_multimap.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::size_type <a name="boost.container.flat_multimap.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::difference_type <a name="boost.container.flat_multimap.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::allocator_type <a name="boost.container.flat_multimap.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::stored_allocator_type <a name="boost.container.flat_multimap.stored_allocator_type"></a>stored_allocator_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ flat_multimap(<span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ flat_multimap(InputIterator, InputIterator, <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ flat_multimap(ordered_range_t, InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ flat_multimap(<span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > &);
+ flat_multimap(flat_multimap &&);
+ flat_multimap& operator=(<span class="bold"><strong>const</strong></span> flat_multimap &);
+ flat_multimap& operator=(flat_multimap &&);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">key_compare</span> key_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">value_compare</span> value_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(flat_multimap &) ;
+ <span class="type">iterator</span> insert(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(value_type &&) ;
+ <span class="type">iterator</span> insert(impl_value_type &&) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(const_iterator, value_type &&) ;
+ <span class="type">iterator</span> insert(const_iterator, impl_value_type &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_hint(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">size_type</span> erase(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> shrink_to_fit() ;
+ <span class="type">iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> count(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< iterator, iterator ></span> equal_range(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">std::pair< const_iterator, const_iterator ></span>
+ equal_range(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> capacity() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reserve(size_type) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id488920"></a><h2>Description</h2>
+<p>A flat_multimap is a kind of associative container that supports equivalent keys (possibly containing multiple copies of the same key value) and provides for fast retrieval of values of another type T based on the keys. The flat_multimap class supports random-access iterators.</p>
+<p>A flat_multimap satisfies all of the requirements of a container and of a reversible container and of an associative container. For a flat_multimap<Key,T> the key_type is Key and the value_type is std::pair<Key,T> (unlike std::multimap<Key, T> which value_type is std::pair<<span class="bold"><strong>const</strong></span> Key, T>).</p>
+<p>Pred is the ordering function for Keys (e.g. std::less<Key>).</p>
+<p>Alloc is the allocator to allocate the value_types (e.g. allocator< std::pair<Key, T> >). </p>
+<div class="refsect2" lang="en">
+<a name="id488956"></a><h3>
+<a name="boost.container.flat_multimapconstruct-copy-destruct"></a><code class="computeroutput">flat_multimap</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id284473-bb"></a>flat_multimap(<span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_multimap using the specified comparison object and allocator.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id284517-bb"></a>flat_multimap(InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_multimap using the specified comparison object and allocator, and inserts elements from the range [first ,last ).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id284587-bb"></a>flat_multimap(ordered_range_t, InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_multimap using the specified comparison object and allocator, and inserts elements from the ordered range [first ,last). This function is more efficient than the normal range creation for ordered ranges.</p>
+<p><span class="bold"><strong>Requires</strong></span>: [first ,last) must be ordered according to the predicate.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id284674-bb"></a>flat_multimap(<span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a flat_multimap.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id284708-bb"></a>flat_multimap(flat_multimap && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a flat_multimap. Constructs *this using x's resources.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Construct.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x is emptied. </p>
+</li>
+<li>
+<pre class="literallayout">flat_multimap& <a name="id284750-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> flat_multimap & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this a copy of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout">flat_multimap& <a name="id284783-bb"></a><span class="bold"><strong>operator</strong></span>=(flat_multimap && mx);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: this->swap(x.get()).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id489400"></a><h3>
+<a name="id282623-bb"></a><code class="computeroutput">flat_multimap</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">key_compare</span> <a name="id282627-bb"></a>key_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the comparison object out of which a was constructed.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">value_compare</span> <a name="id282657-bb"></a>value_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an object of value_compare constructed out of the comparison object.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id282688-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator that was passed to the object's constructor.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id282718-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id282728-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id282739-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id282778-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id282817-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id282855-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id282894-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id282933-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id282973-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id283012-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id283051-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id283090-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id283129-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id283168-bb"></a>swap(flat_multimap & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id283218-bb"></a>insert(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id283267-bb"></a>insert(value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value move-constructed from x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id283316-bb"></a>insert(impl_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value move-constructed from x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id283365-bb"></a>insert(const_iterator position, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant time if the value is to be inserted before p) plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id283433-bb"></a>insert(const_iterator position, value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a value move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant time if the value is to be inserted before p) plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id283501-bb"></a>insert(const_iterator position, impl_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a value move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant time if the value is to be inserted before p) plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id283569-bb"></a>insert(InputIterator first, InputIterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: i, j are not iterators into *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: inserts each element from the range [i,j) .</p>
+<p><span class="bold"><strong>Complexity</strong></span>: N log(size()+N) (N is the distance from i to j) search time plus N*size() insertion time.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id283642-bb"></a>emplace(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id283704-bb"></a>emplace_hint(const_iterator hint, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant time if the value is to be inserted before p) plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id283785-bb"></a>erase(const_iterator position) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by position.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns end().</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements with keys bigger than position</p>
+<p><span class="bold"><strong>Note</strong></span>: Invalidates elements with keys not less than the erased element. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id283844-bb"></a>erase(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all elements in the container with key equivalent to x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns the number of erased elements.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus erasure time linear to the elements with bigger keys. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id283892-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements in the range [first, last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: size()*N where N is the distance from first to last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus erasure time linear to the elements with bigger keys. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id283957-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: erase(a.begin(),a.end()).</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: size() == 0.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: linear in size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id283995-bb"></a>shrink_to_fit() ;</pre>
+<span class="bold"><strong>Effects</strong></span><p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id284035-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id284074-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An const_iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id284112-bb"></a>count(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The number of elements with key equivalent to x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id284150-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id284188-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id284227-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id284266-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, iterator ></span> <a name="id284304-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< const_iterator, const_iterator ></span>
+<a name="id284342-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id284381-bb"></a>capacity() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Number of elements for which memory has been allocated. capacity() is always greater than or equal to size().</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id284421-bb"></a>reserve(size_type count) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: If n is less than or equal to capacity(), this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Note</strong></span>: If capacity() is less than "count", iterators and references to to values might be invalidated. </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="flat_map.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.flat_map_hpp"><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="flat_set.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/flat_multiset.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/flat_multiset.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,418 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template flat_multiset</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.flat_set_hpp" title="Header <boost/container/flat_set.hpp>">
+<link rel="prev" href="flat_set.html" title="Class template flat_set">
+<link rel="next" href="list.html" title="Class template list">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="flat_set.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.flat_set_hpp"><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="list.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.flat_multiset"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template flat_multiset</span></h2>
+<p>boost::container::flat_multiset — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> flat_multiset {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_type <a name="boost.container.flat_multiset.key_type"></a>key_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_type <a name="boost.container.flat_multiset.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::pointer <a name="boost.container.flat_multiset.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_pointer <a name="boost.container.flat_multiset.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reference <a name="boost.container.flat_multiset.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reference <a name="boost.container.flat_multiset.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_compare <a name="boost.container.flat_multiset.key_compare"></a>key_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_compare <a name="boost.container.flat_multiset.value_compare"></a>value_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::iterator <a name="boost.container.flat_multiset.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_iterator <a name="boost.container.flat_multiset.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reverse_iterator <a name="boost.container.flat_multiset.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reverse_iterator <a name="boost.container.flat_multiset.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::size_type <a name="boost.container.flat_multiset.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::difference_type <a name="boost.container.flat_multiset.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::allocator_type <a name="boost.container.flat_multiset.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::stored_allocator_type <a name="boost.container.flat_multiset.stored_allocator_type"></a>stored_allocator_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ flat_multiset(<span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ flat_multiset(InputIterator, InputIterator, <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ flat_multiset(ordered_range_t, InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ flat_multiset(<span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > &);
+ flat_multiset(flat_multiset &&);
+ flat_multiset& operator=(<span class="bold"><strong>const</strong></span> flat_multiset &);
+ flat_multiset& operator=(flat_multiset &&);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">key_compare</span> key_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">value_compare</span> value_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(flat_multiset &) ;
+ <span class="type">iterator</span> insert(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(value_type &&) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(const_iterator, value_type &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_hint(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">size_type</span> erase(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> shrink_to_fit() ;
+ <span class="type">iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> count(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< const_iterator, const_iterator ></span>
+ equal_range(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< iterator, iterator ></span> equal_range(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">size_type</span> capacity() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reserve(size_type) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id498943"></a><h2>Description</h2>
+<p>flat_multiset is a Sorted Associative Container that stores objects of type Key. flat_multiset is a Simple Associative Container, meaning that its value type, as well as its key type, is Key. flat_Multiset can store multiple copies of the same key value.</p>
+<p>flat_multiset is similar to std::multiset but it's implemented like an ordered vector. This means that inserting a new element into a flat_multiset invalidates previous iterators and references</p>
+<p>Erasing an element of a flat_multiset invalidates iterators and references pointing to elements that come after (their keys are equal or bigger) the erased element. </p>
+<div class="refsect2" lang="en">
+<a name="id498962"></a><h3>
+<a name="boost.container.flat_multisetconstruct-copy-destruct"></a><code class="computeroutput">flat_multiset</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id290145-bb"></a>flat_multiset(<span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id290168-bb"></a>flat_multiset(InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre></li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id290215-bb"></a>flat_multiset(ordered_range_t, InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_multiset using the specified comparison object and allocator, and inserts elements from the ordered range [first ,last ). This function is more efficient than the normal range creation for ordered ranges.</p>
+<p><span class="bold"><strong>Requires</strong></span>: [first ,last) must be ordered according to the predicate.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N. </p>
+</li>
+<li><pre class="literallayout"><a name="id290302-bb"></a>flat_multiset(<span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & x);</pre></li>
+<li><pre class="literallayout"><a name="id290316-bb"></a>flat_multiset(flat_multiset && x);</pre></li>
+<li><pre class="literallayout">flat_multiset& <a name="id290328-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> flat_multiset & x);</pre></li>
+<li><pre class="literallayout">flat_multiset& <a name="id290342-bb"></a><span class="bold"><strong>operator</strong></span>=(flat_multiset && mx);</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id499296"></a><h3>
+<a name="id288256-bb"></a><code class="computeroutput">flat_multiset</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">key_compare</span> <a name="id288260-bb"></a>key_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the comparison object out of which a was constructed.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">value_compare</span> <a name="id288290-bb"></a>value_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an object of value_compare constructed out of the comparison object.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id288321-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator that was passed to the object's constructor.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id288351-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id288362-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id288372-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id288411-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id288450-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id288489-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id288528-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id288566-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id288605-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id288644-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id288684-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id288723-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id288762-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id288802-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id288841-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id288880-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id288918-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id288957-bb"></a>swap(flat_multiset & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289007-bb"></a>insert(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289056-bb"></a>insert(value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value_type move constructed from x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289106-bb"></a>insert(const_iterator position, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289173-bb"></a>insert(const_iterator position, value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id289241-bb"></a>insert(InputIterator first, InputIterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: i, j are not iterators into *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: inserts each element from the range [i,j) .</p>
+<p><span class="bold"><strong>Complexity</strong></span>: N log(size()+N) (N is the distance from i to j) search time plus N*size() insertion time.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id289315-bb"></a>emplace(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id289377-bb"></a>emplace_hint(const_iterator hint, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289458-bb"></a>erase(const_iterator position) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by position.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns end().</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements with keys bigger than position</p>
+<p><span class="bold"><strong>Note</strong></span>: Invalidates elements with keys not less than the erased element. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id289516-bb"></a>erase(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all elements in the container with key equivalent to x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns the number of erased elements.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus erasure time linear to the elements with bigger keys. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289565-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements in the range [first, last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: size()*N where N is the distance from first to last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus erasure time linear to the elements with bigger keys. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id289629-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: erase(a.begin(),a.end()).</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: size() == 0.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: linear in size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id289668-bb"></a>shrink_to_fit() ;</pre>
+<span class="bold"><strong>Effects</strong></span><p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289707-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id289746-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const_iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.s </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id289784-bb"></a>count(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The number of elements with key equivalent to x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289822-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id289861-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id289899-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id289938-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< const_iterator, const_iterator ></span>
+<a name="id289976-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, iterator ></span> <a name="id290015-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id290053-bb"></a>capacity() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Number of elements for which memory has been allocated. capacity() is always greater than or equal to size().</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id290093-bb"></a>reserve(size_type count) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: If n is less than or equal to capacity(), this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Note</strong></span>: If capacity() is less than "count", iterators and references to to values might be invalidated. </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="flat_set.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.flat_set_hpp"><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="list.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/flat_set.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/flat_set.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,445 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template flat_set</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.flat_set_hpp" title="Header <boost/container/flat_set.hpp>">
+<link rel="prev" href="flat_multimap.html" title="Class template flat_multimap">
+<link rel="next" href="flat_multiset.html" title="Class template flat_multiset">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="flat_multimap.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.flat_set_hpp"><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="flat_multiset.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.flat_set"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template flat_set</span></h2>
+<p>boost::container::flat_set — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> flat_set {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_type <a name="boost.container.flat_set.key_type"></a>key_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_type <a name="boost.container.flat_set.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::pointer <a name="boost.container.flat_set.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_pointer <a name="boost.container.flat_set.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reference <a name="boost.container.flat_set.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reference <a name="boost.container.flat_set.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_compare <a name="boost.container.flat_set.key_compare"></a>key_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_compare <a name="boost.container.flat_set.value_compare"></a>value_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::iterator <a name="boost.container.flat_set.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_iterator <a name="boost.container.flat_set.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reverse_iterator <a name="boost.container.flat_set.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reverse_iterator <a name="boost.container.flat_set.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::size_type <a name="boost.container.flat_set.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::difference_type <a name="boost.container.flat_set.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::allocator_type <a name="boost.container.flat_set.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::stored_allocator_type <a name="boost.container.flat_set.stored_allocator_type"></a>stored_allocator_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ flat_set(<span class="bold"><strong>const</strong></span> Pred & = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ flat_set(InputIterator, InputIterator, <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ flat_set(ordered_unique_range_t, InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ flat_set(<span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > &);
+ flat_set(flat_set &&);
+ flat_set& operator=(<span class="bold"><strong>const</strong></span> flat_set &);
+ flat_set& operator=(flat_set &&);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">key_compare</span> key_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">value_compare</span> value_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(flat_set &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(value_type &&) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(const_iterator, value_type &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_hint(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">size_type</span> erase(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> shrink_to_fit() ;
+ <span class="type">iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> count(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< const_iterator, const_iterator ></span>
+ equal_range(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< iterator, iterator ></span> equal_range(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">size_type</span> capacity() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reserve(size_type) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id494496"></a><h2>Description</h2>
+<p>flat_set is a Sorted Associative Container that stores objects of type Key. flat_set is a Simple Associative Container, meaning that its value type, as well as its key type, is Key. It is also a Unique Associative Container, meaning that no two elements are the same.</p>
+<p>flat_set is similar to std::set but it's implemented like an ordered vector. This means that inserting a new element into a flat_set invalidates previous iterators and references</p>
+<p>Erasing an element of a flat_set invalidates iterators and references pointing to elements that come after (their keys are bigger) the erased element. </p>
+<div class="refsect2" lang="en">
+<a name="id494518"></a><h3>
+<a name="boost.container.flat_setconstruct-copy-destruct"></a><code class="computeroutput">flat_set</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id287749-bb"></a>flat_set(<span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_map using the specified comparison object and allocator.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id287792-bb"></a>flat_set(InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the range [first ,last ).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id287862-bb"></a>flat_set(ordered_unique_range_t, InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty flat_set using the specified comparison object and allocator, and inserts elements from the ordered unique range [first ,last). This function is more efficient than the normal range creation for ordered ranges.</p>
+<p><span class="bold"><strong>Requires</strong></span>: [first ,last) must be ordered according to the predicate and must be unique values.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id287950-bb"></a>flat_set(<span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a map.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id287984-bb"></a>flat_set(flat_set && mx);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a map. Constructs *this using x's resources.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Construct.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x is emptied. </p>
+</li>
+<li>
+<pre class="literallayout">flat_set& <a name="id288025-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> flat_set & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this a copy of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout">flat_set& <a name="id288058-bb"></a><span class="bold"><strong>operator</strong></span>=(flat_set && mx);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this a copy of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id494960"></a><h3>
+<a name="id285818-bb"></a><code class="computeroutput">flat_set</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">key_compare</span> <a name="id285822-bb"></a>key_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the comparison object out of which a was constructed.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">value_compare</span> <a name="id285852-bb"></a>value_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an object of value_compare constructed out of the comparison object.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id285883-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator that was passed to the object's constructor.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id285913-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id285924-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id285934-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id285973-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id286012-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id286051-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id286090-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id286128-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id286167-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id286206-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id286246-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id286285-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id286324-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id286364-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id286403-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id286442-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id286480-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id286519-bb"></a>swap(flat_set & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id286569-bb"></a>insert(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts x if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id286631-bb"></a>insert(value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id286693-bb"></a>insert(const_iterator position, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container if and only if there is no element in the container with key equivalent to the key of x. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id286762-bb"></a>insert(const_iterator position, value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an element move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id286829-bb"></a>insert(InputIterator first, InputIterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: i, j are not iterators into *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: inserts each element from the range [i,j) if and only if there is no element with key equivalent to the key of that element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: N log(size()+N) (N is the distance from i to j) search time plus N*size() insertion time.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id286905-bb"></a>emplace(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus linear insertion to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id286979-bb"></a>emplace_hint(const_iterator hint, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the container if and only if there is no element in the container with key equivalent to the key of x. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time (constant if x is inserted right before p) plus insertion linear to the elements with bigger keys than x.</p>
+<p><span class="bold"><strong>Note</strong></span>: If an element it's inserted it might invalidate elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id287061-bb"></a>erase(const_iterator position) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by position.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns end().</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements with keys bigger than position</p>
+<p><span class="bold"><strong>Note</strong></span>: Invalidates elements with keys not less than the erased element. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id287120-bb"></a>erase(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all elements in the container with key equivalent to x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns the number of erased elements.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus erasure time linear to the elements with bigger keys. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id287168-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements in the range [first, last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: size()*N where N is the distance from first to last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic search time plus erasure time linear to the elements with bigger keys. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id287232-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: erase(a.begin(),a.end()).</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: size() == 0.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: linear in size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id287271-bb"></a>shrink_to_fit() ;</pre>
+<span class="bold"><strong>Effects</strong></span><p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id287310-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id287349-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const_iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic.s </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id287388-bb"></a>count(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The number of elements with key equivalent to x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id287425-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id287464-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id287503-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id287541-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< const_iterator, const_iterator ></span>
+<a name="id287580-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, iterator ></span> <a name="id287618-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id287657-bb"></a>capacity() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Number of elements for which memory has been allocated. capacity() is always greater than or equal to size().</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id287696-bb"></a>reserve(size_type count) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: If n is less than or equal to capacity(), this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Note</strong></span>: If capacity() is less than "count", iterators and references to to values might be invalidated. </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="flat_multimap.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.flat_set_hpp"><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="flat_multiset.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/list.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/list.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,583 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template list</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.list_hpp" title="Header <boost/container/list.hpp>">
+<link rel="prev" href="flat_multiset.html" title="Class template flat_multiset">
+<link rel="next" href="map.html" title="Class template map">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="flat_multiset.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.list_hpp"><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="map.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.list"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template list</span></h2>
+<p>boost::container::list — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+<span class="bold"><strong>class</strong></span> list {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> T value_type;
+ <span class="bold"><strong>typedef</strong></span> A::pointer <a name="boost.container.list.pointer"></a>pointer; <span class="emphasis"><em>// Pointer to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::const_pointer <a name="boost.container.list.const_pointer"></a>const_pointer; <span class="emphasis"><em>// Const pointer to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::reference <a name="boost.container.list.reference"></a>reference; <span class="emphasis"><em>// Reference to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::const_reference <a name="boost.container.list.const_reference"></a>const_reference; <span class="emphasis"><em>// Const reference to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::size_type <a name="boost.container.list.size_type"></a>size_type; <span class="emphasis"><em>// An unsigned integral type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::difference_type <a name="boost.container.list.difference_type"></a>difference_type; <span class="emphasis"><em>// A signed integral type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A <a name="boost.container.list.allocator_type"></a>allocator_type; <span class="emphasis"><em>// The allocator type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> NodeAlloc <a name="boost.container.list.stored_allocator_type"></a>stored_allocator_type; <span class="emphasis"><em>// The stored allocator type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< const_iterator > const_reverse_iterator;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ list(<span class="bold"><strong>const</strong></span> allocator_type & = A());
+ list(size_type);
+ list(size_type, <span class="bold"><strong>const</strong></span> T &, <span class="bold"><strong>const</strong></span> A & = A());
+ list(<span class="bold"><strong>const</strong></span> list &);
+ list(list &&);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> list(InpIt, InpIt, <span class="bold"><strong>const</strong></span> A & = A());
+ list& operator=(<span class="bold"><strong>const</strong></span> ThisType &);
+ list& operator=(ThisType &&);
+ ~list();
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_front(<span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_front(T &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(<span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(T &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_front() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_back() ;
+ <span class="type">reference</span> front() ;
+ <span class="type">const_reference</span> front() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> back() ;
+ <span class="type">const_reference</span> back() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(ThisType &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, InpIt, InpIt) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type">iterator</span> insert(const_iterator, T &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> emplace_back(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> emplace_front(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> assign(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <span class="type"><span class="bold"><strong>void</strong></span></span> assign(InpIt, InpIt) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice(iterator, ThisType &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice(const_iterator, ThisType &, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice(const_iterator, ThisType &, const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice(const_iterator, ThisType &, const_iterator, const_iterator,
+ size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reverse() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> remove(<span class="bold"><strong>const</strong></span> T &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Pred> <span class="type"><span class="bold"><strong>void</strong></span></span> remove_if(Pred) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> unique() ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> BinaryPredicate> <span class="type"><span class="bold"><strong>void</strong></span></span> unique(BinaryPredicate) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> merge(list< T, A > &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> StrictWeakOrdering>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> merge(list &, StrictWeakOrdering) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> sort() ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> StrictWeakOrdering> <span class="type"><span class="bold"><strong>void</strong></span></span> sort(StrictWeakOrdering) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id504017"></a><h2>Description</h2>
+<p>A list is a doubly linked list. That is, it is a Sequence that supports both forward and backward traversal, and (amortized) constant time insertion and removal of elements at the beginning or the end, or in the middle. Lists have the important property that insertion and splicing do not invalidate iterators to list elements, and that even removal invalidates only the iterators that point to the elements that are removed. The ordering of iterators may be changed (that is, list<T>::iterator might have a different predecessor or successor after a list operation than it did before), but the iterators themselves will not be invalidated or made to point to different elements unless that invalidation or mutation is explicit. </p>
+<div class="refsect2" lang="en">
+<a name="id504040"></a><h3>
+<a name="boost.container.listtypes"></a><code class="computeroutput">list</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<p>
+<span class="bold"><strong>typedef</strong></span> T <a name="boost.container.list.value_type"></a>value_type;</p>
+<p>The type of object, T, stored in the list </p>
+</li>
+<li>
+<p>
+<span class="bold"><strong>typedef</strong></span> std::reverse_iterator< const_iterator > <a name="boost.container.list.const_reverse_iterator"></a>const_reverse_iterator;</p>
+<p>Iterator used to iterate backwards through a list. Const iterator used to iterate backwards through a list. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id504116"></a><h3>
+<a name="boost.container.listconstruct-copy-destruct"></a><code class="computeroutput">list</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id294173-bb"></a>list(<span class="bold"><strong>const</strong></span> allocator_type & a = A());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a list taking the allocator as parameter.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id294215-bb"></a>list(size_type n);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a list that will use a copy of allocator a and inserts n copies of value.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws or T's default or copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id294255-bb"></a>list(size_type n, <span class="bold"><strong>const</strong></span> T & value, <span class="bold"><strong>const</strong></span> A & a = A());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a list that will use a copy of allocator a and inserts n copies of value.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws or T's default or copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id294313-bb"></a>list(<span class="bold"><strong>const</strong></span> list & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a list.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x == *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements x contains. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id294365-bb"></a>list(list && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructor. Moves mx's resources to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <a name="id294406-bb"></a>list(InpIt first, InpIt last, <span class="bold"><strong>const</strong></span> A & a = A());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a list that will use a copy of allocator a and inserts a copy of the range [first, last) in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws or T's constructor taking an dereferenced InIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the range [first, last). </p>
+</li>
+<li>
+<pre class="literallayout">list& <a name="id294506-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> ThisType & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this contain the same elements as x.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: this->size() == x.size(). *this contains a copy of each of x's elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in x. </p>
+</li>
+<li>
+<pre class="literallayout">list& <a name="id294555-bb"></a><span class="bold"><strong>operator</strong></span>=(ThisType && mx);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move assignment. All mx's values are transferred to *this.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x.empty(). *this contains a the elements x had before the function.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id294474-bb"></a>~list();</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Destroys the list. All stored values are destroyed and used memory is deallocated.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id504656"></a><h3>
+<a name="id291255-bb"></a><code class="computeroutput">list</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id291259-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the internal allocator.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id291298-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id291309-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id291319-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the list. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id291358-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id291397-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id291436-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id291474-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id291513-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id291552-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id291592-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id291631-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id291670-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id291709-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id291748-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id291787-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id291826-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the list contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id291865-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id291904-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id291942-bb"></a>push_front(<span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of t in the beginning of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id291990-bb"></a>push_front(T && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a new element in the beginning of the list and moves the resources of t to this new element.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292037-bb"></a>push_back(<span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes the last element from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292083-bb"></a>push_back(T && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes the first element from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292130-bb"></a>pop_front() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes the first element from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292168-bb"></a>pop_back() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes the last element from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id292207-bb"></a>front() ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id292255-bb"></a>front() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id292303-bb"></a>back() ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id292351-bb"></a>back() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292400-bb"></a>resize(size_type new_size, <span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts or erases elements at the end such that the size becomes n. New elements are copy constructed from x.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the difference between size() and new_size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292456-bb"></a>resize(size_type new_size) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts or erases elements at the end such that the size becomes n. New elements are default constructed.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the difference between size() and new_size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292504-bb"></a>swap(ThisType & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292551-bb"></a>insert(const_iterator p, size_type n, <span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts n copies of x before p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292622-bb"></a>insert(const_iterator p, InpIt first, InpIt last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a copy of the [first, last) range before p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, T's constructor from a dereferenced InpIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to std::distance [first, last). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id292703-bb"></a>insert(const_iterator p, <span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a copy of x before p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or x's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id292767-bb"></a>insert(const_iterator p, T && x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a new element before p with mx's resources.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292830-bb"></a>emplace_back(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the end of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id292890-bb"></a>emplace_front(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the beginning of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id292951-bb"></a>emplace(const_iterator p, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... before p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id293018-bb"></a>erase(const_iterator p) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element at p p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id293074-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: first and last must be valid iterator to elements in *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the elements pointed by [first, last).</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the distance between first and last. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293138-bb"></a>assign(size_type n, <span class="bold"><strong>const</strong></span> T & val) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Assigns the n copies of val to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293192-bb"></a>assign(InpIt first, InpIt last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Assigns the the range [first, last) to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's constructor from dereferencing InpIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293255-bb"></a>splice(iterator p, ThisType & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must point to an element contained by the list. x != *this</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers all the elements of list x to this list, before the the element pointed by p. No destructors or copy constructors are called.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293332-bb"></a>splice(const_iterator p, ThisType & x, const_iterator i) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must point to an element contained by this list. i must point to an element contained in list x.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers the value pointed by i, from list x to this list, before the the element pointed by p. No destructors or copy constructors are called. If p == i or p == ++i, this function is a null operation.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293418-bb"></a>splice(const_iterator p, ThisType & x, const_iterator first,
+ const_iterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must point to an element contained by this list. first and last must point to elements contained in list x.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers the range pointed by first and last from list x to this list, before the the element pointed by p. No destructors or copy constructors are called.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements transferred.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293511-bb"></a>splice(const_iterator p, ThisType & x, const_iterator first,
+ const_iterator last, size_type n) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must point to an element contained by this list. first and last must point to elements contained in list x. n == std::distance(first, last)</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers the range pointed by first and last from list x to this list, before the the element pointed by p. No destructors or copy constructors are called.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293612-bb"></a>reverse() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Reverses the order of elements in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: This function is linear time.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators and references are not invalidated </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293660-bb"></a>remove(<span class="bold"><strong>const</strong></span> T & value) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes all the elements that compare equal to value.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear time. It performs exactly size() comparisons for equality.</p>
+<p><span class="bold"><strong>Note</strong></span>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Pred> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293718-bb"></a>remove_if(Pred pred) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes all the elements for which a specified predicate is satisfied.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If pred throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear time. It performs exactly size() calls to the predicate.</p>
+<p><span class="bold"><strong>Note</strong></span>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293785-bb"></a>unique() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes adjacent duplicate elements or adjacent elements that are equal from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear time (size()-1 comparisons calls to pred()).</p>
+<p><span class="bold"><strong>Note</strong></span>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> BinaryPredicate> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293836-bb"></a>unique(BinaryPredicate binary_pred) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If pred throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear time (size()-1 comparisons equality comparisons).</p>
+<p><span class="bold"><strong>Note</strong></span>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293904-bb"></a>merge(list< T, A > & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: The lists x and *this must be distinct.</p>
+<p><span class="bold"><strong>Effects</strong></span>: This function removes all of x's elements and inserts them in order into *this according to std::less<value_type>. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: This function is linear time: it performs at most size() + x.size() - 1 comparisons. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> StrictWeakOrdering>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id293967-bb"></a>merge(list & x, StrictWeakOrdering comp) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.</p>
+<p><span class="bold"><strong>Effects</strong></span>: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators and references to *this are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id294055-bb"></a>sort() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: This function sorts the list *this according to std::less<value_type>. The sort is stable, that is, the relative order of equivalent elements is preserved.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Notes</strong></span>: Iterators and references are not invalidated.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: The number of comparisons is approximately N log N, where N is the list's size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> StrictWeakOrdering> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id294106-bb"></a>sort(StrictWeakOrdering comp) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: This function sorts the list *this according to std::less<value_type>. The sort is stable, that is, the relative order of equivalent elements is preserved.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Notes</strong></span>: Iterators and references are not invalidated.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: The number of comparisons is approximately N log N, where N is the list's size. </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="flat_multiset.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.list_hpp"><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="map.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/map.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/map.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,455 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template map</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.map_hpp" title="Header <boost/container/map.hpp>">
+<link rel="prev" href="list.html" title="Class template list">
+<link rel="next" href="multimap.html" title="Class template multimap">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="list.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.map_hpp"><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="multimap.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.map"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template map</span></h2>
+<p>boost::container::map — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> map {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_type <a name="boost.container.map.key_type"></a>key_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_type <a name="boost.container.map.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::pointer <a name="boost.container.map.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_pointer <a name="boost.container.map.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reference <a name="boost.container.map.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reference <a name="boost.container.map.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> T <a name="boost.container.map.mapped_type"></a>mapped_type;
+ <span class="bold"><strong>typedef</strong></span> Pred <a name="boost.container.map.key_compare"></a>key_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::iterator <a name="boost.container.map.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_iterator <a name="boost.container.map.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reverse_iterator <a name="boost.container.map.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reverse_iterator <a name="boost.container.map.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::size_type <a name="boost.container.map.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::difference_type <a name="boost.container.map.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::allocator_type <a name="boost.container.map.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::stored_allocator_type <a name="boost.container.map.stored_allocator_type"></a>stored_allocator_type;
+ <span class="bold"><strong>typedef</strong></span> std::pair< key_type, mapped_type > <a name="boost.container.map.nonconst_value_type"></a>nonconst_value_type;
+ <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="boost.container.map.nonconst_impl_value_type"></a>nonconst_impl_value_type;
+ <span class="bold"><strong>typedef</strong></span> value_compare_impl <a name="boost.container.map.value_compare"></a>value_compare;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ map(<span class="bold"><strong>const</strong></span> Pred & = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ map(InputIterator, InputIterator, <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ map(ordered_unique_range_t, InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Pred & = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ map(<span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > &);
+ map(map &&);
+ map& operator=(<span class="bold"><strong>const</strong></span> map &);
+ map& operator=(map &&);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">key_compare</span> key_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">value_compare</span> value_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">T &</span> operator[](<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">T &</span> operator[](key_type &&) ;
+ <span class="type">T &</span> at(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type"><span class="bold"><strong>const</strong></span> T &</span> at(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(map &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(<span class="bold"><strong>const</strong></span> nonconst_value_type &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(nonconst_value_type &&) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(nonconst_impl_value_type &&) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(value_type &&) ;
+ <span class="type">iterator</span> insert(iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(iterator, nonconst_value_type &&) ;
+ <span class="type">iterator</span> insert(iterator, nonconst_impl_value_type &&) ;
+ <span class="type">iterator</span> insert(iterator, <span class="bold"><strong>const</strong></span> nonconst_value_type &) ;
+ <span class="type">iterator</span> insert(iterator, value_type &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_hint(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">size_type</span> erase(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type">iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> count(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< iterator, iterator ></span> equal_range(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">std::pair< const_iterator, const_iterator ></span>
+ equal_range(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id511102"></a><h2>Description</h2>
+<p>A map is a kind of associative container that supports unique keys (contains at most one of each key value) and provides for fast retrieval of values of another type T based on the keys. The map class supports bidirectional iterators.</p>
+<p>A map satisfies all of the requirements of a container and of a reversible container and of an associative container. For a map<Key,T> the key_type is Key and the value_type is std::pair<const Key,T>.</p>
+<p>Pred is the ordering function for Keys (e.g. std::less<Key>).</p>
+<p>Alloc is the allocator to allocate the value_types (e.g. allocator< std::pair<const Key, T> > ). </p>
+<div class="refsect2" lang="en">
+<a name="id511130"></a><h3>
+<a name="boost.container.mapconstruct-copy-destruct"></a><code class="computeroutput">map</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id297122-bb"></a>map(<span class="bold"><strong>const</strong></span> Pred & comp = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty map using the specified comparison object and allocator.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id297165-bb"></a>map(InputIterator first, InputIterator last, <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the range [first ,last ).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id297235-bb"></a>map(ordered_unique_range_t, InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty map using the specified comparison object and allocator, and inserts elements from the ordered unique range [first ,last). This function is more efficient than the normal range creation for ordered ranges.</p>
+<p><span class="bold"><strong>Requires</strong></span>: [first ,last) must be ordered according to the predicate and must be unique values.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id297323-bb"></a>map(<span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a map.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id297356-bb"></a>map(map && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a map. Constructs *this using x's resources.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Construct.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x is emptied. </p>
+</li>
+<li>
+<pre class="literallayout">map& <a name="id297398-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> map & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this a copy of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout">map& <a name="id297431-bb"></a><span class="bold"><strong>operator</strong></span>=(map && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: this->swap(x.get()).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id511569"></a><h3>
+<a name="id295137-bb"></a><code class="computeroutput">map</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">key_compare</span> <a name="id295141-bb"></a>key_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the comparison object out of which a was constructed.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">value_compare</span> <a name="id295172-bb"></a>value_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an object of value_compare constructed out of the comparison object.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id295202-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator that was passed to the object's constructor.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id295232-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id295243-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id295253-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id295292-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id295331-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id295370-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id295408-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id295448-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id295487-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id295526-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id295566-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id295604-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id295643-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">T &</span> <a name="id295682-bb"></a><span class="bold"><strong>operator</strong></span>[](<span class="bold"><strong>const</strong></span> key_type & k) ;</pre>
+<p>Effects: If there is no key equivalent to x in the map, inserts value_type(x, T()) into the map.</p>
+<p>Returns: A reference to the mapped_type corresponding to x in *this.</p>
+<p>Complexity: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">T &</span> <a name="id295713-bb"></a><span class="bold"><strong>operator</strong></span>[](key_type && mk) ;</pre>
+<p>Effects: If there is no key equivalent to x in the map, inserts value_type(boost::move(x), T()) into the map (the key is move-constructed)</p>
+<p>Returns: A reference to the mapped_type corresponding to x in *this.</p>
+<p>Complexity: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">T &</span> <a name="id295744-bb"></a>at(<span class="bold"><strong>const</strong></span> key_type & k) ;</pre>
+<p>Returns: A reference to the element whose key is equivalent to x. Throws: An exception object of type out_of_range if no such element is present. Complexity: logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> T &</span> <a name="id295769-bb"></a>at(<span class="bold"><strong>const</strong></span> key_type & k) <span class="bold"><strong>const</strong></span>;</pre>
+<p>Returns: A reference to the element whose key is equivalent to x. Throws: An exception object of type out_of_range if no such element is present. Complexity: logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id295794-bb"></a>swap(map & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id295844-bb"></a>insert(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts x if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id295894-bb"></a>insert(<span class="bold"><strong>const</strong></span> nonconst_value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value_type created from the pair if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id295945-bb"></a>insert(nonconst_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id295996-bb"></a>insert(nonconst_impl_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value_type move constructed from the pair if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id296048-bb"></a>insert(value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296098-bb"></a>insert(iterator position, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container if and only if there is no element in the container with key equivalent to the key of x. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296157-bb"></a>insert(iterator position, nonconst_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296215-bb"></a>insert(iterator position, nonconst_impl_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296274-bb"></a>insert(iterator position, <span class="bold"><strong>const</strong></span> nonconst_value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296330-bb"></a>insert(iterator position, value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an element move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id296386-bb"></a>insert(InputIterator first, InputIterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: i, j are not iterators into *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: inserts each element from the range [i,j) if and only if there is no element with key equivalent to the key of that element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: N log(size()+N) (N is the distance from i to j) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id296451-bb"></a>emplace(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the container if and only if there is no element in the container with an equivalent key. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id296515-bb"></a>emplace_hint(const_iterator hint, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the container if and only if there is no element in the container with an equivalent key. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296586-bb"></a>erase(const_iterator position) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by position.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns end().</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id296635-bb"></a>erase(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all elements in the container with key equivalent to x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns the number of erased elements.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size()) + count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296682-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements in the range [first, last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+N where N is the distance from first to last. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id296737-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: erase(a.begin(),a.end()).</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: size() == 0.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: linear in size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296775-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id296814-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const_iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id296852-bb"></a>count(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The number of elements with key equivalent to x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296890-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id296929-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id296967-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id297006-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, iterator ></span> <a name="id297045-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< const_iterator, const_iterator ></span>
+<a name="id297083-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="list.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.map_hpp"><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="multimap.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/multimap.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/multimap.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,416 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template multimap</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.map_hpp" title="Header <boost/container/map.hpp>">
+<link rel="prev" href="map.html" title="Class template map">
+<link rel="next" href="set.html" title="Class template set">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="map.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.map_hpp"><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="set.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.multimap"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template multimap</span></h2>
+<p>boost::container::multimap — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> multimap {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_type <a name="boost.container.multimap.key_type"></a>key_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_type <a name="boost.container.multimap.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::pointer <a name="boost.container.multimap.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_pointer <a name="boost.container.multimap.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reference <a name="boost.container.multimap.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reference <a name="boost.container.multimap.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> T <a name="boost.container.multimap.mapped_type"></a>mapped_type;
+ <span class="bold"><strong>typedef</strong></span> Pred <a name="boost.container.multimap.key_compare"></a>key_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::iterator <a name="boost.container.multimap.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_iterator <a name="boost.container.multimap.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reverse_iterator <a name="boost.container.multimap.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reverse_iterator <a name="boost.container.multimap.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::size_type <a name="boost.container.multimap.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::difference_type <a name="boost.container.multimap.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::allocator_type <a name="boost.container.multimap.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::stored_allocator_type <a name="boost.container.multimap.stored_allocator_type"></a>stored_allocator_type;
+ <span class="bold"><strong>typedef</strong></span> std::pair< key_type, mapped_type > <a name="boost.container.multimap.nonconst_value_type"></a>nonconst_value_type;
+ <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="boost.container.multimap.nonconst_impl_value_type"></a>nonconst_impl_value_type;
+ <span class="bold"><strong>typedef</strong></span> value_compare_impl <a name="boost.container.multimap.value_compare"></a>value_compare;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ multimap(<span class="bold"><strong>const</strong></span> Pred & = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ multimap(InputIterator, InputIterator, <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ multimap(ordered_range_t, InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ multimap(<span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > &);
+ multimap(multimap &&);
+ multimap& operator=(<span class="bold"><strong>const</strong></span> multimap &);
+ multimap& operator=(multimap &&);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">key_compare</span> key_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">value_compare</span> value_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(multimap &) ;
+ <span class="type">iterator</span> insert(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(<span class="bold"><strong>const</strong></span> nonconst_value_type &) ;
+ <span class="type">iterator</span> insert(nonconst_value_type &&) ;
+ <span class="type">iterator</span> insert(nonconst_impl_value_type &&) ;
+ <span class="type">iterator</span> insert(iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(iterator, <span class="bold"><strong>const</strong></span> nonconst_value_type &) ;
+ <span class="type">iterator</span> insert(iterator, nonconst_value_type &&) ;
+ <span class="type">iterator</span> insert(iterator, nonconst_impl_value_type &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_hint(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">size_type</span> erase(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type">iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> count(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">std::pair< iterator, iterator ></span> equal_range(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< const_iterator, const_iterator ></span>
+ equal_range(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id515595"></a><h2>Description</h2>
+<p>A multimap is a kind of associative container that supports equivalent keys (possibly containing multiple copies of the same key value) and provides for fast retrieval of values of another type T based on the keys. The multimap class supports bidirectional iterators.</p>
+<p>A multimap satisfies all of the requirements of a container and of a reversible container and of an associative container. For a map<Key,T> the key_type is Key and the value_type is std::pair<const Key,T>.</p>
+<p>Pred is the ordering function for Keys (e.g. std::less<Key>).</p>
+<p>Alloc is the allocator to allocate the value_types (e.g. allocator< std::pair<<span class="bold"><strong>const</strong></span> Key, T> >). </p>
+<div class="refsect2" lang="en">
+<a name="id515630"></a><h3>
+<a name="boost.container.multimapconstruct-copy-destruct"></a><code class="computeroutput">multimap</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id299378-bb"></a>multimap(<span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty multimap using the specified comparison object and allocator.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id299421-bb"></a>multimap(InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty multimap using the specified comparison object and allocator, and inserts elements from the range [first ,last ).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id299491-bb"></a>multimap(ordered_range_t ordered_range, InputIterator first,
+ InputIterator last, <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty multimap using the specified comparison object and allocator, and inserts elements from the ordered range [first ,last). This function is more efficient than the normal range creation for ordered ranges.</p>
+<p><span class="bold"><strong>Requires</strong></span>: [first ,last) must be ordered according to the predicate.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id299578-bb"></a>multimap(<span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a multimap.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id299612-bb"></a>multimap(multimap && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a multimap. Constructs *this using x's resources.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Construct.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x is emptied. </p>
+</li>
+<li>
+<pre class="literallayout">multimap& <a name="id299654-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> multimap & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this a copy of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout">multimap& <a name="id299687-bb"></a><span class="bold"><strong>operator</strong></span>=(multimap && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: this->swap(x.get()).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id516075"></a><h3>
+<a name="id297668-bb"></a><code class="computeroutput">multimap</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">key_compare</span> <a name="id297672-bb"></a>key_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the comparison object out of which a was constructed.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">value_compare</span> <a name="id297702-bb"></a>value_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an object of value_compare constructed out of the comparison object.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id297733-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator that was passed to the object's constructor.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id297763-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id297773-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id297784-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id297823-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id297862-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id297900-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id297939-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id297978-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id298018-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id298057-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id298096-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id298135-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id298174-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id298213-bb"></a>swap(multimap & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298263-bb"></a>insert(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298301-bb"></a>insert(<span class="bold"><strong>const</strong></span> nonconst_value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value constructed from x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298339-bb"></a>insert(nonconst_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value move-constructed from x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298378-bb"></a>insert(nonconst_impl_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value move-constructed from x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298416-bb"></a>insert(iterator position, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298474-bb"></a>insert(iterator position, <span class="bold"><strong>const</strong></span> nonconst_value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298531-bb"></a>insert(iterator position, nonconst_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298588-bb"></a>insert(iterator position, nonconst_impl_value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a new value move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id298646-bb"></a>insert(InputIterator first, InputIterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: i, j are not iterators into *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: inserts each element from the range [i,j) .</p>
+<p><span class="bold"><strong>Complexity</strong></span>: N log(size()+N) (N is the distance from i to j) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id298710-bb"></a>emplace(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id298773-bb"></a>emplace_hint(const_iterator hint, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298843-bb"></a>erase(const_iterator position) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by position.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns end().</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id298891-bb"></a>erase(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all elements in the container with key equivalent to x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns the number of erased elements.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size()) + count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id298939-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements in the range [first, last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+N where N is the distance from first to last. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id298993-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: erase(a.begin(),a.end()).</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: size() == 0.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: linear in size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id299032-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id299070-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id299109-bb"></a>count(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The number of elements with key equivalent to x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id299146-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id299185-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id299224-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, iterator ></span> <a name="id299262-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id299300-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< const_iterator, const_iterator ></span>
+<a name="id299339-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="map.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.map_hpp"><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="set.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/multiset.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/multiset.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,413 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template multiset</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.set_hpp" title="Header <boost/container/set.hpp>">
+<link rel="prev" href="set.html" title="Class template set">
+<link rel="next" href="slist.html" title="Class template slist">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.set_hpp"><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="slist.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.multiset"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template multiset</span></h2>
+<p>boost::container::multiset — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> multiset {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_type <a name="boost.container.multiset.key_type"></a>key_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_type <a name="boost.container.multiset.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::pointer <a name="boost.container.multiset.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_pointer <a name="boost.container.multiset.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reference <a name="boost.container.multiset.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reference <a name="boost.container.multiset.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> Pred <a name="boost.container.multiset.key_compare"></a>key_compare;
+ <span class="bold"><strong>typedef</strong></span> Pred <a name="boost.container.multiset.value_compare"></a>value_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::iterator <a name="boost.container.multiset.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_iterator <a name="boost.container.multiset.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reverse_iterator <a name="boost.container.multiset.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reverse_iterator <a name="boost.container.multiset.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::size_type <a name="boost.container.multiset.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::difference_type <a name="boost.container.multiset.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::allocator_type <a name="boost.container.multiset.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::stored_allocator_type <a name="boost.container.multiset.stored_allocator_type"></a>stored_allocator_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ multiset(<span class="bold"><strong>const</strong></span> Pred & = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ multiset(InputIterator, InputIterator, <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ multiset(ordered_range_t, InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ multiset(<span class="bold"><strong>const</strong></span> multiset &);
+ multiset(multiset &&);
+ multiset& operator=(<span class="bold"><strong>const</strong></span> multiset &);
+ multiset& operator=(multiset &&);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">key_compare</span> key_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">value_compare</span> value_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(multiset &) ;
+ <span class="type">iterator</span> insert(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(value_type &&) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(const_iterator, value_type &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_hint(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">size_type</span> erase(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type">iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> count(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< iterator, iterator ></span> equal_range(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">std::pair< const_iterator, const_iterator ></span>
+ equal_range(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id525090"></a><h2>Description</h2>
+<p>A multiset is a kind of associative container that supports equivalent keys (possibly contains multiple copies of the same key value) and provides for fast retrieval of the keys themselves. Class multiset supports bidirectional iterators.</p>
+<p>A multiset satisfies all of the requirements of a container and of a reversible container, and of an associative container). multiset also provides most operations described for duplicate keys. </p>
+<div class="refsect2" lang="en">
+<a name="id525104"></a><h3>
+<a name="boost.container.multisetconstruct-copy-destruct"></a><code class="computeroutput">multiset</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id304577-bb"></a>multiset(<span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty multiset using the specified comparison object and allocator.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id304620-bb"></a>multiset(InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty multiset using the specified comparison object and allocator, and inserts elements from the range [first ,last ).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id304690-bb"></a>multiset(ordered_range_t ordered_range, InputIterator first,
+ InputIterator last, <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty multiset using the specified comparison object and allocator, and inserts elements from the ordered range [first ,last ). This function is more efficient than the normal range creation for ordered ranges.</p>
+<p><span class="bold"><strong>Requires</strong></span>: [first ,last) must be ordered according to the predicate.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id304778-bb"></a>multiset(<span class="bold"><strong>const</strong></span> multiset & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a multiset.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id304811-bb"></a>multiset(multiset && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a multiset. Constructs *this using x's resources.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Construct.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x is emptied. </p>
+</li>
+<li>
+<pre class="literallayout">multiset& <a name="id304852-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> multiset & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this a copy of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout">multiset& <a name="id304886-bb"></a><span class="bold"><strong>operator</strong></span>=(multiset && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: this->swap(x.get()).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id525548"></a><h3>
+<a name="id302907-bb"></a><code class="computeroutput">multiset</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">key_compare</span> <a name="id302911-bb"></a>key_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the comparison object out of which a was constructed.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">value_compare</span> <a name="id302941-bb"></a>value_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an object of value_compare constructed out of the comparison object.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id302972-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator that was passed to the object's constructor.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id303002-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id303013-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id303023-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id303062-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id303101-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id303140-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id303178-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id303218-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id303257-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id303296-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id303336-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id303375-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id303413-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id303453-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id303492-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id303531-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id303570-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id303608-bb"></a>swap(multiset & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id303658-bb"></a>insert(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts x and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id303696-bb"></a>insert(value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id303745-bb"></a>insert(const_iterator p, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id303802-bb"></a>insert(const_iterator p, value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a value move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id303859-bb"></a>insert(InputIterator first, InputIterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: i, j are not iterators into *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: inserts each element from the range [i,j) .</p>
+<p><span class="bold"><strong>Complexity</strong></span>: N log(size()+N) (N is the distance from i to j) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id303922-bb"></a>emplace(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id303974-bb"></a>emplace_hint(const_iterator hint, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)...</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id304042-bb"></a>erase(const_iterator p) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by p.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns end().</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id304091-bb"></a>erase(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all elements in the container with key equivalent to x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns the number of erased elements.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size()) + count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id304138-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements in the range [first, last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+N where N is the distance from first to last. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id304193-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: erase(a.begin(),a.end()).</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: size() == 0.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: linear in size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id304231-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id304269-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id304308-bb"></a>count(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The number of elements with key equivalent to x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id304346-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id304384-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id304423-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id304461-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, iterator ></span> <a name="id304500-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< const_iterator, const_iterator ></span>
+<a name="id304538-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="set.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.set_hpp"><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="slist.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_range.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_range.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Global ordered_range</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_unique_range_im_id156279.html" title="Struct ordered_unique_range_impl_t">
+<link rel="next" href="ordered_unique_range.html" title="Global ordered_unique_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_unique_range_im_id156279.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_unique_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_range"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Global ordered_range</span></h2>
+<p>boost::container::ordered_range — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>static</strong></span> const ordered_range_t ordered_range;</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477478"></a><h2>Description</h2>
+<p>Value used to tag that the input range is guaranteed to be ordered </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_unique_range_im_id156279.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_unique_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_range_impl_t.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_range_impl_t.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="../../boost_container_reference.html" title="Boost.Container Reference">
+<link rel="next" href="ordered_unique_range_im_id156279.html" title="Struct ordered_unique_range_impl_t">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../../boost_container_reference.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_unique_range_im_id156279.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_range_impl_t"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_range_impl_t</span></h2>
+<p>boost::container::ordered_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477393"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../../boost_container_reference.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_unique_range_im_id156279.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Global ordered_unique_range</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range.html" title="Global ordered_range">
+<link rel="next" href="deque.html" title="Class template deque">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="deque.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Global ordered_unique_range</span></h2>
+<p>boost::container::ordered_unique_range — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>static</strong></span> const ordered_unique_range_t ordered_unique_range;</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477516"></a><h2>Description</h2>
+<p>Value used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="deque.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156270.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156270.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,49 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id156270"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156279.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156279.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id156279"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477443"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156280.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156280.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id156280"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477536"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156282.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id156282.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id156282"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477522"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id277802.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id277802.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,49 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id277802"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278914.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278914.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,49 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id278914"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278923.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278923.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id278923"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477552"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278927.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id278927.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,49 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id278927"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279032.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279032.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id279032"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477464"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279061.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279061.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id279061"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477513"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279065.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279065.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id279065"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477509"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279068.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/ordered_unique_range_im_id279068.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct ordered_unique_range_impl_t</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp" title="Header <boost/container/container_fwd.hpp>">
+<link rel="prev" href="ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+<link rel="next" href="ordered_range.html" title="Global ordered_range">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.ordered_unique_range_im_id279068"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct ordered_unique_range_impl_t</span></h2>
+<p>boost::container::ordered_unique_range_impl_t — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id477513"></a><h2>Description</h2>
+<p>Type used to tag that the input range is guaranteed to be ordered and unique </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="ordered_range_impl_t.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.container_fwd_hpp"><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="ordered_range.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/set.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/set.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,412 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template set</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.set_hpp" title="Header <boost/container/set.hpp>">
+<link rel="prev" href="multimap.html" title="Class template multimap">
+<link rel="next" href="multiset.html" title="Class template multiset">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="multimap.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.set_hpp"><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="multiset.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.set"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template set</span></h2>
+<p>boost::container::set — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+<span class="bold"><strong>class</strong></span> set {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> tree_t::key_type <a name="boost.container.set.key_type"></a>key_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::value_type <a name="boost.container.set.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::pointer <a name="boost.container.set.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_pointer <a name="boost.container.set.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reference <a name="boost.container.set.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reference <a name="boost.container.set.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> Pred <a name="boost.container.set.key_compare"></a>key_compare;
+ <span class="bold"><strong>typedef</strong></span> Pred <a name="boost.container.set.value_compare"></a>value_compare;
+ <span class="bold"><strong>typedef</strong></span> tree_t::iterator <a name="boost.container.set.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_iterator <a name="boost.container.set.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::reverse_iterator <a name="boost.container.set.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::const_reverse_iterator <a name="boost.container.set.const_reverse_iterator"></a>const_reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> tree_t::size_type <a name="boost.container.set.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::difference_type <a name="boost.container.set.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::allocator_type <a name="boost.container.set.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> tree_t::stored_allocator_type <a name="boost.container.set.stored_allocator_type"></a>stored_allocator_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ set(<span class="bold"><strong>const</strong></span> Pred & = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ set(InputIterator, InputIterator, <span class="bold"><strong>const</strong></span> Pred & = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ set(ordered_unique_range_t, InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Pred & = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ set(<span class="bold"><strong>const</strong></span> set &);
+ set(set &&);
+ set& operator=(<span class="bold"><strong>const</strong></span> set &);
+ set& operator=(set &&);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">key_compare</span> key_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">value_compare</span> value_comp() <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(set &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> insert(value_type &&) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(const_iterator, value_type &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_hint(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">size_type</span> erase(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type">iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> find(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> count(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> lower_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">const_iterator</span> upper_bound(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+ <span class="type">std::pair< iterator, iterator ></span> equal_range(<span class="bold"><strong>const</strong></span> key_type &) ;
+ <span class="type">std::pair< const_iterator, const_iterator ></span>
+ equal_range(<span class="bold"><strong>const</strong></span> key_type &) <span class="bold"><strong>const</strong></span>;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id520957"></a><h2>Description</h2>
+<p>A set is a kind of associative container that supports unique keys (contains at most one of each key value) and provides for fast retrieval of the keys themselves. Class set supports bidirectional iterators.</p>
+<p>A set satisfies all of the requirements of a container and of a reversible container , and of an associative container. A set also provides most operations described in for unique keys. </p>
+<div class="refsect2" lang="en">
+<a name="id520974"></a><h3>
+<a name="boost.container.setconstruct-copy-destruct"></a><code class="computeroutput">set</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id302407-bb"></a>set(<span class="bold"><strong>const</strong></span> Pred & comp = Pred(), <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty set using the specified comparison object and allocator.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id302451-bb"></a>set(InputIterator first, InputIterator last, <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty set using the specified comparison object and allocator, and inserts elements from the range [first ,last ).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N if the range [first ,last ) is already sorted using comp and otherwise N logN, where N is last - first. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id302521-bb"></a>set(ordered_unique_range_t, InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Pred & comp = Pred(),
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs an empty set using the specified comparison object and allocator, and inserts elements from the ordered unique range [first ,last). This function is more efficient than the normal range creation for ordered ranges.</p>
+<p><span class="bold"><strong>Requires</strong></span>: [first ,last) must be ordered according to the predicate and must be unique values.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in N. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id302608-bb"></a>set(<span class="bold"><strong>const</strong></span> set & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a set.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id302642-bb"></a>set(set && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a set. Constructs *this using x's resources.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Construct.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x is emptied. </p>
+</li>
+<li>
+<pre class="literallayout">set& <a name="id302683-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> set & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this a copy of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in x.size(). </p>
+</li>
+<li>
+<pre class="literallayout">set& <a name="id302716-bb"></a><span class="bold"><strong>operator</strong></span>=(set && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: this->swap(x.get()).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id521413"></a><h3>
+<a name="id300713-bb"></a><code class="computeroutput">set</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">key_compare</span> <a name="id300717-bb"></a>key_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the comparison object out of which a was constructed.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">value_compare</span> <a name="id300747-bb"></a>value_comp() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an object of value_compare constructed out of the comparison object.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id300778-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the Allocator that was passed to the object's constructor.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id300808-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id300819-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id300829-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id300868-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id300907-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id300946-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id300984-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id301024-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id301063-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id301102-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id301141-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id301180-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id301219-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id301258-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id301298-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the container contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id301336-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id301375-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id301414-bb"></a>swap(set & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id301464-bb"></a>insert(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts x if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, <span class="bold"><strong>bool</strong></span> ></span> <a name="id301514-bb"></a>insert(value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructs a new value from x if and only if there is no element in the container with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: The bool component of the returned pair is true if and only if the insertion takes place, and the iterator component of the pair points to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id301565-bb"></a>insert(const_iterator p, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x in the container if and only if there is no element in the container with key equivalent to the key of x. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic in general, but amortized constant if t is inserted right before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id301623-bb"></a>insert(const_iterator p, value_type && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an element move constructed from x in the container. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id301679-bb"></a>insert(InputIterator first, InputIterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: i, j are not iterators into *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: inserts each element from the range [i,j) if and only if there is no element with key equivalent to the key of that element.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: N log(size()+N) (N is the distance from i to j) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id301744-bb"></a>emplace(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... if and only if there is no element in the container with equivalent value. and returns the iterator pointing to the newly inserted element.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id301803-bb"></a>emplace_hint(const_iterator hint, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... if and only if there is no element in the container with equivalent value. p is a hint pointing to where the insert should start to search.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the element with key equivalent to the key of x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id301873-bb"></a>erase(const_iterator p) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element pointed to by p.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns end().</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id301921-bb"></a>erase(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all elements in the container with key equivalent to x.</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns the number of erased elements.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size()) + count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id301968-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements in the range [first, last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: Returns last.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+N where N is the distance from first to last. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id302023-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: erase(a.begin(),a.end()).</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: size() == 0.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: linear in size(). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id302061-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id302100-bb"></a>find(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const_iterator pointing to an element with the key equivalent to x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id302138-bb"></a>count(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The number of elements with key equivalent to x.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: log(size())+count(k) </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id302176-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id302215-bb"></a>lower_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than k, or a.end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id302253-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id302292-bb"></a>upper_bound(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A const iterator pointing to the first element with key not less than x, or end() if such an element is not found.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< iterator, iterator ></span> <a name="id302331-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">std::pair< const_iterator, const_iterator ></span>
+<a name="id302369-bb"></a>equal_range(<span class="bold"><strong>const</strong></span> key_type & x) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Equivalent to std::make_pair(this->lower_bound(k), this->upper_bound(k)).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Logarithmic </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="multimap.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.set_hpp"><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="multiset.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/slist.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/slist.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,620 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template slist</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.slist_hpp" title="Header <boost/container/slist.hpp>">
+<link rel="prev" href="multiset.html" title="Class template multiset">
+<link rel="next" href="stable_vector.html" title="Class template stable_vector">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="multiset.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.slist_hpp"><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="stable_vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.slist"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template slist</span></h2>
+<p>boost::container::slist — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+<span class="bold"><strong>class</strong></span> slist {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> T value_type;
+ <span class="bold"><strong>typedef</strong></span> A::pointer <a name="boost.container.slist.pointer"></a>pointer; <span class="emphasis"><em>// Pointer to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::const_pointer <a name="boost.container.slist.const_pointer"></a>const_pointer; <span class="emphasis"><em>// Const pointer to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::reference <a name="boost.container.slist.reference"></a>reference; <span class="emphasis"><em>// Reference to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::const_reference <a name="boost.container.slist.const_reference"></a>const_reference; <span class="emphasis"><em>// Const reference to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::size_type <a name="boost.container.slist.size_type"></a>size_type; <span class="emphasis"><em>// An unsigned integral type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::difference_type <a name="boost.container.slist.difference_type"></a>difference_type; <span class="emphasis"><em>// A signed integral type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A <a name="boost.container.slist.allocator_type"></a>allocator_type; <span class="emphasis"><em>// The allocator type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> NodeAlloc <a name="boost.container.slist.stored_allocator_type"></a>stored_allocator_type; <span class="emphasis"><em>// The stored allocator type. </em></span>
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ slist(<span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ slist(size_type);
+ slist(size_type, <span class="bold"><strong>const</strong></span> value_type &,
+ <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt>
+ slist(InpIt, InpIt, <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ slist(<span class="bold"><strong>const</strong></span> slist &);
+ slist(slist &&);
+ slist& operator=(<span class="bold"><strong>const</strong></span> slist &);
+ slist& operator=(slist &&);
+ ~slist();
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> assign(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <span class="type"><span class="bold"><strong>void</strong></span></span> assign(InpIt, InpIt) ;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> before_begin() ;
+ <span class="type">const_iterator</span> before_begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbefore_begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(slist &) ;
+ <span class="type">reference</span> front() ;
+ <span class="type">const_reference</span> front() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_front(<span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_front(T &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_front() ;
+ <span class="type">iterator</span> previous(iterator) ;
+ <span class="type">const_iterator</span> previous(const_iterator) ;
+ <span class="type">iterator</span> insert_after(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert_after(const_iterator, value_type &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert_after(const_iterator, size_type, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIter> <span class="type"><span class="bold"><strong>void</strong></span></span> insert_after(const_iterator, InIter, InIter) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="type">iterator</span> insert(const_iterator, value_type &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, size_type, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIter> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, InIter, InIter) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> emplace_front(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(const_iterator, Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace_after(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase_after(const_iterator) ;
+ <span class="type">iterator</span> erase_after(const_iterator, const_iterator) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice_after(const_iterator, slist &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice_after(const_iterator, slist &, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice_after(const_iterator, slist &, const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice_after(const_iterator, slist &, const_iterator, const_iterator,
+ size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice(const_iterator, ThisType &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice(const_iterator, slist &, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> splice(const_iterator, slist &, const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reverse() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> remove(<span class="bold"><strong>const</strong></span> T &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Pred> <span class="type"><span class="bold"><strong>void</strong></span></span> remove_if(Pred) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> unique() ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Pred> <span class="type"><span class="bold"><strong>void</strong></span></span> unique(Pred) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> merge(slist &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> StrictWeakOrdering>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> merge(slist &, StrictWeakOrdering) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> sort() ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> StrictWeakOrdering> <span class="type"><span class="bold"><strong>void</strong></span></span> sort(StrictWeakOrdering) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id530160"></a><h2>Description</h2>
+<p>An slist is a singly linked list: a list where each element is linked to the next element, but not to the previous element. That is, it is a Sequence that supports forward but not backward traversal, and (amortized) constant time insertion and removal of elements. Slists, like lists, have the important property that insertion and splicing do not invalidate iterators to list elements, and that even removal invalidates only the iterators that point to the elements that are removed. The ordering of iterators may be changed (that is, slist<T>::iterator might have a different predecessor or successor after a list operation than it did before), but the iterators themselves will not be invalidated or made to point to different elements unless that invalidation or mutation is explicit.</p>
+<p>The main difference between slist and list is that list's iterators are bidirectional iterators, while slist's iterators are forward iterators. This means that slist is less versatile than list; frequently, however, bidirectional iterators are unnecessary. You should usually use slist unless you actually need the extra functionality of list, because singly linked lists are smaller and faster than double linked lists.</p>
+<p>Important performance note: like every other Sequence, slist defines the member functions insert and erase. Using these member functions carelessly, however, can result in disastrously slow programs. The problem is that insert's first argument is an iterator p, and that it inserts the new element(s) before p. This means that insert must find the iterator just before p; this is a constant-time operation for list, since list has bidirectional iterators, but for slist it must find that iterator by traversing the list from the beginning up to p. In other words: insert and erase are slow operations anywhere but near the beginning of the slist.</p>
+<p>Slist provides the member functions insert_after and erase_after, which are constant time operations: you should always use insert_after and erase_after whenever possible. If you find that insert_after and erase_after aren't adequate for your needs, and that you often need to use insert and erase in the middle of the list, then you should probably use list instead of slist. </p>
+<div class="refsect2" lang="en">
+<a name="id530223"></a><h3>
+<a name="boost.container.slisttypes"></a><code class="computeroutput">slist</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol type="1"><li>
+<p>
+<span class="bold"><strong>typedef</strong></span> T <a name="boost.container.slist.value_type"></a>value_type;</p>
+<p>The type of object, T, stored in the list </p>
+</li></ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id530273"></a><h3>
+<a name="boost.container.slistconstruct-copy-destruct"></a><code class="computeroutput">slist</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id309284-bb"></a>slist(<span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a list taking the allocator as parameter.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><a name="id309326-bb"></a>slist(size_type n);</pre></li>
+<li>
+<pre class="literallayout"><a name="id309335-bb"></a>slist(size_type n, <span class="bold"><strong>const</strong></span> value_type & x,
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a list that will use a copy of allocator a and inserts n copies of value.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws or T's default or copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt>
+ <a name="id309394-bb"></a>slist(InpIt first, InpIt last, <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a list that will use a copy of allocator a and inserts a copy of the range [first, last) in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws or T's constructor taking an dereferenced InIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the range [first, last). </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id309462-bb"></a>slist(<span class="bold"><strong>const</strong></span> slist & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a list.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x == *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements x contains. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id309514-bb"></a>slist(slist && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructor. Moves mx's resources to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout">slist& <a name="id309556-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> slist & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this contain the same elements as x.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: this->size() == x.size(). *this contains a copy of each of x's elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in x. </p>
+</li>
+<li>
+<pre class="literallayout">slist& <a name="id309609-bb"></a><span class="bold"><strong>operator</strong></span>=(slist && mx);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this contain the same elements as x.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: this->size() == x.size(). *this contains a copy of each of x's elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in x. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id309661-bb"></a>~slist();</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Destroys the list. All stored values are destroyed and used memory is deallocated.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id530816"></a><h3>
+<a name="id305832-bb"></a><code class="computeroutput">slist</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id305837-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the internal allocator.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id305876-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id305886-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id305897-bb"></a>assign(size_type n, <span class="bold"><strong>const</strong></span> T & val) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Assigns the n copies of val to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InpIt> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id305951-bb"></a>assign(InpIt first, InpIt last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Assigns the range [first, last) to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's constructor from dereferencing InpIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id306014-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id306053-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id306092-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id306131-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id306169-bb"></a>before_begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a non-dereferenceable iterator that, when incremented, yields begin(). This iterator may be used as the argument toinsert_after, erase_after, etc.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id306210-bb"></a>before_begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a non-dereferenceable const_iterator that, when incremented, yields begin(). This iterator may be used as the argument toinsert_after, erase_after, etc.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id306250-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id306289-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id306328-bb"></a>cbefore_begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a non-dereferenceable const_iterator that, when incremented, yields begin(). This iterator may be used as the argument toinsert_after, erase_after, etc.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id306369-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id306408-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id306446-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the list contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id306485-bb"></a>swap(slist & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements on *this and x. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id306536-bb"></a>front() ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id306584-bb"></a>front() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id306632-bb"></a>push_front(<span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of t in the beginning of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id306679-bb"></a>push_front(T && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a new element in the beginning of the list and moves the resources of t to this new element.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id306727-bb"></a>pop_front() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes the first element from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id306766-bb"></a>previous(iterator p) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The iterator to the element before i in the sequence. Returns the end-iterator, if either i is the begin-iterator or the sequence is empty.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements before i. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id306814-bb"></a>previous(const_iterator p) ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: The const_iterator to the element before i in the sequence. Returns the end-const_iterator, if either i is the begin-const_iterator or the sequence is empty.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements before i. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id306862-bb"></a>insert_after(const_iterator prev_pos, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of the value after the p pointed by prev_p.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator to the inserted element.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time.</p>
+<p><span class="bold"><strong>Note</strong></span>: Does not affect the validity of iterators and references of previous values. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id306946-bb"></a>insert_after(const_iterator prev_pos, value_type && x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: prev_pos must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a move constructed copy object from the value after the p pointed by prev_pos.</p>
+<p><span class="bold"><strong>Returns</strong></span>: An iterator to the inserted element.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time.</p>
+<p><span class="bold"><strong>Note</strong></span>: Does not affect the validity of iterators and references of previous values. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id307030-bb"></a>insert_after(const_iterator prev_pos, size_type n, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: prev_pos must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts n copies of x after prev_pos.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n.</p>
+<p><span class="bold"><strong>Note</strong></span>: Does not affect the validity of iterators and references of previous values. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIter>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id307111-bb"></a>insert_after(const_iterator prev_pos, InIter first, InIter last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: prev_pos must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts the range pointed by [first, last) after the p prev_pos.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, T's constructor from a dereferenced InpIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements inserted.</p>
+<p><span class="bold"><strong>Note</strong></span>: Does not affect the validity of iterators and references of previous values. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id307202-bb"></a>insert(const_iterator p, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a copy of x before p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or x's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id307266-bb"></a>insert(const_iterator p, value_type && x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a new element before p with mx's resources.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id307330-bb"></a>insert(const_iterator p, size_type n, <span class="bold"><strong>const</strong></span> value_type & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts n copies of x before p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n plus linear to the elements before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIter>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id307401-bb"></a>insert(const_iterator p, InIter first, InIter last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a copy of the [first, last) range before p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, T's constructor from a dereferenced InpIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to std::distance [first, last) plus linear to the elements before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id307483-bb"></a>emplace_front(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the front of the list</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> <a name="id307543-bb"></a>emplace(const_iterator p, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... before p</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements before p </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id307611-bb"></a>emplace_after(const_iterator prev, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... after prev</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id307679-bb"></a>erase_after(const_iterator prev_pos) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element after the element pointed by prev_pos of the list.</p>
+<p><span class="bold"><strong>Returns</strong></span>: the first element remaining beyond the removed elements, or end() if no such element exists.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
+<p><span class="bold"><strong>Note</strong></span>: Does not invalidate iterators or references to non erased elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id307745-bb"></a>erase_after(const_iterator before_first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the range (before_first, last) from the list.</p>
+<p><span class="bold"><strong>Returns</strong></span>: the first element remaining beyond the removed elements, or end() if no such element exists.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of erased elements.</p>
+<p><span class="bold"><strong>Note</strong></span>: Does not invalidate iterators or references to non erased elements. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id307820-bb"></a>erase(const_iterator p) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element at p p.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements before p. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id307875-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: first and last must be valid iterator to elements in *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the elements pointed by [first, last).</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the distance between first and last plus linear to the elements before first. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id307940-bb"></a>resize(size_type new_size, <span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts or erases elements at the end such that the size becomes n. New elements are copy constructed from x.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the difference between size() and new_size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id307996-bb"></a>resize(size_type new_size) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts or erases elements at the end such that the size becomes n. New elements are default constructed.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the difference between size() and new_size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308045-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements of the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the list. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308084-bb"></a>splice_after(const_iterator prev_pos, slist & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must point to an element contained by the list. x != *this</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers all the elements of list x to this list, after the the element pointed by p. No destructors or copy constructors are called.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements in x.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308164-bb"></a>splice_after(const_iterator prev_pos, slist & x, const_iterator prev) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: prev_pos must be a valid iterator of this. i must point to an element contained in list x.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers the value pointed by i, from list x to this list, after the element pointed by prev_pos. If prev_pos == prev or prev_pos == ++prev, this function is a null operation.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308253-bb"></a>splice_after(const_iterator prev_pos, slist & x,
+ const_iterator before_first, const_iterator before_last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: prev_pos must be a valid iterator of this. before_first and before_last must be valid iterators of x. prev_pos must not be contained in [before_first, before_last) range.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers the range [before_first + 1, before_last + 1) from list x to this list, after the element pointed by prev_pos.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of transferred elements.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308350-bb"></a>splice_after(const_iterator prev_pos, slist & x,
+ const_iterator before_first, const_iterator before_last,
+ size_type n) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: prev_pos must be a valid iterator of this. before_first and before_last must be valid iterators of x. prev_pos must not be contained in [before_first, before_last) range. n == std::distance(before_first, before_last)</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers the range [before_first + 1, before_last + 1) from list x to this list, after the element pointed by prev_pos.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308455-bb"></a>splice(const_iterator p, ThisType & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must point to an element contained by the list. x != *this</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers all the elements of list x to this list, before the the element pointed by p. No destructors or copy constructors are called.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in distance(begin(), p), and linear in x.size().</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308533-bb"></a>splice(const_iterator p, slist & x, const_iterator i) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must point to an element contained by this list. i must point to an element contained in list x.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers the value pointed by i, from list x to this list, before the the element pointed by p. No destructors or copy constructors are called. If p == i or p == ++i, this function is a null operation.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in distance(begin(), p), and in distance(x.begin(), i).</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308623-bb"></a>splice(const_iterator p, slist & x, const_iterator first,
+ const_iterator last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must point to an element contained by this list. first and last must point to elements contained in list x.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Transfers the range pointed by first and last from list x to this list, before the the element pointed by p. No destructors or copy constructors are called.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::runtime_error if this' allocator and x's allocator are not equal.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear in distance(begin(), p), in distance(x.begin(), first), and in distance(first, last).</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators of values obtained from list x now point to elements of this list. Iterators of this list and all the references are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308720-bb"></a>reverse() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Reverses the order of elements in the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: This function is linear time.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators and references are not invalidated </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308768-bb"></a>remove(<span class="bold"><strong>const</strong></span> T & value) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes all the elements that compare equal to value.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear time. It performs exactly size() comparisons for equality.</p>
+<p><span class="bold"><strong>Note</strong></span>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Pred> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308826-bb"></a>remove_if(Pred pred) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes all the elements for which a specified predicate is satisfied.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If pred throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear time. It performs exactly size() calls to the predicate.</p>
+<p><span class="bold"><strong>Note</strong></span>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308893-bb"></a>unique() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes adjacent duplicate elements or adjacent elements that are equal from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear time (size()-1 comparisons calls to pred()).</p>
+<p><span class="bold"><strong>Note</strong></span>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Pred> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id308944-bb"></a>unique(Pred pred) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes adjacent duplicate elements or adjacent elements that satisfy some binary predicate from the list.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If pred throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear time (size()-1 comparisons equality comparisons).</p>
+<p><span class="bold"><strong>Note</strong></span>: The relative order of elements that are not removed is unchanged, and iterators to elements that are not removed remain valid. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id309011-bb"></a>merge(slist & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: The lists x and *this must be distinct.</p>
+<p><span class="bold"><strong>Effects</strong></span>: This function removes all of x's elements and inserts them in order into *this according to std::less<value_type>. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: This function is linear time: it performs at most size() + x.size() - 1 comparisons. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> StrictWeakOrdering>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id309074-bb"></a>merge(slist & x, StrictWeakOrdering comp) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: p must be a comparison function that induces a strict weak ordering and both *this and x must be sorted according to that ordering The lists x and *this must be distinct.</p>
+<p><span class="bold"><strong>Effects</strong></span>: This function removes all of x's elements and inserts them in order into *this. The merge is stable; that is, if an element from *this is equivalent to one from x, then the element from *this will precede the one from x.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: This function is linear time: it performs at most size() + x.size() - 1 comparisons.</p>
+<p><span class="bold"><strong>Note</strong></span>: Iterators and references to *this are not invalidated. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id309166-bb"></a>sort() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: This function sorts the list *this according to std::less<value_type>. The sort is stable, that is, the relative order of equivalent elements is preserved.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Notes</strong></span>: Iterators and references are not invalidated.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: The number of comparisons is approximately N log N, where N is the list's size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> StrictWeakOrdering> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id309216-bb"></a>sort(StrictWeakOrdering comp) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: This function sorts the list *this according to std::less<value_type>. The sort is stable, that is, the relative order of equivalent elements is preserved.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Notes</strong></span>: Iterators and references are not invalidated.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: The number of comparisons is approximately N log N, where N is the list's size. </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="multiset.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.slist_hpp"><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="stable_vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/stable_vector.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/stable_vector.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,233 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template stable_vector</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.stable_vector_hpp" title="Header <boost/container/stable_vector.hpp>">
+<link rel="prev" href="slist.html" title="Class template slist">
+<link rel="next" href="basic_string.html" title="Class template basic_string">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="slist.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.stable_vector_hpp"><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="basic_string.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.stable_vector"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template stable_vector</span></h2>
+<p>boost::container::stable_vector — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+<span class="bold"><strong>class</strong></span> stable_vector {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> Allocator::reference <a name="boost.container.stable_vector.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> Allocator::const_reference <a name="boost.container.stable_vector.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> Allocator::pointer <a name="boost.container.stable_vector.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> Allocator::const_pointer <a name="boost.container.stable_vector.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="boost.container.stable_vector.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="boost.container.stable_vector.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> impl_type::size_type <a name="boost.container.stable_vector.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> iterator::difference_type <a name="boost.container.stable_vector.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> T <a name="boost.container.stable_vector.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> Allocator <a name="boost.container.stable_vector.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< iterator > <a name="boost.container.stable_vector.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< const_iterator > <a name="boost.container.stable_vector.const_reverse_iterator"></a>const_reverse_iterator;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ stable_vector(<span class="bold"><strong>const</strong></span> Allocator & = Allocator());
+ stable_vector(size_type);
+ stable_vector(size_type, <span class="bold"><strong>const</strong></span> T &, <span class="bold"><strong>const</strong></span> Allocator & = Allocator());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ stable_vector(InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Allocator & = Allocator());
+ stable_vector(<span class="bold"><strong>const</strong></span> stable_vector &);
+ stable_vector(stable_vector &&);
+ stable_vector& operator=(<span class="bold"><strong>const</strong></span> stable_vector &);
+ stable_vector& operator=(stable_vector &&);
+ ~stable_vector();
+
+ <span class="emphasis"><em>// private member functions</em></span>
+ <span class="type">node_type_ptr_t</span> allocate_one() ;
+ <span class="type">node_type_ptr_t</span> allocate_one(allocator_v1) ;
+ <span class="type">node_type_ptr_t</span> allocate_one(allocator_v2) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> deallocate_one(node_type_ptr_t) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> deallocate_one(node_type_ptr_t, allocator_v1) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> deallocate_one(node_type_ptr_t, allocator_v2) ;
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> assign(InputIterator, InputIterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> assign(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> capacity() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reserve(size_type) ;
+ <span class="type">reference</span> operator[](size_type) ;
+ <span class="type">const_reference</span> operator[](size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reference</span> at(size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> at(size_type) ;
+ <span class="type">reference</span> front() ;
+ <span class="type">const_reference</span> front() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> back() ;
+ <span class="type">const_reference</span> back() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(<span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(T &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_back() ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type">iterator</span> insert(const_iterator, T &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> emplace_back(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(stable_vector &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id536769"></a><h2>Description</h2>
+<p>Help taken from (Introducing stable_vector)</p>
+<p>We present stable_vector, a fully STL-compliant stable container that provides most of the features of std::vector except element contiguity.</p>
+<p>General properties: stable_vector satisfies all the requirements of a container, a reversible container and a sequence and provides all the optional operations present in std::vector. Like std::vector, iterators are random access. stable_vector does not provide element contiguity; in exchange for this absence, the container is stable, i.e. references and iterators to an element of a stable_vector remain valid as long as the element is not erased, and an iterator that has been assigned the return value of end() always remain valid until the destruction of the associated stable_vector.</p>
+<p>Operation complexity: The big-O complexities of stable_vector operations match exactly those of std::vector. In general, insertion/deletion is constant time at the end of the sequence and linear elsewhere. Unlike std::vector, stable_vector does not internally perform any value_type destruction, copy or assignment operations other than those exactly corresponding to the insertion of new elements or deletion of stored elements, which can sometimes compensate in terms of performance for the extra burden of doing more pointer manipulation and an additional allocation per element.</p>
+<p>Exception safety: As stable_vector does not internally copy elements around, some operations provide stronger exception safety guarantees than in std::vector: </p>
+<div class="refsect2" lang="en">
+<a name="id536812"></a><h3>
+<a name="boost.container.stable_vectorconstruct-copy-destruct"></a><code class="computeroutput">stable_vector</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id311078-bb"></a>stable_vector(<span class="bold"><strong>const</strong></span> Allocator & al = Allocator());</pre></li>
+<li><pre class="literallayout"><a name="id311090-bb"></a>stable_vector(size_type n);</pre></li>
+<li><pre class="literallayout"><a name="id311099-bb"></a>stable_vector(size_type n, <span class="bold"><strong>const</strong></span> T & t, <span class="bold"><strong>const</strong></span> Allocator & al = Allocator());</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id311127-bb"></a>stable_vector(InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Allocator & al = Allocator());</pre></li>
+<li><pre class="literallayout"><a name="id311163-bb"></a>stable_vector(<span class="bold"><strong>const</strong></span> stable_vector & x);</pre></li>
+<li><pre class="literallayout"><a name="id311177-bb"></a>stable_vector(stable_vector && x);</pre></li>
+<li><pre class="literallayout">stable_vector& <a name="id311190-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> stable_vector & x);</pre></li>
+<li><pre class="literallayout">stable_vector& <a name="id311204-bb"></a><span class="bold"><strong>operator</strong></span>=(stable_vector && x);</pre></li>
+<li><pre class="literallayout"><a name="id311189-bb"></a>~stable_vector();</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id537123"></a><h3>
+<a name="id310182-bb"></a><code class="computeroutput">stable_vector</code> private member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="type">node_type_ptr_t</span> <a name="id310186-bb"></a>allocate_one() ;</pre></li>
+<li><pre class="literallayout"><span class="type">node_type_ptr_t</span> <a name="id310196-bb"></a>allocate_one(allocator_v1) ;</pre></li>
+<li><pre class="literallayout"><span class="type">node_type_ptr_t</span> <a name="id310214-bb"></a>allocate_one(allocator_v2) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310231-bb"></a>deallocate_one(node_type_ptr_t p) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310249-bb"></a>deallocate_one(node_type_ptr_t p, allocator_v1) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310274-bb"></a>deallocate_one(node_type_ptr_t p, allocator_v2) ;</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id537297"></a><h3>
+<a name="id310298-bb"></a><code class="computeroutput">stable_vector</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310303-bb"></a>assign(InputIterator first, InputIterator last) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310337-bb"></a>assign(size_type n, <span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type">allocator_type</span> <a name="id310362-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310372-bb"></a>begin() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id310382-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310391-bb"></a>end() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id310401-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id310411-bb"></a>rbegin() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id310421-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id310431-bb"></a>rend() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id310441-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id310451-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id310461-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id310471-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id310481-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">size_type</span> <a name="id310491-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">size_type</span> <a name="id310501-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">size_type</span> <a name="id310511-bb"></a>capacity() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id310521-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310531-bb"></a>resize(size_type n, <span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310555-bb"></a>resize(size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310573-bb"></a>reserve(size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id310590-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id310607-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id310625-bb"></a>at(size_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id310642-bb"></a>at(size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id310659-bb"></a>front() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id310669-bb"></a>front() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id310679-bb"></a>back() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id310689-bb"></a>back() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310699-bb"></a>push_back(<span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310716-bb"></a>push_back(T && t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310733-bb"></a>pop_back() ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310743-bb"></a>insert(const_iterator position, <span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310768-bb"></a>insert(const_iterator position, T && x) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310793-bb"></a>insert(const_iterator position, size_type n, <span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310825-bb"></a>insert(const_iterator position, InputIterator first,
+ InputIterator last) ;</pre></li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310867-bb"></a>emplace_back(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or the in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id310928-bb"></a>emplace(const_iterator position, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: position must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... before position</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or the in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: If position is end(), amortized constant time Linear time otherwise. </p>
+</li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id311006-bb"></a>erase(const_iterator position) ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id311023-bb"></a>erase(const_iterator first, const_iterator last) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id311048-bb"></a>swap(stable_vector & x) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id311068-bb"></a>clear() ;</pre></li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="slist.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.stable_vector_hpp"><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="basic_string.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/string.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/string.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Type definition string</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.string_hpp" title="Header <boost/container/string.hpp>">
+<link rel="prev" href="basic_string.html" title="Class template basic_string">
+<link rel="next" href="wstring.html" title="Type definition wstring">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="basic_string.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.string_hpp"><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="wstring.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.string"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Type definition string</span></h2>
+<p>string — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>typedef</strong></span> basic_string< <span class="bold"><strong>char</strong></span>,std::char_traits< <span class="bold"><strong>char</strong></span> >,std::allocator< <span class="bold"><strong>char</strong></span> > > string;</pre></div>
+<div class="refsect1" lang="en">
+<a name="id550910"></a><h2>Description</h2>
+<p>Typedef for a basic_string of narrow characters </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="basic_string.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.string_hpp"><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="wstring.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/vector.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/vector.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,496 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template vector</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.vector_hpp" title="Header <boost/container/vector.hpp>">
+<link rel="prev" href="wstring.html" title="Type definition wstring">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wstring.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.vector_hpp"><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>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.vector"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template vector</span></h2>
+<p>boost::container::vector — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+<span class="bold"><strong>class</strong></span> vector {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> T value_type;
+ <span class="bold"><strong>typedef</strong></span> A::pointer <a name="boost.container.vector.pointer"></a>pointer; <span class="emphasis"><em>// Pointer to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::const_pointer <a name="boost.container.vector.const_pointer"></a>const_pointer; <span class="emphasis"><em>// Const pointer to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::reference <a name="boost.container.vector.reference"></a>reference; <span class="emphasis"><em>// Reference to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::const_reference <a name="boost.container.vector.const_reference"></a>const_reference; <span class="emphasis"><em>// Const reference to T. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::size_type <a name="boost.container.vector.size_type"></a>size_type; <span class="emphasis"><em>// An unsigned integral type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A::difference_type <a name="boost.container.vector.difference_type"></a>difference_type; <span class="emphasis"><em>// A signed integral type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> A <a name="boost.container.vector.allocator_type"></a>allocator_type; <span class="emphasis"><em>// The allocator type. </em></span>
+ <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="boost.container.vector.iterator"></a>iterator; <span class="emphasis"><em>// The random access iterator. </em></span>
+ <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="boost.container.vector.const_iterator"></a>const_iterator; <span class="emphasis"><em>// The random access const_iterator. </em></span>
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< iterator > <a name="boost.container.vector.reverse_iterator"></a>reverse_iterator; <span class="emphasis"><em>// Iterator used to iterate backwards through a vector. </em></span>
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< const_iterator > <a name="boost.container.vector.const_reverse_iterator"></a>const_reverse_iterator; <span class="emphasis"><em>// Const iterator used to iterate backwards through a vector. </em></span>
+ <span class="bold"><strong>typedef</strong></span> allocator_type <a name="boost.container.vector.stored_allocator_type"></a>stored_allocator_type; <span class="emphasis"><em>// The stored allocator type. </em></span>
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ vector(<span class="bold"><strong>const</strong></span> A & = A());
+ vector(size_type);
+ vector(size_type, <span class="bold"><strong>const</strong></span> T &, <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ vector(<span class="bold"><strong>const</strong></span> vector< T, A > &);
+ vector(vector &&);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIt>
+ vector(InIt, InIt, <span class="bold"><strong>const</strong></span> allocator_type & = allocator_type());
+ vector& operator=(<span class="bold"><strong>const</strong></span> vector &);
+ vector& operator=(vector &&);
+ ~vector();
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> front() ;
+ <span class="type">const_reference</span> front() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> back() ;
+ <span class="type">const_reference</span> back() <span class="bold"><strong>const</strong></span>;
+ <span class="type">pointer</span> data() ;
+ <span class="type">const_pointer</span> data() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> capacity() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> operator[](size_type) ;
+ <span class="type">const_reference</span> operator[](size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> at(size_type) ;
+ <span class="type">const_reference</span> at(size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> get_stored_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">stored_allocator_type &</span> get_stored_allocator() ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reserve(size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> assign(size_type, <span class="bold"><strong>const</strong></span> value_type &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIt> <span class="type"><span class="bold"><strong>void</strong></span></span> assign(InIt, InIt) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(<span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(T &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> emplace_back(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(const_iterator, Args &&...) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(vector &) ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type">iterator</span> insert(const_iterator, T &&) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIt> <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, InIt, InIt) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_back() ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id552952"></a><h2>Description</h2>
+<p>A vector is a sequence that supports random access to elements, constant time insertion and removal of elements at the end, and linear time insertion and removal of elements at the beginning or in the middle. The number of elements in a vector may vary dynamically; memory management is automatic. boost::container::vector is similar to std::vector but it's compatible with shared memory and memory mapped files. </p>
+<div class="refsect2" lang="en">
+<a name="id552966"></a><h3>
+<a name="boost.container.vectortypes"></a><code class="computeroutput">vector</code>
+ public
+ types</h3>
+<div class="orderedlist"><ol type="1"><li>
+<p>
+<span class="bold"><strong>typedef</strong></span> T <a name="boost.container.vector.value_type"></a>value_type;</p>
+<p>The type of object, T, stored in the vector </p>
+</li></ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id553015"></a><h3>
+<a name="boost.container.vectorconstruct-copy-destruct"></a><code class="computeroutput">vector</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><a name="id320547-bb"></a>vector(<span class="bold"><strong>const</strong></span> A & a = A());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a vector taking the allocator as parameter.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id320589-bb"></a>vector(size_type n);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a vector that will use a copy of allocator a and inserts n default contructed values.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws or T's default or copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id320629-bb"></a>vector(size_type n, <span class="bold"><strong>const</strong></span> T & value,
+ <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a vector that will use a copy of allocator a and inserts n copies of value.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws or T's default or copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id320687-bb"></a>vector(<span class="bold"><strong>const</strong></span> vector< T, A > & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Copy constructs a vector.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x == *this.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements x contains. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id320730-bb"></a>vector(vector && mx);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move constructor. Moves mx's resources to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIt>
+ <a name="id320771-bb"></a>vector(InIt first, InIt last, <span class="bold"><strong>const</strong></span> allocator_type & a = allocator_type());</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a vector that will use a copy of allocator a and inserts a copy of the range [first, last) in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's default constructor or copy constructor throws or T's constructor taking an dereferenced InIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the range [first, last). </p>
+</li>
+<li>
+<pre class="literallayout">vector& <a name="id320871-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> vector & x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Makes *this contain the same elements as x.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: this->size() == x.size(). *this contains a copy of each of x's elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in x. </p>
+</li>
+<li>
+<pre class="literallayout">vector& <a name="id320924-bb"></a><span class="bold"><strong>operator</strong></span>=(vector && x);</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Move assignment. All mx's values are transferred to *this.</p>
+<p><span class="bold"><strong>Postcondition</strong></span>: x.empty(). *this contains a the elements x had before the function.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator_type's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><a name="id320840-bb"></a>~vector();</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Destroys the vector. All stored values are destroyed and used memory is deallocated.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements. </p>
+</li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id553570"></a><h3>
+<a name="id318364-bb"></a><code class="computeroutput">vector</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id318368-bb"></a>begin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the first element contained in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id318407-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id318446-bb"></a>end() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns an iterator to the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id318485-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id318524-bb"></a>rbegin() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the beginning of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id318563-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id318602-bb"></a>rend() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reverse_iterator pointing to the end of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id318641-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id318681-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the first element contained in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_iterator</span> <a name="id318720-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_iterator to the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id318758-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the beginning of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id318798-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const_reverse_iterator pointing to the end of the reversed vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id318837-bb"></a>front() ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id318885-bb"></a>front() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id318933-bb"></a>back() ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: !empty()</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id318981-bb"></a>back() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the first element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">pointer</span> <a name="id319021-bb"></a>data() ;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A pointer such that [data(),data() + size()) is a valid range. For a non-empty vector, data() == &front().</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_pointer</span> <a name="id319060-bb"></a>data() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Returns</strong></span>: A pointer such that [data(),data() + size()) is a valid range. For a non-empty vector, data() == &front().</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id319100-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the number of the elements contained in the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id319138-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns the largest possible size of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">size_type</span> <a name="id319177-bb"></a>capacity() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Number of elements for which memory has been allocated. capacity() is always greater than or equal to size().</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id319217-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns true if the vector contains no elements.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id319256-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: size() < n.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the nth element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id319311-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: size() < n.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the nth element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">reference</span> <a name="id319367-bb"></a>at(size_type n) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: size() < n.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a reference to the nth element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::range_error if n >= size()</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">const_reference</span> <a name="id319423-bb"></a>at(size_type n) <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: size() < n.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a const reference to the nth element from the beginning of the container.</p>
+<p><span class="bold"><strong>Throws</strong></span>: std::range_error if n >= size()</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">allocator_type</span> <a name="id319479-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Returns a copy of the internal allocator.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If allocator's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>const</strong></span> stored_allocator_type &</span> <a name="id319518-bb"></a>get_stored_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">stored_allocator_type &</span> <a name="id319528-bb"></a>get_stored_allocator() ;</pre></li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id319539-bb"></a>reserve(size_type new_cap) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: If n is less than or equal to capacity(), this call has no effect. Otherwise, it is a request for allocation of additional memory. If the request is successful, then capacity() is greater than or equal to n; otherwise, capacity() is unchanged. In either case, size() is unchanged.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation allocation throws or T's copy constructor throws. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id319581-bb"></a>assign(size_type n, <span class="bold"><strong>const</strong></span> value_type & val) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Assigns the n copies of val to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIt> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id319635-bb"></a>assign(InIt first, InIt last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Assigns the the range [first, last) to *this.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's constructor from dereferencing InpIt throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id319698-bb"></a>push_back(<span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts a copy of x at the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id319745-bb"></a>push_back(T && x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Constructs a new element in the end of the vector and moves the resources of mx to this new element.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id319793-bb"></a>emplace_back(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or the in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id319853-bb"></a>emplace(const_iterator position, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: position must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... before position</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or the in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: If position is end(), amortized constant time Linear time otherwise. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id319931-bb"></a>swap(vector & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Swaps the contents of *this and x. If this->allocator_type() != x.allocator_type() allocators are also swapped.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id319981-bb"></a>insert(const_iterator position, <span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: position must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a copy of x before position.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or x's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: If position is end(), amortized constant time Linear time otherwise. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id320046-bb"></a>insert(const_iterator position, T && x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: position must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a new element before position with mx's resources.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: If position is end(), amortized constant time Linear time otherwise. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InIt>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id320110-bb"></a>insert(const_iterator pos, InIt first, InIt last) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: pos must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert a copy of the [first, last) range before pos.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, T's constructor from a dereferenced InpIt throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to std::distance [first, last). </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id320192-bb"></a>insert(const_iterator p, size_type n, <span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: pos must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Insert n copies of x before pos.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to n. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id320263-bb"></a>pop_back() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Removes the last element from the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id320302-bb"></a>erase(const_iterator position) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the element at position pos.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the elements between pos and the last element. Constant if pos is the first or the last element. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type">iterator</span> <a name="id320349-bb"></a>erase(const_iterator first, const_iterator last) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases the elements pointed by [first, last).</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the distance between first and last. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id320403-bb"></a>resize(size_type new_size, <span class="bold"><strong>const</strong></span> T & x) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts or erases elements at the end such that the size becomes n. New elements are copy constructed from x.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the difference between size() and new_size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id320459-bb"></a>resize(size_type new_size) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts or erases elements at the end such that the size becomes n. New elements are default constructed.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws, or T's copy constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the difference between size() and new_size. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id320508-bb"></a>clear() ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Erases all the elements of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: Nothing.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Linear to the number of elements in the vector. </p>
+</li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="wstring.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.vector_hpp"><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>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost/container/wstring.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost/container/wstring.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Type definition wstring</title>
+<link rel="stylesheet" href="../../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../../boost_container_reference.html#header.boost.container.string_hpp" title="Header <boost/container/string.hpp>">
+<link rel="prev" href="string.html" title="Type definition string">
+<link rel="next" href="vector.html" title="Class template vector">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="string.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.string_hpp"><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="vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.container.wstring"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Type definition wstring</span></h2>
+<p>wstring — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>typedef</strong></span> basic_string< <span class="bold"><strong>wchar_t</strong></span>,std::char_traits< <span class="bold"><strong>wchar_t</strong></span> >,std::allocator< <span class="bold"><strong>wchar_t</strong></span> > > wstring;</pre></div>
+<div class="refsect1" lang="en">
+<a name="id550976"></a><h2>Description</h2>
+<p>Typedef for a basic_string of narrow characters </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="string.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_container_reference.html#header.boost.container.string_hpp"><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="vector.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boost_container_reference.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boost_container_reference.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,524 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Boost.Container Reference</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="prev" href="container/release_notes.html" title=" Release Notes">
+<link rel="next" href="boost/container/ordered_range_impl_t.html" title="Struct ordered_range_impl_t">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="container/release_notes.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.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="boost/container/ordered_range_impl_t.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_container_reference"></a>Boost.Container Reference</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Header <boost/container/container_fwd.hpp></span></dt>
+<dt><span class="section">Header <boost/container/deque.hpp></span></dt>
+<dt><span class="section">Header <boost/container/flat_map.hpp></span></dt>
+<dt><span class="section">Header <boost/container/flat_set.hpp></span></dt>
+<dt><span class="section">Header <boost/container/list.hpp></span></dt>
+<dt><span class="section">Header <boost/container/map.hpp></span></dt>
+<dt><span class="section">Header <boost/container/set.hpp></span></dt>
+<dt><span class="section">Header <boost/container/slist.hpp></span></dt>
+<dt><span class="section">Header <boost/container/stable_vector.hpp></span></dt>
+<dt><span class="section">Header <boost/container/string.hpp></span></dt>
+<dt><span class="section">Header <boost/container/vector.hpp></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.container_fwd_hpp"></a>Header <boost/container/container_fwd.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>struct</strong></span> ordered_range_impl_t;
+ <span class="bold"><strong>struct</strong></span> ordered_unique_range_impl_t;
+
+ <span class="bold"><strong>static</strong></span> const ordered_range_t ordered_range;
+ <span class="bold"><strong>static</strong></span> const ordered_unique_range_t ordered_unique_range;
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.deque_hpp"></a>Header <boost/container/deque.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Alloc> <span class="bold"><strong>class</strong></span> deque;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id279377"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> deque< T, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> deque< T, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id279424"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> deque< T, Alloc > & x, <span class="bold"><strong>const</strong></span> deque< T, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id279470"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> deque< T, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> deque< T, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id279517"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> deque< T, Alloc > & x, <span class="bold"><strong>const</strong></span> deque< T, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id279563"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> deque< T, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> deque< T, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id279610"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> deque< T, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> deque< T, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id279656"></a>swap(deque< T, A > & x, deque< T, A > & y);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.flat_map_hpp"></a>Header <boost/container/flat_map.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="bold"><strong>class</strong></span> flat_map;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="bold"><strong>class</strong></span> flat_multimap;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id284815"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id284874"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id284933"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id284993"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id285052"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id285111"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id285171"></a>swap(flat_map< Key, T, Pred, Alloc > & x,
+ flat_map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id285227"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id285286"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id285346"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id285405"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id285464"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id285524"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id285583"></a>swap(flat_multimap< Key, T, Pred, Alloc > & x,
+ flat_multimap< Key, T, Pred, Alloc > & y);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.flat_set_hpp"></a>Header <boost/container/flat_set.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc> <span class="bold"><strong>class</strong></span> flat_set;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc> <span class="bold"><strong>class</strong></span> flat_multiset;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id290354"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id290407"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id290460"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id290513"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id290566"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id290619"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id290672"></a>swap(flat_set< T, Pred, Alloc > & x,
+ flat_set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id290722"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id290776"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id290829"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id290882"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id290935"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id290988"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> flat_multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id291041"></a>swap(flat_multiset< T, Pred, Alloc > & x,
+ flat_multiset< T, Pred, Alloc > & y);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.list_hpp"></a>Header <boost/container/list.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A> <span class="bold"><strong>class</strong></span> list;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id294603"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> list< T, A > & x, <span class="bold"><strong>const</strong></span> list< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id294650"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> list< T, A > & x, <span class="bold"><strong>const</strong></span> list< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id294696"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> list< T, A > & x, <span class="bold"><strong>const</strong></span> list< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id294743"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> list< T, A > & x, <span class="bold"><strong>const</strong></span> list< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id294789"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> list< T, A > & x, <span class="bold"><strong>const</strong></span> list< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id294836"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> list< T, A > & x, <span class="bold"><strong>const</strong></span> list< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id294883"></a>swap(list< T, A > & x, list< T, A > & y);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.map_hpp"></a>Header <boost/container/map.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc> <span class="bold"><strong>class</strong></span> map;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="bold"><strong>class</strong></span> multimap;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id299719"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id299778"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id299837"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id299896"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id299955"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id300014"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id300073"></a>swap(map< Key, T, Pred, Alloc > & x,
+ map< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id300129"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id300188"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id300248"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id300307"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id300366"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id300426"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multimap< Key, T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Key, <span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id300485"></a>swap(multimap< Key, T, Pred, Alloc > & x,
+ multimap< Key, T, Pred, Alloc > & y);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.set_hpp"></a>Header <boost/container/set.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc> <span class="bold"><strong>class</strong></span> set;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc> <span class="bold"><strong>class</strong></span> multiset;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id304917"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id304970"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id305023"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id305076"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id305129"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id305181"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id305234"></a>swap(set< T, Pred, Alloc > & x, set< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id305284"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id305337"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id305390"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id305443"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id305496"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id305549"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & x,
+ <span class="bold"><strong>const</strong></span> multiset< T, Pred, Alloc > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Pred, <span class="bold"><strong>typename</strong></span> Alloc>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id305603"></a>swap(multiset< T, Pred, Alloc > & x,
+ multiset< T, Pred, Alloc > & y);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.slist_hpp"></a>Header <boost/container/slist.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A> <span class="bold"><strong>class</strong></span> slist;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id309692"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> slist< T, A > & x, <span class="bold"><strong>const</strong></span> slist< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id309739"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> slist< T, A > & sL1, <span class="bold"><strong>const</strong></span> slist< T, A > & sL2);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id309785"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> slist< T, A > & sL1, <span class="bold"><strong>const</strong></span> slist< T, A > & sL2);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id309832"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> slist< T, A > & sL1, <span class="bold"><strong>const</strong></span> slist< T, A > & sL2);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id309878"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> slist< T, A > & sL1, <span class="bold"><strong>const</strong></span> slist< T, A > & sL2);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id309925"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> slist< T, A > & sL1, <span class="bold"><strong>const</strong></span> slist< T, A > & sL2);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id309972"></a>swap(slist< T, A > & x, slist< T, A > & y);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.stable_vector_hpp"></a>Header <boost/container/stable_vector.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator> <span class="bold"><strong>class</strong></span> stable_vector;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id311216"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & x,
+ <span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id311263"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & x,
+ <span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id311311"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & x,
+ <span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id311358"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & x,
+ <span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id311405"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & x,
+ <span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id311452"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & x,
+ <span class="bold"><strong>const</strong></span> stable_vector< T, Allocator > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id311499"></a>swap(stable_vector< T, Allocator > & x,
+ stable_vector< T, Allocator > & y);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.string_hpp"></a>Header <boost/container/string.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A> <span class="bold"><strong>class</strong></span> basic_string;
+ <span class="bold"><strong>typedef</strong></span> basic_string< <span class="bold"><strong>char</strong></span>,std::char_traits< <span class="bold"><strong>char</strong></span> >,std::allocator< <span class="bold"><strong>char</strong></span> > > string;
+ <span class="bold"><strong>typedef</strong></span> basic_string< <span class="bold"><strong>wchar_t</strong></span>,std::char_traits< <span class="bold"><strong>wchar_t</strong></span> >,std::allocator< <span class="bold"><strong>wchar_t</strong></span> > > wstring;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A ></span>
+ <a name="boost.container.operator+_id316360"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > &&</span>
+ <a name="boost.container.operator+_id316417"></a><span class="bold"><strong>operator</strong></span>+(basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > && mx,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > &&</span>
+ <a name="boost.container.operator+_id316482"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > && my);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A ></span>
+ <a name="boost.container.operator+_id316547"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> CharT * s, <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > &&</span>
+ <a name="boost.container.operator+_id316598"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> CharT * s,
+ basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > && my);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A ></span>
+ <a name="boost.container.operator+_id316659"></a><span class="bold"><strong>operator</strong></span>+(CharT c, <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > &&</span>
+ <a name="boost.container.operator+_id316710"></a><span class="bold"><strong>operator</strong></span>+(CharT c,
+ basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > && my);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A ></span>
+ <a name="boost.container.operator+_id316770"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x, <span class="bold"><strong>const</strong></span> CharT * s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > &&</span>
+ <a name="boost.container.operator+_id316822"></a><span class="bold"><strong>operator</strong></span>+(basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > && mx,
+ <span class="bold"><strong>const</strong></span> CharT * s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A ></span>
+ <a name="boost.container.operator+_id316882"></a><span class="bold"><strong>operator</strong></span>+(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x, <span class="bold"><strong>const</strong></span> CharT c);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > &&</span>
+ <a name="boost.container.operator+_id316934"></a><span class="bold"><strong>operator</strong></span>+(basic_string< CharT, Traits, A > basic_string< CharT, Traits, A > && mx,
+ <span class="bold"><strong>const</strong></span> CharT c);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id316994"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id317047"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> CharT * s,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id317096"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> CharT * s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id317144"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id317197"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> CharT * s,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id317245"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> CharT * s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id317293"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id317346"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> CharT * s,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id317395"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> CharT * s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id317443"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id317496"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> CharT * s,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id317544"></a><span class="bold"><strong>operator</strong></span>>(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> CharT * s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id317593"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id317646"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> CharT * s,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id317694"></a><span class="bold"><strong>operator</strong></span><=(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> CharT * s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id317742"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id317795"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> CharT * s,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_=_id317844"></a><span class="bold"><strong>operator</strong></span>>=(<span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & x,
+ <span class="bold"><strong>const</strong></span> CharT * s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id317892"></a>swap(basic_string< CharT, Traits, A > & x,
+ basic_string< CharT, Traits, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">std::basic_ostream< CharT, Traits > &</span>
+ <a name="boost.container.operator_id317942"></a><span class="bold"><strong>operator</strong></span><<(std::basic_ostream< CharT, Traits > & os,
+ <span class="bold"><strong>const</strong></span> basic_string< CharT, Traits, A > & s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">std::basic_istream< CharT, Traits > &</span>
+ <a name="boost.container.operator_id317991"></a><span class="bold"><strong>operator</strong></span>>>(std::basic_istream< CharT, Traits > & is,
+ basic_string< CharT, Traits, A > & s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">std::basic_istream< CharT, Traits > &</span>
+ <a name="boost.container.getline_id318039"></a>getline(std::istream & is, basic_string< CharT, Traits, A > & s,
+ CharT delim);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> CharT, <span class="bold"><strong>typename</strong></span> Traits, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">std::basic_istream< CharT, Traits > &</span>
+ <a name="boost.container.getline_id318094"></a>getline(std::basic_istream< CharT, Traits > & is,
+ basic_string< CharT, Traits, A > & s);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> Ch, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type">std::size_t</span> <a name="boost.container.hash_value"></a>hash_value(basic_string< Ch, std::char_traits< Ch >, A > <span class="bold"><strong>const</strong></span> & v);
+ }
+}</pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.container.vector_hpp"></a>Header <boost/container/vector.hpp></h3></div></div></div>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>namespace</strong></span> container {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A> <span class="bold"><strong>class</strong></span> vector;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator==_id320976"></a><span class="bold"><strong>operator</strong></span>==(<span class="bold"><strong>const</strong></span> vector< T, A > & x, <span class="bold"><strong>const</strong></span> vector< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator!=_id321022"></a><span class="bold"><strong>operator</strong></span>!=(<span class="bold"><strong>const</strong></span> vector< T, A > & x, <span class="bold"><strong>const</strong></span> vector< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="boost.container.operator_id321069"></a><span class="bold"><strong>operator</strong></span><(<span class="bold"><strong>const</strong></span> vector< T, A > & x, <span class="bold"><strong>const</strong></span> vector< T, A > & y);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> A>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="boost.container.swap_id321115"></a>swap(vector< T, A > & x, vector< T, A > & y);
+ }
+}</pre>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="container/release_notes.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="index.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="boost/container/ordered_range_impl_t.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/boostbook.css
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/boostbook.css 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,538 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*=============================================================================
+ Body defaults
+=============================================================================*/
+
+ body
+ {
+ margin: 1em;
+ font-family: sans-serif;
+ }
+
+/*=============================================================================
+ Paragraphs
+=============================================================================*/
+
+ p
+ {
+ text-align: left;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+/*=============================================================================
+ Program listings
+=============================================================================*/
+
+ /* Code on paragraphs */
+ p tt.computeroutput
+ {
+ font-size: 10pt;
+ }
+
+ pre.synopsis
+ {
+ font-size: 10pt;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ .programlisting,
+ .screen
+ {
+ font-size: 10pt;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+/*=============================================================================
+ Headings
+=============================================================================*/
+
+ h1, h2, h3, h4, h5, h6
+ {
+ text-align: left;
+ margin: 1em 0em 0.5em 0em;
+ font-weight: bold;
+ }
+
+ h1 { font: 140% }
+ h2 { font: bold 140% }
+ h3 { font: bold 130% }
+ h4 { font: bold 120% }
+ h5 { font: italic 110% }
+ h6 { font: italic 100% }
+
+ /* Top page titles */
+ title,
+ h1.title,
+ h2.title
+ h3.title,
+ h4.title,
+ h5.title,
+ h6.title,
+ .refentrytitle
+ {
+ font-weight: bold;
+ margin-bottom: 1pc;
+ }
+
+ h1.title { font-size: 140% }
+ h2.title { font-size: 140% }
+ h3.title { font-size: 130% }
+ h4.title { font-size: 120% }
+ h5.title { font-size: 110% }
+ h6.title { font-size: 100% }
+
+ .section h1
+ {
+ margin: 0em 0em 0.5em 0em;
+ font-size: 140%;
+ }
+
+ .section h2 { font-size: 140% }
+ .section h3 { font-size: 130% }
+ .section h4 { font-size: 120% }
+ .section h5 { font-size: 110% }
+ .section h6 { font-size: 100% }
+
+ /* Code on titles */
+ h1 tt.computeroutput { font-size: 140% }
+ h2 tt.computeroutput { font-size: 140% }
+ h3 tt.computeroutput { font-size: 130% }
+ h4 tt.computeroutput { font-size: 120% }
+ h5 tt.computeroutput { font-size: 110% }
+ h6 tt.computeroutput { font-size: 100% }
+
+/*=============================================================================
+ Author
+=============================================================================*/
+
+ h3.author
+ {
+ font-size: 100%
+ }
+
+/*=============================================================================
+ Lists
+=============================================================================*/
+
+ li
+ {
+ font-size: 10pt;
+ line-height: 1.3;
+ }
+
+ /* Unordered lists */
+ ul
+ {
+ text-align: left;
+ }
+
+ /* Ordered lists */
+ ol
+ {
+ text-align: left;
+ }
+
+/*=============================================================================
+ Links
+=============================================================================*/
+
+ a
+ {
+ text-decoration: none; /* no underline */
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+/*=============================================================================
+ Spirit style navigation
+=============================================================================*/
+
+ .spirit-nav
+ {
+ text-align: right;
+ }
+
+ .spirit-nav a
+ {
+ color: white;
+ padding-left: 0.5em;
+ }
+
+ .spirit-nav img
+ {
+ border-width: 0px;
+ }
+
+/*=============================================================================
+ Table of contents
+=============================================================================*/
+
+ .toc
+ {
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.1pc 1pc 0.1pc 1pc;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+ .toc-main
+ {
+ width: 600;
+ text-align: center;
+ margin: 1pc 1pc 1pc 10%;
+ padding: 2pc 1pc 3pc 1pc;
+ line-height: 0.1;
+ }
+
+ .boost-toc
+ {
+ float: right;
+ padding: 0.5pc;
+ }
+
+/*=============================================================================
+ Tables
+=============================================================================*/
+
+ .table-title,
+ div.table p.title
+ {
+ margin-left: 4%;
+ padding-right: 0.5em;
+ padding-left: 0.5em;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+ }
+
+ div.informaltable table,
+ div.table table
+ {
+ padding: 4px;
+ }
+
+ /* Table Cells */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ padding: 0.5em;
+ text-align: left;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ border: 1pt solid white;
+ font-size: 120%;
+ }
+
+/*=============================================================================
+ Blurbs
+=============================================================================*/
+
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ font-size: 10pt;
+ line-height: 1.2;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ p.blurb img
+ {
+ padding: 1pt;
+ }
+
+/*=============================================================================
+ Variable Lists
+=============================================================================*/
+
+ span.term
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td
+ {
+ text-align: left;
+ vertical-align: top;
+ padding: 0em 2em 0em 0em;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td p
+ {
+ margin: 0em 0em 0.5em 0em;
+ }
+
+ /* Make the terms in definition lists bold */
+ div.variablelist dl dt
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist dl dd
+ {
+ margin: 1em 0em 1em 2em;
+ font-size: 10pt;
+ }
+
+/*=============================================================================
+ Misc
+=============================================================================*/
+
+ /* Title of books and articles in bibliographies */
+ span.title
+ {
+ font-style: italic;
+ }
+
+ span.underline
+ {
+ text-decoration: underline;
+ }
+
+ span.strikethrough
+ {
+ text-decoration: line-through;
+ }
+
+ /* Copyright, Legal Notice */
+ div div.legalnotice p
+ {
+ font-size: 8pt;
+ text-align: left
+ }
+
+/*=============================================================================
+ Colors
+=============================================================================*/
+
+ @media screen
+ {
+ /* Links */
+ a
+ {
+ color: #0C7445;
+ }
+
+ a:visited
+ {
+ color: #663974;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
+ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
+ {
+ text-decoration: none; /* no underline */
+ color: #000000;
+ }
+
+ /* Syntax Highlighting */
+ .keyword { color: #0000AA; }
+ .identifier { color: #000000; }
+ .special { color: #707070; }
+ .preprocessor { color: #402080; }
+ .char { color: teal; }
+ .comment { color: #800000; }
+ .string { color: teal; }
+ .number { color: teal; }
+ .white_bkd { background-color: #E8FBE9; }
+ .dk_grey_bkd { background-color: #A0DAAC; }
+
+ /* Copyright, Legal Notice */
+ .copyright
+ {
+ color: #666666;
+ font-size: small;
+ }
+
+ div div.legalnotice p
+ {
+ color: #666666;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Blurbs */
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc-main
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ background-color: #E3F9E4;
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ color: #00A000;
+ }
+ }
+
+ @media print
+ {
+ /* Links */
+ a
+ {
+ color: black;
+ }
+
+ a:visited
+ {
+ color: black;
+ }
+
+ .spirit-nav
+ {
+ display: none;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid gray;
+ background-color: #FAFFFB;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid gray;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc-main
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ border-collapse: collapse;
+ background-color: #FAFFFB;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ font-weight: bold;
+ }
+ }
Added: sandbox/move/libs/container/doc/html/container/acknowledgements_notes.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/container/acknowledgements_notes.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,48 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Acknowledgements, notes
+ and links</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="prev" href="other_features.html" title=" Other features">
+<link rel="next" href="release_notes.html" title=" Release Notes">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="other_features.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="release_notes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="container.acknowledgements_notes"></a><a href="acknowledgements_notes.html" title=" Acknowledgements, notes
+ and links"> Acknowledgements, notes
+ and links</a></h2></div></div></div>
+<div class="toc"><dl><dt><span class="section"> Thanks to...</span></dt></dl></div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
+<a name="container.acknowledgements_notes.thanks_to"></a> Thanks to...</h3></div></div></div></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="other_features.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="release_notes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/container/emplace.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/container/emplace.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,90 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Emplace: Placement insertion</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="prev" href="move_containers.html" title=" Move-aware containers">
+<link rel="next" href="recursive_containers.html" title=" Recursive containers">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_containers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="recursive_containers.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="container.emplace"></a> Emplace: Placement insertion</h2></div></div></div>
+<p>
+ All containers offered by <span class="bold"><strong>Boost.Container</strong></span>
+ implement placement insertion, which means that the objects can be built directly
+ from user arguments without creating any temporary object. Expensive to move
+ types are perfect candidates for these emplace functions and in case of node
+ containers (<code class="computeroutput">list</code>, <code class="computeroutput">set</code>, ...) emplace allows storing non-movable
+ and non-copyable types in containers! Let's see an example:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">container</span><span class="special">/</span><span class="identifier">list</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">cassert</span><span class="special">></span>
+
+<span class="comment">//Non-copyable and non-movable class
+</span><span class="keyword">class</span> <span class="identifier">non_copy_movable</span>
+<span class="special">{</span>
+ <span class="identifier">non_copy_movable</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">non_copy_movable</span> <span class="special">&);</span>
+ <span class="identifier">non_copy_movable</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">non_copy_movable</span> <span class="special">&);</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">non_copy_movable</span><span class="special">(</span><span class="keyword">int</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
+<span class="special">};</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span> <span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">;</span>
+
+ <span class="comment">//Store non-copyable and non-movable objects in a list
+</span> <span class="identifier">list</span><span class="special"><</span><span class="identifier">non_copy_movable</span><span class="special">></span> <span class="identifier">l</span><span class="special">;</span>
+ <span class="identifier">non_copy_movable</span> <span class="identifier">ncm</span><span class="special">;</span>
+
+ <span class="comment">//A new element will be built calling non_copy_movable(int) contructor
+</span> <span class="identifier">l</span><span class="special">.</span><span class="identifier">emplace</span><span class="special">(</span><span class="identifier">l</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="number">0</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">l</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">1</span><span class="special">);</span>
+
+ <span class="comment">//A new element will be built calling the default constructor
+</span> <span class="identifier">l</span><span class="special">.</span><span class="identifier">emplace</span><span class="special">(</span><span class="identifier">l</span><span class="special">.</span><span class="identifier">begin</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">l</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">2</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_containers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="recursive_containers.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/container/intro.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/container/intro.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,119 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Introduction</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="prev" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="next" href="move_containers.html" title=" Move-aware containers">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_containers.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="container.intro"></a> Introduction</h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="intro.html#container.intro.introduction_building_container"> Building
+ Boost.Container</a></span></dt>
+<dt><span class="section"> Tested compilers</span></dt>
+</dl></div>
+<p>
+ <span class="bold"><strong>Boost.Container</strong></span> library implements several
+ well-known containers, including STL containers. The aim of the library is
+ to offers advanced features not present in standard containers or to offer
+ the latest standard draft features for compilers that comply with C++03.
+ </p>
+<p>
+ In short, what does <span class="bold"><strong>Boost.Container</strong></span> offer?
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Move semantics are implemented, including move emulation for pre-C++0x compilers.
+ </li>
+<li>
+ New advanced features (e.g. placement insertion, recursive containers) are
+ present.
+ </li>
+<li>
+ Containers support stateful allocators and are compatible with <span class="bold"><strong>Boost.Interprocess</strong></span> (they can be safely placed in shared
+ memory).
+ </li>
+<li>
+ The library offers new useful containers:
+ <div class="itemizedlist"><ul type="circle">
+<li>
+<code class="computeroutput">flat_map</code>, <code class="computeroutput">flat_set</code>, <code class="computeroutput">flat_multiset</code>
+ and <code class="computeroutput">flat_multiset</code>:
+ drop-in replacements for standard associative containers but more memory
+ friendly and with faster searches.
+ </li>
+<li>
+<code class="computeroutput">stable_vector</code>:
+ a std::list and std::vector hybrid with random-access iterators that
+ offers iterator stability in insertions and erasures.
+ </li>
+<li>
+<code class="computeroutput">slist</code>: the classic
+ pre-standard singly linked list container.
+ </li>
+</ul></div>
+</li>
+</ul></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="container.intro.introduction_building_container"></a><a href="intro.html#container.intro.introduction_building_container" title=" Building
+ Boost.Container"> Building
+ Boost.Container</a></h3></div></div></div>
+<p>
+ There is no need to compile <span class="bold"><strong>Boost.Container</strong></span>,
+ since it's a header only library. Just include your Boost header directory
+ in your compiler include path.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="container.intro.tested_compilers"></a> Tested compilers</h3></div></div></div>
+<p>
+ <span class="bold"><strong>Boost.Container</strong></span> requires a decent C++98
+ compatibility. Some compilers known to work are:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Visual C++ >= 7.1.
+ </li>
+<li>
+ GCC >= 3.4.
+ </li>
+<li>
+ Intel C++ >= 9.0
+ </li>
+</ul></div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_containers.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/container/move_containers.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/container/move_containers.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,104 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Move-aware containers</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="prev" href="intro.html" title=" Introduction">
+<link rel="next" href="emplace.html" title=" Emplace: Placement insertion">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="intro.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="emplace.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="container.move_containers"></a> Move-aware containers</h2></div></div></div>
+<p>
+ All containers offered by <span class="bold"><strong>Boost.Container</strong></span>
+ can store movable-only types and actual requirements for <code class="computeroutput"><span class="identifier">value_type</span></code>
+ depend on each container operations. Following C++0x draft, many operations
+ now require movable or default constructible types instead of copy constructible
+ types.
+ </p>
+<p>
+ Containers themselves are also movable, with no-throw guarantee if allocator
+ or predicate (if present) copy operations are no-throw. This allows high performance
+ operations when transfering data between vectors. Let's see an example:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">container</span><span class="special">/</span><span class="identifier">vector</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">move</span><span class="special">/</span><span class="identifier">move</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">cassert</span><span class="special">></span>
+
+<span class="comment">//Non-copyable class
+</span><span class="keyword">class</span> <span class="identifier">non_copyable</span>
+<span class="special">{</span>
+ <span class="identifier">BOOST_MOVABLE_BUT_NOT_COPYABLE</span><span class="special">(</span><span class="identifier">non_copyable</span><span class="special">)</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">non_copyable</span><span class="special">(){}</span>
+ <span class="identifier">non_copyable</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">non_copyable</span><span class="special">))</span> <span class="special">{}</span>
+ <span class="identifier">non_copyable</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">non_copyable</span><span class="special">))</span> <span class="special">{</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span> <span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">;</span>
+
+ <span class="comment">//Store non-copyable objects in a vector
+</span> <span class="identifier">vector</span><span class="special"><</span><span class="identifier">non_copyable</span><span class="special">></span> <span class="identifier">v</span><span class="special">;</span>
+ <span class="identifier">non_copyable</span> <span class="identifier">nc</span><span class="special">;</span>
+ <span class="identifier">v</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">nc</span><span class="special">));</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">1</span><span class="special">);</span>
+
+ <span class="comment">//Reserve no longer needs copy-constructible
+</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">reserve</span><span class="special">(</span><span class="number">100</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">capacity</span><span class="special">()</span> <span class="special">>=</span> <span class="number">100</span><span class="special">);</span>
+
+ <span class="comment">//This resize overload only needs movable and default constructible
+</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span><span class="number">200</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">200</span><span class="special">);</span>
+
+ <span class="comment">//Containers are also movable
+</span> <span class="identifier">vector</span><span class="special"><</span><span class="identifier">non_copyable</span><span class="special">></span> <span class="identifier">v_other</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">v</span><span class="special">));</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">v_other</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="number">200</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">empty</span><span class="special">());</span>
+
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="intro.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="emplace.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/container/other_features.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/container/other_features.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,56 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Other features</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="prev" href="recursive_containers.html" title=" Recursive containers">
+<link rel="next" href="acknowledgements_notes.html" title=" Acknowledgements, notes
+ and links">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="recursive_containers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="acknowledgements_notes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="container.other_features"></a> Other features</h2></div></div></div>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Default constructors don't allocate memory which improves performance and
+ usually implies a no-throw guarantee (if predicate's default constructor
+ doesn't throw).
+ </li>
+<li>
+ Small string optimization for <code class="computeroutput">basic_string</code>,
+ with an internal buffer of 11/23 bytes (32/64 bit systems) <span class="bold"><strong>without</strong></span>
+ increasing the usual <code class="computeroutput"><span class="keyword">sizeof</span></code>
+ of the string (3 words).
+ </li>
+</ul></div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="recursive_containers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="acknowledgements_notes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/container/recursive_containers.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/container/recursive_containers.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,81 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Recursive containers</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="prev" href="emplace.html" title=" Emplace: Placement insertion">
+<link rel="next" href="other_features.html" title=" Other features">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="emplace.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="other_features.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="container.recursive_containers"></a> Recursive containers</h2></div></div></div>
+<p>
+ All containers offered by <span class="bold"><strong>Boost.Container</strong></span>
+ can be used in recursive data structures, something that is not guaranteed
+ by the standard. Programmers can write the following data structures:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">container</span><span class="special">/</span><span class="identifier">vector</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">container</span><span class="special">/</span><span class="identifier">list</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">container</span><span class="special">/</span><span class="identifier">map</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">container</span><span class="special">/</span><span class="identifier">stable_vector</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">;</span>
+
+<span class="keyword">struct</span> <span class="identifier">data</span>
+<span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">i_</span><span class="special">;</span>
+ <span class="identifier">vector</span><span class="special"><</span><span class="identifier">data</span><span class="special">></span> <span class="identifier">v_</span><span class="special">;</span>
+ <span class="identifier">list</span><span class="special"><</span><span class="identifier">data</span><span class="special">></span> <span class="identifier">l_</span><span class="special">;</span>
+ <span class="identifier">map</span><span class="special"><</span><span class="identifier">data</span><span class="special">,</span> <span class="identifier">data</span><span class="special">></span> <span class="identifier">m_</span><span class="special">;</span>
+
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span> <span class="special"><(</span><span class="keyword">const</span> <span class="identifier">data</span> <span class="special">&</span><span class="identifier">l</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">data</span> <span class="special">&</span><span class="identifier">r</span><span class="special">)</span>
+ <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">l</span><span class="special">.</span><span class="identifier">i_</span> <span class="special"><</span> <span class="identifier">r</span><span class="special">.</span><span class="identifier">i_</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">stable_vector</span><span class="special"><</span><span class="identifier">data</span><span class="special">></span> <span class="identifier">sv</span><span class="special">;</span>
+ <span class="identifier">sv</span><span class="special">.</span><span class="identifier">resize</span><span class="special">(</span><span class="number">100</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="emplace.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="other_features.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/container/release_notes.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/container/release_notes.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,41 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Release Notes</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Container">
+<link rel="prev" href="acknowledgements_notes.html" title=" Acknowledgements, notes
+ and links">
+<link rel="next" href="../boost_container_reference.html" title="Boost.Container Reference">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="acknowledgements_notes.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="../boost_container_reference.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="container.release_notes"></a> Release Notes</h2></div></div></div></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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="acknowledgements_notes.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="../boost_container_reference.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/images/blank.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/caution.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/draft.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/home.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/important.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/next.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/note.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/prev.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/tip.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/toc-blank.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/toc-minus.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/toc-plus.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/up.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/images/warning.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/container/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/index.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,95 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Chapter 1. Boost.Container</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="next" href="container/intro.html" title=" Introduction">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="container/intro.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div>
+<div><h2 class="title">
+<a name="container"></a>Chapter 1. Boost.Container</h2></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">Ion</span> <span class="surname">Gaztañaga</span>
+</h3></div></div>
+<div><p class="copyright">Copyright © 2009 -2009 Ion Gaztañaga</p></div>
+<div><div class="legalnotice">
+<a name="id399459"></a><p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></div>
+</div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"> Introduction</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="container/intro.html#container.intro.introduction_building_container"> Building
+ Boost.Container</a></span></dt>
+<dt><span class="section"> Tested compilers</span></dt>
+</dl></dd>
+<dt><span class="section"> Move-aware containers</span></dt>
+<dt><span class="section"> Emplace: Placement insertion</span></dt>
+<dt><span class="section"> Recursive containers</span></dt>
+<dt><span class="section"> Other features</span></dt>
+<dt><span class="section"><a href="container/acknowledgements_notes.html"> Acknowledgements, notes
+ and links</a></span></dt>
+<dd><dl><dt><span class="section"> Thanks to...</span></dt></dl></dd>
+<dt><span class="section"> Release Notes</span></dt>
+<dt><span class="section">Boost.Container Reference</span></dt>
+<dd><dl>
+<dt><span class="section">Header <boost/container/container_fwd.hpp></span></dt>
+<dt><span class="section">Header <boost/container/deque.hpp></span></dt>
+<dt><span class="section">Header <boost/container/flat_map.hpp></span></dt>
+<dt><span class="section">Header <boost/container/flat_set.hpp></span></dt>
+<dt><span class="section">Header <boost/container/list.hpp></span></dt>
+<dt><span class="section">Header <boost/container/map.hpp></span></dt>
+<dt><span class="section">Header <boost/container/set.hpp></span></dt>
+<dt><span class="section">Header <boost/container/slist.hpp></span></dt>
+<dt><span class="section">Header <boost/container/stable_vector.hpp></span></dt>
+<dt><span class="section">Header <boost/container/string.hpp></span></dt>
+<dt><span class="section">Header <boost/container/vector.hpp></span></dt>
+</dl></dd>
+</dl>
+</div>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../doc/html/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td colspan="2" align="left" valign="top"><p>
+ This library is NOT an official Boost library
+ </p></td></tr>
+</table></div>
+<div class="important"><table border="0" summary="Important">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../doc/html/images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td colspan="2" align="left" valign="top"><p>
+ To be able to use this library you also need <span class="bold"><strong>Boost.Move</strong></span>
+ </p></td></tr>
+</table></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: August 11, 2009 at 21:50:02 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="container/intro.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/reference.css
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/reference.css 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+PRE.synopsis {
+ background-color: #e0ffff;
+ border: thin solid blue;
+ padding: 1em
+}
Added: sandbox/move/libs/container/doc/html/stable_vector.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/stable_vector.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,233 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template stable_vector</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.stable_vector_hpp" title="Header <boost/container/stable_vector.hpp>">
+<link rel="prev" href="boost/container/slist.html" title="Class template slist">
+<link rel="next" href="boost/container/basic_string.html" title="Class template basic_string">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/slist.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.stable_vector_hpp"><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="boost/container/basic_string.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="stable_vector"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template stable_vector</span></h2>
+<p>stable_vector — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T, <span class="bold"><strong>typename</strong></span> Allocator>
+<span class="bold"><strong>class</strong></span> stable_vector {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> Allocator::reference <a name="stable_vector.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> Allocator::const_reference <a name="stable_vector.const_reference"></a>const_reference;
+ <span class="bold"><strong>typedef</strong></span> Allocator::pointer <a name="stable_vector.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> Allocator::const_pointer <a name="stable_vector.const_pointer"></a>const_pointer;
+ <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="stable_vector.iterator"></a>iterator;
+ <span class="bold"><strong>typedef</strong></span> <span class="emphasis"><em>unspecified</em></span> <a name="stable_vector.const_iterator"></a>const_iterator;
+ <span class="bold"><strong>typedef</strong></span> impl_type::size_type <a name="stable_vector.size_type"></a>size_type;
+ <span class="bold"><strong>typedef</strong></span> iterator::difference_type <a name="stable_vector.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> T <a name="stable_vector.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> Allocator <a name="stable_vector.allocator_type"></a>allocator_type;
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< iterator > <a name="stable_vector.reverse_iterator"></a>reverse_iterator;
+ <span class="bold"><strong>typedef</strong></span> std::reverse_iterator< const_iterator > <a name="stable_vector.const_reverse_iterator"></a>const_reverse_iterator;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ stable_vector(<span class="bold"><strong>const</strong></span> Allocator & = Allocator());
+ stable_vector(size_type);
+ stable_vector(size_type, <span class="bold"><strong>const</strong></span> T &, <span class="bold"><strong>const</strong></span> Allocator & = Allocator());
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ stable_vector(InputIterator, InputIterator,
+ <span class="bold"><strong>const</strong></span> Allocator & = Allocator());
+ stable_vector(<span class="bold"><strong>const</strong></span> stable_vector &);
+ stable_vector(stable_vector &&);
+ stable_vector& operator=(<span class="bold"><strong>const</strong></span> stable_vector &);
+ stable_vector& operator=(stable_vector &&);
+ ~stable_vector();
+
+ <span class="emphasis"><em>// private member functions</em></span>
+ <span class="type">node_type_ptr_t</span> allocate_one() ;
+ <span class="type">node_type_ptr_t</span> allocate_one(allocator_v1) ;
+ <span class="type">node_type_ptr_t</span> allocate_one(allocator_v2) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> deallocate_one(node_type_ptr_t) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> deallocate_one(node_type_ptr_t, allocator_v1) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> deallocate_one(node_type_ptr_t, allocator_v2) ;
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator> <span class="type"><span class="bold"><strong>void</strong></span></span> assign(InputIterator, InputIterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> assign(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type">allocator_type</span> get_allocator() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> begin() ;
+ <span class="type">const_iterator</span> begin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">iterator</span> end() ;
+ <span class="type">const_iterator</span> end() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rbegin() ;
+ <span class="type">const_reverse_iterator</span> rbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reverse_iterator</span> rend() ;
+ <span class="type">const_reverse_iterator</span> rend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_iterator</span> cend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crbegin() <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reverse_iterator</span> crend() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> max_size() <span class="bold"><strong>const</strong></span>;
+ <span class="type">size_type</span> capacity() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>bool</strong></span></span> empty() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> resize(size_type) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> reserve(size_type) ;
+ <span class="type">reference</span> operator[](size_type) ;
+ <span class="type">const_reference</span> operator[](size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">const_reference</span> at(size_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> at(size_type) ;
+ <span class="type">reference</span> front() ;
+ <span class="type">const_reference</span> front() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> back() ;
+ <span class="type">const_reference</span> back() <span class="bold"><strong>const</strong></span>;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(<span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> push_back(T &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> pop_back() ;
+ <span class="type">iterator</span> insert(const_iterator, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="type">iterator</span> insert(const_iterator, T &&) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, size_type, <span class="bold"><strong>const</strong></span> T &) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> insert(const_iterator, InputIterator, InputIterator) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> emplace_back(Args &&...) ;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type">iterator</span> emplace(const_iterator, Args &&...) ;
+ <span class="type">iterator</span> erase(const_iterator) ;
+ <span class="type">iterator</span> erase(const_iterator, const_iterator) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> swap(stable_vector &) ;
+ <span class="type"><span class="bold"><strong>void</strong></span></span> clear() ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id536799"></a><h2>Description</h2>
+<p>Help taken from (Introducing stable_vector)</p>
+<p>We present stable_vector, a fully STL-compliant stable container that provides most of the features of std::vector except element contiguity.</p>
+<p>General properties: stable_vector satisfies all the requirements of a container, a reversible container and a sequence and provides all the optional operations present in std::vector. Like std::vector, iterators are random access. stable_vector does not provide element contiguity; in exchange for this absence, the container is stable, i.e. references and iterators to an element of a stable_vector remain valid as long as the element is not erased, and an iterator that has been assigned the return value of end() always remain valid until the destruction of the associated stable_vector.</p>
+<p>Operation complexity: The big-O complexities of stable_vector operations match exactly those of std::vector. In general, insertion/deletion is constant time at the end of the sequence and linear elsewhere. Unlike std::vector, stable_vector does not internally perform any value_type destruction, copy or assignment operations other than those exactly corresponding to the insertion of new elements or deletion of stored elements, which can sometimes compensate in terms of performance for the extra burden of doing more pointer manipulation and an additional allocation per element.</p>
+<p>Exception safety: As stable_vector does not internally copy elements around, some operations provide stronger exception safety guarantees than in std::vector: </p>
+<div class="refsect2" lang="en">
+<a name="id536842"></a><h3>
+<a name="stable_vectorconstruct-copy-destruct"></a><code class="computeroutput">stable_vector</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id311042-bb"></a>stable_vector(<span class="bold"><strong>const</strong></span> Allocator & al = Allocator());</pre></li>
+<li><pre class="literallayout"><a name="id311054-bb"></a>stable_vector(size_type n);</pre></li>
+<li><pre class="literallayout"><a name="id311064-bb"></a>stable_vector(size_type n, <span class="bold"><strong>const</strong></span> T & t, <span class="bold"><strong>const</strong></span> Allocator & al = Allocator());</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <a name="id311091-bb"></a>stable_vector(InputIterator first, InputIterator last,
+ <span class="bold"><strong>const</strong></span> Allocator & al = Allocator());</pre></li>
+<li><pre class="literallayout"><a name="id311127-bb"></a>stable_vector(<span class="bold"><strong>const</strong></span> stable_vector & x);</pre></li>
+<li><pre class="literallayout"><a name="id311141-bb"></a>stable_vector(stable_vector && x);</pre></li>
+<li><pre class="literallayout">stable_vector& <a name="id311155-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> stable_vector & x);</pre></li>
+<li><pre class="literallayout">stable_vector& <a name="id311168-bb"></a><span class="bold"><strong>operator</strong></span>=(stable_vector && x);</pre></li>
+<li><pre class="literallayout"><a name="id311153-bb"></a>~stable_vector();</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id537149"></a><h3>
+<a name="id310146-bb"></a><code class="computeroutput">stable_vector</code> private member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="type">node_type_ptr_t</span> <a name="id310151-bb"></a>allocate_one() ;</pre></li>
+<li><pre class="literallayout"><span class="type">node_type_ptr_t</span> <a name="id310161-bb"></a>allocate_one(allocator_v1) ;</pre></li>
+<li><pre class="literallayout"><span class="type">node_type_ptr_t</span> <a name="id310178-bb"></a>allocate_one(allocator_v2) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310196-bb"></a>deallocate_one(node_type_ptr_t p) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310213-bb"></a>deallocate_one(node_type_ptr_t p, allocator_v1) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310238-bb"></a>deallocate_one(node_type_ptr_t p, allocator_v2) ;</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id537325"></a><h3>
+<a name="id310262-bb"></a><code class="computeroutput">stable_vector</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310267-bb"></a>assign(InputIterator first, InputIterator last) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310301-bb"></a>assign(size_type n, <span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type">allocator_type</span> <a name="id310326-bb"></a>get_allocator() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310336-bb"></a>begin() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id310346-bb"></a>begin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310356-bb"></a>end() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id310365-bb"></a>end() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id310375-bb"></a>rbegin() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id310385-bb"></a>rbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reverse_iterator</span> <a name="id310395-bb"></a>rend() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id310405-bb"></a>rend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id310415-bb"></a>cbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_iterator</span> <a name="id310425-bb"></a>cend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id310435-bb"></a>crbegin() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reverse_iterator</span> <a name="id310445-bb"></a>crend() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">size_type</span> <a name="id310455-bb"></a>size() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">size_type</span> <a name="id310465-bb"></a>max_size() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">size_type</span> <a name="id310475-bb"></a>capacity() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id310485-bb"></a>empty() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310495-bb"></a>resize(size_type n, <span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310519-bb"></a>resize(size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310537-bb"></a>reserve(size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id310554-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id310571-bb"></a><span class="bold"><strong>operator</strong></span>[](size_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id310589-bb"></a>at(size_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id310606-bb"></a>at(size_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id310624-bb"></a>front() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id310633-bb"></a>front() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id310643-bb"></a>back() ;</pre></li>
+<li><pre class="literallayout"><span class="type">const_reference</span> <a name="id310653-bb"></a>back() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310663-bb"></a>push_back(<span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310680-bb"></a>push_back(T && t) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310698-bb"></a>pop_back() ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310707-bb"></a>insert(const_iterator position, <span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310732-bb"></a>insert(const_iterator position, T && x) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310757-bb"></a>insert(const_iterator position, size_type n, <span class="bold"><strong>const</strong></span> T & t) ;</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> InputIterator>
+ <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310790-bb"></a>insert(const_iterator position, InputIterator first,
+ InputIterator last) ;</pre></li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args> <span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id310831-bb"></a>emplace_back(Args &&... args) ;</pre>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... in the end of the vector.</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or the in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Amortized constant time. </p>
+</li>
+<li>
+<pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Args>
+ <span class="type">iterator</span> <a name="id310892-bb"></a>emplace(const_iterator position, Args &&... args) ;</pre>
+<p><span class="bold"><strong>Requires</strong></span>: position must be a valid iterator of *this.</p>
+<p><span class="bold"><strong>Effects</strong></span>: Inserts an object of type T constructed with std::forward<Args>(args)... before position</p>
+<p><span class="bold"><strong>Throws</strong></span>: If memory allocation throws or the in-place constructor throws.</p>
+<p><span class="bold"><strong>Complexity</strong></span>: If position is end(), amortized constant time Linear time otherwise. </p>
+</li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310970-bb"></a>erase(const_iterator position) ;</pre></li>
+<li><pre class="literallayout"><span class="type">iterator</span> <a name="id310987-bb"></a>erase(const_iterator first, const_iterator last) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id311012-bb"></a>swap(stable_vector & x) ;</pre></li>
+<li><pre class="literallayout"><span class="type"><span class="bold"><strong>void</strong></span></span> <a name="id311032-bb"></a>clear() ;</pre></li>
+</ol></div>
+</div>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/slist.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.stable_vector_hpp"><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="boost/container/basic_string.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/string.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/string.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Type definition string</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.string_hpp" title="Header <boost/container/string.hpp>">
+<link rel="prev" href="boost/container/basic_string.html" title="Class template basic_string">
+<link rel="next" href="wstring.html" title="Type definition wstring">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/basic_string.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.string_hpp"><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="wstring.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="string"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Type definition string</span></h2>
+<p>string — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>typedef</strong></span> basic_string< <span class="bold"><strong>char</strong></span>,std::char_traits< <span class="bold"><strong>char</strong></span> >,std::allocator< <span class="bold"><strong>char</strong></span> > > string;</pre></div>
+<div class="refsect1" lang="en">
+<a name="id550550"></a><h2>Description</h2>
+<p>typedef for basic_string of narrow characters </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/container/basic_string.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.string_hpp"><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="wstring.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/doc/html/wstring.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/doc/html/wstring.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Type definition wstring</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Container">
+<link rel="up" href="boost_container_reference.html#header.boost.container.string_hpp" title="Header <boost/container/string.hpp>">
+<link rel="prev" href="string.html" title="Type definition string">
+<link rel="next" href="boost/container/vector.html" title="Class template vector">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="string.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.string_hpp"><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="boost/container/vector.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="wstring"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Type definition wstring</span></h2>
+<p>wstring — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>typedef</strong></span> basic_string< <span class="bold"><strong>wchar_t</strong></span>,std::char_traits< <span class="bold"><strong>wchar_t</strong></span> >,std::allocator< <span class="bold"><strong>wchar_t</strong></span> > > wstring;</pre></div>
+<div class="refsect1" lang="en">
+<a name="id550610"></a><h2>Description</h2>
+<p>typedef for basic_string of narrow characters </p>
+</div>
+</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 © 2009 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="string.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="boost_container_reference.html#header.boost.container.string_hpp"><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="boost/container/vector.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/container/example/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/example/Jamfile.v2 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,34 @@
+# Boost Container Library Example Jamfile
+
+# (C) Copyright Ion Gaztanaga 2009
+# 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)
+
+# Adapted from John Maddock's TR1 Jamfile.v2
+# Copyright John Maddock 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)
+
+# this rule enumerates through all the sources and invokes
+# the run rule for each source, the result is a list of all
+# the run rules, which we can pass on to the test_suite rule:
+
+rule test_all
+{
+ local all_rules = ;
+
+ for local fileb in [ glob doc_*.cpp ]
+ {
+ all_rules += [ run $(fileb)
+ : # additional args
+ : # test-files
+ : # requirements
+ ] ;
+ }
+
+ return $(all_rules) ;
+}
+
+test-suite container_example : [ test_all r ] : <threading>multi ;
\ No newline at end of file
Added: sandbox/move/libs/container/example/doc_emplace.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/example/doc_emplace.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,44 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+//[doc_emplace
+#include <boost/container/list.hpp>
+#include <cassert>
+
+//Non-copyable and non-movable class
+class non_copy_movable
+{
+ non_copy_movable(const non_copy_movable &);
+ non_copy_movable& operator=(const non_copy_movable &);
+
+ public:
+ non_copy_movable(int = 0) {}
+};
+
+int main ()
+{
+ using namespace boost::container;
+
+ //Store non-copyable and non-movable objects in a list
+ list<non_copy_movable> l;
+ non_copy_movable ncm;
+
+ //A new element will be built calling non_copy_movable(int) contructor
+ l.emplace(l.begin(), 0);
+ assert(l.size() == 1);
+
+ //A new element will be built calling the default constructor
+ l.emplace(l.begin());
+ assert(l.size() == 2);
+ return 0;
+}
+//]
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/example/doc_move_containers.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/example/doc_move_containers.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+//[doc_move_containers
+#include <boost/container/vector.hpp>
+#include <boost/move/move.hpp>
+#include <cassert>
+
+//Non-copyable class
+class non_copyable
+{
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(non_copyable)
+
+ public:
+ non_copyable(){}
+ non_copyable(BOOST_RV_REF(non_copyable)) {}
+ non_copyable& operator=(BOOST_RV_REF(non_copyable)) { return *this; }
+};
+
+int main ()
+{
+ using namespace boost::container;
+
+ //Store non-copyable objects in a vector
+ vector<non_copyable> v;
+ non_copyable nc;
+ v.push_back(boost::move(nc));
+ assert(v.size() == 1);
+
+ //Reserve no longer needs copy-constructible
+ v.reserve(100);
+ assert(v.capacity() >= 100);
+
+ //This resize overload only needs movable and default constructible
+ v.resize(200);
+ assert(v.size() == 200);
+
+ //Containers are also movable
+ vector<non_copyable> v_other(boost::move(v));
+ assert(v_other.size() == 200);
+ assert(v.empty());
+
+ return 0;
+}
+//]
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/example/doc_recursive_containers.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/example/doc_recursive_containers.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,38 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2009. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+//[doc_recursive_containers
+#include <boost/container/vector.hpp>
+#include <boost/container/list.hpp>
+#include <boost/container/map.hpp>
+#include <boost/container/stable_vector.hpp>
+
+using namespace boost::container;
+
+struct data
+{
+ int i_;
+ vector<data> v_;
+ list<data> l_;
+ map<data, data> m_;
+
+ friend bool operator <(const data &l, const data &r)
+ { return l.i_ < r.i_; }
+};
+
+int main()
+{
+ stable_vector<data> sv;
+ sv.resize(100);
+ return 0;
+}
+//]
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/index.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/index.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,14 @@
+<!--
+Copyright 2005-2009 Ion Gaztanaga
+Distributed under the Boost Software License, Version 1.0. (See accompanying
+file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+-->
+<html>
+<head>
+<meta http-equiv="refresh" content="0; URL=./doc/html/container.html">
+</head>
+<body>
+Automatic redirection failed, please go to
+./doc/html/container.html
+</body>
+</html>
Added: sandbox/move/libs/container/proj/to-do.txt
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/to-do.txt 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1 @@
+
Added: sandbox/move/libs/container/proj/vc7ide/container.sln
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/container.sln 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,87 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "deque_test", "deque_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792655}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "flat_tree_test", "flat_tree_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792637}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "list_test", "list_ex.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792632}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stable_vector_test", "stable_vector_test.vcproj", "{5E11C8D3-FA52-760A-84FE-943A6BA05A21}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "string_test", "string_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D4A792607}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tree_test", "tree_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792606}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slist_test", "slist_test.vcproj", "{58CCE183-6092-48FE-A4F7-BA0D3A792608}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector_test", "vector_test.vcproj", "{5CE11C83-096A-84FE-4FA2-D3A6BA792002}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_containerlib", "container.vcproj", "{FF56BAF1-32EC-4B22-B6BD-95A3A67C3135}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {58CCE183-6092-48FE-A4F7-BA0D3A792655}.Debug.ActiveCfg = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792655}.Debug.Build.0 = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792655}.Release.ActiveCfg = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792655}.Release.Build.0 = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792637}.Debug.ActiveCfg = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792637}.Debug.Build.0 = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792637}.Release.ActiveCfg = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792637}.Release.Build.0 = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792632}.Debug.ActiveCfg = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792632}.Debug.Build.0 = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792632}.Release.ActiveCfg = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792632}.Release.Build.0 = Release|Win32
+ {5E11C8D3-FA52-760A-84FE-943A6BA05A21}.Debug.ActiveCfg = Debug|Win32
+ {5E11C8D3-FA52-760A-84FE-943A6BA05A21}.Debug.Build.0 = Debug|Win32
+ {5E11C8D3-FA52-760A-84FE-943A6BA05A21}.Release.ActiveCfg = Release|Win32
+ {5E11C8D3-FA52-760A-84FE-943A6BA05A21}.Release.Build.0 = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D4A792607}.Debug.ActiveCfg = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D4A792607}.Debug.Build.0 = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D4A792607}.Release.ActiveCfg = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D4A792607}.Release.Build.0 = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792606}.Debug.ActiveCfg = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792606}.Debug.Build.0 = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792606}.Release.ActiveCfg = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792606}.Release.Build.0 = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792608}.Debug.ActiveCfg = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792608}.Debug.Build.0 = Debug|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792608}.Release.ActiveCfg = Release|Win32
+ {58CCE183-6092-48FE-A4F7-BA0D3A792608}.Release.Build.0 = Release|Win32
+ {5CE11C83-096A-84FE-4FA2-D3A6BA792002}.Debug.ActiveCfg = Debug|Win32
+ {5CE11C83-096A-84FE-4FA2-D3A6BA792002}.Debug.Build.0 = Debug|Win32
+ {5CE11C83-096A-84FE-4FA2-D3A6BA792002}.Release.ActiveCfg = Release|Win32
+ {5CE11C83-096A-84FE-4FA2-D3A6BA792002}.Release.Build.0 = Release|Win32
+ {FF56BAF1-32EC-4B22-B6BD-95A3A67C3135}.Debug.ActiveCfg = Debug|Win32
+ {FF56BAF1-32EC-4B22-B6BD-95A3A67C3135}.Debug.Build.0 = Debug|Win32
+ {FF56BAF1-32EC-4B22-B6BD-95A3A67C3135}.Release.ActiveCfg = Release|Win32
+ {FF56BAF1-32EC-4B22-B6BD-95A3A67C3135}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
Added: sandbox/move/libs/container/proj/vc7ide/container.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/container.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,315 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="_containerlib"
+ ProjectGUID="{FF56BAF1-32EC-4B22-B6BD-95A3A67C3135}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32"
+ IntermediateDirectory="Debug"
+ ConfigurationType="4"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/d.lib"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32"
+ IntermediateDirectory="Release"
+ ConfigurationType="4"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/container.lib"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="detail"
+ Filter="">
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\adaptive_node_pool_impl.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\advanced_insert_int.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\allocation_type.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\config_begin.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\config_end.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\destroyers.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\flat_tree.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\iterators.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\math_functions.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\mpl.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\multiallocation_chain.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\node_alloc_holder.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\node_pool_impl.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\pair.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\pool_common.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\preprocessor.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\transform_iterator.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\tree.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\type_traits.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\utilities.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\value_init.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\variadic_templates_tools.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\version_type.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\detail\workaround.hpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Documentation"
+ Filter="">
+ <File
+ RelativePath="..\..\doc\container.qbk">
+ </File>
+ <File
+ RelativePath="..\..\doc\Jamfile.v2">
+ </File>
+ </Filter>
+ <Filter
+ Name="example"
+ Filter="">
+ <File
+ RelativePath="..\..\example\doc_emplace.cpp">
+ </File>
+ <File
+ RelativePath="..\..\example\doc_move_containers.cpp">
+ </File>
+ <File
+ RelativePath="..\..\example\doc_recursive_containers.cpp">
+ </File>
+ <File
+ RelativePath="..\..\example\Jamfile.v2">
+ </File>
+ </Filter>
+ <Filter
+ Name="test"
+ Filter="">
+ <File
+ RelativePath="..\..\test\boost_interprocess_check.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\check_equal_containers.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\deque_test.cpp">
+ </File>
+ <File
+ RelativePath="..\..\test\dummy_test_allocator.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\emplace_test.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\expand_bwd_test_allocator.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\expand_bwd_test_template.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\flat_tree_test.cpp">
+ </File>
+ <File
+ RelativePath="..\..\test\heap_allocator_v1.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\Jamfile.v2">
+ </File>
+ <File
+ RelativePath="..\..\test\list_test.cpp">
+ </File>
+ <File
+ RelativePath="..\..\test\list_test.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\map_test.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\movable_int.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\print_container.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\set_test.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\slist_test.cpp">
+ </File>
+ <File
+ RelativePath="..\..\test\stable_vector_test.cpp">
+ </File>
+ <File
+ RelativePath="..\..\test\string_test.cpp">
+ </File>
+ <File
+ RelativePath="..\..\test\tree_test.cpp">
+ </File>
+ <File
+ RelativePath="..\..\test\util.hpp">
+ </File>
+ <File
+ RelativePath="..\..\test\vector_test.cpp">
+ </File>
+ <File
+ RelativePath="..\..\test\vector_test.hpp">
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\..\..\..\boost\container\container_fwd.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\deque.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\flat_map.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\flat_set.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\list.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\map.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\set.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\slist.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\stable_vector.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\string.hpp">
+ </File>
+ <File
+ RelativePath="..\to-do.txt">
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\container\vector.hpp">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/proj/vc7ide/deque_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/deque_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="deque_test"
+ ProjectGUID="{58CCE183-6092-48FE-A4F7-BA0D3A792655}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/deque_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/deque_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/deque_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/deque_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/deque_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\test\deque_test.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/proj/vc7ide/flat_tree_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/flat_tree_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="flat_tree_test"
+ ProjectGUID="{58CCE183-6092-48FE-A4F7-BA0D3A792637}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/flat_tree_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/flat_tree_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/flat_tree_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/flat_tree_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/flat_tree_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\test\flat_tree_test.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/proj/vc7ide/list_ex.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/list_ex.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="list_test"
+ ProjectGUID="{58CCE183-6092-48FE-A4F7-BA0D3A792632}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/list_ex"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/list_ex_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/list_ex.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/list_ex"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/list_ex.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\test\list_test.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/proj/vc7ide/slist_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/slist_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="slist_test"
+ ProjectGUID="{58CCE183-6092-48FE-A4F7-BA0D3A792608}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/slist_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/slist_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/slist_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/slist_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/slist_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\test\slist_test.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/proj/vc7ide/stable_vector_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/stable_vector_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="stable_vector_test"
+ ProjectGUID="{5E11C8D3-FA52-760A-84FE-943A6BA05A21}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/stable_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/stable_vector_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/stable_vector_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/stable_vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/stable_vector_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{37BC807F-2451-A306-7AC5-7A35A32A22DF}">
+ <File
+ RelativePath="..\..\test\stable_vector_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/proj/vc7ide/string_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/string_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="string_test"
+ ProjectGUID="{58CCE183-6092-48FE-A4F7-BA0D4A792607}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/string_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/string_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/string_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/string_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/string_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\test\string_test.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/proj/vc7ide/tree_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/tree_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="tree_test"
+ ProjectGUID="{58CCE183-6092-48FE-A4F7-BA0D3A792606}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/tree_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/tree_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/tree_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/tree_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/tree_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\test\tree_test.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/proj/vc7ide/vector_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/proj/vc7ide/vector_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="vector_test"
+ ProjectGUID="{5CE11C83-096A-84FE-4FA2-D3A6BA792002}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/vector_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/vector_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/vector_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/vector_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{41737BCF-4312-7AC5-A066-32D75A32A2AF}">
+ <File
+ RelativePath="..\..\test\vector_test.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93815995-89BD-b043-5E8B-65FBE52E2AFB}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/container/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/Jamfile.v2 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,34 @@
+# Boost Container Library Test Jamfile
+
+# (C) Copyright Ion Gaztanaga 2009.
+# 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)
+
+# Adapted from John Maddock's TR1 Jamfile.v2
+# Copyright John Maddock 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)
+
+# this rule enumerates through all the sources and invokes
+# the run rule for each source, the result is a list of all
+# the run rules, which we can pass on to the test_suite rule:
+
+rule test_all
+{
+ local all_rules = ;
+
+ for local fileb in [ glob *.cpp ]
+ {
+ all_rules += [ run $(fileb)
+ : # additional args
+ : # test-files
+ : # requirements
+ ] ;
+ }
+
+ return $(all_rules) ;
+}
+
+test-suite container_test : [ test_all r ] ;
Added: sandbox/move/libs/container/test/boost_interprocess_check.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/boost_interprocess_check.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,27 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_HEADER
+#define BOOST_CONTAINER_TEST_HEADER
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/exceptions.hpp>
+#include <iostream>
+
+namespace boost { namespace container { namespace test {
+
+#define BOOST_INTERPROCES_CHECK( P ) \
+ if(!(P)) do{ std::cout << "Failed: " << #P << " file: " << __FILE__ << " line : " << __LINE__ << std::endl; throw boost::container::container_exception();}while(0)
+
+}}} //namespace boost { namespace container { namespace test {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //BOOST_CONTAINER_TEST_HEADER
Added: sandbox/move/libs/container/test/check_equal_containers.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/check_equal_containers.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,76 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_CHECK_EQUAL_CONTAINERS_HPP
+#define BOOST_CONTAINER_TEST_CHECK_EQUAL_CONTAINERS_HPP
+
+#include <boost/container/detail/config_begin.hpp>
+#include <functional>
+#include <iostream>
+#include <algorithm>
+
+namespace boost{
+namespace container {
+namespace test{
+
+//Function to check if both containers are equal
+template<class MyShmCont
+ ,class MyStdCont>
+bool CheckEqualContainers(MyShmCont *shmcont, MyStdCont *stdcont)
+{
+ if(shmcont->size() != stdcont->size())
+ return false;
+
+ typedef typename MyShmCont::value_type value_type;
+
+ typename MyShmCont::iterator itshm(shmcont->begin()), itshmend(shmcont->end());
+ typename MyStdCont::iterator itstd(stdcont->begin());
+ typename MyStdCont::size_type dist = (typename MyStdCont::size_type)std::distance(itshm, itshmend);
+ if(dist != shmcont->size()){
+ return false;
+ }
+ std::size_t i = 0;
+ for(; itshm != itshmend; ++itshm, ++itstd, ++i){
+ value_type val(*itstd);
+ const value_type &v = *itshm;
+ if(v != val)
+ return false;
+ }
+ return true;
+}
+
+template<class MyShmCont
+ ,class MyStdCont>
+bool CheckEqualPairContainers(MyShmCont *shmcont, MyStdCont *stdcont)
+{
+ if(shmcont->size() != stdcont->size())
+ return false;
+
+ typedef typename MyShmCont::key_type key_type;
+ typedef typename MyShmCont::mapped_type mapped_type;
+
+ typename MyShmCont::iterator itshm(shmcont->begin()), itshmend(shmcont->end());
+ typename MyStdCont::iterator itstd(stdcont->begin());
+ for(; itshm != itshmend; ++itshm, ++itstd){
+ if(itshm->first != key_type(itstd->first))
+ return false;
+
+ if(itshm->second != mapped_type(itstd->second))
+ return false;
+ }
+ return true;
+}
+} //namespace test{
+} //namespace container {
+} //namespace boost{
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_TEST_CHECK_EQUAL_CONTAINERS_HPP
Added: sandbox/move/libs/container/test/deque_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/deque_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,281 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/detail/config_begin.hpp>
+#include <algorithm>
+#include <memory>
+#include <deque>
+#include <iostream>
+#include <functional>
+#include <list>
+
+#include <boost/container/deque.hpp>
+#include "print_container.hpp"
+#include "check_equal_containers.hpp"
+#include "dummy_test_allocator.hpp"
+#include "movable_int.hpp"
+#include <boost/move/move.hpp>
+#include <boost/container/detail/mpl.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#include <string>
+#include "emplace_test.hpp"
+
+
+using namespace boost::container;
+
+//Explicit instantiation to detect compilation errors
+template class boost::container::deque
+ < test::movable_and_copyable_int
+ , test::dummy_test_allocator<test::movable_and_copyable_int> >;
+
+//Function to check if both sets are equal
+template<class V1, class V2>
+bool copyable_only(V1 *, V2 *, containers_detail::false_type)
+{
+ return true;
+}
+
+//Function to check if both sets are equal
+template<class V1, class V2>
+bool copyable_only(V1 *cntdeque, V2 *stddeque, containers_detail::true_type)
+{
+ typedef typename V1::value_type IntType;
+ std::size_t size = cntdeque->size();
+ stddeque->insert(stddeque->end(), 50, 1);
+ cntdeque->insert(cntdeque->end(), 50, 1);
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ {
+ IntType move_me(1);
+ stddeque->insert(stddeque->begin()+size/2, 50, 1);
+ cntdeque->insert(cntdeque->begin()+size/2, 50, boost::move(move_me));
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ }
+ {
+ IntType move_me(2);
+ cntdeque->assign(cntdeque->size()/2, boost::move(move_me));
+ stddeque->assign(stddeque->size()/2, 2);
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ }
+ {
+ IntType move_me(1);
+ stddeque->clear();
+ cntdeque->clear();
+ stddeque->insert(stddeque->begin(), 50, 1);
+ cntdeque->insert(cntdeque->begin(), 50, boost::move(move_me));
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ stddeque->insert(stddeque->begin()+20, 50, 1);
+ cntdeque->insert(cntdeque->begin()+20, 50, boost::move(move_me));
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ stddeque->insert(stddeque->begin()+20, 20, 1);
+ cntdeque->insert(cntdeque->begin()+20, 20, boost::move(move_me));
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ }
+ {
+ IntType move_me(1);
+ stddeque->clear();
+ cntdeque->clear();
+ stddeque->insert(stddeque->end(), 50, 1);
+ cntdeque->insert(cntdeque->end(), 50, boost::move(move_me));
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ stddeque->insert(stddeque->end()-20, 50, 1);
+ cntdeque->insert(cntdeque->end()-20, 50, boost::move(move_me));
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ stddeque->insert(stddeque->end()-20, 20, 1);
+ cntdeque->insert(cntdeque->end()-20, 20, boost::move(move_me));
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ }
+
+ return true;
+}
+
+//Test recursive structures
+class recursive_deque
+{
+public:
+ int id_;
+ deque<recursive_deque> deque_;
+};
+
+template<class IntType>
+bool do_test()
+{
+ //Test for recursive types
+ {
+ deque<recursive_deque> recursive_deque_deque;
+ }
+
+ {
+ //Now test move semantics
+ deque<recursive_deque> original;
+ deque<recursive_deque> move_ctor(boost::move(original));
+ deque<recursive_deque> move_assign;
+ move_assign = boost::move(move_ctor);
+ move_assign.swap(original);
+ }
+
+ //Alias deque types
+ typedef deque<IntType> MyCntDeque;
+ typedef std::deque<int> MyStdDeque;
+ const int max = 100;
+ try{
+ //Shared memory allocator must be always be initialized
+ //since it has no default constructor
+ MyCntDeque *cntdeque = new MyCntDeque;
+ MyStdDeque *stddeque = new MyStdDeque;
+ //Compare several shared memory deque operations with std::deque
+ int i;
+ for(i = 0; i < max*100; ++i){
+ IntType move_me(i);
+ cntdeque->insert(cntdeque->end(), boost::move(move_me));
+ stddeque->insert(stddeque->end(), i);
+ }
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+
+ cntdeque->clear();
+ stddeque->clear();
+
+ for(i = 0; i < max*100; ++i){
+ IntType move_me(i);
+ cntdeque->push_back(boost::move(move_me));
+ stddeque->push_back(i);
+ }
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+
+ cntdeque->clear();
+ stddeque->clear();
+
+ for(i = 0; i < max*100; ++i){
+ IntType move_me(i);
+ cntdeque->push_front(boost::move(move_me));
+ stddeque->push_front(i);
+ }
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+
+ typename MyCntDeque::iterator it;
+ typename MyCntDeque::const_iterator cit = it;
+
+ cntdeque->erase(cntdeque->begin()++);
+ stddeque->erase(stddeque->begin()++);
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+
+ cntdeque->erase(cntdeque->begin());
+ stddeque->erase(stddeque->begin());
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+
+ {
+ //Initialize values
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me (-1);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = -1;
+ }
+
+ cntdeque->insert(cntdeque->end()
+ ,boost::make_move_iterator(&aux_vect[0])
+ ,boost::make_move_iterator(aux_vect + 50));
+ stddeque->insert(stddeque->end(), aux_vect2, aux_vect2 + 50);
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+
+ for(int i = 0, j = static_cast<int>(cntdeque->size()); i < j; ++i){
+ cntdeque->erase(cntdeque->begin());
+ stddeque->erase(stddeque->begin());
+ }
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ }
+ {
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = -1;
+ }
+ cntdeque->insert(cntdeque->begin()
+ ,boost::make_move_iterator(&aux_vect[0])
+ ,boost::make_move_iterator(aux_vect + 50));
+ stddeque->insert(stddeque->begin(), aux_vect2, aux_vect2 + 50);
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+ }
+
+ if(!copyable_only(cntdeque, stddeque
+ ,containers_detail::bool_<!boost::is_movable<IntType>::value>())){
+ return false;
+ }
+
+ cntdeque->erase(cntdeque->begin());
+ stddeque->erase(stddeque->begin());
+
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+
+ for(i = 0; i < max; ++i){
+ IntType move_me(i);
+ cntdeque->insert(cntdeque->begin(), boost::move(move_me));
+ stddeque->insert(stddeque->begin(), i);
+ }
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return false;
+
+ //Test insertion from list
+ {
+ std::list<int> l(50, int(1));
+ cntdeque->insert(cntdeque->begin(), l.begin(), l.end());
+ stddeque->insert(stddeque->begin(), l.begin(), l.end());
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
+ cntdeque->assign(l.begin(), l.end());
+ stddeque->assign(l.begin(), l.end());
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
+ }
+
+ cntdeque->resize(100);
+ stddeque->resize(100);
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
+
+ cntdeque->resize(200);
+ stddeque->resize(200);
+ if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1;
+
+ delete cntdeque;
+ delete stddeque;
+ }
+ catch(std::exception &ex){
+ std::cout << ex.what() << std::endl;
+ return false;
+ }
+
+ std::cout << std::endl << "Test OK!" << std::endl;
+ return true;
+}
+
+int main ()
+{
+ if(!do_test<int>())
+ return 1;
+
+ if(!do_test<test::movable_int>())
+ return 1;
+
+// if(!do_test<int, test::allocator_v1>())
+// return 1;
+
+ const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_FRONT | test::EMPLACE_BEFORE);
+
+ if(!boost::container::test::test_emplace
+ < deque<test::EmplaceInt>, Options>())
+ return 1;
+
+ return 0;
+}
+
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/test/dummy_test_allocator.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/dummy_test_allocator.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,157 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_DUMMY_TEST_ALLOCATOR_HPP
+#define BOOST_CONTAINER_DUMMY_TEST_ALLOCATOR_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+
+#include <boost/container/container_fwd.hpp>
+#include <boost/container/detail/allocation_type.hpp>
+#include <boost/assert.hpp>
+#include <boost/container/detail/utilities.hpp>
+#include <boost/container/detail/type_traits.hpp>
+#include <boost/container/detail/version_type.hpp>
+#include <memory>
+#include <algorithm>
+#include <cstddef>
+#include <stdexcept>
+#include <cassert>
+
+//!\file
+//!Describes an allocator to test expand capabilities
+
+namespace boost {
+namespace container {
+namespace test {
+
+//This allocator just allows two allocations. The first one will return
+//mp_buffer + m_offset configured in the constructor. The second one
+//will return mp_buffer.
+template<class T>
+class dummy_test_allocator
+{
+ private:
+ typedef dummy_test_allocator<T> self_t;
+ typedef void * aux_pointer_t;
+ typedef const void * cvoid_ptr;
+
+ template<class T2>
+ dummy_test_allocator& operator=(const dummy_test_allocator<T2>&);
+
+ dummy_test_allocator& operator=(const dummy_test_allocator&);
+
+ public:
+ typedef T value_type;
+ typedef T * pointer;
+ typedef const T * const_pointer;
+ typedef typename containers_detail::add_reference
+ <value_type>::type reference;
+ typedef typename containers_detail::add_reference
+ <const value_type>::type const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+// typedef boost::container::version_type<dummy_test_allocator, 2> version;
+
+ template<class T2>
+ struct rebind
+ { typedef dummy_test_allocator<T2> other; };
+
+ //!Default constructor. Never throws
+ dummy_test_allocator()
+ {}
+
+ //!Constructor from other dummy_test_allocator. Never throws
+ dummy_test_allocator(const dummy_test_allocator &)
+ {}
+
+ //!Constructor from related dummy_test_allocator. Never throws
+ template<class T2>
+ dummy_test_allocator(const dummy_test_allocator<T2> &)
+ {}
+
+ pointer address(reference value)
+ { return pointer(addressof(value)); }
+
+ const_pointer address(const_reference value) const
+ { return const_pointer(addressof(value)); }
+
+ pointer allocate(size_type, cvoid_ptr = 0)
+ { return 0; }
+
+ void deallocate(const pointer &, size_type)
+ { }
+
+ template<class Convertible>
+ void construct(pointer, const Convertible &)
+ {}
+
+ void destroy(pointer)
+ {}
+
+ size_type max_size() const
+ { return 0; }
+
+ friend void swap(self_t &, self_t &)
+ {}
+
+ //Experimental version 2 dummy_test_allocator functions
+
+ std::pair<pointer, bool>
+ allocation_command(boost::container::allocation_type,
+ size_type,
+ size_type,
+ size_type &, const pointer & = 0)
+ { return std::pair<pointer, bool>(pointer(0), true); }
+
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold.
+ size_type size(const pointer &) const
+ { return 0; }
+
+ //!Allocates just one object. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ //!Throws boost::container::bad_alloc if there is no enough memory
+ pointer allocate_one()
+ { return pointer(0); }
+
+ //!Deallocates memory previously allocated with allocate_one().
+ //!You should never use deallocate_one to deallocate memory allocated
+ //!with other functions different from allocate_one(). Never throws
+ void deallocate_one(const pointer &)
+ {}
+};
+
+//!Equality test for same type of dummy_test_allocator
+template<class T> inline
+bool operator==(const dummy_test_allocator<T> &,
+ const dummy_test_allocator<T> &)
+{ return false; }
+
+//!Inequality test for same type of dummy_test_allocator
+template<class T> inline
+bool operator!=(const dummy_test_allocator<T> &,
+ const dummy_test_allocator<T> &)
+{ return true; }
+
+} //namespace test {
+} //namespace container {
+} //namespace boost {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //BOOST_CONTAINER_DUMMY_TEST_ALLOCATOR_HPP
+
Added: sandbox/move/libs/container/test/emplace_test.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/emplace_test.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,622 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2008. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_CONTAINER_TEST_EMPLACE_TEST_HPP
+#define BOOST_CONTAINER_TEST_EMPLACE_TEST_HPP
+
+#include <iostream>
+#include <typeinfo>
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+#include <boost/container/detail/mpl.hpp>
+#include <boost/move/move.hpp>
+#include <boost/container/detail/utilities.hpp>
+#include <boost/aligned_storage.hpp>
+
+namespace boost{
+namespace container {
+namespace test{
+
+class EmplaceInt
+{
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(EmplaceInt)
+
+ public:
+ EmplaceInt(int a = 0, int b = 0, int c = 0, int d = 0, int e = 0)
+ : a_(a), b_(b), c_(c), d_(d), e_(e)
+ {}
+
+ EmplaceInt(BOOST_RV_REF(EmplaceInt) o)
+ : a_(o.a_), b_(o.b_), c_(o.c_), d_(o.d_), e_(o.e_)
+ {}
+
+ EmplaceInt& operator=(BOOST_RV_REF(EmplaceInt) o)
+ {
+ this->a_ = o.a_;
+ this->b_ = o.b_;
+ this->c_ = o.c_;
+ this->d_ = o.d_;
+ this->e_ = o.e_;
+ return *this;
+ }
+
+ friend bool operator==(const EmplaceInt &l, const EmplaceInt &r)
+ {
+ return l.a_ == r.a_ &&
+ l.b_ == r.b_ &&
+ l.c_ == r.c_ &&
+ l.d_ == r.d_ &&
+ l.e_ == r.e_;
+ }
+
+ friend bool operator<(const EmplaceInt &l, const EmplaceInt &r)
+ { return l.sum() < r.sum(); }
+
+ friend bool operator>(const EmplaceInt &l, const EmplaceInt &r)
+ { return l.sum() > r.sum(); }
+
+ friend bool operator!=(const EmplaceInt &l, const EmplaceInt &r)
+ { return !(l == r); }
+
+ friend std::ostream &operator <<(std::ostream &os, const EmplaceInt &v)
+ {
+ os << "EmplaceInt: " << v.a_ << ' ' << v.b_ << ' ' << v.c_ << ' ' << v.d_ << ' ' << v.e_;
+ return os;
+ }
+
+ //private:
+ int sum() const
+ { return this->a_ + this->b_ + this->c_ + this->d_ + this->e_; }
+
+ int a_, b_, c_, d_, e_;
+ int padding[6];
+};
+
+
+} //namespace test {
+
+namespace test {
+
+enum EmplaceOptions{
+ EMPLACE_BACK = 1 << 0,
+ EMPLACE_FRONT = 1 << 1,
+ EMPLACE_BEFORE = 1 << 2,
+ EMPLACE_AFTER = 1 << 3,
+ EMPLACE_ASSOC = 1 << 4,
+ EMPLACE_HINT = 1 << 5,
+ EMPLACE_ASSOC_PAIR = 1 << 6,
+ EMPLACE_HINT_PAIR = 1 << 7
+};
+
+template<class Container>
+bool test_expected_container(const Container &ec, const EmplaceInt *Expected, unsigned int only_first_n)
+{
+ typedef typename Container::const_iterator const_iterator;
+ const_iterator itb(ec.begin()), ite(ec.end());
+ unsigned int cur = 0;
+ if(only_first_n > ec.size()){
+ return false;
+ }
+ for(; itb != ite && only_first_n--; ++itb, ++cur){
+ const EmplaceInt & cr = *itb;
+ if(cr != Expected[cur]){
+ return false;
+ }
+ }
+ return true;
+}
+
+template<class Container>
+bool test_expected_container(const Container &ec, const std::pair<EmplaceInt, EmplaceInt> *Expected, unsigned int only_first_n)
+{
+ typedef typename Container::const_iterator const_iterator;
+ const_iterator itb(ec.begin()), ite(ec.end());
+ unsigned int cur = 0;
+ if(only_first_n > ec.size()){
+ return false;
+ }
+ for(; itb != ite && only_first_n--; ++itb, ++cur){
+ if(itb->first != Expected[cur].first){
+ std::cout << "Error in first: " << itb->first << ' ' << Expected[cur].first << std::endl;
+ return false;
+
+ }
+ else if(itb->second != Expected[cur].second){
+ std::cout << "Error in second: " << itb->second << ' ' << Expected[cur].second << std::endl;
+ return false;
+ }
+ }
+ return true;
+}
+
+static EmplaceInt expected [10];
+
+typedef std::pair<EmplaceInt, EmplaceInt> EmplaceIntPair;
+static boost::aligned_storage<sizeof(EmplaceIntPair)*10>::type pair_storage;
+
+static EmplaceIntPair* initialize_emplace_int_pair()
+{
+ EmplaceIntPair* ret = reinterpret_cast<EmplaceIntPair*>(&pair_storage);
+ for(unsigned int i = 0; i != 10; ++i){
+ new(&ret->first)EmplaceInt();
+ new(&ret->second)EmplaceInt();
+ }
+ return ret;
+}
+
+static EmplaceIntPair * expected_pair = initialize_emplace_int_pair();
+
+
+template<class Container>
+bool test_emplace_back(containers_detail::true_)
+{
+ std::cout << "Starting test_emplace_back." << std::endl << " Class: "
+ << typeid(Container).name() << std::endl;
+
+ {
+ new(&expected [0]) EmplaceInt();
+ new(&expected [1]) EmplaceInt(1);
+ new(&expected [2]) EmplaceInt(1, 2);
+ new(&expected [3]) EmplaceInt(1, 2, 3);
+ new(&expected [4]) EmplaceInt(1, 2, 3, 4);
+ new(&expected [5]) EmplaceInt(1, 2, 3, 4, 5);
+ Container c;
+ c.emplace_back();
+ if(!test_expected_container(c, &expected[0], 1))
+ return false;
+ c.emplace_back(1);
+ if(!test_expected_container(c, &expected[0], 2))
+ return false;
+ c.emplace_back(1, 2);
+ if(!test_expected_container(c, &expected[0], 3))
+ return false;
+ c.emplace_back(1, 2, 3);
+ if(!test_expected_container(c, &expected[0], 4))
+ return false;
+ c.emplace_back(1, 2, 3, 4);
+ if(!test_expected_container(c, &expected[0], 5))
+ return false;
+ c.emplace_back(1, 2, 3, 4, 5);
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ }
+
+ return true;
+}
+
+template<class Container>
+bool test_emplace_back(containers_detail::false_)
+{ return true; }
+
+template<class Container>
+bool test_emplace_front(containers_detail::true_)
+{
+ std::cout << "Starting test_emplace_front." << std::endl << " Class: "
+ << typeid(Container).name() << std::endl;
+
+ {
+ new(&expected [0]) EmplaceInt(1, 2, 3, 4, 5);
+ new(&expected [1]) EmplaceInt(1, 2, 3, 4);
+ new(&expected [2]) EmplaceInt(1, 2, 3);
+ new(&expected [3]) EmplaceInt(1, 2);
+ new(&expected [4]) EmplaceInt(1);
+ new(&expected [5]) EmplaceInt();
+ Container c;
+ c.emplace_front();
+ if(!test_expected_container(c, &expected[0] + 5, 1))
+ return false;
+ c.emplace_front(1);
+ if(!test_expected_container(c, &expected[0] + 4, 2))
+ return false;
+ c.emplace_front(1, 2);
+ if(!test_expected_container(c, &expected[0] + 3, 3))
+ return false;
+ c.emplace_front(1, 2, 3);
+ if(!test_expected_container(c, &expected[0] + 2, 4))
+ return false;
+ c.emplace_front(1, 2, 3, 4);
+ if(!test_expected_container(c, &expected[0] + 1, 5))
+ return false;
+ c.emplace_front(1, 2, 3, 4, 5);
+ if(!test_expected_container(c, &expected[0] + 0, 6))
+ return false;
+ }
+ return true;
+}
+
+template<class Container>
+bool test_emplace_front(containers_detail::false_)
+{ return true; }
+
+template<class Container>
+bool test_emplace_before(containers_detail::true_)
+{
+ std::cout << "Starting test_emplace_before." << std::endl << " Class: "
+ << typeid(Container).name() << std::endl;
+
+ {
+ new(&expected [0]) EmplaceInt();
+ new(&expected [1]) EmplaceInt(1);
+ new(&expected [2]) EmplaceInt();
+ Container c;
+ c.emplace(c.cend(), 1);
+ c.emplace(c.cbegin());
+ if(!test_expected_container(c, &expected[0], 2))
+ return false;
+ c.emplace(c.cend());
+ if(!test_expected_container(c, &expected[0], 3))
+ return false;
+ }
+ {
+ new(&expected [0]) EmplaceInt();
+ new(&expected [1]) EmplaceInt(1);
+ new(&expected [2]) EmplaceInt(1, 2);
+ new(&expected [3]) EmplaceInt(1, 2, 3);
+ new(&expected [4]) EmplaceInt(1, 2, 3, 4);
+ new(&expected [5]) EmplaceInt(1, 2, 3, 4, 5);
+ //emplace_front-like
+ Container c;
+ c.emplace(c.cbegin(), 1, 2, 3, 4, 5);
+ c.emplace(c.cbegin(), 1, 2, 3, 4);
+ c.emplace(c.cbegin(), 1, 2, 3);
+ c.emplace(c.cbegin(), 1, 2);
+ c.emplace(c.cbegin(), 1);
+ c.emplace(c.cbegin());
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ c.clear();
+ //emplace_back-like
+ typename Container::const_iterator i = c.emplace(c.cend());
+ if(!test_expected_container(c, &expected[0], 1))
+ return false;
+ i = c.emplace(++i, 1);
+ if(!test_expected_container(c, &expected[0], 2))
+ return false;
+ i = c.emplace(++i, 1, 2);
+ if(!test_expected_container(c, &expected[0], 3))
+ return false;
+ i = c.emplace(++i, 1, 2, 3);
+ if(!test_expected_container(c, &expected[0], 4))
+ return false;
+ i = c.emplace(++i, 1, 2, 3, 4);
+ if(!test_expected_container(c, &expected[0], 5))
+ return false;
+ i = c.emplace(++i, 1, 2, 3, 4, 5);
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ c.clear();
+ //emplace in the middle
+ c.emplace(c.cbegin());
+ i = c.emplace(c.cend(), 1, 2, 3, 4, 5);
+ i = c.emplace(i, 1, 2, 3, 4);
+ i = c.emplace(i, 1, 2, 3);
+ i = c.emplace(i, 1, 2);
+ i = c.emplace(i, 1);
+
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ }
+ return true;
+}
+
+template<class Container>
+bool test_emplace_before(containers_detail::false_)
+{ return true; }
+
+template<class Container>
+bool test_emplace_after(containers_detail::true_)
+{
+ std::cout << "Starting test_emplace_after." << std::endl << " Class: "
+ << typeid(Container).name() << std::endl;
+ {
+ new(&expected [0]) EmplaceInt();
+ new(&expected [1]) EmplaceInt(1);
+ new(&expected [2]) EmplaceInt();
+ Container c;
+ typename Container::const_iterator i = c.emplace_after(c.cbefore_begin(), 1);
+ c.emplace_after(c.cbefore_begin());
+ if(!test_expected_container(c, &expected[0], 2))
+ return false;
+ c.emplace_after(i);
+ if(!test_expected_container(c, &expected[0], 3))
+ return false;
+ }
+ {
+ new(&expected [0]) EmplaceInt();
+ new(&expected [1]) EmplaceInt(1);
+ new(&expected [2]) EmplaceInt(1, 2);
+ new(&expected [3]) EmplaceInt(1, 2, 3);
+ new(&expected [4]) EmplaceInt(1, 2, 3, 4);
+ new(&expected [5]) EmplaceInt(1, 2, 3, 4, 5);
+ //emplace_front-like
+ Container c;
+ c.emplace_after(c.cbefore_begin(), 1, 2, 3, 4, 5);
+ c.emplace_after(c.cbefore_begin(), 1, 2, 3, 4);
+ c.emplace_after(c.cbefore_begin(), 1, 2, 3);
+ c.emplace_after(c.cbefore_begin(), 1, 2);
+ c.emplace_after(c.cbefore_begin(), 1);
+ c.emplace_after(c.cbefore_begin());
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ c.clear();
+ //emplace_back-like
+ typename Container::const_iterator i = c.emplace_after(c.cbefore_begin());
+ if(!test_expected_container(c, &expected[0], 1))
+ return false;
+ i = c.emplace_after(i, 1);
+ if(!test_expected_container(c, &expected[0], 2))
+ return false;
+ i = c.emplace_after(i, 1, 2);
+ if(!test_expected_container(c, &expected[0], 3))
+ return false;
+ i = c.emplace_after(i, 1, 2, 3);
+ if(!test_expected_container(c, &expected[0], 4))
+ return false;
+ i = c.emplace_after(i, 1, 2, 3, 4);
+ if(!test_expected_container(c, &expected[0], 5))
+ return false;
+ i = c.emplace_after(i, 1, 2, 3, 4, 5);
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ c.clear();
+ //emplace_after in the middle
+ i = c.emplace_after(c.cbefore_begin());
+ c.emplace_after(i, 1, 2, 3, 4, 5);
+ c.emplace_after(i, 1, 2, 3, 4);
+ c.emplace_after(i, 1, 2, 3);
+ c.emplace_after(i, 1, 2);
+ c.emplace_after(i, 1);
+
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ }
+ return true;
+}
+
+template<class Container>
+bool test_emplace_after(containers_detail::false_)
+{ return true; }
+
+template<class Container>
+bool test_emplace_assoc(containers_detail::true_)
+{
+ std::cout << "Starting test_emplace_assoc." << std::endl << " Class: "
+ << typeid(Container).name() << std::endl;
+
+ new(&expected [0]) EmplaceInt();
+ new(&expected [1]) EmplaceInt(1);
+ new(&expected [2]) EmplaceInt(1, 2);
+ new(&expected [3]) EmplaceInt(1, 2, 3);
+ new(&expected [4]) EmplaceInt(1, 2, 3, 4);
+ new(&expected [5]) EmplaceInt(1, 2, 3, 4, 5);
+ {
+ Container c;
+ c.emplace();
+ if(!test_expected_container(c, &expected[0], 1))
+ return false;
+ c.emplace(1);
+ if(!test_expected_container(c, &expected[0], 2))
+ return false;
+ c.emplace(1, 2);
+ if(!test_expected_container(c, &expected[0], 3))
+ return false;
+ c.emplace(1, 2, 3);
+ if(!test_expected_container(c, &expected[0], 4))
+ return false;
+ c.emplace(1, 2, 3, 4);
+ if(!test_expected_container(c, &expected[0], 5))
+ return false;
+ c.emplace(1, 2, 3, 4, 5);
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ }
+ return true;
+}
+
+template<class Container>
+bool test_emplace_assoc(containers_detail::false_)
+{ return true; }
+
+template<class Container>
+bool test_emplace_hint(containers_detail::true_)
+{
+ std::cout << "Starting test_emplace_hint." << std::endl << " Class: "
+ << typeid(Container).name() << std::endl;
+
+ new(&expected [0]) EmplaceInt();
+ new(&expected [1]) EmplaceInt(1);
+ new(&expected [2]) EmplaceInt(1, 2);
+ new(&expected [3]) EmplaceInt(1, 2, 3);
+ new(&expected [4]) EmplaceInt(1, 2, 3, 4);
+ new(&expected [5]) EmplaceInt(1, 2, 3, 4, 5);
+
+ {
+ Container c;
+ typename Container::const_iterator it;
+ it = c.emplace_hint(c.begin());
+ if(!test_expected_container(c, &expected[0], 1))
+ return false;
+ it = c.emplace_hint(it, 1);
+ if(!test_expected_container(c, &expected[0], 2))
+ return false;
+ it = c.emplace_hint(it, 1, 2);
+ if(!test_expected_container(c, &expected[0], 3))
+ return false;
+ it = c.emplace_hint(it, 1, 2, 3);
+ if(!test_expected_container(c, &expected[0], 4))
+ return false;
+ it = c.emplace_hint(it, 1, 2, 3, 4);
+ if(!test_expected_container(c, &expected[0], 5))
+ return false;
+ it = c.emplace_hint(it, 1, 2, 3, 4, 5);
+ if(!test_expected_container(c, &expected[0], 6))
+ return false;
+ }
+
+ return true;
+}
+
+template<class Container>
+bool test_emplace_hint(containers_detail::false_)
+{ return true; }
+
+template<class Container>
+bool test_emplace_assoc_pair(containers_detail::true_)
+{
+ std::cout << "Starting test_emplace_assoc_pair." << std::endl << " Class: "
+ << typeid(Container).name() << std::endl;
+
+ new(&expected_pair[0].first) EmplaceInt();
+ new(&expected_pair[0].second) EmplaceInt();
+ new(&expected_pair[1].first) EmplaceInt(1);
+ new(&expected_pair[1].second) EmplaceInt();
+ new(&expected_pair[2].first) EmplaceInt(2);
+ new(&expected_pair[2].second) EmplaceInt(2);
+ new(&expected_pair[3].first) EmplaceInt(3);
+ new(&expected_pair[3].second) EmplaceInt(2, 3);
+ new(&expected_pair[4].first) EmplaceInt(4);
+ new(&expected_pair[4].second) EmplaceInt(2, 3, 4);
+ new(&expected_pair[5].first) EmplaceInt(5);
+ new(&expected_pair[5].second) EmplaceInt(2, 3, 4, 5);
+ {
+ Container c;
+ c.emplace();
+ if(!test_expected_container(c, &expected_pair[0], 1)){
+ std::cout << "Error after c.emplace();\n";
+ return false;
+ }
+ c.emplace(1);
+ if(!test_expected_container(c, &expected_pair[0], 2)){
+ std::cout << "Error after c.emplace(1);\n";
+ return false;
+ }
+ c.emplace(2, 2);
+ if(!test_expected_container(c, &expected_pair[0], 3)){
+ std::cout << "Error after c.emplace(2, 2);\n";
+ return false;
+ }
+ c.emplace(3, 2, 3);
+ if(!test_expected_container(c, &expected_pair[0], 4)){
+ std::cout << "Error after c.emplace(3, 2, 3);\n";
+ return false;
+ }
+ c.emplace(4, 2, 3, 4);
+ if(!test_expected_container(c, &expected_pair[0], 5)){
+ std::cout << "Error after c.emplace(4, 2, 3, 4);\n";
+ return false;
+ }
+ c.emplace(5, 2, 3, 4, 5);
+ if(!test_expected_container(c, &expected_pair[0], 6)){
+ std::cout << "Error after c.emplace(5, 2, 3, 4, 5);\n";
+ return false;
+ }
+ }
+ return true;
+}
+
+template<class Container>
+bool test_emplace_assoc_pair(containers_detail::false_)
+{ return true; }
+
+template<class Container>
+bool test_emplace_hint_pair(containers_detail::true_)
+{
+ std::cout << "Starting test_emplace_hint_pair." << std::endl << " Class: "
+ << typeid(Container).name() << std::endl;
+
+ new(&expected_pair[0].first) EmplaceInt();
+ new(&expected_pair[0].second) EmplaceInt();
+ new(&expected_pair[1].first) EmplaceInt(1);
+ new(&expected_pair[1].second) EmplaceInt();
+ new(&expected_pair[2].first) EmplaceInt(2);
+ new(&expected_pair[2].second) EmplaceInt(2);
+ new(&expected_pair[3].first) EmplaceInt(3);
+ new(&expected_pair[3].second) EmplaceInt(2, 3);
+ new(&expected_pair[4].first) EmplaceInt(4);
+ new(&expected_pair[4].second) EmplaceInt(2, 3, 4);
+ new(&expected_pair[5].first) EmplaceInt(5);
+ new(&expected_pair[5].second) EmplaceInt(2, 3, 4, 5);
+ {
+ Container c;
+ typename Container::const_iterator it;
+ it = c.emplace_hint(c.begin());
+ if(!test_expected_container(c, &expected_pair[0], 1)){
+ std::cout << "Error after c.emplace(1);\n";
+ return false;
+ }
+ it = c.emplace_hint(it, 1);
+ if(!test_expected_container(c, &expected_pair[0], 2)){
+ std::cout << "Error after c.emplace(it, 1);\n";
+ return false;
+ }
+ it = c.emplace_hint(it, 2, 2);
+ if(!test_expected_container(c, &expected_pair[0], 3)){
+ std::cout << "Error after c.emplace(it, 2, 2);\n";
+ return false;
+ }
+ it = c.emplace_hint(it, 3, 2, 3);
+ if(!test_expected_container(c, &expected_pair[0], 4)){
+ std::cout << "Error after c.emplace(it, 3, 2, 3);\n";
+ return false;
+ }
+ it = c.emplace_hint(it, 4, 2, 3, 4);
+ if(!test_expected_container(c, &expected_pair[0], 5)){
+ std::cout << "Error after c.emplace(it, 4, 2, 3, 4);\n";
+ return false;
+ }
+ it = c.emplace_hint(it, 5, 2, 3, 4, 5);
+ if(!test_expected_container(c, &expected_pair[0], 6)){
+ std::cout << "Error after c.emplace(it, 5, 2, 3, 4, 5);\n";
+ return false;
+ }
+ }
+ return true;
+}
+
+template<class Container>
+bool test_emplace_hint_pair(containers_detail::false_)
+{ return true; }
+
+template <EmplaceOptions O, EmplaceOptions Mask>
+struct emplace_active
+{
+ static const bool value = (0 != (O & Mask));
+ typedef containers_detail::bool_<value> type;
+ operator type() const{ return type(); }
+};
+
+template<class Container, EmplaceOptions O>
+bool test_emplace()
+{
+ if(!test_emplace_back<Container>(emplace_active<O, EMPLACE_BACK>()))
+ return false;
+ if(!test_emplace_front<Container>(emplace_active<O, EMPLACE_FRONT>()))
+ return false;
+ if(!test_emplace_before<Container>(emplace_active<O, EMPLACE_BEFORE>()))
+ return false;
+ if(!test_emplace_after<Container>(emplace_active<O, EMPLACE_AFTER>()))
+ return false;
+ if(!test_emplace_assoc<Container>(emplace_active<O, EMPLACE_ASSOC>()))
+ return false;
+ if(!test_emplace_hint<Container>(emplace_active<O, EMPLACE_HINT>()))
+ return false;
+ if(!test_emplace_assoc_pair<Container>(emplace_active<O, EMPLACE_ASSOC_PAIR>()))
+ return false;
+ if(!test_emplace_hint_pair<Container>(emplace_active<O, EMPLACE_HINT_PAIR>()))
+ return false;
+ return true;
+}
+
+} //namespace test{
+} //namespace container {
+} //namespace boost{
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_TEST_EMPLACE_TEST_HPP
Added: sandbox/move/libs/container/test/expand_bwd_test_allocator.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/expand_bwd_test_allocator.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,193 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_EXPAND_BWD_TEST_ALLOCATOR_HPP
+#define BOOST_CONTAINER_EXPAND_BWD_TEST_ALLOCATOR_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+
+#include <boost/container/container_fwd.hpp>
+#include <boost/container/detail/allocation_type.hpp>
+#include <boost/assert.hpp>
+#include <boost/container/detail/utilities.hpp>
+#include <boost/container/detail/version_type.hpp>
+#include <memory>
+#include <algorithm>
+#include <cstddef>
+#include <stdexcept>
+#include <cassert>
+
+//!\file
+//!Describes an allocator to test expand capabilities
+
+namespace boost {
+namespace container {
+namespace test {
+
+//This allocator just allows two allocations. The first one will return
+//mp_buffer + m_offset configured in the constructor. The second one
+//will return mp_buffer.
+template<class T>
+class expand_bwd_test_allocator
+{
+ private:
+ typedef expand_bwd_test_allocator<T> self_t;
+ typedef void * aux_pointer_t;
+ typedef const void * cvoid_ptr;
+
+ template<class T2>
+ expand_bwd_test_allocator& operator=(const expand_bwd_test_allocator<T2>&);
+
+ expand_bwd_test_allocator& operator=(const expand_bwd_test_allocator&);
+
+ public:
+ typedef T value_type;
+ typedef T * pointer;
+ typedef const T * const_pointer;
+ typedef typename containers_detail::add_reference
+ <value_type>::type reference;
+ typedef typename containers_detail::add_reference
+ <const value_type>::type const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ typedef boost::container::containers_detail::version_type<expand_bwd_test_allocator, 2> version;
+
+ template<class T2>
+ struct rebind
+ { typedef expand_bwd_test_allocator<T2> other; };
+
+ //!Constructor from the segment manager. Never throws
+ expand_bwd_test_allocator(T *buffer, size_type size, difference_type offset)
+ : mp_buffer(buffer), m_size(size)
+ , m_offset(offset), m_allocations(0){ }
+
+ //!Constructor from other expand_bwd_test_allocator. Never throws
+ expand_bwd_test_allocator(const expand_bwd_test_allocator &other)
+ : mp_buffer(other.mp_buffer), m_size(other.m_size)
+ , m_offset(other.m_offset), m_allocations(0){ }
+
+ //!Constructor from related expand_bwd_test_allocator. Never throws
+ template<class T2>
+ expand_bwd_test_allocator(const expand_bwd_test_allocator<T2> &other)
+ : mp_buffer(other.mp_buffer), m_size(other.m_size)
+ , m_offset(other.m_offset), m_allocations(0){ }
+
+ pointer address(reference value)
+ { return pointer(addressof(value)); }
+
+ const_pointer address(const_reference value) const
+ { return const_pointer(addressof(value)); }
+
+ pointer allocate(size_type , cvoid_ptr hint = 0)
+ { (void)hint; return 0; }
+
+ void deallocate(const pointer &, size_type)
+ {}
+
+ template<class Convertible>
+ void construct(pointer ptr, const Convertible &value)
+ { new((void*)ptr) value_type(value); }
+
+ void destroy(pointer ptr)
+ { (*ptr).~value_type(); }
+
+ size_type max_size() const
+ { return m_size; }
+
+ friend void swap(self_t &alloc1, self_t &alloc2)
+ {
+ containers_detail::do_swap(alloc1.mp_buffer, alloc2.mp_buffer);
+ containers_detail::do_swap(alloc1.m_size, alloc2.m_size);
+ containers_detail::do_swap(alloc1.m_offset, alloc2.m_offset);
+ }
+
+ //Experimental version 2 expand_bwd_test_allocator functions
+
+ std::pair<pointer, bool>
+ allocation_command(boost::container::allocation_type command,
+ size_type limit_size,
+ size_type preferred_size,
+ size_type &received_size, const pointer &reuse = 0)
+ {
+ (void)preferred_size; (void)reuse; (void)command;
+ //This allocator only expands backwards!
+ assert(m_allocations == 0 || (command & boost::container::expand_bwd));
+
+ received_size = limit_size;
+
+ if(m_allocations == 0){
+ if((m_offset + limit_size) > m_size){
+ assert(0);
+ }
+ ++m_allocations;
+ return std::pair<pointer, bool>(mp_buffer + m_offset, false);
+ }
+ else if(m_allocations == 1){
+ if(limit_size > m_size){
+ assert(0);
+ }
+ ++m_allocations;
+ return std::pair<pointer, bool>(mp_buffer, true);
+ }
+ else{
+ assert(0);
+ throw std::bad_alloc();
+ }
+ }
+
+ //!Returns maximum the number of objects the previously allocated memory
+ //!pointed by p can hold.
+ size_type size(const pointer &p) const
+ { (void)p; return m_size; }
+
+ //!Allocates just one object. Memory allocated with this function
+ //!must be deallocated only with deallocate_one().
+ //!Throws boost::container::bad_alloc if there is no enough memory
+ pointer allocate_one()
+ { return this->allocate(1); }
+
+ //!Deallocates memory previously allocated with allocate_one().
+ //!You should never use deallocate_one to deallocate memory allocated
+ //!with other functions different from allocate_one(). Never throws
+ void deallocate_one(const pointer &p)
+ { return this->deallocate(p, 1); }
+
+ pointer mp_buffer;
+ size_type m_size;
+ difference_type m_offset;
+ char m_allocations;
+};
+
+//!Equality test for same type of expand_bwd_test_allocator
+template<class T> inline
+bool operator==(const expand_bwd_test_allocator<T> &alloc1,
+ const expand_bwd_test_allocator<T> &alloc2)
+{ return false; }
+
+//!Inequality test for same type of expand_bwd_test_allocator
+template<class T> inline
+bool operator!=(const expand_bwd_test_allocator<T> &alloc1,
+ const expand_bwd_test_allocator<T> &alloc2)
+{ return true; }
+
+} //namespace test {
+} //namespace container {
+} //namespace boost {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //BOOST_CONTAINER_EXPAND_BWD_TEST_ALLOCATOR_HPP
+
Added: sandbox/move/libs/container/test/expand_bwd_test_template.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/expand_bwd_test_template.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,269 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_ALLOCATION_TEST_TEMPLATE_HEADER
+#define BOOST_CONTAINER_TEST_ALLOCATION_TEST_TEMPLATE_HEADER
+
+#include <boost/container/detail/config_begin.hpp>
+#include <vector>
+#include <typeinfo>
+#include "expand_bwd_test_allocator.hpp"
+#include <algorithm>
+#include <boost/type_traits/remove_volatile.hpp>
+
+namespace boost { namespace container { namespace test {
+
+template<class T>
+struct value_holder
+{
+ value_holder(T val) : m_value(val){}
+ value_holder(): m_value(0){}
+ ~value_holder(){ m_value = 0; }
+ bool operator == (const value_holder &other) const
+ { return m_value == other.m_value; }
+ bool operator != (const value_holder &other) const
+ { return m_value != other.m_value; }
+
+ T m_value;
+};
+
+template<class T>
+struct triple_value_holder
+{
+ triple_value_holder(T val)
+ : m_value1(val)
+ , m_value2(val)
+ , m_value3(val)
+ {}
+
+ triple_value_holder()
+ : m_value1(0)
+ , m_value2(0)
+ , m_value3(0)
+ {}
+
+ ~triple_value_holder()
+ { m_value1 = m_value2 = m_value3 = 0; }
+
+ bool operator == (const triple_value_holder &other) const
+ {
+ return m_value1 == other.m_value1
+ && m_value2 == other.m_value2
+ && m_value3 == other.m_value3;
+ }
+
+ bool operator != (const triple_value_holder &other) const
+ {
+ return m_value1 != other.m_value1
+ || m_value2 != other.m_value2
+ || m_value3 != other.m_value3;
+ }
+
+ T m_value1;
+ T m_value2;
+ T m_value3;
+};
+
+typedef value_holder<int> int_holder;
+typedef triple_value_holder<int> triple_int_holder;
+
+
+
+//Function to check if both sets are equal
+template <class Vector1, class Vector2>
+bool CheckEqualVector(const Vector1 &vector1, const Vector2 &vector2)
+{
+ if(vector1.size() != vector2.size())
+ return false;
+ return std::equal(vector1.begin(), vector1.end(), vector2.begin());
+}
+
+template<class Vector>
+bool CheckUninitializedIsZero(const Vector & v)
+{
+ typedef typename Vector::value_type value_type;
+ typename Vector::size_type sz = v.size();
+ typename Vector::size_type extra = v.capacity() - v.size();
+ value_type comp(0);
+
+ const value_type *holder = &v[0] + sz;
+
+ while(extra--){
+ if(*holder++ != comp)
+ return false;
+ }
+ return true;
+}
+
+
+//This function tests all the possible combinations when
+//inserting data in a vector and expanding backwards
+template<class VectorWithExpandBwdAllocator>
+bool test_insert_with_expand_bwd()
+{
+ typedef typename VectorWithExpandBwdAllocator::value_type value_type;
+ typedef typename boost::remove_volatile<value_type>::type non_volatile_value_type;
+ typedef std::vector<non_volatile_value_type> Vect;
+ const int MemorySize = 1000;
+
+ //Distance old and new buffer
+ const int Offset[] =
+ { 350, 250, 150, 150,
+ 150, 50, 50, 50 };
+ //Insert position
+ const int Position[] =
+ { 100, 100, 100, 100,
+ 100, 100, 100, 100 };
+ //Initial vector size
+ const int InitialSize[] =
+ { 200, 200, 200, 200,
+ 200, 200, 200, 200 };
+ //Size of the data to insert
+ const int InsertSize[] =
+ { 100, 100, 100, 200,
+ 300, 25, 100, 200 };
+ //Number of tests
+ const int Iterations = sizeof(InsertSize)/sizeof(int);
+
+ for(int iteration = 0; iteration < Iterations; ++iteration)
+ {
+ value_type *memory = new value_type[MemorySize];
+ try {
+ std::vector<non_volatile_value_type> initial_data;
+ initial_data.resize(InitialSize[iteration]);
+ for(int i = 0; i < InitialSize[iteration]; ++i){
+ initial_data[i] = i;
+ }
+
+ Vect data_to_insert;
+ data_to_insert.resize(InsertSize[iteration]);
+ for(int i = 0; i < InsertSize[iteration]; ++i){
+ data_to_insert[i] = -i;
+ }
+
+ expand_bwd_test_allocator<value_type> alloc
+ (&memory[0], MemorySize, Offset[iteration]);
+ VectorWithExpandBwdAllocator vector(alloc);
+ vector.insert( vector.begin()
+ , initial_data.begin(), initial_data.end());
+ vector.insert( vector.begin() + Position[iteration]
+ , data_to_insert.begin(), data_to_insert.end());
+ initial_data.insert(initial_data.begin() + Position[iteration]
+ , data_to_insert.begin(), data_to_insert.end());
+ //Now check that values are equal
+ if(!CheckEqualVector(vector, initial_data)){
+ std::cout << "test_assign_with_expand_bwd::CheckEqualVector failed." << std::endl
+ << " Class: " << typeid(VectorWithExpandBwdAllocator).name() << std::endl
+ << " Iteration: " << iteration << std::endl;
+ return false;
+ }
+ }
+ catch(...){
+ delete [](const_cast<non_volatile_value_type*>(memory));
+ throw;
+ }
+ delete [](const_cast<non_volatile_value_type*>(memory));
+ }
+
+ return true;
+}
+
+//This function tests all the possible combinations when
+//inserting data in a vector and expanding backwards
+template<class VectorWithExpandBwdAllocator>
+bool test_assign_with_expand_bwd()
+{
+ typedef typename VectorWithExpandBwdAllocator::value_type value_type;
+ typedef typename boost::remove_volatile<value_type>::type non_volatile_value_type;
+ typedef std::vector<non_volatile_value_type> Vect;
+ const int MemorySize = 200;
+
+ const int Offset[] = { 50, 50, 50};
+ const int InitialSize[] = { 25, 25, 25};
+ const int AssignSize[] = { 40, 60, 80};
+ const int Iterations = sizeof(AssignSize)/sizeof(int);
+
+ for(int iteration = 0; iteration <Iterations; ++iteration)
+ {
+ value_type *memory = new value_type[MemorySize];
+ try {
+ //Create initial data
+ std::vector<non_volatile_value_type> initial_data;
+ initial_data.resize(InitialSize[iteration]);
+ for(int i = 0; i < InitialSize[iteration]; ++i){
+ initial_data[i] = i;
+ }
+
+ //Create data to assign
+ std::vector<non_volatile_value_type> data_to_assign;
+ data_to_assign.resize(AssignSize[iteration]);
+ for(int i = 0; i < AssignSize[iteration]; ++i){
+ data_to_assign[i] = -i;
+ }
+
+ //Insert initial data to the vector to test
+ expand_bwd_test_allocator<value_type> alloc
+ (&memory[0], MemorySize, Offset[iteration]);
+ VectorWithExpandBwdAllocator vector(alloc);
+ vector.insert( vector.begin()
+ , initial_data.begin(), initial_data.end());
+
+ //Assign data
+ vector.assign(data_to_assign.begin(), data_to_assign.end());
+ initial_data.assign(data_to_assign.begin(), data_to_assign.end());
+
+ //Now check that values are equal
+ if(!CheckEqualVector(vector, initial_data)){
+ std::cout << "test_assign_with_expand_bwd::CheckEqualVector failed." << std::endl
+ << " Class: " << typeid(VectorWithExpandBwdAllocator).name() << std::endl
+ << " Iteration: " << iteration << std::endl;
+ return false;
+ }
+ }
+ catch(...){
+ delete [](const_cast<typename boost::remove_volatile<value_type>::type*>(memory));
+ throw;
+ }
+ delete [](const_cast<typename boost::remove_volatile<value_type>::type*>(memory));
+ }
+
+ return true;
+}
+
+//This function calls all tests
+template<class VectorWithExpandBwdAllocator>
+bool test_all_expand_bwd()
+{
+ std::cout << "Starting test_insert_with_expand_bwd." << std::endl << " Class: "
+ << typeid(VectorWithExpandBwdAllocator).name() << std::endl;
+
+ if(!test_insert_with_expand_bwd<VectorWithExpandBwdAllocator>()){
+ std::cout << "test_allocation_direct_deallocation failed. Class: "
+ << typeid(VectorWithExpandBwdAllocator).name() << std::endl;
+ return false;
+ }
+
+ std::cout << "Starting test_assign_with_expand_bwd." << std::endl << " Class: "
+ << typeid(VectorWithExpandBwdAllocator).name() << std::endl;
+
+ if(!test_assign_with_expand_bwd<VectorWithExpandBwdAllocator>()){
+ std::cout << "test_allocation_direct_deallocation failed. Class: "
+ << typeid(VectorWithExpandBwdAllocator).name() << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+}}} //namespace boost { namespace container { namespace test {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //BOOST_CONTAINER_TEST_ALLOCATION_TEST_TEMPLATE_HEADER
Added: sandbox/move/libs/container/test/flat_tree_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/flat_tree_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,292 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/detail/config_begin.hpp>
+#include <set>
+#include <boost/container/flat_set.hpp>
+#include <boost/container/flat_map.hpp>
+#include "print_container.hpp"
+#include "dummy_test_allocator.hpp"
+#include "movable_int.hpp"
+#include "set_test.hpp"
+#include "map_test.hpp"
+#include "emplace_test.hpp"
+
+/////////////////////////////////////////////////////////////////
+//
+// This example repeats the same operations with std::set and
+// shmem_set using the node allocator
+// and compares the values of both containers
+//
+/////////////////////////////////////////////////////////////////
+
+using namespace boost::container;
+/*
+//Explicit instantiation to detect compilation errors
+template class boost::container::flat_set
+ <test::movable_and_copyable_int
+ ,std::less<test::movable_and_copyable_int>
+ ,test::dummy_test_allocator<test::movable_and_copyable_int> >;
+
+template class boost::container::flat_map
+ <test::movable_and_copyable_int
+ ,test::movable_and_copyable_int
+ ,std::less<test::movable_and_copyable_int>
+ ,test::dummy_test_allocator<std::pair<test::movable_and_copyable_int
+ ,test::movable_and_copyable_int> > >;
+
+template class boost::container::flat_multiset
+ <test::movable_and_copyable_int
+ ,std::less<test::movable_and_copyable_int>
+ ,test::dummy_test_allocator<test::movable_and_copyable_int> >;
+
+template class boost::container::flat_multimap
+ <test::movable_and_copyable_int
+ ,test::movable_and_copyable_int
+ ,std::less<test::movable_and_copyable_int>
+ ,test::dummy_test_allocator<std::pair<test::movable_and_copyable_int
+ ,test::movable_and_copyable_int> > >;
+*/
+//Alias allocator type
+typedef std::allocator<int> shmem_allocator_t;
+typedef std::allocator<test::movable_int>
+ shmem_movable_allocator_t;
+typedef std::allocator<std::pair<int, int> >
+ shmem_pair_allocator_t;
+typedef std::allocator<std::pair<test::movable_int, test::movable_int> >
+ shmem_movable_pair_allocator_t;
+typedef std::allocator<test::movable_and_copyable_int >
+ shmem_move_copy_allocator_t;
+typedef std::allocator<std::pair<test::movable_and_copyable_int, test::movable_and_copyable_int> >
+ shmem_move_copy_pair_allocator_t;
+
+//Alias set types
+typedef std::set<int> MyStdSet;
+typedef std::multiset<int> MyStdMultiSet;
+typedef std::map<int, int> MyStdMap;
+typedef std::multimap<int, int> MyStdMultiMap;
+
+typedef flat_set<int, std::less<int>, shmem_allocator_t> MyShmSet;
+typedef flat_multiset<int, std::less<int>, shmem_allocator_t> MyShmMultiSet;
+typedef flat_map<int, int, std::less<int>, shmem_pair_allocator_t> MyShmMap;
+typedef flat_multimap<int, int, std::less<int>, shmem_pair_allocator_t> MyShmMultiMap;
+
+typedef flat_set<test::movable_int, std::less<test::movable_int>
+ ,shmem_movable_allocator_t> MyMovableShmSet;
+typedef flat_multiset<test::movable_int,std::less<test::movable_int>
+ ,shmem_movable_allocator_t> MyMovableShmMultiSet;
+typedef flat_map<test::movable_int, test::movable_int
+ ,std::less<test::movable_int>
+ ,shmem_movable_pair_allocator_t> MyMovableShmMap;
+typedef flat_multimap<test::movable_int, test::movable_int
+ ,std::less<test::movable_int>
+ ,shmem_movable_pair_allocator_t> MyMovableShmMultiMap;
+
+typedef flat_set<test::movable_and_copyable_int, std::less<test::movable_and_copyable_int>
+ ,shmem_move_copy_allocator_t> MyMoveCopyShmSet;
+typedef flat_multiset<test::movable_and_copyable_int,std::less<test::movable_and_copyable_int>
+ ,shmem_move_copy_allocator_t> MyMoveCopyShmMultiSet;
+typedef flat_map<test::movable_and_copyable_int, test::movable_and_copyable_int
+ ,std::less<test::movable_and_copyable_int>
+ ,shmem_move_copy_pair_allocator_t> MyMoveCopyShmMap;
+typedef flat_multimap<test::movable_and_copyable_int, test::movable_and_copyable_int
+ ,std::less<test::movable_and_copyable_int>
+ ,shmem_move_copy_pair_allocator_t> MyMoveCopyShmMultiMap;
+
+//Test recursive structures
+class recursive_flat_set
+{
+ public:
+ recursive_flat_set(const recursive_flat_set &c)
+ : id_(c.id_), flat_set_(c.flat_set_)
+ {}
+
+ recursive_flat_set & operator =(const recursive_flat_set &c)
+ {
+ id_ = c.id_;
+ flat_set_= c.flat_set_;
+ return *this;
+ }
+ int id_;
+ flat_set<recursive_flat_set> flat_set_;
+ friend bool operator< (const recursive_flat_set &a, const recursive_flat_set &b)
+ { return a.id_ < b.id_; }
+};
+
+class recursive_flat_map
+{
+ public:
+ recursive_flat_map(const recursive_flat_map &c)
+ : id_(c.id_), map_(c.map_)
+ {}
+
+ recursive_flat_map & operator =(const recursive_flat_map &c)
+ {
+ id_ = c.id_;
+ map_= c.map_;
+ return *this;
+ }
+
+ int id_;
+ flat_map<recursive_flat_map, recursive_flat_map> map_;
+
+ friend bool operator< (const recursive_flat_map &a, const recursive_flat_map &b)
+ { return a.id_ < b.id_; }
+};
+
+//Test recursive structures
+class recursive_flat_multiset
+{
+ public:
+ recursive_flat_multiset(const recursive_flat_multiset &c)
+ : id_(c.id_), flat_set_(c.flat_set_)
+ {}
+
+ recursive_flat_multiset & operator =(const recursive_flat_multiset &c)
+ {
+ id_ = c.id_;
+ flat_set_= c.flat_set_;
+ return *this;
+ }
+ int id_;
+ flat_multiset<recursive_flat_multiset> flat_set_;
+ friend bool operator< (const recursive_flat_multiset &a, const recursive_flat_set &b)
+ { return a.id_ < b.id_; }
+};
+
+class recursive_flat_multimap
+{
+public:
+ recursive_flat_multimap(const recursive_flat_multimap &c)
+ : id_(c.id_), map_(c.map_)
+ {}
+
+ recursive_flat_multimap & operator =(const recursive_flat_multimap &c)
+ {
+ id_ = c.id_;
+ map_= c.map_;
+ return *this;
+ }
+ int id_;
+ flat_map<recursive_flat_multimap, recursive_flat_multimap> map_;
+ friend bool operator< (const recursive_flat_multimap &a, const recursive_flat_multimap &b)
+ { return a.id_ < b.id_; }
+};
+
+template<class C>
+void test_move()
+{
+ //Now test move semantics
+ C original;
+ C move_ctor(boost::move(original));
+ C move_assign;
+ move_assign = boost::move(move_ctor);
+ move_assign.swap(original);
+}
+
+int main()
+{
+ using namespace boost::container::test;
+
+ //Now test move semantics
+ {
+ test_move<flat_set<recursive_flat_set> >();
+ test_move<flat_multiset<recursive_flat_multiset> >();
+ test_move<flat_map<recursive_flat_map, recursive_flat_map> >();
+ test_move<flat_multimap<recursive_flat_multimap, recursive_flat_multimap> >();
+ }
+
+
+ if (0 != set_test<
+ MyShmSet
+ ,MyStdSet
+ ,MyShmMultiSet
+ ,MyStdMultiSet>()){
+ std::cout << "Error in set_test<MyShmSet>" << std::endl;
+ return 1;
+ }
+
+ if (0 != set_test_copyable<
+ MyShmSet
+ ,MyStdSet
+ ,MyShmMultiSet
+ ,MyStdMultiSet>()){
+ std::cout << "Error in set_test<MyShmSet>" << std::endl;
+ return 1;
+ }
+
+ if (0 != set_test<
+ MyMovableShmSet
+ ,MyStdSet
+ ,MyMovableShmMultiSet
+ ,MyStdMultiSet>()){
+ std::cout << "Error in set_test<MyMovableShmSet>" << std::endl;
+ return 1;
+ }
+
+ if (0 != set_test<
+ MyMoveCopyShmSet
+ ,MyStdSet
+ ,MyMoveCopyShmMultiSet
+ ,MyStdMultiSet>()){
+ std::cout << "Error in set_test<MyMoveCopyShmSet>" << std::endl;
+ return 1;
+ }
+
+ if (0 != map_test<
+ MyShmMap
+ ,MyStdMap
+ ,MyShmMultiMap
+ ,MyStdMultiMap>()){
+ std::cout << "Error in set_test<MyShmMap>" << std::endl;
+ return 1;
+ }
+
+ if (0 != map_test_copyable<
+ MyShmMap
+ ,MyStdMap
+ ,MyShmMultiMap
+ ,MyStdMultiMap>()){
+ std::cout << "Error in set_test<MyShmMap>" << std::endl;
+ return 1;
+ }
+
+// if (0 != map_test<
+// MyMovableShmMap
+// ,MyStdMap
+// ,MyMovableShmMultiMap
+// ,MyStdMultiMap>()){
+// return 1;
+// }
+
+ if (0 != map_test<
+ MyMoveCopyShmMap
+ ,MyStdMap
+ ,MyMoveCopyShmMultiMap
+ ,MyStdMultiMap>()){
+ std::cout << "Error in set_test<MyMoveCopyShmMap>" << std::endl;
+ return 1;
+ }
+
+ const test::EmplaceOptions SetOptions = (test::EmplaceOptions)(test::EMPLACE_HINT | test::EMPLACE_ASSOC);
+ const test::EmplaceOptions MapOptions = (test::EmplaceOptions)(test::EMPLACE_HINT_PAIR | test::EMPLACE_ASSOC_PAIR);
+
+ if(!boost::container::test::test_emplace<flat_map<test::EmplaceInt, test::EmplaceInt>, MapOptions>())
+ return 1;
+ if(!boost::container::test::test_emplace<flat_multimap<test::EmplaceInt, test::EmplaceInt>, MapOptions>())
+ return 1;
+ if(!boost::container::test::test_emplace<flat_set<test::EmplaceInt>, SetOptions>())
+ return 1;
+ if(!boost::container::test::test_emplace<flat_multiset<test::EmplaceInt>, SetOptions>())
+ return 1;
+ return 0;
+}
+
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/test/heap_allocator_v1.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/heap_allocator_v1.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,159 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_HEAP_ALLOCATOR_V1_HPP
+#define BOOST_CONTAINER_HEAP_ALLOCATOR_V1_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+
+#include <boost/pointer_to_other.hpp>
+
+#include <boost/container/container_fwd.hpp>
+#include <boost/container/detail/allocation_type.hpp>
+#include <boost/container/detail/utilities.hpp>
+#include <boost/container/detail/version_type.hpp>
+#include <boost/container/exceptions.hpp>
+#include <memory>
+#include <algorithm>
+#include <cstddef>
+#include <stdexcept>
+
+//!\file
+//!Describes an heap_allocator_v1 that allocates portions of fixed size
+//!memory buffer (shared memory, mapped file...)
+
+namespace boost {
+namespace container {
+namespace test {
+
+//!An STL compatible heap_allocator_v1 that uses a segment manager as
+//!memory source. The internal pointer type will of the same type (raw, smart) as
+//!"typename SegmentManager::void_pointer" type. This allows
+//!placing the heap_allocator_v1 in shared memory, memory mapped-files, etc...*/
+template<class T, class SegmentManager>
+class heap_allocator_v1
+{
+ private:
+ typedef heap_allocator_v1<T, SegmentManager> self_t;
+ typedef SegmentManager segment_manager;
+ typedef typename segment_manager::void_pointer aux_pointer_t;
+
+ typedef typename
+ boost::pointer_to_other
+ <aux_pointer_t, const void>::type cvoid_ptr;
+
+ typedef typename boost::pointer_to_other
+ <cvoid_ptr, segment_manager>::type alloc_ptr_t;
+
+ template<class T2, class SegmentManager2>
+ heap_allocator_v1& operator=(const heap_allocator_v1<T2, SegmentManager2>&);
+
+ heap_allocator_v1& operator=(const heap_allocator_v1&);
+
+ alloc_ptr_t mp_mngr;
+
+ public:
+ typedef T value_type;
+ typedef typename boost::pointer_to_other
+ <cvoid_ptr, T>::type pointer;
+ typedef typename boost::
+ pointer_to_other<pointer, const T>::type const_pointer;
+ typedef typename detail::add_reference
+ <value_type>::type reference;
+ typedef typename detail::add_reference
+ <const value_type>::type const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ //!Obtains an heap_allocator_v1 of other type
+ template<class T2>
+ struct rebind
+ {
+ typedef heap_allocator_v1<T2, SegmentManager> other;
+ };
+
+ //!Returns the segment manager. Never throws
+ segment_manager* get_segment_manager()const
+ { return detail::get_pointer(mp_mngr); }
+/*
+ //!Returns address of mutable object. Never throws
+ pointer address(reference value) const
+ { return pointer(addressof(value)); }
+
+ //!Returns address of non mutable object. Never throws
+ const_pointer address(const_reference value) const
+ { return const_pointer(addressof(value)); }
+*/
+ //!Constructor from the segment manager. Never throws
+ heap_allocator_v1(segment_manager *segment_mngr)
+ : mp_mngr(segment_mngr) { }
+
+ //!Constructor from other heap_allocator_v1. Never throws
+ heap_allocator_v1(const heap_allocator_v1 &other)
+ : mp_mngr(other.get_segment_manager()){ }
+
+ //!Constructor from related heap_allocator_v1. Never throws
+ template<class T2>
+ heap_allocator_v1(const heap_allocator_v1<T2, SegmentManager> &other)
+ : mp_mngr(other.get_segment_manager()){}
+
+ //!Allocates memory for an array of count elements.
+ //!Throws boost::container::bad_alloc if there is no enough memory
+ pointer allocate(size_type count, cvoid_ptr hint = 0)
+ { (void)hint; return ::new value_type[count]; }
+
+ //!Deallocates memory previously allocated. Never throws
+ void deallocate(const pointer &ptr, size_type)
+ { return ::delete[] detail::get_pointer(ptr) ; }
+
+ //!Construct object, calling constructor.
+ //!Throws if T(const T&) throws
+ void construct(const pointer &ptr, const_reference value)
+ { new((void*)detail::get_pointer(ptr)) value_type(value); }
+
+ //!Destroys object. Throws if object's destructor throws
+ void destroy(const pointer &ptr)
+ { BOOST_ASSERT(ptr != 0); (*ptr).~value_type(); }
+
+ //!Returns the number of elements that could be allocated. Never throws
+ size_type max_size() const
+ { return mp_mngr->get_size(); }
+
+ //!Swap segment manager. Does not throw. If each heap_allocator_v1 is placed in
+ //!different memory segments, the result is undefined.
+ friend void swap(self_t &alloc1, self_t &alloc2)
+ { detail::do_swap(alloc1.mp_mngr, alloc2.mp_mngr); }
+};
+
+//!Equality test for same type of heap_allocator_v1
+template<class T, class SegmentManager> inline
+bool operator==(const heap_allocator_v1<T , SegmentManager> &alloc1,
+ const heap_allocator_v1<T, SegmentManager> &alloc2)
+ { return alloc1.get_segment_manager() == alloc2.get_segment_manager(); }
+
+//!Inequality test for same type of heap_allocator_v1
+template<class T, class SegmentManager> inline
+bool operator!=(const heap_allocator_v1<T, SegmentManager> &alloc1,
+ const heap_allocator_v1<T, SegmentManager> &alloc2)
+ { return alloc1.get_segment_manager() != alloc2.get_segment_manager(); }
+
+} //namespace test {
+} //namespace container {
+} //namespace boost {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //BOOST_CONTAINER_HEAP_ALLOCATOR_V1_HPP
+
Added: sandbox/move/libs/container/test/list_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/list_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,72 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/list.hpp>
+#include "dummy_test_allocator.hpp"
+#include "list_test.hpp"
+#include "movable_int.hpp"
+#include "emplace_test.hpp"
+
+using namespace boost::container;
+
+//Explicit instantiation to detect compilation errors
+template class boost::container::list<test::movable_and_copyable_int,
+ test::dummy_test_allocator<test::movable_and_copyable_int> >;
+typedef list<int> MyList;
+
+typedef list<volatile int> MyVolatileList;
+typedef list<test::movable_int> MyMoveList;
+typedef list<test::movable_and_copyable_int> MyCopyMoveList;
+
+class recursive_list
+{
+public:
+ int id_;
+ list<recursive_list> list_;
+};
+
+void recursive_list_test()//Test for recursive types
+{
+ list<recursive_list> recursive_list_list;
+}
+
+int main ()
+{
+ recursive_list_test();
+ {
+ //Now test move semantics
+ list<recursive_list> original;
+ list<recursive_list> move_ctor(boost::move(original));
+ list<recursive_list> move_assign;
+ move_assign = boost::move(move_ctor);
+ move_assign.swap(original);
+ }
+ if(test::list_test<MyList, true>())
+ return 1;
+
+ if(test::list_test<MyVolatileList, true>())
+ return 1;
+
+ if(test::list_test<MyMoveList, true>())
+ return 1;
+
+ if(test::list_test<MyCopyMoveList, true>())
+ return 1;
+
+ const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_FRONT | test::EMPLACE_BEFORE);
+
+ if(!boost::container::test::test_emplace<list<test::EmplaceInt>, Options>())
+ return 1;
+
+ return 0;
+}
+
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/test/list_test.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/list_test.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,248 @@
+////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_LIST_TEST_HEADER
+#define BOOST_CONTAINER_TEST_LIST_TEST_HEADER
+
+#include <boost/container/detail/config_begin.hpp>
+#include "check_equal_containers.hpp"
+#include <memory>
+#include <list>
+#include <vector>
+#include <functional>
+#include "print_container.hpp"
+#include <boost/move/move.hpp>
+#include <string>
+
+namespace boost{
+namespace container {
+namespace test{
+
+template<bool DoublyLinked>
+struct push_data_function
+{
+ template<class MyShmList, class MyStdList>
+ static int execute(int max, MyShmList *shmlist, MyStdList *stdlist)
+ {
+ typedef typename MyShmList::value_type IntType;
+ for(int i = 0; i < max; ++i){
+ IntType move_me(i);
+ shmlist->push_back(boost::move(move_me));
+ stdlist->push_back(i);
+ }
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+ return 0;
+ }
+};
+
+template<>
+struct push_data_function<false>
+{
+ template<class MyShmList, class MyStdList>
+ static int execute(int max, MyShmList *shmlist, MyStdList *stdlist)
+ {
+ typedef typename MyShmList::value_type IntType;
+ for(int i = 0; i < max; ++i){
+ IntType move_me(i);
+ shmlist->push_front(boost::move(move_me));
+ stdlist->push_front(i);
+ }
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+ return 0;
+ }
+};
+
+template<bool DoublyLinked>
+struct pop_back_function
+{
+ template<class MyStdList, class MyShmList>
+ static int execute(MyShmList *shmlist, MyStdList *stdlist)
+ {
+ shmlist->pop_back();
+ stdlist->pop_back();
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+ return 0;
+ }
+};
+
+template<>
+struct pop_back_function<false>
+{
+ template<class MyStdList, class MyShmList>
+ static int execute(MyShmList *shmlist, MyStdList *stdlist)
+ {
+ (void)shmlist; (void)stdlist;
+ return 0;
+ }
+};
+
+template<class MyShmList
+ ,bool DoublyLinked>
+int list_test (bool copied_allocators_equal = true)
+{
+ typedef std::list<int> MyStdList;
+ typedef typename MyShmList::value_type IntType;
+ const int max = 100;
+ typedef push_data_function<DoublyLinked> push_data_t;
+
+ try{
+ MyShmList *shmlist = new MyShmList;
+ MyStdList *stdlist = new MyStdList;
+
+ if(push_data_t::execute(max, shmlist, stdlist)){
+ return 1;
+ }
+
+ shmlist->erase(shmlist->begin()++);
+ stdlist->erase(stdlist->begin()++);
+ if(!CheckEqualContainers(shmlist, stdlist)) return 1;
+
+ if(pop_back_function<DoublyLinked>::execute(shmlist, stdlist)){
+ return 1;
+ }
+
+ shmlist->pop_front();
+ stdlist->pop_front();
+ if(!CheckEqualContainers(shmlist, stdlist)) return 1;
+
+ {
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = -1;
+ }
+ shmlist->assign(boost::make_move_iterator(&aux_vect[0])
+ ,boost::make_move_iterator(&aux_vect[50]));
+ stdlist->assign(&aux_vect2[0], &aux_vect2[50]);
+ if(!CheckEqualContainers(shmlist, stdlist)) return 1;
+ }
+
+ if(copied_allocators_equal){
+ shmlist->sort();
+ stdlist->sort();
+ if(!CheckEqualContainers(shmlist, stdlist)) return 1;
+ }
+
+ shmlist->reverse();
+ stdlist->reverse();
+ if(!CheckEqualContainers(shmlist, stdlist)) return 1;
+
+ shmlist->reverse();
+ stdlist->reverse();
+ if(!CheckEqualContainers(shmlist, stdlist)) return 1;
+
+ {
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = -1;
+ }
+ shmlist->insert(shmlist->begin()
+ ,boost::make_move_iterator(&aux_vect[0])
+ ,boost::make_move_iterator(&aux_vect[50]));
+ stdlist->insert(stdlist->begin(), &aux_vect2[0], &aux_vect2[50]);
+ }
+
+ shmlist->unique();
+ stdlist->unique();
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+
+ if(copied_allocators_equal){
+ shmlist->sort(std::greater<IntType>());
+ stdlist->sort(std::greater<int>());
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+ }
+
+ shmlist->resize(25);
+ stdlist->resize(25);
+ shmlist->resize(50);
+ stdlist->resize(50);
+ shmlist->resize(0);
+ stdlist->resize(0);
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+
+ if(push_data_t::execute(max, shmlist, stdlist)){
+ return 1;
+ }
+ {
+ MyShmList othershmlist(shmlist->get_allocator());
+ MyStdList otherstdlist;
+
+ int listsize = (int)shmlist->size();
+
+ if(push_data_t::execute(listsize, shmlist, stdlist)){
+ return 1;
+ }
+
+ if(copied_allocators_equal){
+ shmlist->splice(shmlist->begin(), othershmlist);
+ stdlist->splice(stdlist->begin(), otherstdlist);
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+ }
+
+ listsize = (int)shmlist->size();
+
+ if(push_data_t::execute(listsize, shmlist, stdlist)){
+ return 1;
+ }
+
+ if(push_data_t::execute(listsize, &othershmlist, &otherstdlist)){
+ return 1;
+ }
+
+ if(copied_allocators_equal){
+ shmlist->sort(std::greater<IntType>());
+ stdlist->sort(std::greater<int>());
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+
+ othershmlist.sort(std::greater<IntType>());
+ otherstdlist.sort(std::greater<int>());
+ if(!CheckEqualContainers(&othershmlist, &otherstdlist))
+ return 1;
+
+ shmlist->merge(othershmlist, std::greater<IntType>());
+ stdlist->merge(otherstdlist, std::greater<int>());
+ if(!CheckEqualContainers(shmlist, stdlist))
+ return 1;
+ }
+ }
+
+ delete shmlist;
+ delete stdlist;
+ }
+ catch(...){
+ throw;
+ }
+ return 0;
+}
+
+} //namespace test{
+} //namespace container {
+} //namespace boost{
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif
Added: sandbox/move/libs/container/test/map_test.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/map_test.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,521 @@
+////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_MAP_TEST_HEADER
+#define BOOST_CONTAINER_TEST_MAP_TEST_HEADER
+
+#include <boost/container/detail/config_begin.hpp>
+#include "check_equal_containers.hpp"
+#include <map>
+#include <functional>
+#include <utility>
+#include "print_container.hpp"
+#include <boost/container/detail/utilities.hpp>
+#include <boost/container/detail/pair.hpp>
+#include <string>
+
+template<class T1, class T2, class T3, class T4>
+bool operator ==(std::pair<T1, T2> &p1, std::pair<T1, T2> &p2)
+{
+ return p1.first == p2.first && p1.second == p2.second;
+}
+
+namespace boost{
+namespace container {
+namespace test{
+
+template<class MyShmMap
+ ,class MyStdMap
+ ,class MyShmMultiMap
+ ,class MyStdMultiMap>
+int map_test ()
+{
+ typedef typename MyShmMap::key_type IntType;
+ typedef containers_detail::pair<IntType, IntType> IntPairType;
+ typedef typename MyStdMap::value_type StdPairType;
+ const int max = 100;
+
+ try{
+ MyShmMap *shmmap = new MyShmMap;
+ MyStdMap *stdmap = new MyStdMap;
+ MyShmMultiMap *shmmultimap = new MyShmMultiMap;
+ MyStdMultiMap *stdmultimap = new MyStdMultiMap;
+
+ //Test construction from a range
+ {
+ //This is really nasty, but we have no other simple choice
+ IntPairType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(i/2);
+ IntType i2(i/2);
+ new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ typedef typename MyStdMap::value_type StdValueType;
+ typedef typename MyStdMap::key_type StdKeyType;
+ typedef typename MyStdMap::mapped_type StdMappedType;
+ StdValueType aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ new(&aux_vect2[i])StdValueType(StdKeyType(i/2), StdMappedType(i/2));
+ }
+
+ IntPairType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(i/2);
+ IntType i2(i/2);
+ new(&aux_vect3[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ MyShmMap *shmmap2 = new MyShmMap
+ ( boost::make_move_iterator(&aux_vect[0])
+ , boost::make_move_iterator(aux_vect + 50));
+ MyStdMap *stdmap2 = new MyStdMap(aux_vect2, aux_vect2 + 50);
+ MyShmMultiMap *shmmultimap2 = new MyShmMultiMap
+ ( boost::make_move_iterator(&aux_vect3[0])
+ , boost::make_move_iterator(aux_vect3 + 50));
+ MyStdMultiMap *stdmultimap2 = new MyStdMultiMap(aux_vect2, aux_vect2 + 50);
+ if(!CheckEqualContainers(shmmap2, stdmap2)) return 1;
+ if(!CheckEqualContainers(shmmultimap2, stdmultimap2)) return 1;
+
+ //ordered range insertion
+ //This is really nasty, but we have no other simple choice
+ for(int i = 0; i < 50; ++i){
+ IntType i1(i);
+ IntType i2(i);
+ new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ for(int i = 0; i < 50; ++i){
+ new(&aux_vect2[i])StdValueType(StdKeyType(i), StdMappedType(i));
+ }
+
+ for(int i = 0; i < 50; ++i){
+ IntType i1(i);
+ IntType i2(i);
+ new(&aux_vect3[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+/*
+ MyShmMap *shmmap3 = new MyShmMap
+ ( ordered_unique_range
+ , boost::make_move_iterator(&aux_vect[0])
+ , boost::make_move_iterator(aux_vect + 50));
+ MyStdMap *stdmap3 = new MyStdMap(aux_vect2, aux_vect2 + 50);
+ MyShmMultiMap *shmmultimap3 = new MyShmMultiMap
+ ( ordered_range
+ , boost::make_move_iterator(&aux_vect3[0])
+ , boost::make_move_iterator(aux_vect3 + 50));
+ MyStdMultiMap *stdmultimap3 = new MyStdMultiMap(aux_vect2, aux_vect2 + 50);
+
+ if(!CheckEqualContainers(shmmap3, stdmap3)){
+ std::cout << "Error in construct<MyShmMap>(MyShmMap3)" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultimap3, stdmultimap3)){
+ std::cout << "Error in construct<MyShmMultiMap>(MyShmMultiMap3)" << std::endl;
+ return 1;
+ }
+*/
+ delete shmmap2;
+ delete shmmultimap2;
+ delete stdmap2;
+ delete stdmultimap2;
+ //delete shmmap3;
+ //delete shmmultimap3;
+ //delete stdmap3;
+ //delete stdmultimap3;
+ }
+ {
+ //This is really nasty, but we have no other simple choice
+ IntPairType aux_vect[max];
+ for(int i = 0; i < max; ++i){
+ IntType i1(i);
+ IntType i2(i);
+ new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+ IntPairType aux_vect3[max];
+ for(int i = 0; i < max; ++i){
+ IntType i1(i);
+ IntType i2(i);
+ new(&aux_vect3[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ for(int i = 0; i < max; ++i){
+ shmmap->insert(boost::move(aux_vect[i]));
+ stdmap->insert(StdPairType(i, i));
+ shmmultimap->insert(boost::move(aux_vect3[i]));
+ stdmultimap->insert(StdPairType(i, i));
+ }
+
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+
+ typename MyShmMap::iterator it;
+ typename MyShmMap::const_iterator cit = it;
+
+ shmmap->erase(shmmap->begin()++);
+ stdmap->erase(stdmap->begin()++);
+ shmmultimap->erase(shmmultimap->begin()++);
+ stdmultimap->erase(stdmultimap->begin()++);
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+
+ shmmap->erase(shmmap->begin());
+ stdmap->erase(stdmap->begin());
+ shmmultimap->erase(shmmultimap->begin());
+ stdmultimap->erase(stdmultimap->begin());
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+
+ //Swapping test
+ MyShmMap tmpshmemap2;
+ MyStdMap tmpstdmap2;
+ MyShmMultiMap tmpshmemultimap2;
+ MyStdMultiMap tmpstdmultimap2;
+ shmmap->swap(tmpshmemap2);
+ stdmap->swap(tmpstdmap2);
+ shmmultimap->swap(tmpshmemultimap2);
+ stdmultimap->swap(tmpstdmultimap2);
+ shmmap->swap(tmpshmemap2);
+ stdmap->swap(tmpstdmap2);
+ shmmultimap->swap(tmpshmemultimap2);
+ stdmultimap->swap(tmpstdmultimap2);
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+ }
+ //Insertion from other container
+ //Initialize values
+ {
+ //This is really nasty, but we have no other simple choice
+ IntPairType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(-1);
+ IntType i2(-1);
+ new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+ IntPairType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(-1);
+ IntType i2(-1);
+ new(&aux_vect3[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ shmmap->insert(boost::make_move_iterator(&aux_vect[0]), boost::make_move_iterator(aux_vect + 50));
+ shmmultimap->insert(boost::make_move_iterator(&aux_vect3[0]), boost::make_move_iterator(aux_vect3 + 50));
+ for(std::size_t i = 0; i != 50; ++i){
+ StdPairType stdpairtype(-1, -1);
+ stdmap->insert(stdpairtype);
+ stdmultimap->insert(stdpairtype);
+ }
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+
+ for(int i = 0, j = static_cast<int>(shmmap->size()); i < j; ++i){
+ shmmap->erase(IntType(i));
+ stdmap->erase(i);
+ shmmultimap->erase(IntType(i));
+ stdmultimap->erase(i);
+ }
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+ }
+ {
+ IntPairType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(-1);
+ IntType i2(-1);
+ new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ IntPairType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(-1);
+ IntType i2(-1);
+ new(&aux_vect3[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ IntPairType aux_vect4[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(-1);
+ IntType i2(-1);
+ new(&aux_vect4[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ IntPairType aux_vect5[50];
+ for(int i = 0; i < 50; ++i){
+ IntType i1(-1);
+ IntType i2(-1);
+ new(&aux_vect5[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ shmmap->insert(boost::make_move_iterator(&aux_vect[0]), boost::make_move_iterator(aux_vect + 50));
+ shmmap->insert(boost::make_move_iterator(&aux_vect3[0]), boost::make_move_iterator(aux_vect3 + 50));
+ shmmultimap->insert(boost::make_move_iterator(&aux_vect4[0]), boost::make_move_iterator(aux_vect4 + 50));
+ shmmultimap->insert(boost::make_move_iterator(&aux_vect5[0]), boost::make_move_iterator(aux_vect5 + 50));
+
+ for(std::size_t i = 0; i != 50; ++i){
+ StdPairType stdpairtype(-1, -1);
+ stdmap->insert(stdpairtype);
+ stdmultimap->insert(stdpairtype);
+ stdmap->insert(stdpairtype);
+ stdmultimap->insert(stdpairtype);
+ }
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+
+ shmmap->erase(shmmap->begin()->first);
+ stdmap->erase(stdmap->begin()->first);
+ shmmultimap->erase(shmmultimap->begin()->first);
+ stdmultimap->erase(stdmultimap->begin()->first);
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+ }
+
+ {
+ //This is really nasty, but we have no other simple choice
+ IntPairType aux_vect[max];
+ for(int i = 0; i < max; ++i){
+ IntType i1(i);
+ IntType i2(i);
+ new(&aux_vect[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+ IntPairType aux_vect3[max];
+ for(int i = 0; i < max; ++i){
+ IntType i1(i);
+ IntType i2(i);
+ new(&aux_vect3[i])IntPairType(boost::move(i1), boost::move(i2));
+ }
+
+ for(int i = 0; i < max; ++i){
+ shmmap->insert(boost::move(aux_vect[i]));
+ stdmap->insert(StdPairType(i, i));
+ shmmultimap->insert(boost::move(aux_vect3[i]));
+ stdmultimap->insert(StdPairType(i, i));
+ }
+
+ if(!CheckEqualPairContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap)) return 1;
+
+ for(int i = 0; i < max; ++i){
+ IntPairType intpair;
+ {
+ IntType i1(i);
+ IntType i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ shmmap->insert(shmmap->begin(), boost::move(intpair));
+ stdmap->insert(stdmap->begin(), StdPairType(i, i));
+ //PrintContainers(shmmap, stdmap);
+ {
+ IntType i1(i);
+ IntType i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ shmmultimap->insert(shmmultimap->begin(), boost::move(intpair));
+ stdmultimap->insert(stdmultimap->begin(), StdPairType(i, i));
+ //PrintContainers(shmmultimap, stdmultimap);
+ if(!CheckEqualPairContainers(shmmap, stdmap))
+ return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap))
+ return 1;
+ {
+ IntType i1(i);
+ IntType i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ shmmap->insert(shmmap->end(), boost::move(intpair));
+ stdmap->insert(stdmap->end(), StdPairType(i, i));
+ {
+ IntType i1(i);
+ IntType i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ shmmultimap->insert(shmmultimap->end(), boost::move(intpair));
+ stdmultimap->insert(stdmultimap->end(), StdPairType(i, i));
+ if(!CheckEqualPairContainers(shmmap, stdmap))
+ return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap))
+ return 1;
+ {
+ IntType i1(i);
+ IntType i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ shmmap->insert(shmmap->lower_bound(IntType(i)), boost::move(intpair));
+ stdmap->insert(stdmap->lower_bound(i), StdPairType(i, i));
+ //PrintContainers(shmmap, stdmap);
+ {
+ IntType i1(i);
+ IntType i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ {
+ IntType i1(i);
+ shmmultimap->insert(shmmultimap->lower_bound(boost::move(i1)), boost::move(intpair));
+ stdmultimap->insert(stdmultimap->lower_bound(i), StdPairType(i, i));
+ }
+
+ //PrintContainers(shmmultimap, stdmultimap);
+ if(!CheckEqualPairContainers(shmmap, stdmap))
+ return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap))
+ return 1;
+ {
+ IntType i1(i);
+ IntType i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ {
+ IntType i1(i);
+ shmmap->insert(shmmap->upper_bound(boost::move(i1)), boost::move(intpair));
+ stdmap->insert(stdmap->upper_bound(i), StdPairType(i, i));
+ }
+ //PrintContainers(shmmap, stdmap);
+ {
+ IntType i1(i);
+ IntType i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ {
+ IntType i1(i);
+ shmmultimap->insert(shmmultimap->upper_bound(boost::move(i1)), boost::move(intpair));
+ stdmultimap->insert(stdmultimap->upper_bound(i), StdPairType(i, i));
+ }
+ //PrintContainers(shmmultimap, stdmultimap);
+ if(!CheckEqualPairContainers(shmmap, stdmap))
+ return 1;
+ if(!CheckEqualPairContainers(shmmultimap, stdmultimap))
+ return 1;
+ }
+
+ //Compare count with std containers
+ for(int i = 0; i < max; ++i){
+ if(shmmap->count(IntType(i)) != stdmap->count(i)){
+ return -1;
+ }
+
+ if(shmmultimap->count(IntType(i)) != stdmultimap->count(i)){
+ return -1;
+ }
+ }
+
+ //Now do count exercise
+ shmmap->erase(shmmap->begin(), shmmap->end());
+ shmmultimap->erase(shmmultimap->begin(), shmmultimap->end());
+ shmmap->clear();
+ shmmultimap->clear();
+
+ for(int j = 0; j < 3; ++j)
+ for(int i = 0; i < 100; ++i){
+ IntPairType intpair;
+ {
+ IntType i1(i), i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ shmmap->insert(boost::move(intpair));
+ {
+ IntType i1(i), i2(i);
+ new(&intpair)IntPairType(boost::move(i1), boost::move(i2));
+ }
+ shmmultimap->insert(boost::move(intpair));
+ if(shmmap->count(IntType(i)) != typename MyShmMultiMap::size_type(1))
+ return 1;
+ if(shmmultimap->count(IntType(i)) != typename MyShmMultiMap::size_type(j+1))
+ return 1;
+ }
+ }
+
+ delete shmmap;
+ delete stdmap;
+ delete shmmultimap;
+ delete stdmultimap;
+ }
+ catch(...){
+ throw;
+ }
+ return 0;
+}
+
+template<class MyShmMap
+ ,class MyStdMap
+ ,class MyShmMultiMap
+ ,class MyStdMultiMap>
+int map_test_copyable ()
+{
+ typedef typename MyShmMap::key_type IntType;
+ typedef containers_detail::pair<IntType, IntType> IntPairType;
+ typedef typename MyStdMap::value_type StdPairType;
+
+ const int max = 100;
+
+ try{
+ MyShmMap *shmmap = new MyShmMap;
+ MyStdMap *stdmap = new MyStdMap;
+ MyShmMultiMap *shmmultimap = new MyShmMultiMap;
+ MyStdMultiMap *stdmultimap = new MyStdMultiMap;
+
+ int i;
+ for(i = 0; i < max; ++i){
+ {
+ IntType i1(i), i2(i);
+ IntPairType intpair1(boost::move(i1), boost::move(i2));
+ shmmap->insert(boost::move(intpair1));
+ stdmap->insert(StdPairType(i, i));
+ }
+ {
+ IntType i1(i), i2(i);
+ IntPairType intpair2(boost::move(i1), boost::move(i2));
+ shmmultimap->insert(boost::move(intpair2));
+ stdmultimap->insert(StdPairType(i, i));
+ }
+ }
+ if(!CheckEqualContainers(shmmap, stdmap)) return 1;
+ if(!CheckEqualContainers(shmmultimap, stdmultimap)) return 1;
+
+ {
+ //Now, test copy constructor
+ MyShmMap shmmapcopy(*shmmap);
+ MyStdMap stdmapcopy(*stdmap);
+ MyShmMultiMap shmmmapcopy(*shmmultimap);
+ MyStdMultiMap stdmmapcopy(*stdmultimap);
+
+ if(!CheckEqualContainers(&shmmapcopy, &stdmapcopy))
+ return 1;
+ if(!CheckEqualContainers(&shmmmapcopy, &stdmmapcopy))
+ return 1;
+
+ //And now assignment
+ shmmapcopy = *shmmap;
+ stdmapcopy = *stdmap;
+ shmmmapcopy = *shmmultimap;
+ stdmmapcopy = *stdmultimap;
+
+ if(!CheckEqualContainers(&shmmapcopy, &stdmapcopy))
+ return 1;
+ if(!CheckEqualContainers(&shmmmapcopy, &stdmmapcopy))
+ return 1;
+ delete shmmap;
+ delete shmmultimap;
+ delete stdmap;
+ delete stdmultimap;
+ }
+ }
+ catch(...){
+ throw;
+ }
+ return 0;
+}
+
+} //namespace test{
+} //namespace container {
+} //namespace boost{
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_TEST_MAP_TEST_HEADER
Added: sandbox/move/libs/container/test/movable_int.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/movable_int.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,149 @@
+///////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_MOVABLE_INT_HEADER
+#define BOOST_CONTAINER_TEST_MOVABLE_INT_HEADER
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/detail/workaround.hpp>
+#include <boost/move/move.hpp>
+
+namespace boost {
+namespace container {
+namespace test {
+
+class movable_int
+{
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(movable_int)
+
+ public:
+ movable_int()
+ : m_int(0)
+ {}
+
+ explicit movable_int(int a)
+ : m_int(a)
+ {}
+
+ movable_int(BOOST_RV_REF(movable_int) mmi)
+ : m_int(mmi.m_int)
+ { mmi.m_int = 0; }
+
+ movable_int & operator= (BOOST_RV_REF(movable_int) mmi)
+ { this->m_int = mmi.m_int; mmi.m_int = 0; return *this; }
+
+ movable_int & operator= (int i)
+ { this->m_int = i; return *this; }
+
+ bool operator ==(const movable_int &mi) const
+ { return this->m_int == mi.m_int; }
+
+ bool operator !=(const movable_int &mi) const
+ { return this->m_int != mi.m_int; }
+
+ bool operator <(const movable_int &mi) const
+ { return this->m_int < mi.m_int; }
+
+ bool operator <=(const movable_int &mi) const
+ { return this->m_int <= mi.m_int; }
+
+ bool operator >=(const movable_int &mi) const
+ { return this->m_int >= mi.m_int; }
+
+ bool operator >(const movable_int &mi) const
+ { return this->m_int > mi.m_int; }
+
+ int get_int() const
+ { return m_int; }
+
+ private:
+ int m_int;
+};
+
+template<class E, class T>
+std::basic_ostream<E, T> & operator<<
+ (std::basic_ostream<E, T> & os, movable_int const & p)
+
+{
+ os << p.get_int();
+ return os;
+}
+
+class movable_and_copyable_int
+{
+ BOOST_COPYABLE_AND_MOVABLE(movable_and_copyable_int)
+
+ public:
+ movable_and_copyable_int()
+ : m_int(0)
+ {}
+
+ explicit movable_and_copyable_int(int a)
+ : m_int(a)
+ {}
+
+ movable_and_copyable_int(const movable_and_copyable_int& mmi)
+ : m_int(mmi.m_int)
+ {}
+
+ movable_and_copyable_int(BOOST_RV_REF(movable_and_copyable_int) mmi)
+ : m_int(mmi.m_int)
+ { mmi.m_int = 0; }
+
+ movable_and_copyable_int &operator= (BOOST_COPY_ASSIGN_REF(movable_and_copyable_int) mi)
+ { this->m_int = mi.m_int; return *this; }
+
+ movable_and_copyable_int & operator= (BOOST_RV_REF(movable_and_copyable_int) mmi)
+ { this->m_int = mmi.m_int; mmi.m_int = 0; return *this; }
+
+ movable_and_copyable_int & operator= (int i)
+ { this->m_int = i; return *this; }
+
+ bool operator ==(const movable_and_copyable_int &mi) const
+ { return this->m_int == mi.m_int; }
+
+ bool operator !=(const movable_and_copyable_int &mi) const
+ { return this->m_int != mi.m_int; }
+
+ bool operator <(const movable_and_copyable_int &mi) const
+ { return this->m_int < mi.m_int; }
+
+ bool operator <=(const movable_and_copyable_int &mi) const
+ { return this->m_int <= mi.m_int; }
+
+ bool operator >=(const movable_and_copyable_int &mi) const
+ { return this->m_int >= mi.m_int; }
+
+ bool operator >(const movable_and_copyable_int &mi) const
+ { return this->m_int > mi.m_int; }
+
+ int get_int() const
+ { return m_int; }
+
+ private:
+ int m_int;
+};
+
+template<class E, class T>
+std::basic_ostream<E, T> & operator<<
+ (std::basic_ostream<E, T> & os, movable_and_copyable_int const & p)
+
+{
+ os << p.get_int();
+ return os;
+}
+
+} //namespace test {
+} //namespace container {
+} //namespace boost {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_TEST_MOVABLE_INT_HEADER
Added: sandbox/move/libs/container/test/print_container.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/print_container.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,64 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_PRINTCONTAINER_HPP
+#define BOOST_PRINTCONTAINER_HPP
+
+#include <boost/container/detail/config_begin.hpp>
+#include <functional>
+#include <iostream>
+#include <algorithm>
+
+namespace boost{
+namespace container {
+namespace test{
+
+struct PrintValues : public std::unary_function<int, void>
+{
+ void operator() (int value) const
+ {
+ std::cout << value << " ";
+ }
+};
+
+template<class Container>
+void PrintContents(const Container &cont, const char *contName)
+{
+ std::cout<< "Printing contents of " << contName << std::endl;
+ std::for_each(cont.begin(), cont.end(), PrintValues());
+ std::cout<< std::endl << std::endl;
+}
+
+//Function to dump data
+template<class MyShmCont
+ ,class MyStdCont>
+void PrintContainers(MyShmCont *shmcont, MyStdCont *stdcont)
+{
+ typename MyShmCont::iterator itshm = shmcont->begin(), itshmend = shmcont->end();
+ typename MyStdCont::iterator itstd = stdcont->begin(), itstdend = stdcont->end();
+
+ std::cout << "MyShmCont" << std::endl;
+ for(; itshm != itshmend; ++itshm){
+ std::cout << *itshm << std::endl;
+ }
+ std::cout << "MyStdCont" << std::endl;
+
+ for(; itstd != itstdend; ++itstd){
+ std::cout << *itstd << std::endl;
+ }
+}
+
+} //namespace test{
+} //namespace container {
+} //namespace boost{
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_PRINTCONTAINER_HPP
Added: sandbox/move/libs/container/test/set_test.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/set_test.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,500 @@
+////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_TEST_SET_TEST_HEADER
+#define BOOST_CONTAINER_TEST_SET_TEST_HEADER
+
+#include <boost/container/detail/config_begin.hpp>
+#include "check_equal_containers.hpp"
+#include <memory>
+#include <set>
+#include <functional>
+#include "print_container.hpp"
+#include <boost/move/move.hpp>
+#include <string>
+
+namespace boost{
+namespace container {
+namespace test{
+
+template<class MyShmSet
+ ,class MyStdSet
+ ,class MyShmMultiSet
+ ,class MyStdMultiSet>
+int set_test ()
+{
+ typedef typename MyShmSet::value_type IntType;
+ const int max = 100;
+
+ //Shared memory allocator must be always be initialized
+ //since it has no default constructor
+ MyShmSet *shmset = new MyShmSet;
+ MyStdSet *stdset = new MyStdSet;
+ MyShmMultiSet *shmmultiset = new MyShmMultiSet;
+ MyStdMultiSet *stdmultiset = new MyStdMultiSet;
+
+ //Test construction from a range
+ {
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(i/2);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = i/2;
+ }
+ IntType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(i/2);
+ aux_vect3[i] = boost::move(move_me);
+ }
+
+ MyShmSet *shmset2 = new MyShmSet
+ ( boost::make_move_iterator(&aux_vect[0])
+ , boost::make_move_iterator(aux_vect + 50));
+ MyStdSet *stdset2 = new MyStdSet(aux_vect2, aux_vect2 + 50);
+ MyShmMultiSet *shmmultiset2 = new MyShmMultiSet
+ ( boost::make_move_iterator(&aux_vect3[0])
+ , boost::make_move_iterator(aux_vect3 + 50));
+ MyStdMultiSet *stdmultiset2 = new MyStdMultiSet(aux_vect2, aux_vect2 + 50);
+ if(!CheckEqualContainers(shmset2, stdset2)){
+ std::cout << "Error in construct<MyShmSet>(MyShmSet2)" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset2, stdmultiset2)){
+ std::cout << "Error in construct<MyShmMultiSet>(MyShmMultiSet2)" << std::endl;
+ return 1;
+ }
+
+ //ordered range insertion
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(i);
+ aux_vect[i] = boost::move(move_me);
+ }
+
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = i;
+ }
+
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(i);
+ aux_vect3[i] = boost::move(move_me);
+ }
+/*
+ MyShmSet *shmset3 = MyShmSet
+ ( ordered_unique_range
+ , boost::make_move_iterator(&aux_vect[0])
+ , boost::make_move_iterator(aux_vect + 50));
+ MyStdSet *stdset3 = new MyStdSet(aux_vect2, aux_vect2 + 50);
+ MyShmMultiSet *shmmultiset3 = MyShmMultiSet
+ ( ordered_range
+ , boost::make_move_iterator(&aux_vect3[0])
+ , boost::make_move_iterator(aux_vect3 + 50));
+ MyStdMultiSet *stdmultiset3 = new MyStdMultiSet(aux_vect2, aux_vect2 + 50);
+
+ if(!CheckEqualContainers(shmset3, stdset3)){
+ std::cout << "Error in construct<MyShmSet>(MyShmSet3)" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset3, stdmultiset3)){
+ std::cout << "Error in construct<MyShmMultiSet>(MyShmMultiSet3)" << std::endl;
+ return 1;
+ }
+*/
+ delete shmset2;
+ delete shmmultiset2;
+ delete stdset2;
+ delete stdmultiset2;
+ //delete shmset3;
+ //delete shmmultiset3;
+ //delete stdset3;
+ //delete stdmultiset3;
+ }
+
+ int i, j;
+ for(i = 0; i < max; ++i){
+ IntType move_me(i);
+ shmset->insert(boost::move(move_me));
+ stdset->insert(i);
+ IntType move_me2(i);
+ shmmultiset->insert(boost::move(move_me2));
+ stdmultiset->insert(i);
+ }
+
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->insert(boost::move(move_me)" << std::endl;
+ return 1;
+ }
+
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->insert(boost::move(move_me)" << std::endl;
+ return 1;
+ }
+
+ typename MyShmSet::iterator it;
+ typename MyShmSet::const_iterator cit = it;
+
+ shmset->erase(shmset->begin()++);
+ stdset->erase(stdset->begin()++);
+ shmmultiset->erase(shmmultiset->begin()++);
+ stdmultiset->erase(stdmultiset->begin()++);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->erase(shmset->begin()++)" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->erase(shmmultiset->begin()++)" << std::endl;
+ return 1;
+ }
+
+ shmset->erase(shmset->begin());
+ stdset->erase(stdset->begin());
+ shmmultiset->erase(shmmultiset->begin());
+ stdmultiset->erase(stdmultiset->begin());
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->erase(shmset->begin())" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->erase(shmmultiset->begin())" << std::endl;
+ return 1;
+ }
+
+ //Swapping test
+ MyShmSet tmpshmeset2;
+ MyStdSet tmpstdset2;
+ MyShmMultiSet tmpshmemultiset2;
+ MyStdMultiSet tmpstdmultiset2;
+ shmset->swap(tmpshmeset2);
+ stdset->swap(tmpstdset2);
+ shmmultiset->swap(tmpshmemultiset2);
+ stdmultiset->swap(tmpstdmultiset2);
+ shmset->swap(tmpshmeset2);
+ stdset->swap(tmpstdset2);
+ shmmultiset->swap(tmpshmemultiset2);
+ stdmultiset->swap(tmpstdmultiset2);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->swap(tmpshmeset2)" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->swap(tmpshmemultiset2)" << std::endl;
+ return 1;
+ }
+
+ //Insertion from other container
+ //Initialize values
+ {
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = -1;
+ }
+ IntType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect3[i] = boost::move(move_me);
+ }
+
+ shmset->insert(boost::make_move_iterator(&aux_vect[0]), boost::make_move_iterator(aux_vect + 50));
+ stdset->insert(aux_vect2, aux_vect2 + 50);
+ shmmultiset->insert(boost::make_move_iterator(&aux_vect3[0]), boost::make_move_iterator(aux_vect3 + 50));
+ stdmultiset->insert(aux_vect2, aux_vect2 + 50);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->insert(boost::make_move_iterator(&aux_vect[0])..." << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->insert(boost::make_move_iterator(&aux_vect3[0]), ..." << std::endl;
+ return 1;
+ }
+
+ for(int i = 0, j = static_cast<int>(shmset->size()); i < j; ++i){
+ IntType erase_me(i);
+ shmset->erase(erase_me);
+ stdset->erase(i);
+ shmmultiset->erase(erase_me);
+ stdmultiset->erase(i);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->erase(erase_me)" << shmset->size() << " " << stdset->size() << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->erase(erase_me)" << std::endl;
+ return 1;
+ }
+ }
+ }
+ {
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect[i] = boost::move(move_me);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = -1;
+ }
+ IntType aux_vect3[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect3[i] = boost::move(move_me);
+ }
+
+ IntType aux_vect4[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect4[i] = boost::move(move_me);
+ }
+
+ IntType aux_vect5[50];
+ for(int i = 0; i < 50; ++i){
+ IntType move_me(-1);
+ aux_vect5[i] = boost::move(move_me);
+ }
+
+ shmset->insert(boost::make_move_iterator(&aux_vect[0]), boost::make_move_iterator(aux_vect + 50));
+ shmset->insert(boost::make_move_iterator(&aux_vect3[0]), boost::make_move_iterator(aux_vect3 + 50));
+ stdset->insert(aux_vect2, aux_vect2 + 50);
+ stdset->insert(aux_vect2, aux_vect2 + 50);
+ shmmultiset->insert(boost::make_move_iterator(&aux_vect4[0]), boost::make_move_iterator(aux_vect4 + 50));
+ shmmultiset->insert(boost::make_move_iterator(&aux_vect5[0]), boost::make_move_iterator(aux_vect5 + 50));
+ stdmultiset->insert(aux_vect2, aux_vect2 + 50);
+ stdmultiset->insert(aux_vect2, aux_vect2 + 50);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->insert(boost::make_move_iterator(&aux_vect3[0])..." << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->insert(boost::make_move_iterator(&aux_vect5[0])..." << std::endl;
+ return 1;
+ }
+
+ shmset->erase(*shmset->begin());
+ stdset->erase(*stdset->begin());
+ shmmultiset->erase(*shmmultiset->begin());
+ stdmultiset->erase(*stdmultiset->begin());
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->erase(*shmset->begin())" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->erase(*shmmultiset->begin())" << std::endl;
+ return 1;
+ }
+ }
+
+ for(i = 0; i < max; ++i){
+ IntType move_me(i);
+ shmset->insert(boost::move(move_me));
+ stdset->insert(i);
+ IntType move_me2(i);
+ shmmultiset->insert(boost::move(move_me2));
+ stdmultiset->insert(i);
+ }
+
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->insert(boost::move(move_me)) try 2" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->insert(boost::move(move_me2)) try 2" << std::endl;
+ return 1;
+ }
+
+ for(i = 0; i < max; ++i){
+ IntType move_me(i);
+ shmset->insert(shmset->begin(), boost::move(move_me));
+ stdset->insert(stdset->begin(), i);
+ //PrintContainers(shmset, stdset);
+ IntType move_me2(i);
+ shmmultiset->insert(shmmultiset->begin(), boost::move(move_me2));
+ stdmultiset->insert(stdmultiset->begin(), i);
+ //PrintContainers(shmmultiset, stdmultiset);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->insert(shmset->begin(), boost::move(move_me))" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->insert(shmmultiset->begin(), boost::move(move_me2))" << std::endl;
+ return 1;
+ }
+
+ IntType move_me3(i);
+ shmset->insert(shmset->end(), boost::move(move_me3));
+ stdset->insert(stdset->end(), i);
+ IntType move_me4(i);
+ shmmultiset->insert(shmmultiset->end(), boost::move(move_me4));
+ stdmultiset->insert(stdmultiset->end(), i);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->insert(shmset->end(), boost::move(move_me3))" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->insert(shmmultiset->end(), boost::move(move_me4))" << std::endl;
+ return 1;
+ }
+ {
+ IntType move_me(i);
+ shmset->insert(shmset->upper_bound(move_me), boost::move(move_me));
+ stdset->insert(stdset->upper_bound(i), i);
+ //PrintContainers(shmset, stdset);
+ IntType move_me2(i);
+ shmmultiset->insert(shmmultiset->upper_bound(move_me2), boost::move(move_me2));
+ stdmultiset->insert(stdmultiset->upper_bound(i), i);
+ //PrintContainers(shmmultiset, stdmultiset);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->insert(shmset->upper_bound(move_me), boost::move(move_me))" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->insert(shmmultiset->upper_bound(move_me2), boost::move(move_me2))" << std::endl;
+ return 1;
+ }
+
+ }
+ {
+ IntType move_me(i);
+ shmset->insert(shmset->lower_bound(move_me), boost::move(move_me2));
+ stdset->insert(stdset->lower_bound(i), i);
+ //PrintContainers(shmset, stdset);
+ IntType move_me2(i);
+ shmmultiset->insert(shmmultiset->lower_bound(move_me2), boost::move(move_me2));
+ stdmultiset->insert(stdmultiset->lower_bound(i), i);
+ //PrintContainers(shmmultiset, stdmultiset);
+ if(!CheckEqualContainers(shmset, stdset)){
+ std::cout << "Error in shmset->insert(shmset->lower_bound(move_me), boost::move(move_me2))" << std::endl;
+ return 1;
+ }
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)){
+ std::cout << "Error in shmmultiset->insert(shmmultiset->lower_bound(move_me2), boost::move(move_me2))" << std::endl;
+ return 1;
+ }
+ }
+ }
+
+ //Compare count with std containers
+ for(i = 0; i < max; ++i){
+ IntType count_me(i);
+ if(shmset->count(count_me) != stdset->count(i)){
+ return -1;
+ }
+ if(shmmultiset->count(count_me) != stdmultiset->count(i)){
+ return -1;
+ }
+ }
+
+ //Now do count exercise
+ shmset->erase(shmset->begin(), shmset->end());
+ shmmultiset->erase(shmmultiset->begin(), shmmultiset->end());
+ shmset->clear();
+ shmmultiset->clear();
+
+ for(j = 0; j < 3; ++j)
+ for(i = 0; i < 100; ++i){
+ IntType move_me(i);
+ shmset->insert(boost::move(move_me));
+ IntType move_me2(i);
+ shmmultiset->insert(boost::move(move_me2));
+ IntType count_me(i);
+ if(shmset->count(count_me) != typename MyShmMultiSet::size_type(1)){
+ std::cout << "Error in shmset->count(count_me)" << std::endl;
+ return 1;
+ }
+ if(shmmultiset->count(count_me) != typename MyShmMultiSet::size_type(j+1)){
+ std::cout << "Error in shmmultiset->count(count_me)" << std::endl;
+ return 1;
+ }
+ }
+
+ delete shmset;
+ delete stdset;
+ delete shmmultiset;
+ delete stdmultiset;
+ return 0;
+}
+
+template<class MyShmSet
+ ,class MyStdSet
+ ,class MyShmMultiSet
+ ,class MyStdMultiSet>
+int set_test_copyable ()
+{
+ typedef typename MyShmSet::value_type IntType;
+ const int max = 100;
+
+ try{
+ //Shared memory allocator must be always be initialized
+ //since it has no default constructor
+ MyShmSet *shmset = new MyShmSet;
+ MyStdSet *stdset = new MyStdSet;
+ MyShmMultiSet *shmmultiset = new MyShmMultiSet;
+ MyStdMultiSet *stdmultiset = new MyStdMultiSet;
+
+ int i;
+ for(i = 0; i < max; ++i){
+ IntType move_me(i);
+ shmset->insert(boost::move(move_me));
+ stdset->insert(i);
+ IntType move_me2(i);
+ shmmultiset->insert(boost::move(move_me2));
+ stdmultiset->insert(i);
+ }
+ if(!CheckEqualContainers(shmset, stdset)) return 1;
+ if(!CheckEqualContainers(shmmultiset, stdmultiset)) return 1;
+
+ {
+ //Now, test copy constructor
+ MyShmSet shmsetcopy(*shmset);
+ MyStdSet stdsetcopy(*stdset);
+
+ if(!CheckEqualContainers(&shmsetcopy, &stdsetcopy))
+ return 1;
+
+ MyShmMultiSet shmmsetcopy(*shmmultiset);
+ MyStdMultiSet stdmsetcopy(*stdmultiset);
+
+ if(!CheckEqualContainers(&shmmsetcopy, &stdmsetcopy))
+ return 1;
+
+ //And now assignment
+ shmsetcopy = *shmset;
+ stdsetcopy = *stdset;
+
+ if(!CheckEqualContainers(&shmsetcopy, &stdsetcopy))
+ return 1;
+
+ shmmsetcopy = *shmmultiset;
+ stdmsetcopy = *stdmultiset;
+
+ if(!CheckEqualContainers(&shmmsetcopy, &stdmsetcopy))
+ return 1;
+ }
+ delete shmset;
+ delete shmmultiset;
+ }
+ catch(...){
+ throw;
+ }
+ return 0;
+}
+
+} //namespace test{
+} //namespace container {
+} //namespace boost{
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif
Added: sandbox/move/libs/container/test/slist_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/slist_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,73 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/slist.hpp>
+#include "dummy_test_allocator.hpp"
+#include "list_test.hpp"
+#include "movable_int.hpp"
+#include "emplace_test.hpp"
+
+using namespace boost::container;
+
+//Explicit instantiation to detect compilation errors
+template class boost::container::slist<test::movable_and_copyable_int,
+ test::dummy_test_allocator<test::movable_and_copyable_int> >;
+
+typedef slist<int> MyList;
+typedef slist<volatile int> MyVolatileList;
+typedef slist<test::movable_int> MyMoveList;
+typedef slist<test::movable_and_copyable_int> MyCopyMoveList;
+
+class recursive_slist
+{
+public:
+ int id_;
+ slist<recursive_slist> slist_;
+};
+
+void recursive_slist_test()//Test for recursive types
+{
+ slist<recursive_slist> recursive_list_list;
+}
+
+int main ()
+{
+ recursive_slist_test();
+ {
+ //Now test move semantics
+ slist<recursive_slist> original;
+ slist<recursive_slist> move_ctor(boost::move(original));
+ slist<recursive_slist> move_assign;
+ move_assign = boost::move(move_ctor);
+ move_assign.swap(original);
+ }
+
+ if(test::list_test<MyList, false>())
+ return 1;
+
+ if(test::list_test<MyMoveList, false>())
+ return 1;
+
+ if(test::list_test<MyCopyMoveList, false>())
+ return 1;
+
+ if(test::list_test<MyVolatileList, false>())
+ return 1;
+
+ const test::EmplaceOptions Options = (test::EmplaceOptions)
+ (test::EMPLACE_FRONT | test::EMPLACE_AFTER | test::EMPLACE_BEFORE | test::EMPLACE_AFTER);
+
+ if(!boost::container::test::test_emplace
+ < slist<test::EmplaceInt>, Options>())
+ return 1;
+}
+
+#include <boost/container/detail/config_end.hpp>
+
Added: sandbox/move/libs/container/test/stable_vector_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/stable_vector_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,76 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/detail/config_begin.hpp>
+#include <algorithm>
+#include <memory>
+#include <vector>
+#include <iostream>
+#include <functional>
+
+#include <boost/container/stable_vector.hpp>
+#include "check_equal_containers.hpp"
+#include "movable_int.hpp"
+#include "expand_bwd_test_allocator.hpp"
+#include "expand_bwd_test_template.hpp"
+#include "dummy_test_allocator.hpp"
+#include "vector_test.hpp"
+
+using namespace boost::container;
+
+//Explicit instantiation to detect compilation errors
+//template class stable_vector<test::movable_and_copyable_int,
+ //test::dummy_test_allocator<test::movable_and_copyable_int> >;
+
+class recursive_vector
+{
+ public:
+ int id_;
+ stable_vector<recursive_vector> vector_;
+};
+
+void recursive_vector_test()//Test for recursive types
+{
+ stable_vector<recursive_vector> recursive_vector_vector;
+}
+
+int main()
+{
+ recursive_vector_test();
+ {
+ //Now test move semantics
+ stable_vector<recursive_vector> original;
+ stable_vector<recursive_vector> move_ctor(boost::move(original));
+ stable_vector<recursive_vector> move_assign;
+ move_assign = boost::move(move_ctor);
+ move_assign.swap(original);
+ }
+ typedef stable_vector<int> MyVector;
+ typedef stable_vector<test::movable_int> MyMoveVector;
+ typedef stable_vector<test::movable_and_copyable_int> MyCopyMoveVector;
+
+ if(test::vector_test<MyVector>())
+ return 1;
+
+ if(test::vector_test<MyMoveVector>())
+ return 1;
+
+ if(test::vector_test<MyCopyMoveVector>())
+ return 1;
+
+ const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_BEFORE);
+ if(!boost::container::test::test_emplace
+ < stable_vector<test::EmplaceInt>, Options>())
+ return 1;
+
+ return 0;
+}
+
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/test/string_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/string_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,266 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/vector.hpp>
+#include <boost/container/string.hpp>
+#include <string>
+#include <vector>
+#include <algorithm>
+#include <cstring>
+#include <cstdio>
+#include <cstddef>
+#include <new>
+#include "dummy_test_allocator.hpp"
+#include "check_equal_containers.hpp"
+#include "expand_bwd_test_allocator.hpp"
+#include "expand_bwd_test_template.hpp"
+
+using namespace boost::container;
+
+typedef test::dummy_test_allocator<char> DummyCharAllocator;
+typedef basic_string<char, std::char_traits<char>, DummyCharAllocator> DummyString;
+typedef test::dummy_test_allocator<DummyString> DummyStringAllocator;
+typedef test::dummy_test_allocator<wchar_t> DummyWCharAllocator;
+typedef basic_string<wchar_t, std::char_traits<wchar_t>, DummyWCharAllocator> DummyWString;
+typedef test::dummy_test_allocator<DummyWString> DummyWStringAllocator;
+
+//Explicit instantiations of container::basic_string
+template class basic_string<char, std::char_traits<char>, DummyCharAllocator>;
+template class basic_string<wchar_t, std::char_traits<wchar_t>, DummyWCharAllocator>;
+//Explicit instantiation of container::vectors of container::strings
+template class vector<DummyString, DummyStringAllocator>;
+template class vector<DummyWString, DummyWStringAllocator>;
+
+struct StringEqual
+{
+ template<class Str1, class Str2>
+ bool operator ()(const Str1 &string1, const Str2 &string2) const
+ {
+ if(string1.size() != string2.size())
+ return false;
+ return std::char_traits<typename Str1::value_type>::compare
+ (string1.c_str(), string2.c_str(), string1.size()) == 0;
+ }
+};
+
+//Function to check if both lists are equal
+template<class StrVector1, class StrVector2>
+bool CheckEqualStringVector(StrVector1 *strvect1, StrVector2 *strvect2)
+{
+ StringEqual comp;
+ return std::equal(strvect1->begin(), strvect1->end(),
+ strvect2->begin(), comp);
+}
+
+template<class CharType>
+int string_test()
+{
+ typedef std::string StdString;
+ typedef vector<StdString> StdStringVector;
+ typedef basic_string<CharType> ShmString;
+ typedef vector<ShmString> ShmStringVector;
+
+ const int MaxSize = 100;
+
+ //Create shared memory
+ {
+ ShmStringVector *shmStringVect = new ShmStringVector;
+ StdStringVector *stdStringVect = new StdStringVector;
+ ShmString auxShmString;
+ StdString auxStdString(StdString(auxShmString.begin(), auxShmString.end() ));
+
+ CharType buffer [20];
+
+ //First, push back
+ for(int i = 0; i < MaxSize; ++i){
+ auxShmString = "String";
+ auxStdString = "String";
+ std::sprintf(buffer, "%i", i);
+ auxShmString += buffer;
+ auxStdString += buffer;
+ shmStringVect->push_back(auxShmString);
+ stdStringVect->push_back(auxStdString);
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)){
+ return 1;
+ }
+
+ //Now push back moving
+ for(int i = 0; i < MaxSize; ++i){
+ auxShmString = "String";
+ auxStdString = "String";
+ std::sprintf(buffer, "%i", i);
+ auxShmString += buffer;
+ auxStdString += buffer;
+ shmStringVect->push_back(boost::move(auxShmString));
+ stdStringVect->push_back(auxStdString);
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)){
+ return 1;
+ }
+
+ //push front
+ for(int i = 0; i < MaxSize; ++i){
+ auxShmString = "String";
+ auxStdString = "String";
+ std::sprintf(buffer, "%i", i);
+ auxShmString += buffer;
+ auxStdString += buffer;
+ shmStringVect->insert(shmStringVect->begin(), auxShmString);
+ stdStringVect->insert(stdStringVect->begin(), auxStdString);
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)){
+ return 1;
+ }
+
+ //Now push front moving
+ for(int i = 0; i < MaxSize; ++i){
+ auxShmString = "String";
+ auxStdString = "String";
+ std::sprintf(buffer, "%i", i);
+ auxShmString += buffer;
+ auxStdString += buffer;
+ shmStringVect->insert(shmStringVect->begin(), boost::move(auxShmString));
+ stdStringVect->insert(stdStringVect->begin(), auxStdString);
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)){
+ return 1;
+ }
+
+ //Now test long and short representation swapping
+ auxShmString = "String";
+ auxStdString = "String";
+ ShmString shm_swapper;
+ StdString std_swapper;
+ shm_swapper.swap(auxShmString);
+ std_swapper.swap(auxStdString);
+ if(!StringEqual()(auxShmString, auxStdString))
+ return 1;
+ if(!StringEqual()(shm_swapper, std_swapper))
+ return 1;
+
+ shm_swapper.swap(auxShmString);
+ std_swapper.swap(auxStdString);
+ if(!StringEqual()(auxShmString, auxStdString))
+ return 1;
+ if(!StringEqual()(shm_swapper, std_swapper))
+ return 1;
+
+ auxShmString = "LongLongLongLongLongLongLongLongLongLongLongLongLongString";
+ auxStdString = "LongLongLongLongLongLongLongLongLongLongLongLongLongString";
+ shm_swapper = ShmString();
+ std_swapper = StdString();
+ shm_swapper.swap(auxShmString);
+ std_swapper.swap(auxStdString);
+ if(!StringEqual()(auxShmString, auxStdString))
+ return 1;
+ if(!StringEqual()(shm_swapper, std_swapper))
+ return 1;
+
+ shm_swapper.swap(auxShmString);
+ std_swapper.swap(auxStdString);
+ if(!StringEqual()(auxShmString, auxStdString))
+ return 1;
+ if(!StringEqual()(shm_swapper, std_swapper))
+ return 1;
+
+ //No sort
+ std::sort(shmStringVect->begin(), shmStringVect->end());
+ std::sort(stdStringVect->begin(), stdStringVect->end());
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)) return 1;
+
+ const CharType prefix [] = "Prefix";
+ const int prefix_size = sizeof(prefix)/sizeof(prefix[0])-1;
+ const CharType sufix [] = "Suffix";
+
+ for(int i = 0; i < MaxSize; ++i){
+ (*shmStringVect)[i].append(sufix);
+ (*stdStringVect)[i].append(sufix);
+ (*shmStringVect)[i].insert((*shmStringVect)[i].begin(),
+ prefix, prefix + prefix_size);
+ (*stdStringVect)[i].insert((*stdStringVect)[i].begin(),
+ prefix, prefix + prefix_size);
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)) return 1;
+
+ for(int i = 0; i < MaxSize; ++i){
+ std::reverse((*shmStringVect)[i].begin(), (*shmStringVect)[i].end());
+ std::reverse((*stdStringVect)[i].begin(), (*stdStringVect)[i].end());
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)) return 1;
+
+ for(int i = 0; i < MaxSize; ++i){
+ std::reverse((*shmStringVect)[i].begin(), (*shmStringVect)[i].end());
+ std::reverse((*stdStringVect)[i].begin(), (*stdStringVect)[i].end());
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)) return 1;
+
+ for(int i = 0; i < MaxSize; ++i){
+ std::sort(shmStringVect->begin(), shmStringVect->end());
+ std::sort(stdStringVect->begin(), stdStringVect->end());
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)) return 1;
+
+ for(int i = 0; i < MaxSize; ++i){
+ (*shmStringVect)[i].replace((*shmStringVect)[i].begin(),
+ (*shmStringVect)[i].end(),
+ "String");
+ (*stdStringVect)[i].replace((*stdStringVect)[i].begin(),
+ (*stdStringVect)[i].end(),
+ "String");
+ }
+
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)) return 1;
+
+ shmStringVect->erase(std::unique(shmStringVect->begin(), shmStringVect->end()),
+ shmStringVect->end());
+ stdStringVect->erase(std::unique(stdStringVect->begin(), stdStringVect->end()),
+ stdStringVect->end());
+ if(!CheckEqualStringVector(shmStringVect, stdStringVect)) return 1;
+
+ //When done, delete vector
+ delete shmStringVect;
+ delete stdStringVect;
+ }
+ return 0;
+}
+
+bool test_expand_bwd()
+{
+ //Now test all back insertion possibilities
+ typedef test::expand_bwd_test_allocator<char>
+ allocator_type;
+ typedef basic_string<char, std::char_traits<char>, allocator_type>
+ string_type;
+ return test::test_all_expand_bwd<string_type>();
+}
+
+int main()
+{
+ if(string_test<char>()){
+ return 1;
+ }
+
+ if(!test_expand_bwd())
+ return 1;
+
+ return 0;
+}
+
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/test/tree_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/tree_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,194 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+#include <boost/container/detail/config_begin.hpp>
+#include <set>
+#include <boost/container/set.hpp>
+#include <boost/container/map.hpp>
+#include "print_container.hpp"
+#include "movable_int.hpp"
+#include "dummy_test_allocator.hpp"
+#include "set_test.hpp"
+#include "map_test.hpp"
+#include "emplace_test.hpp"
+
+///////////////////////////////////////////////////////////////////
+// //
+// This example repeats the same operations with std::set and //
+// shmem_set using the node allocator //
+// and compares the values of both containers //
+// //
+///////////////////////////////////////////////////////////////////
+
+using namespace boost::container;
+
+//Alias standard types
+typedef std::set<int> MyStdSet;
+typedef std::multiset<int> MyStdMultiSet;
+typedef std::map<int, int> MyStdMap;
+typedef std::multimap<int, int> MyStdMultiMap;
+
+//Alias non-movable types
+typedef set<int> MyShmSet;
+typedef multiset<int> MyShmMultiSet;
+typedef map<int, int> MyShmMap;
+typedef multimap<int, int> MyShmMultiMap;
+
+//Alias movable types
+typedef set<test::movable_int> MyMovableShmSet;
+typedef multiset<test::movable_int> MyMovableShmMultiSet;
+typedef map<test::movable_int, test::movable_int> MyMovableShmMap;
+typedef multimap<test::movable_int, test::movable_int> MyMovableShmMultiMap;
+typedef set<test::movable_and_copyable_int> MyMoveCopyShmSet;
+typedef multiset<test::movable_and_copyable_int> MyMoveCopyShmMultiSet;
+typedef map<test::movable_and_copyable_int
+ ,test::movable_and_copyable_int> MyMoveCopyShmMap;
+typedef multimap<test::movable_and_copyable_int
+ ,test::movable_and_copyable_int> MyMoveCopyShmMultiMap;
+//Test recursive structures
+class recursive_set
+{
+public:
+ int id_;
+ set<recursive_set> set_;
+ friend bool operator< (const recursive_set &a, const recursive_set &b)
+ { return a.id_ < b.id_; }
+};
+
+class recursive_map
+{
+ public:
+ int id_;
+ map<recursive_map, recursive_map> map_;
+ friend bool operator< (const recursive_map &a, const recursive_map &b)
+ { return a.id_ < b.id_; }
+};
+
+//Test recursive structures
+class recursive_multiset
+{
+public:
+ int id_;
+ multiset<recursive_multiset> multiset_;
+ friend bool operator< (const recursive_multiset &a, const recursive_multiset &b)
+ { return a.id_ < b.id_; }
+};
+
+class recursive_multimap
+{
+public:
+ int id_;
+ multimap<recursive_multimap, recursive_multimap> multimap_;
+ friend bool operator< (const recursive_multimap &a, const recursive_multimap &b)
+ { return a.id_ < b.id_; }
+};
+
+template<class C>
+void test_move()
+{
+ //Now test move semantics
+ C original;
+ C move_ctor(boost::move(original));
+ C move_assign;
+ move_assign = boost::move(move_ctor);
+ move_assign.swap(original);
+}
+
+int main ()
+{
+ //Recursive container instantiation
+ {
+ set<recursive_set> set_;
+ multiset<recursive_multiset> multiset_;
+ map<recursive_map, recursive_map> map_;
+ multimap<recursive_multimap, recursive_multimap> multimap_;
+ }
+ //Now test move semantics
+ {
+ test_move<set<recursive_set> >();
+ test_move<multiset<recursive_multiset> >();
+ test_move<map<recursive_map, recursive_map> >();
+ test_move<multimap<recursive_multimap, recursive_multimap> >();
+ }
+
+ //using namespace boost::container::detail;
+
+ if(0 != test::set_test<MyShmSet
+ ,MyStdSet
+ ,MyShmMultiSet
+ ,MyStdMultiSet>()){
+ return 1;
+ }
+
+ if(0 != test::set_test_copyable<MyShmSet
+ ,MyStdSet
+ ,MyShmMultiSet
+ ,MyStdMultiSet>()){
+ return 1;
+ }
+
+ if(0 != test::set_test<MyMovableShmSet
+ ,MyStdSet
+ ,MyMovableShmMultiSet
+ ,MyStdMultiSet>()){
+ return 1;
+ }
+
+ if(0 != test::set_test<MyMoveCopyShmSet
+ ,MyStdSet
+ ,MyMoveCopyShmMultiSet
+ ,MyStdMultiSet>()){
+ return 1;
+ }
+
+
+ if (0 != test::map_test<MyShmMap
+ ,MyStdMap
+ ,MyShmMultiMap
+ ,MyStdMultiMap>()){
+ return 1;
+ }
+
+ if(0 != test::map_test_copyable<MyShmMap
+ ,MyStdMap
+ ,MyShmMultiMap
+ ,MyStdMultiMap>()){
+ return 1;
+ }
+
+// if (0 != test::map_test<my_managed_shared_memory
+// ,MyMovableShmMap
+// ,MyStdMap
+// ,MyMovableShmMultiMap
+// ,MyStdMultiMap>()){
+// return 1;
+// }
+
+ if (0 != test::map_test<MyMoveCopyShmMap
+ ,MyStdMap
+ ,MyMoveCopyShmMultiMap
+ ,MyStdMultiMap>()){
+ return 1;
+ }
+
+ const test::EmplaceOptions SetOptions = (test::EmplaceOptions)(test::EMPLACE_HINT | test::EMPLACE_ASSOC);
+ if(!boost::container::test::test_emplace<set<test::EmplaceInt>, SetOptions>())
+ return 1;
+ if(!boost::container::test::test_emplace<multiset<test::EmplaceInt>, SetOptions>())
+ return 1;
+ const test::EmplaceOptions MapOptions = (test::EmplaceOptions)(test::EMPLACE_HINT_PAIR | test::EMPLACE_ASSOC_PAIR);
+ if(!boost::container::test::test_emplace<map<test::EmplaceInt, test::EmplaceInt>, MapOptions>())
+ return 1;
+ if(!boost::container::test::test_emplace<multimap<test::EmplaceInt, test::EmplaceInt>, MapOptions>())
+ return 1;
+
+ return 0;
+}
+
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/test/util.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/util.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,113 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+// Copyright (C) 2001-2003
+// William E. Kempf
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation. William E. Kempf makes no representations
+// about the suitability of this software for any purpose.
+// It is provided "as is" without express or implied warranty.
+
+#ifndef BOOST_CONTAINER_TEST_UTIL_HEADER
+#define BOOST_CONTAINER_TEST_UTIL_HEADER
+
+#include <boost/container/detail/config_begin.hpp>
+#include <boost/container/sync/container_mutex.hpp>
+#include <boost/container/sync/container_condition.hpp>
+#include <boost/container/sync/scoped_lock.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/thread/xtime.hpp>
+
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <algorithm>
+#include <iostream>
+
+#ifndef DEFAULT_EXECUTION_MONITOR_TYPE
+# define DEFAULT_EXECUTION_MONITOR_TYPE execution_monitor::use_condition
+#endif
+
+namespace boost {
+namespace container {
+namespace test {
+
+inline void sleep(const boost::posix_time::ptime &xt)
+{
+ boost::container::container_mutex mx;
+ boost::container::scoped_lock<boost::container::container_mutex>
+ lock(mx);
+ boost::container::container_condition cond;
+ cond.timed_wait(lock, xt);
+}
+
+inline boost::posix_time::ptime delay(int secs, int msecs=0, int nsecs = 0)
+{
+ (void)msecs;
+ using namespace boost::posix_time;
+ int count = static_cast<int>(double(nsecs)*
+ (double(time_duration::ticks_per_second())/double(1000000000.0)));
+ count += static_cast<int>(double(msecs)*
+ (double(time_duration::ticks_per_second())/double(1000.0)));
+ boost::posix_time::ptime cur = microsec_clock::universal_time();
+ return cur += boost::posix_time::time_duration(0, 0, secs, count);
+}
+
+inline bool in_range(const boost::posix_time::ptime& xt, int secs=1)
+{
+ boost::posix_time::ptime min = delay(-secs);
+ boost::posix_time::ptime max = delay(0);
+ return (xt > min) && (max > xt);
+}
+
+boost::xtime xsecs(int secs)
+{
+ boost::xtime ret;
+ boost::xtime_get(&ret, boost::TIME_UTC);
+ ret.sec += secs;
+ return ret;
+}
+
+template <typename P>
+class thread_adapter
+{
+ public:
+ thread_adapter(void (*func)(void*, P &), void* param1, P ¶m2)
+ : _func(func), _param1(param1) ,_param2(param2){ }
+ void operator()() const { _func(_param1, _param2); }
+
+ private:
+ void (*_func)(void*, P &);
+ void* _param1;
+ P& _param2;
+};
+
+template <typename P>
+struct data
+{
+ data(int id, int secs=0)
+ : m_id(id), m_value(-1), m_secs(secs)
+ {}
+ int m_id;
+ int m_value;
+ int m_secs;
+};
+
+static int shared_val = 0;
+static const int BaseSeconds = 1;
+
+} //namespace test {
+} //namespace container {
+} //namespace boost {
+
+#include <boost/container/detail/config_end.hpp>
+
+#endif //#ifndef BOOST_CONTAINER_TEST_UTIL_HEADER
Added: sandbox/move/libs/container/test/vector_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/vector_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,110 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/detail/config_begin.hpp>
+#include <algorithm>
+#include <memory>
+#include <vector>
+#include <iostream>
+#include <functional>
+
+#include <boost/container/vector.hpp>
+#include "check_equal_containers.hpp"
+#include "movable_int.hpp"
+#include "expand_bwd_test_allocator.hpp"
+#include "expand_bwd_test_template.hpp"
+#include "dummy_test_allocator.hpp"
+#include "vector_test.hpp"
+
+using namespace boost::container;
+
+//Explicit instantiation to detect compilation errors
+template class boost::container::vector<test::movable_and_copyable_int,
+ test::dummy_test_allocator<test::movable_and_copyable_int> >;
+
+int test_expand_bwd()
+{
+ //Now test all back insertion possibilities
+
+ //First raw ints
+ typedef test::expand_bwd_test_allocator<int>
+ int_allocator_type;
+ typedef vector<int, int_allocator_type>
+ int_vector;
+
+ if(!test::test_all_expand_bwd<int_vector>())
+ return 1;
+
+ //Now user defined wrapped int
+ typedef test::expand_bwd_test_allocator<test::int_holder>
+ int_holder_allocator_type;
+ typedef vector<test::int_holder, int_holder_allocator_type>
+ int_holder_vector;
+
+ if(!test::test_all_expand_bwd<int_holder_vector>())
+ return 1;
+
+ //Now user defined bigger wrapped int
+ typedef test::expand_bwd_test_allocator<test::triple_int_holder>
+ triple_int_holder_allocator_type;
+
+ typedef vector<test::triple_int_holder, triple_int_holder_allocator_type>
+ triple_int_holder_vector;
+
+ if(!test::test_all_expand_bwd<triple_int_holder_vector>())
+ return 1;
+
+ return 0;
+}
+
+class recursive_vector
+{
+ public:
+ int id_;
+ vector<recursive_vector> vector_;
+};
+
+void recursive_vector_test()//Test for recursive types
+{
+ vector<recursive_vector> recursive_vector_vector;
+}
+
+int main()
+{
+ recursive_vector_test();
+ {
+ //Now test move semantics
+ vector<recursive_vector> original;
+ vector<recursive_vector> move_ctor(boost::move(original));
+ vector<recursive_vector> move_assign;
+ move_assign = boost::move(move_ctor);
+ move_assign.swap(original);
+ }
+ typedef vector<int> MyVector;
+ typedef vector<test::movable_int> MyMoveVector;
+ typedef vector<test::movable_and_copyable_int> MyCopyMoveVector;
+ if(test::vector_test<MyVector>())
+ return 1;
+ if(test::vector_test<MyMoveVector>())
+ return 1;
+ if(test::vector_test<MyCopyMoveVector>())
+ return 1;
+ if(test_expand_bwd())
+ return 1;
+
+ const test::EmplaceOptions Options = (test::EmplaceOptions)(test::EMPLACE_BACK | test::EMPLACE_BEFORE);
+ if(!boost::container::test::test_emplace
+ < vector<test::EmplaceInt>, Options>())
+ return 1;
+
+ return 0;
+}
+
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/container/test/vector_test.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/container/test/vector_test.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,217 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2004-2007. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#include <boost/container/detail/config_begin.hpp>
+#include <algorithm>
+#include <memory>
+#include <vector>
+#include <iostream>
+#include <functional>
+#include <list>
+
+#include <boost/move/move.hpp>
+#include <boost/container/detail/mpl.hpp>
+#include "print_container.hpp"
+#include "check_equal_containers.hpp"
+#include "movable_int.hpp"
+#include <string>
+#include <vector>
+#include "emplace_test.hpp"
+
+namespace boost{
+namespace container {
+namespace test{
+
+template<class V1, class V2>
+bool copyable_only(V1 *, V2 *, boost::container::containers_detail::false_type)
+{
+ return true;
+}
+
+//Function to check if both sets are equal
+template<class V1, class V2>
+bool copyable_only(V1 *shmvector, V2 *stdvector, boost::container::containers_detail::true_type)
+{
+ typedef typename V1::value_type IntType;
+ std::size_t size = shmvector->size();
+ stdvector->insert(stdvector->end(), 50, 1);
+ shmvector->insert(shmvector->end(), 50, 1);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return false;
+
+ {
+ IntType move_me(1);
+ stdvector->insert(stdvector->begin()+size/2, 50, 1);
+ shmvector->insert(shmvector->begin()+size/2, 50, boost::move(move_me));
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return false;
+ }
+ {
+ IntType move_me(2);
+ shmvector->assign(shmvector->size()/2, boost::move(move_me));
+ stdvector->assign(stdvector->size()/2, 2);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return false;
+ }
+ {
+ IntType move_me(3);
+ shmvector->assign(shmvector->size()*3-1, boost::move(move_me));
+ stdvector->assign(stdvector->size()*3-1, 3);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return false;
+ }
+ return true;
+}
+
+template<class MyShmVector>
+int vector_test()
+{
+ typedef std::vector<int> MyStdVector;
+ typedef typename MyShmVector::value_type IntType;
+ const int max = 100;
+
+ {
+ try{
+ MyShmVector *shmvector = new MyShmVector;
+ MyStdVector *stdvector = new MyStdVector;
+ shmvector->resize(100);
+ stdvector->resize(100);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ shmvector->resize(200);
+ stdvector->resize(200);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ shmvector->resize(0);
+ stdvector->resize(0);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ for(int i = 0; i < max; ++i){
+ IntType new_int(i);
+ shmvector->insert(shmvector->end(), boost::move(new_int));
+ stdvector->insert(stdvector->end(), i);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+ }
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ typename MyShmVector::iterator shmit(shmvector->begin());
+ typename MyStdVector::iterator stdit(stdvector->begin());
+ typename MyShmVector::const_iterator cshmit = shmit;
+ ++shmit; ++stdit;
+ shmvector->erase(shmit);
+ stdvector->erase(stdit);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ shmvector->erase(shmvector->begin());
+ stdvector->erase(stdvector->begin());
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ {
+ //Initialize values
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType new_int(-1);
+ BOOST_STATIC_ASSERT((boost::is_movable<boost::container::test::movable_int>::value == true));
+ aux_vect[i] = boost::move(new_int);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = -1;
+ }
+
+ shmvector->insert(shmvector->end()
+ ,boost::make_move_iterator(&aux_vect[0])
+ ,boost::make_move_iterator(aux_vect + 50));
+ stdvector->insert(stdvector->end(), aux_vect2, aux_vect2 + 50);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ for(int i = 0, j = static_cast<int>(shmvector->size()); i < j; ++i){
+ shmvector->erase(shmvector->begin());
+ stdvector->erase(stdvector->begin());
+ }
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+ }
+ {
+ IntType aux_vect[50];
+ for(int i = 0; i < 50; ++i){
+ IntType new_int(-1);
+ aux_vect[i] = boost::move(new_int);
+ }
+ int aux_vect2[50];
+ for(int i = 0; i < 50; ++i){
+ aux_vect2[i] = -1;
+ }
+ shmvector->insert(shmvector->begin()
+ ,boost::make_move_iterator(&aux_vect[0])
+ ,boost::make_move_iterator(aux_vect + 50));
+ stdvector->insert(stdvector->begin(), aux_vect2, aux_vect2 + 50);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+ }
+
+ shmvector->reserve(shmvector->size()*2);
+ stdvector->reserve(stdvector->size()*2);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ IntType push_back_this(1);
+ shmvector->push_back(boost::move(push_back_this));
+ stdvector->push_back(int(1));
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ if(!copyable_only(shmvector, stdvector
+ ,containers_detail::bool_<!is_movable<IntType>::value>())){
+ return 1;
+ }
+
+ shmvector->erase(shmvector->begin());
+ stdvector->erase(stdvector->begin());
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ for(int i = 0; i < max; ++i){
+ IntType insert_this(i);
+ shmvector->insert(shmvector->begin(), boost::move(insert_this));
+ stdvector->insert(stdvector->begin(), i);
+ }
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+
+ //Test insertion from list
+ {
+ std::list<int> l(50, int(1));
+ shmvector->insert(shmvector->begin(), l.begin(), l.end());
+ stdvector->insert(stdvector->begin(), l.begin(), l.end());
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+ shmvector->assign(l.begin(), l.end());
+ stdvector->assign(l.begin(), l.end());
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+ }
+/*
+ std::size_t cap = shmvector->capacity();
+ shmvector->reserve(cap*2);
+ stdvector->reserve(cap*2);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+ shmvector->resize(0);
+ stdvector->resize(0);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+ shmvector->resize(cap*2);
+ stdvector->resize(cap*2);
+ if(!test::CheckEqualContainers(shmvector, stdvector)) return 1;
+*/
+ delete stdvector;
+ delete shmvector;
+ }
+ catch(std::exception &ex){
+ std::cout << ex.what() << std::endl;
+ return 1;
+ }
+ }
+ std::cout << std::endl << "Test OK!" << std::endl;
+ return 0;
+}
+
+} //namespace test{
+} //namespace container {
+} //namespace boost{
+
+#include <boost/container/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/CMakeLists.txt
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/CMakeLists.txt 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,22 @@
+#----------------------------------------------------------------------------
+# This file was automatically generated from the original CMakeLists.txt file
+# Add a variable to hold the headers for the library
+set (lib_headers
+ intrusive_ptr.hpp
+ intrusive
+)
+
+# Add a library target to the build system
+boost_library_project(
+ intrusive
+ # SRCDIRS
+ # TESTDIRS
+ HEADERS ${lib_headers}
+ # DOCDIRS
+ # DESCRIPTION
+ MODULARIZED
+ # AUTHORS
+ # MAINTAINERS
+)
+
+
Added: sandbox/move/libs/intrusive/doc/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/doc/Jamfile.v2 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,58 @@
+# Boost.Intrusive library documentation Jamfile
+#
+# Copyright Ion Gaztanaga 2006.
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+#
+# See http://www.boost.org/libs/intrusive for documentation.
+
+
+import doxygen ;
+import quickbook ;
+
+doxygen autodoc
+ :
+ [ glob ../../../boost/intrusive/*.hpp ]
+ :
+ <doxygen:param>HIDE_UNDOC_MEMBERS=YES
+ <doxygen:param>HIDE_UNDOC_MEMBERS=YES
+ <doxygen:param>HIDE_UNDOC_CLASSES=YES
+ <doxygen:param>EXTRACT_PRIVATE=NO
+ <doxygen:param>ENABLE_PREPROCESSING=YES
+ <doxygen:param>MACRO_EXPANSION=YES
+ <doxygen:param>"PREDEFINED=BOOST_INTRUSIVE_DOXYGEN_INVOKED \\
+ "list_impl=list" \\
+ "slist_impl=slist" \\
+ "set_impl=set" \\
+ "multiset_impl=multiset" \\
+ "rbtree_impl=rbtree" \\
+ "unordered_set_impl=unordered_set" \\
+ "unordered_multiset_impl=unordered_multiset" \\
+ "hashtable_impl=hashtable" \\
+ "splay_set_impl=splay_set" \\
+ "splay_multiset_impl=splay_multiset" \\
+ "splaytree_impl=splaytree" \\
+ "sg_set_impl=sg_set" \\
+ "sg_multiset_impl=sg_multiset" \\
+ "sgtree_impl=sgtree" \\
+ "avl_set_impl=avl_set" \\
+ "avl_multiset_impl=avl_multiset" \\
+ "avltree_impl=avltree" \\
+ "treap_set_impl=treap_set" \\
+ "treap_multiset_impl=treap_multiset" \\
+ "treap_impl=treap""
+ ;
+
+xml intrusive : intrusive.qbk ;
+
+boostbook standalone
+ :
+ intrusive
+ :
+ <xsl:param>boost.root=../../../..
+ <xsl:param>boost.libraries=../../../../libs/libraries.htm
+ <xsl:param>generate.section.toc.level=3
+ <xsl:param>chunk.first.sections=1
+ <dependency>autodoc
+ ;
Added: sandbox/move/libs/intrusive/doc/html/boostbook.css
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/doc/html/boostbook.css 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,538 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+/*=============================================================================
+ Body defaults
+=============================================================================*/
+
+ body
+ {
+ margin: 1em;
+ font-family: sans-serif;
+ }
+
+/*=============================================================================
+ Paragraphs
+=============================================================================*/
+
+ p
+ {
+ text-align: left;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+/*=============================================================================
+ Program listings
+=============================================================================*/
+
+ /* Code on paragraphs */
+ p tt.computeroutput
+ {
+ font-size: 10pt;
+ }
+
+ pre.synopsis
+ {
+ font-size: 10pt;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ .programlisting,
+ .screen
+ {
+ font-size: 10pt;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+/*=============================================================================
+ Headings
+=============================================================================*/
+
+ h1, h2, h3, h4, h5, h6
+ {
+ text-align: left;
+ margin: 1em 0em 0.5em 0em;
+ font-weight: bold;
+ }
+
+ h1 { font: 140% }
+ h2 { font: bold 140% }
+ h3 { font: bold 130% }
+ h4 { font: bold 120% }
+ h5 { font: italic 110% }
+ h6 { font: italic 100% }
+
+ /* Top page titles */
+ title,
+ h1.title,
+ h2.title
+ h3.title,
+ h4.title,
+ h5.title,
+ h6.title,
+ .refentrytitle
+ {
+ font-weight: bold;
+ margin-bottom: 1pc;
+ }
+
+ h1.title { font-size: 140% }
+ h2.title { font-size: 140% }
+ h3.title { font-size: 130% }
+ h4.title { font-size: 120% }
+ h5.title { font-size: 110% }
+ h6.title { font-size: 100% }
+
+ .section h1
+ {
+ margin: 0em 0em 0.5em 0em;
+ font-size: 140%;
+ }
+
+ .section h2 { font-size: 140% }
+ .section h3 { font-size: 130% }
+ .section h4 { font-size: 120% }
+ .section h5 { font-size: 110% }
+ .section h6 { font-size: 100% }
+
+ /* Code on titles */
+ h1 tt.computeroutput { font-size: 140% }
+ h2 tt.computeroutput { font-size: 140% }
+ h3 tt.computeroutput { font-size: 130% }
+ h4 tt.computeroutput { font-size: 120% }
+ h5 tt.computeroutput { font-size: 110% }
+ h6 tt.computeroutput { font-size: 100% }
+
+/*=============================================================================
+ Author
+=============================================================================*/
+
+ h3.author
+ {
+ font-size: 100%
+ }
+
+/*=============================================================================
+ Lists
+=============================================================================*/
+
+ li
+ {
+ font-size: 10pt;
+ line-height: 1.3;
+ }
+
+ /* Unordered lists */
+ ul
+ {
+ text-align: left;
+ }
+
+ /* Ordered lists */
+ ol
+ {
+ text-align: left;
+ }
+
+/*=============================================================================
+ Links
+=============================================================================*/
+
+ a
+ {
+ text-decoration: none; /* no underline */
+ }
+
+ a:hover
+ {
+ text-decoration: underline;
+ }
+
+/*=============================================================================
+ Spirit style navigation
+=============================================================================*/
+
+ .spirit-nav
+ {
+ text-align: right;
+ }
+
+ .spirit-nav a
+ {
+ color: white;
+ padding-left: 0.5em;
+ }
+
+ .spirit-nav img
+ {
+ border-width: 0px;
+ }
+
+/*=============================================================================
+ Table of contents
+=============================================================================*/
+
+ .toc
+ {
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.1pc 1pc 0.1pc 1pc;
+ font-size: 10pt;
+ line-height: 1.15;
+ }
+
+ .toc-main
+ {
+ width: 600;
+ text-align: center;
+ margin: 1pc 1pc 1pc 10%;
+ padding: 2pc 1pc 3pc 1pc;
+ line-height: 0.1;
+ }
+
+ .boost-toc
+ {
+ float: right;
+ padding: 0.5pc;
+ }
+
+/*=============================================================================
+ Tables
+=============================================================================*/
+
+ .table-title,
+ div.table p.title
+ {
+ margin-left: 4%;
+ padding-right: 0.5em;
+ padding-left: 0.5em;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+ }
+
+ div.informaltable table,
+ div.table table
+ {
+ padding: 4px;
+ }
+
+ /* Table Cells */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ padding: 0.5em;
+ text-align: left;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ padding: 0.5em 0.5em 0.5em 0.5em;
+ border: 1pt solid white;
+ font-size: 120%;
+ }
+
+/*=============================================================================
+ Blurbs
+=============================================================================*/
+
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ font-size: 10pt;
+ line-height: 1.2;
+ display: block;
+ margin: 1pc 4% 0pc 4%;
+ padding: 0.5pc 0.5pc 0.5pc 0.5pc;
+ }
+
+ p.blurb img
+ {
+ padding: 1pt;
+ }
+
+/*=============================================================================
+ Variable Lists
+=============================================================================*/
+
+ span.term
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td
+ {
+ text-align: left;
+ vertical-align: top;
+ padding: 0em 2em 0em 0em;
+ font-size: 10pt;
+ }
+
+ div.variablelist table tbody tr td p
+ {
+ margin: 0em 0em 0.5em 0em;
+ }
+
+ /* Make the terms in definition lists bold */
+ div.variablelist dl dt
+ {
+ font-weight: bold;
+ font-size: 10pt;
+ }
+
+ div.variablelist dl dd
+ {
+ margin: 1em 0em 1em 2em;
+ font-size: 10pt;
+ }
+
+/*=============================================================================
+ Misc
+=============================================================================*/
+
+ /* Title of books and articles in bibliographies */
+ span.title
+ {
+ font-style: italic;
+ }
+
+ span.underline
+ {
+ text-decoration: underline;
+ }
+
+ span.strikethrough
+ {
+ text-decoration: line-through;
+ }
+
+ /* Copyright, Legal Notice */
+ div div.legalnotice p
+ {
+ font-size: 8pt;
+ text-align: left
+ }
+
+/*=============================================================================
+ Colors
+=============================================================================*/
+
+ @media screen
+ {
+ /* Links */
+ a
+ {
+ color: #0C7445;
+ }
+
+ a:visited
+ {
+ color: #663974;
+ }
+
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
+ h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover,
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited
+ {
+ text-decoration: none; /* no underline */
+ color: #000000;
+ }
+
+ /* Syntax Highlighting */
+ .keyword { color: #0000AA; }
+ .identifier { color: #000000; }
+ .special { color: #707070; }
+ .preprocessor { color: #402080; }
+ .char { color: teal; }
+ .comment { color: #800000; }
+ .string { color: teal; }
+ .number { color: teal; }
+ .white_bkd { background-color: #E8FBE9; }
+ .dk_grey_bkd { background-color: #A0DAAC; }
+
+ /* Copyright, Legal Notice */
+ .copyright
+ {
+ color: #666666;
+ font-size: small;
+ }
+
+ div div.legalnotice p
+ {
+ color: #666666;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Blurbs */
+ div.note,
+ div.tip,
+ div.important,
+ div.caution,
+ div.warning,
+ p.blurb
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc-main
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ background-color: #E3F9E4;
+ border: 1px solid #DCDCDC;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ color: #00A000;
+ }
+ }
+
+ @media print
+ {
+ /* Links */
+ a
+ {
+ color: black;
+ }
+
+ a:visited
+ {
+ color: black;
+ }
+
+ .spirit-nav
+ {
+ display: none;
+ }
+
+ /* Program listing */
+ pre.synopsis
+ {
+ border: 1px solid gray;
+ background-color: #FAFFFB;
+ }
+
+ .programlisting,
+ .screen
+ {
+ border: 1px solid gray;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ /* Table of contents */
+ .toc-main
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ background-color: #FAFFFB;
+ }
+
+ .informaltable table,
+ .table table
+ {
+ border: 1px solid #DCDCDC;
+ border-bottom: 3px solid #9D9D9D;
+ border-right: 3px solid #9D9D9D;
+ border-collapse: collapse;
+ background-color: #FAFFFB;
+ }
+
+ /* Tables */
+ div.informaltable table tr td,
+ div.table table tr td
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ div.informaltable table tr th,
+ div.table table tr th
+ {
+ border: 1px solid #DCDCDC;
+ background-color: #FAFFFB;
+ }
+
+ /* Misc */
+ span.highlight
+ {
+ font-weight: bold;
+ }
+ }
Added: sandbox/move/libs/intrusive/doc/html/images/blank.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/caution.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/draft.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/home.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/important.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/next.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/note.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/prev.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/tip.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/toc-blank.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/toc-minus.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/toc-plus.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/up.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/images/warning.png
==============================================================================
Binary file. No diff available.
Added: sandbox/move/libs/intrusive/doc/html/reference.css
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/doc/html/reference.css 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,13 @@
+/*=============================================================================
+ Copyright (c) 2004 Joel de Guzman
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+PRE.synopsis {
+ background-color: #e0ffff;
+ border: thin solid blue;
+ padding: 1em
+}
Added: sandbox/move/libs/intrusive/doc/intrusive.qbk
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/doc/intrusive.qbk 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,3876 @@
+[/
+ / Copyright (c) 2007-2009 Ion Gaztanaga
+ /
+ / Distributed under the Boost Software License, Version 1.0. (See accompanying
+ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ /]
+
+[library Boost.Intrusive
+ [quickbook 1.3]
+ [authors [Krzikalla, Olaf], [Gaztañaga, Ion]]
+ [copyright 2005 Olaf Krzikalla, 2006-2009 Ion Gaztañaga]
+ [id intrusive]
+ [dirname intrusive]
+ [purpose Intrusive containers]
+ [license
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ [@http://www.boost.org/LICENSE_1_0.txt])
+ ]
+]
+
+[section:introduction Introduction]
+
+[section:introduction_presenting Presenting Boost.Intrusive]
+
+[*Boost.Intrusive] is a library presenting some intrusive containers to
+the world of C++. Intrusive containers are special containers
+that offer [link intrusive.performance better performance]
+and exception safety guarantees than non-intrusive containers (like STL containers).
+
+The performance benefits of intrusive containers makes them ideal as a building
+block to efficiently construct complex containers like multi-index containers or
+to design high performance code like memory allocation algorithms.
+
+While intrusive containers were and are widely used in C, they
+became more and more forgotten in C++ due to the presence of the standard
+containers which don't support intrusive techniques.[*Boost.Intrusive] not only
+reintroduces this technique to C++, but also encapsulates the implementation in
+STL-like interfaces. Hence anyone familiar with standard containers can easily use
+[*Boost.Intrusive].
+
+[endsect]
+
+[section:introduction_building_intrusive Building Boost.Intrusive]
+
+There is no need to compile anything to use [*Boost.Intrusive], since it's
+a header only library. Just include your Boost header directory in your
+compiler include path.
+
+[endsect]
+
+[endsect]
+
+[section:intrusive_vs_nontrusive Intrusive and non-intrusive containers]
+
+[section:differences_intrusive_vs_nontrusive Differences between intrusive and non-intrusive containers]
+
+The main difference between intrusive containers and non-intrusive containers is
+that in C++ non-intrusive containers store [*copies] of values passed by the user.
+Containers use the `Allocator` template parameter to allocate the stored values:
+
+[c++]
+
+ #include <list>
+ #include <assert.h>
+
+ int main()
+ {
+ std::list<MyClass> myclass_list;
+
+ MyClass myclass(...);
+ myclass_list.push_back(myclass);
+
+ //The stored object is different from the original object
+ assert(&myclass != &myclass_list.front());
+ return 0;
+ }
+
+
+To store the newly allocated copy of `myclass`, the container needs additional
+data: `std::list` usually allocates nodes that contain pointers to the
+next and previous node and the value itself. Something similar to:
+
+[c++]
+
+ //A possible implementation of a std::list<MyClass> node
+ class list_node
+ {
+ list_node *next;
+ list_node *previous;
+ MyClass value;
+ };
+
+
+On the other hand, an intrusive container does not store copies of passed objects,
+but it stores the objects themselves. The additional data needed to insert the object
+in the container must be provided by the object itself. For example, to insert `MyClass`
+in an intrusive container that implements a linked list, `MyClass` must contain the
+needed ['next] and ['previous] pointers:
+
+[c++]
+
+ class MyClass
+ {
+ MyClass *next;
+ MyClass *previous;
+ //Other members...
+ };
+
+ int main()
+ {
+ acme_intrusive_list<MyClass> list;
+
+ MyClass myclass;
+ list.push_back(myclass);
+
+ //"myclass" object is stored in the list
+ assert(&myclass == &list.front());
+ return 0;
+ }
+
+As we can see, knowing which additional data the class should contain is not
+an easy task. [*Boost.Intrusive] offers several intrusive containers and an easy
+way to make user classes compatible with those containers.
+
+[endsect]
+
+[section:properties_of_intrusive Properties of Boost.Intrusive containers]
+
+Semantically, a [*Boost.Intrusive] container is similar to a STL container
+holding pointers to objects. That is, if you have an intrusive list holding
+objects of type `T`, then `std::list<T*>` would allow you to do quite the
+same operations (maintaining and navigating a set of objects of type T and
+types derived from it).
+
+A non-intrusive container has some limitations:
+
+* An object can only belong to one container: If you want to share an object
+ between two containers, you either have to store multiple copies of those
+ objects or you need to use containers of pointers: `std::list<Object*>`.
+
+* The use of dynamic allocation to create copies of passed values can be a performance
+ and size bottleneck in some applications. Normally, dynamic allocation imposes
+ a size overhead for each allocation to store bookkeeping information and a
+ synchronization to protected concurrent allocation from different threads.
+
+* Only copies of objects are stored in non-intrusive containers. Hence copy
+ or move constructors and copy or move assignment operators are required. Non-copyable
+ and non-movable objects can't be stored in non-intrusive containers.
+
+* It's not possible to store a derived object in a STL-container while
+ retaining its original type.
+
+Intrusive containers have some important advantages:
+
+* Operating with intrusive containers doesn't invoke any memory management at all.
+ The time and size overhead associated with dynamic memory can be minimized.
+
+* Iterating an Intrusive container needs less memory accesses than the semantically
+ equivalent container of pointers: iteration is faster.
+
+* Intrusive containers offer better exception guarantees than non-intrusive containers.
+ In some situations intrusive containers offer a no-throw guarantee that can't be
+ achieved with non-intrusive containers.
+
+* The computation of an iterator to an element from a pointer or reference to that element
+ is a constant time operation (computing the position of `T*` in a `std::list<T*>` has
+ linear complexity).
+
+* Intrusive containers offer predictability when inserting and erasing objects since no
+ memory management is done with intrusive containers. Memory management usually is not a predictable
+ operation so complexity guarantees from non-intrusive containers are looser than the guarantees
+ offered by intrusive containers.
+
+Intrusive containers have also downsides:
+
+* Each type stored in an intrusive container needs additional memory holding the
+ maintenance information needed by the container. Hence, whenever a certain type will
+ be stored in an intrusive container [*you have to change the definition of that type]
+ appropriately. Although this task is easy with [*Boost.Intrusive], touching the
+ definition of a type is sometimes a crucial issue.
+
+* In intrusive containers you don't store a copy of an object, [*but rather the original object
+ is linked with other objects in the container]. Objects don't need copy-constructors or assignment
+ operators to be stored in intrusive containers. But you have to take care of possible side effects,
+ whenever you change the contents of an object (this is especially important for
+ associative containers).
+
+* The user [*has to manage the lifetime of inserted objects] independently from the
+ containers.
+
+* Again you have to be [*careful]: in contrast to STL containers [*it's easy to render an
+ iterator invalid] without touching the intrusive container directly, because the object
+ can be disposed before is erased from the container.
+
+* [*Boost.Intrusive] containers are [*non-copyable and non-assignable]. Since intrusive
+ containers don't have allocation capabilities, these operations make no sense. However,
+ swapping can be used to implement move capabilities. To ease the implementation of
+ copy constructors and assignment operators of classes storing [*Boost.Intrusive]
+ containers, [*Boost.Intrusive] offers special cloning functions. See
+ [link intrusive.clone_from Cloning [*Boost.Intrusive] containers] section for more information.
+
+* Analyzing the thread safety of a program that uses containers is harder with intrusive containers, because
+ the container might be modified indirectly without an explicit call to a container member.
+
+[table Summary of intrusive containers advantages and disadvantages
+ [[Issue] [Intrusive] [Non-intrusive]]
+ [[Memory management] [External] [Internal through allocator]]
+ [[Insertion/Erasure time] [Faster] [Slower]]
+ [[Memory locality] [Better] [Worse]]
+ [[Can hold non-copyable and non-movable objects by value] [Yes] [No]]
+ [[Exception guarantees] [Better] [Worse]]
+ [[Computation of iterator from value] [Constant] [Non-constant]]
+ [[Insertion/erasure predictability] [High] [Low]]
+ [[Memory use] [Minimal] [More than minimal]]
+ [[Insert objects by value retaining polymorphic behavior] [Yes] [No (slicing)]]
+ [[User must modify the definition of the values to insert] [Yes] [No]]
+ [[Containers are copyable] [No] [Yes]]
+ [[Inserted object's lifetime managed by] [User (more complex)] [Container (less complex)]]
+ [[Container invariants can be broken without using the container] [Easier] [Harder (only with containers of pointers)]]
+ [[Thread-safety analysis] [Harder] [Easier]]
+]
+
+For a performance comparison between Intrusive and Non-intrusive containers see
+[link intrusive.performance Performance] section.
+
+[endsect]
+
+[endsect]
+
+[section:usage How to use Boost.Intrusive]
+
+If you plan to insert a class in an intrusive container, you have to make some decisions
+influencing the class definition itself. Each class that will be used in an intrusive
+container needs some appropriate data members storing the information needed by the
+container. We will take a simple intrusive container, the intrusive list
+([classref boost::intrusive::list boost::intrusive::list]), for the following
+examples, but all [*Boost.Intrusive] containers are very similar. To compile
+the example using [classref boost::intrusive::list boost::intrusive::list],
+just include:
+
+[c++]
+
+ #include <boost/intrusive/list.hpp>
+
+Every class to be inserted in an intrusive container, needs to contain a hook that
+will offer the necessary data and resources to be insertable in the container.
+With [*Boost.Intrusive] you just choose the hook to be a public base class or
+a public member of the class to be inserted.
+
+[section:usage_base_hook Using base hooks]
+
+For [classref boost::intrusive::list list], you can publicly derive from
+[classref boost::intrusive::list_base_hook list_base_hook].
+
+[c++]
+
+ template <class ...Options>
+ class list_base_hook;
+
+The class can take several options. [*Boost.Intrusive] classes receive arguments in the
+form `option_name<option_value>`. You can specify the following options:
+
+* [*`tag<class Tag>`]: this argument serves as a tag, so you can derive from more than one
+ [classref boost::intrusive::list_base_hook list_base_hook] and hence put an object in
+ multiple intrusive lists at the same time. An incomplete type can serve as a tag.
+ If you specify two base hooks, you [*must] specify a different
+ tag for each one. Example: `list_base_hook< tag<tag1> >`. If no tag is specified
+ a default one will be used (more on default tags later).
+
+* [*`link_mode<link_mode_type LinkMode>`]: The second template argument controls the
+ linking policy. [*Boost.Intrusive] currently supports
+ 3 modes: `normal_link`, `safe_link` and `auto_unlink`. By default, `safe_link`
+ mode is used. More about these in sections
+ [link intrusive.safe_hook Safe hooks] and [link intrusive.auto_unlink_hooks Auto-unlink hooks].
+ Example: `list_base_hook< link_mode<auto_unlink> >`
+
+* [*`void_pointer<class VoidPointer>`]: this option is the pointer type to be used
+ internally in the hook. The default value is `void *`, which means that raw pointers
+ will be used in the hook. More about this in the section titled
+ [link intrusive.using_smart_pointers Using smart pointers with Boost.Intrusive containers].
+ Example: `list_base_hook< void_pointer< my_smart_ptr<void> >`
+
+For the following examples, let's forget the options and use the default values:
+
+[c++]
+
+ #include <boost/intrusive/list.hpp>
+
+ using namespace boost::intrusive;
+
+ class Foo
+ //Base hook with default tag, raw pointers and safe_link mode
+ : public list_base_hook<>
+ { /**/ };
+
+After that, we can define the intrusive list:
+
+[c++]
+
+ template <class T, class ...Options>
+ class list;
+
+`list` receives the type to be inserted in the container (`T`) as the first parameter
+and optionally, the user can specify options. We have 3 option types:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: All these options specify the relationship
+ between the type `T` to be inserted in the list and the hook (since we can
+ have several hooks in the same `T` type). `member_hook` will be explained
+ a bit later and `value_traits` will be explained in the
+ [link intrusive.value_traits Containers with custom ValueTraits] section.
+ [*If no option is specified, the container will be configured to use the base
+ hook with the default tag].
+ Some options configured for the hook (the type of the pointers, link mode, etc.)
+ will be propagated to the container.
+
+* [*`constant_time_size<bool Enabled>`]: Specifies if a constant time `size()`
+ function is demanded for the container. This will instruct the intrusive
+ container to store an additional member to keep track of the current size of the
+ container. By default, constant-time size is activated.
+
+* [*`size_type<bool Enabled>`]: Specifies a type that can hold
+ the size of the container. This type will be the type returned by `list.size()`
+ and the type stored in the intrusive container if `constant_time_size<true>`
+ is requested.
+ The user normally will not need to change this type, but some
+ containers can have a `size_type` that might be different from `std::size_t`
+ (for example, STL-like containers use the `size_type` defined by their allocator).
+ [*Boost.Intrusive] can be used to implement such containers specifying the
+ the type of the size. By default the type is `std::size_t`.
+
+Example of a constant-time size intrusive list that will store Foo objects, using
+the base hook with the default tag:
+
+[c++]
+
+ typedef list<Foo> FooList;
+
+Example of a intrusive list with non constant-time size that will store Foo objects:
+
+[c++]
+
+ typedef list<Foo, constant_time_size<false> > FooList;
+
+Remember that the user must specify the base hook if the base hook has no default tag
+(e.g: if more than one base hook is used):
+
+[c++]
+
+ #include <boost/intrusive/list.hpp>
+
+ using namespace boost::intrusive;
+
+ struct my_tag;
+
+ typedef list_base_hook< tag<my_tag> > BaseHook;
+ class Foo : public BaseHook
+ { /**/ };
+
+ typedef list< Foo, base_hook<BaseHook> > FooList;
+
+Once the list is defined, we can use it:
+
+[c++]
+
+ //An object to be inserted in the list
+ Foo foo_object;
+ FooList list;
+
+ list.push_back(object);
+
+ assert(&list.front() == &foo_object);
+
+[endsect]
+
+[section:usage_member_hook Using member hooks]
+
+Sometimes an 'is-a' relationship between list hooks and the list value types
+is not desirable. In this case, using a member hook as a data member instead of
+'disturbing' the hierarchy might be the right way: you can add a public data
+member `list_member_hook<...>` to your class.
+This class can be configured with the same options as `list_base_hook`
+except the option `tag`:
+
+[c++]
+
+ template <class ...Options>
+ class list_member_hook;
+
+Example:
+
+[c++]
+
+ #include <boost/intrusive/list.hpp>
+
+ class Foo
+ {
+ public:
+ list_member_hook<> hook_;
+ //...
+ };
+
+When member hooks are used, the `member_hook` option is used to configure the
+list:
+
+[c++]
+
+ //This option will configure "list" to use the member hook
+ typedef member_hook<Foo, list_member_hook<>, &Foo::hook_> MemberHookOption;
+
+ //This list will use the member hook
+ typedef list<Foo, MemberHookOption> FooList;
+
+Now we can use the container:
+
+[c++]
+
+ //An object to be inserted in the list
+ Foo foo_object;
+ FooList list;
+
+ list.push_back(object);
+
+ assert(&list.front() == &foo_object);
+
+[endsect]
+
+[section:usage_both_hooks Using both hooks]
+
+You can insert the same object in several intrusive containers at the same time,
+using one hook per container. This is a full example using base and member hooks:
+
+[import ../example/doc_how_to_use.cpp]
+[doc_how_to_use_code]
+
+[endsect]
+
+[section:usage_lifetime Object lifetime]
+
+Even if the interface of [classref boost::intrusive::list list] is similar to
+`std::list`, its usage is a bit different: You always have to keep in mind that
+you directly store objects in intrusive containers, not copies. The lifetime of a
+stored object is not bound to or managed by the container:
+
+* When the container gets destroyed before the object, the object is not destroyed,
+ so you have to be careful to avoid resource leaks.
+
+* When the object is destroyed before the container, your program is likely to crash,
+ because the container contains a pointer to an non-existing object.
+
+[endsect]
+
+[endsect]
+
+[section:usage_when When to use?]
+
+Intrusive containers can be used for highly optimized algorithms, where speed is a crucial
+issue and:
+
+* additional memory management should be avoided.
+* the programmer needs to efficiently track the construction and destruction of objects.
+* exception safety, especially the no-throw guarantee, is needed.
+* the computation of an iterator to an element from a pointer or reference
+ to that element should be a constant time operation.
+* it's important to achieve a well-known worst-time system response.
+* localization of data (e.g. for cache hit optimization) leads to measurable effects.
+
+The last point is important if you have a lot of containers over a set of elements. E.g. if
+you have a vector of objects (say, `std::vector<Object>`), and you also have a list
+storing a subset of those objects (`std::list<Object*>`), then operating on an Object
+from the list iterator (`std::list<Object*>::iterator`) requires two steps:
+
+* Access from the iterator (usually on the stack) to the list node storing a pointer to `Object`.
+* Access from the pointer to `Object` to the Object stored in the vector.
+
+While the objects themselves are tightly packed in the memory of the vector
+(a vector's memory is guaranteed to be contiguous), and form something
+like a data block, list nodes may be dispersed in the heap memory.
+Hence depending on your system you might get a lot of cache misses. The same doesn't hold
+for an intrusive list. Indeed, dereferencing an iterator from an intrusive list is performed in
+the same two steps as described above. But the list node is already embedded in the Object, so
+the memory is directly tracked from the iterator to the Object.
+
+It's also possible to use intrusive containers when the objects to be stored can
+have different or unknown size. This allows storing base and derived objects
+in the same container, as shown in the following example:
+
+[import ../example/doc_window.cpp]
+[doc_window_code]
+
+Due to certain properties of intrusive containers
+they are often more difficult to use than their STL-counterparts. That's why you
+should avoid them in public interfaces of libraries. Classes to be stored in intrusive
+containers must change their implementation to store the hook and this is not always
+possible or desirable.
+
+[endsect]
+
+[section:concepts_summary Concept summary]
+
+Here is a small summary of the basic concepts that will be used in the following
+chapters:
+
+[variablelist Brief Concepts Summary
+[[Node Algorithms][A class containing typedefs and static functions that define
+ basic operations that can be applied to a group of nodes. It's independent
+ from the node definition and configured using a NodeTraits template
+ parameter that describes the node.]]
+[[Node Traits][A class that stores basic information and operations to insert a node into a group of nodes.]]
+[[Hook][A class that a user must add as a base class or as a member to make the user class compatible with intrusive containers.]]
+[[Intrusive Container][A class that stores user classes that have the needed hooks. It takes a ValueTraits template parameter as configuration information.]]
+[[Semi-Intrusive Container][Similar to an intrusive container but a semi-intrusive container needs additional memory (e.g. an auxiliary array) to work.]]
+[[Value Traits][A class containing typedefs and operations to obtain the node to be used by Node Algorithms from the user class and the inverse.]]
+]
+
+[endsect]
+
+[section:presenting_containers Presenting Boost.Intrusive containers]
+
+[*Boost.Intrusive] offers a wide range of intrusive containers:
+
+* [*slist]: An intrusive singly linked list. The size overhead is very small
+ for user classes (usually the size of one pointer) but many operations have linear
+ time complexity, so the user must be careful if he wants to avoid performance problems.
+
+* [*list]: A `std::list` like intrusive linked list. The size overhead is quite
+ small for user classes (usually the size of two pointers). Many operations have
+ constant time complexity.
+
+* [*set/multiset/rbtree]: `std::set/std::multiset` like intrusive associative containers
+ based on red-black trees.
+ The size overhead is moderate for user classes (usually the size of three pointers).
+ Many operations have logarithmic time complexity.
+
+* [*avl_set/avl_multiset/avltree]: A `std::set/std::multiset` like intrusive associative
+ containers based on AVL trees.
+ The size overhead is moderate for user classes (usually the size of three pointers).
+ Many operations have logarithmic time complexity.
+
+* [*splay_set/splay_multiset/splaytree]: `std::set/std::multiset` like intrusive associative
+ containers based on splay trees. Splay trees have no constant operations, but they
+ have some interesting caching properties.
+ The size overhead is moderate for user classes (usually the size of three pointers).
+ Many operations have logarithmic time complexity.
+
+* [*sg_set/sg_multiset/sgtree]: A `std::set/std::multiset` like intrusive associative
+ containers based on scapegoat trees. Scapegoat can be configured with the desired
+ balance factor to achieve the desired rebalancing frequency/search time compromise.
+ The size overhead is moderate for user classes (usually the size of three pointers).
+ Many operations have logarithmic time complexity.
+
+[*Boost.Intrusive] also offers semi-intrusive containers:
+
+* [*unordered_set/unordered_multiset]: `std::tr1::unordered_set/std::tr1::unordered_multiset`
+ like intrusive unordered associative containers.
+ The size overhead is moderate for user classes (an average of two pointers per element).
+ Many operations have amortized constant time complexity.
+
+Most of these intrusive containers can be configured with constant or linear time
+size:
+
+* [*Linear time size]: The intrusive container doesn't hold a size member that is
+updated with every insertion/erasure. This implies that the `size()` function doesn't have constant
+time complexity. On the other hand, the container is smaller, and some operations, like
+`splice()` taking a range of iterators in linked lists, have constant time complexity
+instead of linear complexity.
+
+* [*Constant time size]: The intrusive container holds a size member that is updated
+with every insertion/erasure. This implies that the `size()` function has constant time
+complexity. On the other hand, increases the size of the container, and some operations,
+like `splice()` taking a range of iterators, have linear time complexity in linked lists.
+
+To make user classes compatible with these intrusive containers [*Boost.Intrusive]
+offers two types of hooks for each container type:
+
+* [*Base hook]: The hook is stored as a public base class of the user class.
+
+* [*Member hook]: The hook is stored as a public member of the user class.
+
+Apart from that, [*Boost.Intrusive] offers additional features:
+
+* [*Safe mode hooks]: Hook constructor initializes the internal data to a well-known
+ safe state and intrusive containers check that state before inserting a value in the
+ container. When erasing an element from the container, the container puts the hook
+ in the safe state again. This allows a safer use mode and it can be used to detect
+ programming errors. It implies a slight performance overhead in some operations
+ and can convert some constant time operations to linear time operations.
+
+* [*Auto-unlink hooks]: The hook destructor removes the object from the container
+ automatically and the user can safely unlink the object from the container without
+ referring to the container.
+
+* [*Non-raw pointers]: If the user wants to use smart pointers instead of raw pointers,
+ [*Boost.Intrusive] hooks can
+ be configured to use any type of pointer. This configuration information is also
+ transmitted to the containers, so all the internal pointers used by intrusive containers
+ configured with these hooks will be smart pointers. As an example,
+ [*Boost.Interprocess] defines a smart pointer compatible with shared memory,
+ called `offset_ptr`. [*Boost.Intrusive] can be configured to use this smart pointer
+ to allow shared memory intrusive containers.
+
+[endsect]
+
+[section:safe_hook Safe hooks]
+
+[section:features Features of the safe mode]
+
+[*Boost.Intrusive] hooks can be configured to operate in safe-link mode.
+The safe mode is activated by default, but it can be also explicitly activated:
+
+[c++]
+
+ //Configuring the safe mode explicitly
+ class Foo : public list_base_hook< link_mode<safe_link> >
+ {};
+
+With the safe mode the user can detect if the object
+is actually inserted in a container without any external reference. Let's review the basic features of the safe mode:
+
+* Hook's constructor puts the hook in a well-known default state.
+
+* Hook's destructor checks if the hook is in the well-known default state. If not,
+ an assertion is raised.
+
+* Every time an object is inserted in the intrusive container, the container
+ checks if the hook is in the well-known default state. If not,
+ an assertion is raised.
+
+* Every time an object is being erased from the intrusive container, the container
+ puts the erased object in the well-known default state.
+
+With these features, without any external reference the user can know if the object
+has been inserted in a container by calling the `is_linked()` member function.
+If the object is not actually inserted
+in a container, the hook is in the default state, and if it is inserted in a container, the
+hook is not in the default state.
+
+[endsect]
+
+[section:configuring Configuring safe-mode assertions]
+
+By default, all safe-mode assertions raised by [*Boost-Intrusive] hooks
+and containers in are implemented using `BOOST_ASSERT`, which can be configured by
+the user. See [@http://www.boost.org/libs/utility/assert.html] for more
+information about `BOOST_ASSERT`.
+
+`BOOST_ASSERT` is globally configured, so the user might
+want to redefine intrusive safe-mode assertions without modifying the global
+`BOOST_ASSERT`. This can be achieved redefining the following macros:
+
+* `BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT`: This assertion will be
+ used in insertion functions of the intrusive containers to check that
+ the hook of the value to be inserted is default constructed.
+* `BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT`: This assertion will be
+ used in hooks' destructors to check that the hook is in a default state.
+
+If any of these macros is not redefined, the assertion will default to `BOOST_ASSERT`.
+If `BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT` or `BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT`
+is defined and the programmer needs to include a file to configure that assertion, it can define
+`BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE` or `BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT_INCLUDE`
+with the name of the file to include:
+
+[c++]
+
+ #define BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT MYASSERT
+ #define BOOST_INTRUSIVE_SAFE_HOOK_DESTRUCTOR_ASSERT_INCLUDE <myassert.h>
+
+[endsect]
+
+[endsect]
+
+[section:auto_unlink_hooks Auto-unlink hooks]
+
+[section:auto_unlink_hooks_what What's an auto-unlink hook?]
+
+[*Boost.Intrusive] offers additional hooks with unique features:
+
+* When the destructor of the hook is called, the hook checks if the node is inserted
+ in a container. If so, the hook removes the node from the container.
+* The hook has a member function called `unlink()` that can be used to unlink the
+ node from the container at any time, without having any reference to the container,
+ if the user wants to do so.
+
+These hooks have exactly the same size overhead as their analog non auto-unlinking
+hooks, but they have a restriction: they can only be used with
+[link intrusive.presenting_containers non-constant time containers].
+There is a reason for this:
+
+* Auto-unlink hooks don't store any reference to the container where they are inserted.
+* Only containers with non constant-time `size()` allow removing an object from the container
+ without referring to the container.
+
+This auto-unlink feature is useful in certain applications
+but it must be used [*very carefully]:
+
+* If several threads are using the same container the destructor of the auto-unlink
+ hook will be called without any thread synchronization so removing the object is
+ thread-unsafe.
+
+* Container contents change silently without modifying the container directly.
+ This can lead to surprising effects.
+
+These auto-unlink hooks have also safe-mode properties:
+
+* Hooks' constructors put the hook in a well-known default state.
+
+* Every time an object is inserted in the intrusive container, the container
+ checks if the hook is in the well-known default state. If not,
+ an assertion is raised.
+
+* Every time an object is erased from an intrusive container, the container
+ puts the erased object in the well-known default state.
+
+[endsect]
+
+[section:auto_unlink_hooks_example Auto-unlink hook example]
+
+Let's see an example of an auto-unlink hook:
+
+[import ../example/doc_auto_unlink.cpp]
+[doc_auto_unlink_code]
+
+[endsect]
+
+[section:auto_unlink_and_constant_time Auto-unlink hooks and containers with constant-time `size()`]
+
+As explained, [*Boost.Intrusive] auto-unlink hooks are incompatible with containers
+that have constant-time `size()`, so if you try to define such container with an
+auto-unlink hook's value_traits, you will get a static assertion:
+
+[c++]
+
+ #include <boost/intrusive/list.hpp>
+
+ using boost::intrusive;
+
+ struct MyTag;
+
+ class MyClass : public list_base_hook< link_mode<auto_unlink> >
+ {/**/};
+
+ list <MyClass, constant_time_size<true> > bad_list;
+
+ int main()
+ {
+ bad_list list;
+ return 0;
+ }
+
+leads to an error similar to:
+
+[pre
+ error : use of undefined type 'boost::STATIC_ASSERTION_FAILURE<false>'
+]
+
+Pointing to code like this:
+
+[c++]
+
+ //Constant-time size is incompatible with auto-unlink hooks!
+ BOOST_STATIC_ASSERT(!(constant_time_size && ((int)value_traits::link_mode == (int)auto_unlink)));
+
+This way, there is no way to compile a program if you try to use auto-unlink hooks
+in constant-time size containers.
+
+[endsect]
+
+[endsect]
+
+[section:slist Intrusive singly linked list: slist]
+
+[classref boost::intrusive::slist slist] is the simplest intrusive container of
+[*Boost.Intrusive]: a singly linked list. The memory overhead
+it imposes is 1 pointer per node. The size of an empty, non constant-time size
+[classref boost::intrusive::slist slist] is the size of 1 pointer. This
+lightweight memory overhead comes with drawbacks, though: many operations have
+linear time complexity, even some that usually are constant time, like
+[classref boost::intrusive::slist::swap swap]. [classref boost::intrusive::slist slist]
+only provides forward iterators.
+
+For most cases, a doubly linked list is preferable because it offers more
+constant-time functions with a slightly bigger size overhead.
+However, for some applications like
+constructing more elaborate containers, singly linked lists are essential
+because of their low size overhead.
+
+[section:slist_hooks slist hooks]
+
+Like the rest of [*Boost.Intrusive] containers,
+[classref boost::intrusive::slist slist] has two hook types:
+
+[c++]
+
+ template <class ...Options>
+ class slist_base_hook;
+
+* [classref boost::intrusive::slist_base_hook slist_base_hook]:
+ the user class derives publicly from
+ [classref boost::intrusive::slist_base_hook slist_base_hook] to make
+ it [classref boost::intrusive::slist slist]-compatible.
+
+[c++]
+
+ template <class ...Options>
+ class slist_member_hook;
+
+* [classref boost::intrusive::slist_member_hook slist_member_hook]:
+ the user class contains a public
+ [classref boost::intrusive::slist_member_hook slist_member_hook] to make
+ it [classref boost::intrusive::slist slist]-compatible.
+
+[classref boost::intrusive::slist_base_hook slist_base_hook] and
+[classref boost::intrusive::slist_member_hook slist_member_hook]
+receive the same options explained in
+the section [link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one slist hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+[endsect]
+
+[section:slist_container slist container]
+
+[c++]
+
+ template <class T, class ...Options>
+ class slist;
+
+[classref boost::intrusive::slist slist] receives the options explained in
+the section [link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
+
+* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
+ Default: `constant_time_size<true>`
+
+* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
+ of the container. Default: `size_type<std::size_t>`.
+
+[classref boost::intrusive::slist slist] can receive additional options:
+
+* [*`linear<bool Enable>`]: the singly linked list is implemented as a
+ null-terminated list instead of a circular list. This allows `O(1)` swap,
+ but losses some operations like `container_from_end_iterator`.
+* [*`cache_last<bool Enable>`]: the singly linked also stores a pointer to the
+ last element of the singly linked list. This allows `O(1)` swap,
+ `splice_after(iterator, slist &)` and makes the list offer new functions
+ like `push_back(reference)` and `back()`. Logically, the size an empty list is
+ increased in `sizeof(void_pointer)` and the the cached last node pointer must
+ be updated in every operation, and that might incur in a slight performance impact.
+
+`auto_unlink` hooks are not usable if `linear<true>` and/or `cache_last<true>` options are
+used. If `auto_unlink` hooks are used and those options are specified, a static
+assertion will be raised.
+
+[endsect]
+
+[section:slist_example Example]
+
+Now let's see a small example using both hooks:
+
+[import ../example/doc_slist.cpp]
+[doc_slist_code]
+
+[endsect]
+
+[endsect]
+
+[section:list Intrusive doubly linked list: list]
+
+[classref boost::intrusive::list list] is a doubly linked list. The memory overhead
+it imposes is 2 pointers per node. An empty, non constant-time size [classref boost::intrusive::list list]
+also has the size of 2 pointers. [classref boost::intrusive::list list]
+has many more constant-time operations than [classref boost::intrusive::slist slist]
+and provides a bidirectional iterator. It is recommended to use
+[classref boost::intrusive::list list] instead of
+[classref boost::intrusive::slist slist] if the size overhead is acceptable:
+
+[section:list_hooks list hooks]
+
+Like the rest of [*Boost.Intrusive] containers,
+[classref boost::intrusive::list list] has two hook types:
+
+[c++]
+
+ template <class ...Options>
+ class list_base_hook;
+
+* [classref boost::intrusive::list_base_hook list_base_hook]: the user class
+ derives publicly from [classref boost::intrusive::list_base_hook list_base_hook]
+ to make it [classref boost::intrusive::list list]-compatible.
+
+[c++]
+
+ template <class ...Options>
+ class list_member_hook;
+
+* [classref boost::intrusive::list_member_hook list_member_hook]:
+ the user class contains a public
+ [classref boost::intrusive::list_member_hook list_member_hook] to make
+ it [classref boost::intrusive::list list]-compatible.
+
+[classref boost::intrusive::list_base_hook list_base_hook] and
+[classref boost::intrusive::list_member_hook list_member_hook] receive
+the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one list hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+[endsect]
+
+[section:list_container list container]
+
+[c++]
+
+ template <class T, class ...Options>
+ class list;
+
+[classref boost::intrusive::list list] receives the same options explained in
+the section [link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
+
+* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
+ Default: `constant_time_size<true>`
+
+* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
+ of the container. Default: `size_type<std::size_t>`
+
+[endsect]
+
+[section:list_example Example]
+
+Now let's see a small example using both hooks:
+
+[import ../example/doc_list.cpp]
+[doc_list_code]
+
+[endsect]
+
+[endsect]
+
+[section:set_multiset Intrusive associative containers: set, multiset, rbtree]
+
+[*Boost.Intrusive] also offers associative containers that can be very useful
+when creating more complex associative containers, like containers maintaining
+one or more indices with different sorting semantics. Boost.Intrusive associative
+containers, like most STL associative container implementations are based on
+red-black trees.
+
+The memory overhead of these containers is usually 3 pointers and a bit (with
+alignment issues, this means 3 pointers and an integer).
+This size can be reduced to 3 pointers if pointers have even alignment
+(which is usually true in most systems).
+
+An empty, non constant-time size [classref boost::intrusive::set set],
+[classref boost::intrusive::multiset multiset] or
+[classref boost::intrusive::rbtree rbtree]
+has also the size of 3 pointers and an integer (3 pointers when optimized for size).
+These containers have logarithmic complexity in many
+operations like
+searches, insertions, erasures, etc. [classref boost::intrusive::set set] and
+[classref boost::intrusive::multiset multiset] are the
+intrusive equivalents of standard `std::set` and `std::multiset` containers.
+
+[classref boost::intrusive::rbtree rbtree] is a superset of
+[classref boost::intrusive::set set] and
+[classref boost::intrusive::multiset multiset] containers that offers
+functions to insert unique and multiple keys.
+
+[section:set_multiset_hooks set, multiset and rbtree hooks]
+
+[classref boost::intrusive::set set],
+[classref boost::intrusive::multiset multiset] and
+[classref boost::intrusive::rbtree rbtree] share the same hooks.
+This is an advantage, because the same
+user type can be inserted first in a [classref boost::intrusive::multiset multiset]
+and after that in [classref boost::intrusive::set set] without
+changing the definition of the user class.
+
+[c++]
+
+ template <class ...Options>
+ class set_base_hook;
+
+* [classref boost::intrusive::set_base_hook set_base_hook]:
+ the user class derives publicly from
+ [classref boost::intrusive::set_base_hook set_base_hook] to make
+ it [classref boost::intrusive::set set]/[classref boost::intrusive::multiset multiset]-compatible.
+
+[c++]
+
+ template <class ...Options>
+ class set_member_hook;
+
+* [classref boost::intrusive::set_member_hook set_member_hook]:
+ the user class contains a public
+ [classref boost::intrusive::set_member_hook set_member_hook] to make
+ it [classref boost::intrusive::set set]/[classref boost::intrusive::multiset multiset]-compatible.
+
+[classref boost::intrusive::set_base_hook set_base_hook] and
+[classref boost::intrusive::set_member_hook set_member_hook] receive
+the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive] plus a size optimization option:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one base hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+* [*`optimize_size<bool Enable>`]: The hook will be optimized for size
+ instead of speed. The hook will embed the color bit of the red-black
+ tree node in the parent pointer if pointer alignment is even.
+ In some platforms, optimizing the size might reduce speed performance a bit
+ since masking operations will be needed to access parent pointer and color attributes,
+ in other platforms this option improves performance due to improved memory locality.
+ Default: `optimize_size<false>`.
+
+[endsect]
+
+[section:set_multiset_containers set, multiset and rbtree containers]
+
+[c++]
+
+ template <class T, class ...Options>
+ class set;
+
+ template <class T, class ...Options>
+ class multiset;
+
+ template <class T, class ...Options>
+ class rbtree;
+
+These containers receive the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
+
+* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
+ Default: `constant_time_size<true>`
+
+* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
+ of the container. Default: `size_type<std::size_t>`
+
+And they also can receive an additional option:
+
+* [*`compare<class Compare>`]: Comparison function for the objects to be inserted
+ in containers. The comparison functor must induce a strict weak ordering.
+ Default: `compare< std::less<T> >`
+
+[endsect]
+
+[section:set_multiset_example Example]
+
+Now let's see a small example using both hooks and both containers:
+
+[import ../example/doc_set.cpp]
+[doc_set_code]
+
+[endsect]
+
+[endsect]
+
+[section:unordered_set_unordered_multiset Semi-Intrusive unordered associative containers: unordered_set, unordered_multiset]
+
+[*Boost.Intrusive] also offers hashed containers that can be very useful to implement
+fast-lookup containers. These containers
+([classref boost::intrusive::unordered_set unordered_set] and [classref boost::intrusive::unordered_multiset unordered_multiset])
+are semi-intrusive containers: they need additional memory apart from the hook
+stored in the `value_type`. This additional
+memory must be passed in the constructor of the container.
+
+Unlike C++ TR1 unordered associative containers (which are also hashed containers),
+the contents of these semi-intrusive containers are not rehashed to maintain a
+load factor: that would require memory management and intrusive containers don't
+implement any memory management at all. However, the user can request an explicit
+rehashing passing a new bucket array.
+This also offers an additional guarantee over TR1 unordered associative containers:
+[*iterators are not invalidated when inserting an element] in the container.
+
+As with TR1 unordered associative containers, rehashing invalidates iterators,
+changes ordering between elements and changes which buckets elements appear in,
+but does not invalidate pointers or references to elements.
+
+Apart from expected hash and equality function objects, [*Boost.Intrusive] unordered
+associative containers' constructors take an argument specifying an auxiliary
+bucket vector to be used by the container.
+
+[section:unordered_set_unordered_multiset_performance unordered_set and unordered_multiset performance notes]
+
+The size overhead for a hashed container is moderate: 1 pointer per value plus
+a bucket array per container. The size of an element of the bucket array
+is usually one pointer. To obtain a good performance hashed container,
+the bucket length is usually the same as the number of elements that the
+container contains, so a well-balanced hashed container (`bucket_count()` is
+equal to `size()` ) will have an equivalent overhead of two pointers per element.
+
+An empty, non constant-time size [classref boost::intrusive::unordered_set unordered_set] or
+[classref boost::intrusive::unordered_multiset unordered_multiset]
+has also the size of `bucket_count()` pointers.
+
+Insertions, erasures, and searches, have amortized constant-time complexity in
+hashed containers. However, some worst-case guarantees are linear. See
+[classref boost::intrusive::unordered_set unordered_set] or
+[classref boost::intrusive::unordered_multiset unordered_multiset] for complexity guarantees
+of each operation.
+
+[*Be careful with non constant-time size hashed containers]: some operations, like
+`empty()`, have linear complexity, unlike other [*Boost.Intrusive] containers.
+
+[endsect]
+
+[section:unordered_set_unordered_multiset_hooks unordered_set and unordered_multiset hooks]
+
+[classref boost::intrusive::unordered_set unordered_set] and [classref boost::intrusive::unordered_multiset unordered_multiset] share the same hooks. This is an advantage, because the same
+user type can be inserted first in a [classref boost::intrusive::unordered_multiset unordered_multiset] and after that in [classref boost::intrusive::unordered_set unordered_set] without
+changing the definition of the user class.
+
+[c++]
+
+ template <class ...Options>
+ class unordered_set_base_hook;
+
+* [classref boost::intrusive::unordered_set_base_hook unordered_set_base_hook]:
+ the user class derives publicly from
+ [classref boost::intrusive::unordered_set_base_hook unordered_set_base_hook] to make
+ it [classref boost::intrusive::unordered_set unordered_set]/[classref boost::intrusive::unordered_multiset unordered_multiset]-compatible.
+
+[c++]
+
+ template <class ...Options>
+ class unordered_set_member_hook;
+
+* [classref boost::intrusive::unordered_set_member_hook unordered_set_member_hook]:
+ the user class contains a public
+ [classref boost::intrusive::unordered_set_member_hook unordered_set_member_hook] to make
+ it [classref boost::intrusive::unordered_set unordered_set]/[classref boost::intrusive::unordered_multiset unordered_multiset]-compatible.
+
+[classref boost::intrusive::unordered_set_base_hook unordered_set_base_hook] and
+[classref boost::intrusive::unordered_set_member_hook unordered_set_member_hook] receive
+the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one base hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+Apart from them, these hooks offer additional options:
+
+* [*`store_hash<bool Enabled>`]: This option reserves additional space in
+ the hook to store the hash value of the object once it's introduced in the
+ container. When this option is used, the unordered container will store
+ the calculated hash value in the hook and rehashing operations won't need
+ to recalculate the hash of the value.
+ This option will improve the performance of unordered containers when
+ rehashing is frequent or hashing the value is a slow operation.
+ Default: `store_hash<false>`.
+
+* [*`optimize_multikey<bool Enabled>`]: This option reserves additional space in
+ the hook that will be used to group equal elements in unordered multisets,
+ improving significantly the performance when many equal values are inserted
+ in these containers. Default: `optimize_multikey<false>`.
+
+[endsect]
+
+[section:unordered_set_unordered_multiset_containers unordered_set and unordered_multiset containers]
+
+[c++]
+
+ template<class T, class ...Options>
+ class unordered_set;
+
+ template<class T, class ...Options>
+ class unordered_multiset;
+
+As mentioned, unordered containers need an auxiliary array to work. [*Boost.Intrusive]
+unordered containers receive this auxiliary array packed in a type called `bucket_traits`
+(which can be also customized by a container option). All unordered containers receive
+a `bucket_traits` object in their constructors. The default `bucket_traits` class
+is initialized with a pointer to an array of buckets and its size:
+
+[c++]
+
+ #include <boost/intrusive/unordered_set.hpp>
+
+ using namespace boost::intrusive;
+
+ struct MyClass : public unordered_set_base_hook<>
+ {};
+
+ typedef unordered_set<MyClass>::bucket_type bucket_type;
+ typedef unordered_set<MyClass>::bucket_traits bucket_traits;
+
+ int main()
+ {
+ bucket_type buckets[100];
+ unordered_set<MyClass> uset(bucket_traits(buckets, 100));
+ return 0;
+ }
+
+Each hashed container needs [*its own bucket traits], that is, [*its own
+bucket vector]. Two hashed containers
+[*can't] share the same `bucket_type` elements. The bucket array [*must] be
+destroyed [*after] the container using it is destroyed, otherwise, the result
+is undefined.
+
+[classref boost::intrusive::unordered_set unordered_set] and
+[classref boost::intrusive::unordered_multiset unordered_multiset]
+receive the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
+
+* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
+ Default: `constant_time_size<true>`
+
+* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
+ of the container. Default: `size_type<std::size_t>`
+
+And they also can receive additional options:
+
+* [*`equal<class Equal>`]: Equality function for the objects to be inserted
+ in containers. Default: `equal< std::equal_to<T> >`
+
+* [*`hash<class Hash>`]: Hash function to be used in the container.
+ Default: `hash< boost::hash<T> >`
+
+* [*`bucket_traits<class BucketTraits>`]: A type that wraps the bucket vector to
+ be used by the unordered container. Default: a type initialized by the address
+ and size of a bucket array and stores both variables internally.
+
+* [*`power_2_buckets<bool Enabled>`]: The user guarantees that only bucket arrays
+ with power of two length will be used. The container will then use masks instead of modulo
+ operations to obtain the bucket number from the hash value. Masks are faster than
+ modulo operations and for some applications modulo operations can impose
+ a considerable overhead. In debug mode an assertion will be raised if the user
+ provides a bucket length that is not power of two.
+ Default: `power_2_buckets<false>`.
+
+* [*`cache_begin<bool Enabled>`]:
+ [*Note: this option is not compatible with `auto_unlink` hooks].
+ Due to its internal structure, finding the first
+ element of an unordered container (`begin()` operation) is
+ amortized constant-time. It's possible to speed up `begin()` and other operations
+ related to it (like `clear()`) if the container caches internally the position
+ of the first element. This imposes the overhead of one pointer to the size
+ of the container. Default: `cache_begin<false>`.
+
+* [*`compare_hash<bool Enabled>`]:
+ [*Note: this option requires `store_hash<true>` option in the hook].
+ When the comparison function is expensive,
+ (e.g. strings with a long common predicate) sometimes (specially when the
+ load factor is high or we have many equivalent elements in an
+ [classref boost::intrusive::unordered_multiset unordered_multiset] and
+ no `optimize_multikey<>` is activated in the hook)
+ the equality function is a performance problem. Two equal values must have
+ equal hashes, so comparing the hash values of two elements before using the
+ comparison functor can speed up some implementations.
+
+* [*`incremental<bool Enabled>`]: Activates incremental hashing (also known as Linear Hashing).
+ This option implies `power_2_buckets<true>` and the container will require power of two buckets.
+ For more information on incremental hashing, see
+ [@http://en.wikipedia.org/wiki/Linear_hashing `Linear hash` on Wikipedia]
+ Default: `incremental<false>`
+
+[endsect]
+
+[section:unordered_set_unordered_multiset_example Example]
+
+Now let's see a small example using both hooks and both containers:
+
+[import ../example/doc_unordered_set.cpp]
+[doc_unordered_set_code]
+
+[endsect]
+
+[section:custom_bucket_traits Custom bucket traits]
+
+Instead of using the default `bucket_traits` class to store the bucket array, a user
+can define his own class to store the bucket array using the [*['bucket_traits<>]]
+option. A user-defined bucket-traits must fulfill the following interface:
+
+[c++]
+
+ class my_bucket_traits
+ {
+ bucket_ptr bucket_begin();
+ const_bucket_ptr bucket_begin() const;
+ std::size_t bucket_count() const;
+ };
+
+
+The following bucket traits just stores a pointer to the bucket
+array but the size is a compile-time constant. Note the use of the auxiliary
+[classref boost::intrusive::unordered_bucket unordered_bucket] and
+[classref boost::intrusive::unordered_bucket_ptr unordered_bucket_ptr]
+utilities to obtain the type of the bucket and its pointer before defining
+the unordered container:
+
+[import ../example/doc_bucket_traits.cpp]
+[doc_bucket_traits]
+
+[endsect]
+
+[endsect]
+
+[section:splay_set_multiset Intrusive splay tree based associative containers: splay_set, splay_multiset and , splay_tree]
+
+C++ associative containers are usually based on red-black tree implementations (e.g.: STL,
+Boost.Intrusive associative containers). However, there are other interesting data
+structures that offer some advantages (and also disadvantages).
+
+Splay trees are self-adjusting binary search trees used typically in caches, memory
+allocators and other applications, because splay trees have a "caching effect": recently
+accessed elements have better access times than elements accessed less frequently.
+For more information on splay trees see [@http://en.wikipedia.org/wiki/Splay_tree Wikipedia entry].
+
+[*Boost.Intrusive] offers 3 containers based on splay trees:
+[classref boost::intrusive::splay_set splay_set],
+[classref boost::intrusive::splay_multiset splay_multiset] and
+[classref boost::intrusive::splaytree splaytree]. The first two are similar to
+[classref boost::intrusive::set set] or
+[classref boost::intrusive::multiset multiset] and the latter is a generalization
+that offers functions both to insert unique and multiple keys.
+
+The memory overhead of these containers with Boost.Intrusive hooks is usually 3 pointers.
+An empty, non constant-time size splay container has also a size of 3 pointers.
+
+[section:splay_set_multiset_disadvantages Advantages and disadvantages of splay tree based containers]
+
+Splay tree based intrusive containers have logarithmic complexity in many
+operations like searches, insertions, erasures, etc., but if some elements are
+more frequently accessed than others, splay trees perform faster searches than equivalent
+balanced binary trees (such as red-black trees).
+
+The caching effect offered by splay trees comes with a cost: the tree must be
+rebalanced when an element is searched. This disallows const versions of search
+functions like `find()`, `lower_bound()`, `upper_bound()`, `equal_range()`,
+`count()`, etc.
+
+Because of this, splay-tree based associative containers are not drop-in
+replacements of [classref boost::intrusive::set set]/
+[classref boost::intrusive::multiset multiset].
+
+Apart from this, if element searches are randomized, the tree will be rebalanced
+without taking advantage of the cache effect, so splay trees can offer worse
+performance than other balanced trees for some search patterns.
+
+[endsect]
+
+[section:splay_set_multiset_hooks splay_set, splay_multiset and splaytree hooks]
+
+[classref boost::intrusive::splay_set splay_set],
+[classref boost::intrusive::splay_multiset splay_multiset] and
+[classref boost::intrusive::splaytree splaytree]
+share the same hooks.
+
+[c++]
+
+ template <class ...Options>
+ class splay_set_base_hook;
+
+* [classref boost::intrusive::splay_set_base_hook splay_set_base_hook]:
+ the user class derives publicly from this class to make
+ it compatible with splay tree based containers.
+
+[c++]
+
+ template <class ...Options>
+ class splay_set_member_hook;
+
+* [classref boost::intrusive::set_member_hook set_member_hook]:
+ the user class contains a public member of this class to make
+ it compatible with splay tree based containers.
+
+[classref boost::intrusive::splay_set_base_hook splay_set_base_hook] and
+[classref boost::intrusive::splay_set_member_hook splay_set_member_hook] receive
+the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one base hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+[endsect]
+
+[section:set_multiset_containers splay_set, splay_multiset and splaytree containers]
+
+[c++]
+
+ template <class T, class ...Options>
+ class splay_set;
+
+ template <class T, class ...Options>
+ class splay_multiset;
+
+ template <class T, class ...Options>
+ class splaytree;
+
+These containers receive the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
+
+* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
+ Default: `constant_time_size<true>`
+
+* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
+ of the container. Default: `size_type<std::size_t>`
+
+And they also can receive an additional option:
+
+* [*`compare<class Compare>`]: Comparison function for the objects to be inserted
+ in containers. The comparison functor must induce a strict weak ordering.
+ Default: `compare< std::less<T> >`
+
+[endsect]
+
+[section:splay_set_bst_hook Splay trees with BST hooks]
+
+Intrusive splay containers can also use plain binary search tree hooks
+[classref boost::intrusive::bs_set_base_hook bs_set_base_hook] and
+[classref boost::intrusive::bs_set_base_hook bs_set_base_hook].
+These hooks can be used by other intrusive containers like
+intrusive scapegoat containers
+[classref boost::intrusive::sg_set sg_set] and
+[classref boost::intrusive::sg_multiset sg_multiset]. A programmer
+might prefer using a binary search tree hook so that the same type
+can be inserted in some situations in a splay container but
+also inserted in other compatible containers when
+the hook is not being used in a splay container.
+
+[classref boost::intrusive::bs_set_base_hook bs_set_base_hook] and
+[classref boost::intrusive::bs_set_base_hook bs_set_member_hook] admit
+the same options as [classref boost::intrusive::splay_set_base_hook splay_set_base_hook].
+
+[endsect]
+
+[section:splay_set_multiset_example Example]
+
+Now let's see a small example using both splay hooks,
+binary search tree hooks and
+[classref boost::intrusive::splay_set splay_set]/
+[classref boost::intrusive::splay_multiset splay_multiset]
+containers:
+
+[import ../example/doc_splay_set.cpp]
+[doc_splay_set_code]
+
+[endsect]
+
+[endsect]
+
+[section:avl_set_multiset Intrusive avl tree based associative containers: avl_set, avl_multiset and avltree]
+
+Similar to red-black trees, AVL trees are balanced binary trees.
+AVL trees are often compared with red-black trees because they support the same set of operations
+and because both take O(log n) time for basic operations.
+AVL trees are more rigidly balanced than Red-Black trees, leading to slower insertion and
+removal but faster retrieval, so AVL trees perform better
+than red-black trees for lookup-intensive applications.
+
+[*Boost.Intrusive] offers 3 containers based on avl trees:
+[classref boost::intrusive::avl_set avl_set],
+[classref boost::intrusive::avl_multiset avl_multiset] and
+[classref boost::intrusive::avltree avltree]. The first two are similar to
+[classref boost::intrusive::set set] or
+[classref boost::intrusive::multiset multiset] and the latter is a generalization
+that offers functions both to insert unique and multiple keys.
+
+The memory overhead of these containers with Boost.Intrusive hooks is usually 3
+pointers and 2 bits (due to alignment, this usually means 3 pointers plus an integer).
+This size can be reduced to 3 pointers if pointers have 4 byte alignment
+(which is usually true in 32 bit systems).
+
+An empty, non constant-time size [classref boost::intrusive::avl_set avl_set],
+[classref boost::intrusive::avl_multiset avl_multiset] or
+[classref boost::intrusive::avltree avltree]
+also has a size of 3 pointers and an integer (3 pointers when optimized for size).
+
+[section:avl_set_multiset_hooks avl_set, avl_multiset and avltree hooks]
+
+[classref boost::intrusive::avl_set avl_set],
+[classref boost::intrusive::avl_multiset avl_multiset] and
+[classref boost::intrusive::avltree avltree]
+share the same hooks.
+
+[c++]
+
+ template <class ...Options>
+ class avl_set_base_hook;
+
+* [classref boost::intrusive::avl_set_base_hook avl_set_base_hook]:
+ the user class derives publicly from this class to make
+ it compatible with avl tree based containers.
+
+[c++]
+
+ template <class ...Options>
+ class avl_set_member_hook;
+
+* [classref boost::intrusive::set_member_hook set_member_hook]:
+ the user class contains a public member of this class to make
+ it compatible with avl tree based containers.
+
+[classref boost::intrusive::avl_set_base_hook avl_set_base_hook] and
+[classref boost::intrusive::avl_set_member_hook avl_set_member_hook] receive
+the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive] plus an option to optimize
+the size of the node:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one base hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+* [*`optimize_size<bool Enable>`]: The hook will be optimized for size
+ instead of speed. The hook will embed the balance bits of the AVL
+ tree node in the parent pointer if pointer alignment is multiple of 4.
+ In some platforms, optimizing the size might reduce speed performance a bit
+ since masking operations will be needed to access parent pointer and balance factor attributes,
+ in other platforms this option improves performance due to improved memory locality.
+ Default: `optimize_size<false>`.
+
+[endsect]
+
+[section:set_multiset_containers avl_set, avl_multiset and avltree containers]
+
+[c++]
+
+ template <class T, class ...Options>
+ class avl_set;
+
+ template <class T, class ...Options>
+ class avl_multiset;
+
+ template <class T, class ...Options>
+ class avltree;
+
+These containers receive the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
+
+* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
+ Default: `constant_time_size<true>`
+
+* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
+ of the container. Default: `size_type<std::size_t>`
+
+And they also can receive an additional option:
+
+* [*`compare<class Compare>`]: Comparison function for the objects to be inserted
+ in containers. The comparison functor must induce a strict weak ordering.
+ Default: `compare< std::less<T> >`
+
+[endsect]
+
+[section:avl_set_multiset_example Example]
+
+Now let's see a small example using both hooks and
+[classref boost::intrusive::avl_set avl_set]/
+[classref boost::intrusive::avl_multiset avl_multiset]
+containers:
+
+[import ../example/doc_avl_set.cpp]
+[doc_avl_set_code]
+
+[endsect]
+
+[endsect]
+
+
+[section:sg_set_multiset Intrusive scapegoat tree based associative containers: sg_set, sg_multiset and sgtree]
+
+A scapegoat tree is a self-balancing binary search tree, that provides worst-case O(log n)
+lookup time, and O(log n) amortized insertion and deletion time.
+Unlike other self-balancing binary search trees that provide worst case O(log n) lookup
+time, scapegoat trees have no additional per-node overhead compared to a regular binary
+search tree.
+
+A binary search tree is said to be weight balanced if half the nodes are on the left
+of the root, and half on the right. An a-height-balanced tree is defined with defined
+with the following equation:
+
+[*['height(tree) <= log1/a(tree.size())]]
+
+* [*['a == 1]]: A tree forming a linked list is considered balanced.
+* [*['a == 0.5]]: Only a perfectly balanced binary is considered balanced.
+
+Scapegoat trees are loosely ['a-height-balanced] so:
+
+[*['height(tree) <= log1/a(tree.size()) + 1]]
+
+Scapegoat trees support any a between 0.5 and 1. If a is higher, the tree is rebalanced
+less often, obtaining quicker insertions but slower searches. Lower
+a values improve search times. Scapegoat-trees implemented in [*Boost.Intrusive] offer the possibility of
+[*changing a at run-time] taking advantage of the flexibility of scapegoat trees.
+For more information on scapegoat trees see [@http://en.wikipedia.org/wiki/Scapegoat_tree Wikipedia entry].
+
+Scapegoat trees also have downsides:
+
+* They need additional storage of data on the
+ root (the size of the tree, for example) to achieve logarithmic complexity operations
+ so it's not possible to offer `auto_unlink` hooks. The size of an empty scapegoat
+ tree is also considerably increased.
+
+* The operations needed to determine if the tree is unbalanced require floating-point
+ operations like ['log1/a]. If the system has no floating point operations (like some
+ embedded systems), scapegoat tree operations might become slow.
+
+[*Boost.Intrusive] offers 3 containers based on scapegoat trees:
+[classref boost::intrusive::sg_set sg_set],
+[classref boost::intrusive::sg_multiset sg_multiset] and
+[classref boost::intrusive::sgtree sgtree]. The first two are similar to
+[classref boost::intrusive::set set] or
+[classref boost::intrusive::multiset multiset] and the latter is a generalization
+that offers functions both to insert unique and multiple keys.
+
+The memory overhead of these containers with Boost.Intrusive hooks is 3
+pointers.
+
+An empty, [classref boost::intrusive::sg_set sg_set],
+[classref boost::intrusive::sg_multiset sg_multiset] or
+[classref boost::intrusive::sgtree sgtree]
+has also the size of 3 pointers, two integers and two floating point values
+(equivalent to the size of 7 pointers on most systems).
+
+[section:sg_set_multiset_hooks Using binary search tree hooks: bs_set_base_hook and bs_set_member_hook]
+
+[classref boost::intrusive::sg_set sg_set],
+[classref boost::intrusive::sg_multiset sg_multiset] and
+[classref boost::intrusive::sgtree sgtree] don't use their
+own hooks but plain binary search tree hooks. This has many advantages
+since binary search tree hooks can also be used to insert values in
+splay and treap containers.
+
+[c++]
+
+ template <class ...Options>
+ class bs_set_base_hook;
+
+* [classref boost::intrusive::bs_set_base_hook bs_set_base_hook]:
+ the user class derives publicly from this class to make
+ it compatible with scapegoat tree based containers.
+
+[c++]
+
+ template <class ...Options>
+ class bs_set_member_hook;
+
+* [classref boost::intrusive::set_member_hook set_member_hook]:
+ the user class contains a public member of this class to make
+ it compatible with scapegoat tree based containers.
+
+[classref boost::intrusive::bs_set_base_hook bs_set_base_hook] and
+[classref boost::intrusive::bs_set_member_hook bs_set_member_hook] receive
+the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one base hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+[endsect]
+
+[section:sg_set_multiset_containers sg_set, sg_multiset and sgtree containers]
+
+[c++]
+
+ template <class T, class ...Options>
+ class sg_set;
+
+ template <class T, class ...Options>
+ class sg_multiset;
+
+ template <class T, class ...Options>
+ class sgtree;
+
+These containers receive the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
+
+* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
+ of the container. Default: `size_type<std::size_t>`
+
+And they also can receive additional options:
+
+* [*`compare<class Compare>`]: Comparison function for the objects to be inserted
+ in containers. The comparison functor must induce a strict weak ordering.
+ Default: `compare< std::less<T> >`
+
+* [*`floating_point<bool Enable>`]:
+ When this option is deactivated, the scapegoat tree loses the ability to change
+ the balance factor a at run-time, but the size of an empty container is reduced
+ and no floating point operations are performed, normally increasing container
+ performance. The fixed a factor that is used when this option is activated
+ is ['1/sqrt(2) ~ 0,70711]. Default: `floating_point<true>`
+
+[endsect]
+
+[section:sg_set_multiset_example Example]
+
+Now let's see a small example using both hooks and
+[classref boost::intrusive::sg_set sg_set]/
+[classref boost::intrusive::sg_multiset sg_multiset]
+containers:
+
+[import ../example/doc_sg_set.cpp]
+[doc_sg_set_code]
+
+[endsect]
+
+[endsect]
+
+
+[section:treap_set_multiset Intrusive treap based associative containers: treap_set, treap_multiset and treap]
+
+The name ['treap] is a mixture of ['tree] and ['heap] indicating that Treaps exhibit the properties of both
+binary search trees and heaps. A treap is a binary search tree that orders the nodes
+by a key but also by a priority attribute. The nodes are ordered so that the keys form a binary search tree and
+the priorities obey the max heap order property.
+
+* If v is a left descendant of u, then key[v] < key[u];
+* If v is a right descendant of u, then key[v] > key[u];
+* If v is a child of u, then priority[v] <= priority[u];
+
+If priorities are non-random, the tree will usually be unbalanced; this worse theoretical average-case
+behavior may be outweighed by better expected-case behavior, as the most important items will be near the root.
+This means most important objects will be retrieved faster than less important items and for items keys with equal keys
+most important objects will be found first. These properties are important for some applications.
+
+The priority comparison will be provided just like the key comparison, via a function object that will be
+stored in the intrusive container. This means that the priority can be stored in the value to be introduced
+in the treap or computed on flight (via hashing or similar).
+
+[*Boost.Intrusive] offers 3 containers based on treaps:
+[classref boost::intrusive::treap_set treap_set],
+[classref boost::intrusive::treap_multiset treap_multiset] and
+[classref boost::intrusive::treap treap]. The first two are similar to
+[classref boost::intrusive::set set] or
+[classref boost::intrusive::multiset multiset] and the latter is a generalization
+that offers functions both to insert unique and multiple keys.
+
+The memory overhead of these containers with Boost.Intrusive hooks is 3
+pointers.
+
+An empty, [classref boost::intrusive::treap_set treap_set],
+[classref boost::intrusive::treap_multiset treap_multiset] or
+[classref boost::intrusive::treap treap]
+has also the size of 3 pointers and an integer (supposing empty function objects for key and priority
+comparison and constant-time size).
+
+[section:treap_set_multiset_hooks Using binary search tree hooks: bs_set_base_hook and bs_set_member_hook]
+
+[classref boost::intrusive::treap_set treap_set],
+[classref boost::intrusive::treap_multiset treap_multiset] and
+[classref boost::intrusive::treap treap] don't use their
+own hooks but plain binary search tree hooks. This has many advantages
+since binary search tree hooks can also be used to insert values in
+splay containers and scapegoat trees.
+
+[c++]
+
+ template <class ...Options>
+ class bs_set_base_hook;
+
+* [classref boost::intrusive::bs_set_base_hook bs_set_base_hook]:
+ the user class derives publicly from this class to make
+ it compatible with scapegoat tree based containers.
+
+[c++]
+
+ template <class ...Options>
+ class bs_set_member_hook;
+
+* [classref boost::intrusive::set_member_hook set_member_hook]:
+ the user class contains a public member of this class to make
+ it compatible with scapegoat tree based containers.
+
+[classref boost::intrusive::bs_set_base_hook bs_set_base_hook] and
+[classref boost::intrusive::bs_set_member_hook bs_set_member_hook] receive
+the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one base hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+[endsect]
+
+[section:treap_set_multiset_containers treap_set, treap_multiset and treap containers]
+
+[c++]
+
+ template <class T, class ...Options>
+ class treap_set;
+
+ template <class T, class ...Options>
+ class treap_multiset;
+
+ template <class T, class ...Options>
+ class treap;
+
+These containers receive the same options explained in the section
+[link intrusive.usage How to use Boost.Intrusive]:
+
+* [*`base_hook<class Hook>`] / [*`member_hook<class T, class Hook, Hook T::* PtrToMember>`] /
+ [*`value_traits<class ValueTraits>`]: To specify the hook type or value traits used
+ to configure the container. (To learn about value traits go to the section
+ [link intrusive.value_traits Containers with custom ValueTraits].)
+
+* [*`constant_time_size<bool Enabled>`]: To activate the constant-time `size()` operation.
+ Default: `constant_time_size<true>`
+
+* [*`size_type<bool Enabled>`]: To specify the type that will be used to store the size
+ of the container. Default: `size_type<std::size_t>`
+
+And they also can receive additional options:
+
+* [*`compare<class Compare>`]: Comparison function for the objects to be inserted
+ in containers. The comparison functor must induce a strict weak ordering.
+ Default: `compare< std::less<T> >`
+
+* [*`priority<class PriorityCompare>`]: Priority Comparison function for the objects to be inserted
+ in containers. The comparison functor must induce a strict weak ordering.
+ Default: `priority< priority_compare<T> >`
+
+The default `priority_compare<T>` object function will call an unqualified function `priority_order`
+passing two constant `T` references as arguments and should return true if the first argument has
+higher priority (it will be searched faster), inducing strict weak ordering.
+The function will be found using ADL lookup so that
+the user just needs to define a `priority_order` function in the same namespace as his class:
+
+[c++]
+
+ struct MyType
+ {
+ friend bool priority_order(const MyType &a, const MyType &b)
+ {...}
+ };
+
+or
+
+ namespace mytype {
+
+ struct MyType{ ... };
+
+ bool priority_order(const MyType &a, const MyType &b)
+ {...}
+
+ } //namespace mytype {
+
+[endsect]
+
+[section:treap_set_exceptions Exception safety of treap-based intrusive containers]
+
+In general, intrusive containers offer strong safety guarantees, but treap containers must deal
+with two possibly throwing functors (one for value ordering, another for priority ordering).
+Moreover, treap erasure operations require rotations based on the priority order function and
+this issue degrades usual `erase(const_iterator)` no-throw guarantee. However, intrusive offers
+the strongest possible behaviour in these situations. In summary:
+
+* If the priority order functor does not throw, treap-based containers, offer exactly the same
+ guarantees as other tree-based containers.
+
+* If the priority order functor throws, treap-based containers offer strong guarantee.
+
+[endsect]
+
+[section:treap_set_multiset_example Example]
+
+Now let's see a small example using both hooks and
+[classref boost::intrusive::treap_set treap_set]/
+[classref boost::intrusive::treap_multiset treap_multiset]
+containers:
+
+[import ../example/doc_treap_set.cpp]
+[doc_treap_set_code]
+
+[endsect]
+
+[endsect]
+
+
+[section:advanced_lookups_insertions Advanced lookup and insertion functions for associative containers]
+
+[section:advanced_lookups Advanced lookups]
+
+[*Boost.Intrusive] associative containers offer the same interface as STL associative
+containers. However, STL and TR1 ordered and unordered simple associative containers
+(`std::set`, `std::multiset`, `std::tr1::unordered_set` and `std::tr1::unordered_multiset`)
+have some inefficiencies caused by the interface: the user can only operate with `value_type`
+objects. When using these containers we must use `iterator find(const value_type &value)`
+to find a value. The same happens in other functions
+like `equal_range`, `lower_bound`, `upper_bound`, etc.
+
+However, sometimes the object to be searched is quite expensive to construct:
+
+[import ../example/doc_assoc_optimized_code.cpp]
+[doc_assoc_optimized_code_normal_find]
+
+`Expensive` is an expensive object to construct. If "key" c-string is quite long
+`Expensive` has to construct a `std::string` using heap memory. Like
+`Expensive`, many times the only member taking part in ordering issues is just
+a small part of the class. For example, with `Expensive`, only the internal
+`std::string` is needed to compare the object.
+
+In both containers, if we call `get_from_set/get_from_unordered_set` in a loop, we might get a performance penalty,
+because we are forced to create a whole `Expensive` object to be able to find an
+equivalent one.
+
+Sometimes this interface limitation is severe, because
+we [*might not have enough information to construct the object] but we might
+[*have enough information to find the object]. In this case, a name is enough
+to search `Expensive` in the container but constructing an `Expensive`
+might require more information that the user might not have.
+
+To solve this, [classref boost::intrusive::set set]/[classref boost::intrusive::multiset multiset]
+offer alternative functions, which take any type comparable with the value and a
+functor that should be compatible with the
+ordering function of the associative container.
+[classref boost::intrusive::unordered_set unordered_set]/[classref boost::intrusive::unordered_multiset unordered_multiset]
+offers functions that take any key type and compatible hash and equality functions. Now, let's see the
+optimized search function:
+
+[doc_assoc_optimized_code_optimized_find]
+
+This new arbitrary key overload is also available for other functions taking
+values as arguments:
+
+* equal_range
+* lower_bound
+* upper_bound
+* count
+* find
+* erase
+
+Check [classref boost::intrusive::set set],
+[classref boost::intrusive::multiset multiset],
+[classref boost::intrusive::unordered_set unordered_set],
+[classref boost::intrusive::unordered_multiset unordered_multiset]
+references to know more about those functions.
+
+[endsect]
+
+[section:advanced_insertions Advanced insertions]
+
+A similar issue happens with insertions in simple ordered and unordered associative
+containers with unique keys (`std::set` and `std::tr1::unordered_set`). In these containers,
+if a value is already present, the value to be inserted is discarded. With expensive
+values, if the value is already present, we can suffer efficiency problems.
+
+[classref boost::intrusive::set set] and [classref boost::intrusive::unordered_set unordered_set]
+have insertion functions to check efficiently, without
+constructing the value, if a value is present or not and if it's not present, a
+function to insert it immediately without any further lookup.
+For example, using the same `Expensive` class,
+this function can be inefficient:
+
+[doc_assoc_optimized_code_normal_insert]
+
+If the object is already present, we are constructing an `Expensive` that
+will be discarded, and this is a waste of resources. Instead of that, let's use
+`insert_check` and `insert_commit` functions:
+
+[doc_assoc_optimized_code_optimized_insert]
+
+`insert_check` is similar to a normal `insert` but:
+
+* `insert_check` can be used with arbitrary keys
+* if the insertion is possible (there is no equivalent value) `insert_check` collects all the needed information
+in an `insert_commit_data` structure, so that `insert_commit`:
+ * [*does not execute] further comparisons
+ * can be executed with [*constant-time complexity]
+ * has [*no-throw guarantee].
+
+These functions must be used with care, since
+no other insertion or erasure must be executed between an `insert_check` and an `insert_commit`
+pair. Otherwise, the behaviour is undefined.
+`insert_check` and `insert_commit` will come in handy
+for developers programming efficient non-intrusive associative containers.
+See [classref boost::intrusive::set set]
+and [classref boost::intrusive::unordered_set unordered_set] reference for more information about
+`insert_check` and `insert_commit`.
+
+With multiple ordered and unordered associative containers
+([classref boost::intrusive::multiset multiset] and
+[classref boost::intrusive::unordered_multiset unordered_multiset]) there is
+no need for these advanced insertion functions, since insertions are always successful.
+
+[endsect]
+
+[section:positional_insertions Positional insertions]
+
+Some ordered associative containers offer low-level functions to bypass ordering
+checks and insert nodes directly in desired tree positions. These functions are
+provided for performance reasons when values to be inserted in the container are
+known to fulfill order (sets and multisets) and uniqueness (sets) invariants. A
+typical usage of these functions is when intrusive associative containers are used
+to build non-intrusive containers and the programmer wants to speed up assignments
+from other associative containers: if the ordering and uniqueness properties are the same,
+there is no need to waste time checking the position of each source value, because values
+are already ordered: back insertions will be much more efficient.
+
+[*Note:] These functions [*don't check preconditions] so they must used with care. These
+are functions are low-level operations [*will break container invariants if
+ordering and uniqueness preconditions are not assured by the caller.]
+
+Let's see an example:
+
+[import ../example/doc_positional_insertion.cpp]
+[doc_positional_insertion]
+
+
+[endsect]
+
+For more information about advanced lookup and insertion functions see
+associative containers' documentation (e.g.
+[classref boost::intrusive::set set],
+[classref boost::intrusive::multiset multiset],
+[classref boost::intrusive::unordered_set unordered_set] and
+[classref boost::intrusive::unordered_multiset unordered_multiset] references).
+
+[endsect]
+
+[section:erasing_and_disposing Erasing and disposing values from Boost.Intrusive containers]
+
+One of the most tedious tasks when using intrusive containers is the management of the erased elements.
+When using STL containers, the container itself unlinks and destroys the contained elements, but with
+intrusive containers, the user must explicitly destroy the object after erasing an element from the container.
+This makes STL-like functions erasing multiple objects unhelpful: the user can't destroy every erased element.
+For example, let's take the function `remove_if` from [classref boost::intrusive::list list]:
+
+[c++]
+
+ template<class Pred>
+ void remove_if(Pred pred);
+
+How can the user destroy the elements (say, using `operator delete`) that will be erased according
+to the predicate? [*Boost.Intrusive] containers offer additional functions that take a function
+object that will be called after the element has been erased from the container. For example,
+[classref boost::intrusive::list list] offers:
+
+[c++]
+
+ template<class Pred, class Disposer>
+ void remove_and_dispose_if(Pred pred, Disposer disposer)
+
+With this function the user can efficiently remove and destroy elements if the disposer
+function destroys an object: `remove_and_dispose_if`
+will call the "disposer" function object for every removed element. [classref boost::intrusive::list list] offers
+more functions taking a disposer function object as argument, like `erase_and_dispose`, `clear_and_dispose`,
+`remove_and_dispose`, etc.
+
+Note that the disposing function does not need to just destroy the object. It can
+implement any other operation like inserting the remove object in another container.
+Let's see a small example:
+
+[import ../example/doc_erasing_and_disposing.cpp]
+[doc_erasing_and_disposing]
+
+All [*Boost.Intrusive] containers offer these "erase + dispose" additional members for all functions
+that erase an element from the container.
+
+
+
+[endsect]
+
+[section:clone_from Cloning [*Boost.Intrusive] containers]
+
+As previously mentioned, [*Boost.Intrusive] containers are [*non-copyable and non-assignable], because
+intrusive containers don't allocate memory at all. To implement a copy-constructor or assignment operator,
+the user must clone one by one all the elements of the container and insert them in another intrusive container.
+However, cloning by hand is usually more inefficient than a member cloning function and a specialized cloning
+function can offer more guarantees than the manual cloning (better exception safety guarantees, for example).
+
+To ease the implementation of copy constructors and assignment operators of classes containing [*Boost.Intrusive]
+containers, all [*Boost.Intrusive] containers offer a special cloning function called `clone_from`.
+
+Apart from the container to be cloned, `clone_from` takes two function objects as arguments. For example, consider the
+`clone_from` member function of [classref boost::intrusive::list list]:
+
+[c++]
+
+ template <class Cloner, class Disposer>
+ void clone_from(const list &src, Cloner cloner, Disposer disposer);
+
+This function will make `*this` a clone of `src`. Let's explain the arguments:
+
+* The first parameter is the list to be cloned.
+* The second parameter is a function object that will clone `value_type` objects and
+ return a pointer to the clone. It must implement the following function:
+ `pointer operator()(const value_type &)`.
+* The second parameter is a function object that will dispose `value_type` objects. It's used first
+ to empty the container before cloning and to dispose the elements if an exception is thrown.
+
+The cloning function works as follows:
+
+* First it clears and disposes all the elements from *this using the disposer function object.
+* After that it starts cloning all the elements of the source container using the cloner function object.
+* If any operation in the cloning function (for example, the cloner function object) throws,
+ all the constructed elements are disposed using the disposer function object.
+
+
+Here is an example of `clone_from`:
+
+[import ../example/doc_clone_from.cpp]
+[doc_clone_from]
+
+[endsect]
+
+[section:using_smart_pointers Using smart pointers with Boost.Intrusive containers]
+
+[*Boost.Intrusive] hooks can be configured to use other pointers than raw pointers.
+When a [*Boost.Intrusive] hook is configured with a smart pointer as an argument,
+this pointer configuration is passed to the containers. For example, if the following
+hook is configured with a smart pointer (for example, an offset pointer from
+[*Boost.Interprocess]):
+
+[import ../example/doc_offset_ptr.cpp]
+[doc_offset_ptr_0]
+
+Any intrusive list constructed using this hook will be ready for shared memory,
+because the intrusive list will also use offset pointers internally. For example,
+we can create an intrusive list in shared memory combining [*Boost.Interprocess]
+and [*Boost.Intrusive]:
+
+[doc_offset_ptr_1]
+
+[section:smart_pointers_requirements Requirements for smart pointers compatible with Boost.Intrusive]
+
+Not every smart pointer is compatible with [*Boost.Intrusive]; the smart pointer must
+have the following features:
+
+* It must support the same operations as a raw pointer, except casting.
+* It must be convertible to a raw pointer and constructible from a raw pointer.
+* It must have the same ownership semantics as a raw pointer. This means that
+ resource management smart pointers (like `boost::shared_ptr`) can't be used.
+
+The conversion from the smart pointer to a raw pointer must be implemented following
+Boost smart pointer `detail::get_pointer()` function. This function will be found using
+ADL. For example, for `boost::interprocess::offset_ptr`, `detail::get_pointer` is defined
+as follows:
+
+[c++]
+
+ template<class T>
+ T * detail::get_pointer(boost::interprocess::offset_ptr<T> const & p)
+ { return p.get(); }
+
+[endsect]
+
+[endsect]
+
+[section:obtaining_iterators_from_values Obtaining iterators from values]
+
+[*Boost.Intrusive] offers another useful feature that's not present in STL
+containers: it's possible to obtain an iterator to a value from the value itself.
+This feature is implemented in [*Boost.Intrusive] containers by a
+function called `iterator_to`:
+
+[c++]
+
+ iterator iterator_to(reference value);
+ const_iterator iterator_to(const_reference value);
+
+For [*Boost.Intrusive] containers that have local iterators, like unordered
+associative containers, we can also obtain local iterators:
+
+[c++]
+
+ local_iterator local_iterator_to(reference value);
+ const_local_iterator local_iterator_to(const_reference value) const;
+
+For most [*Boost.Intrusive] containers
+([classref boost::intrusive::list list],
+[classref boost::intrusive::slist slist],
+[classref boost::intrusive::set set],
+[classref boost::intrusive::multiset multiset]) we have an alternative
+static `s_iterator_to` function.
+
+For unordered associative containers
+([classref boost::intrusive::unordered_set unordered_set],
+[classref boost::intrusive::multiset multiset]),
+`iterator_to` has no static alternative function.
+On the other hand, `local_iterator_to` functions
+have their `s_local_iterator_to` static alternatives.
+
+Alternative static functions are available under certain circumstances
+explained in the [link intrusive.value_traits.stateful_value_traits Stateful value traits] section;
+if the programmer uses hooks provided by [*Boost.Intrusive], those functions
+will be available.
+
+Let's see a small function that shows the use of `iterator_to` and
+`local_iterator_to`:
+
+[import ../example/doc_iterator_from_value.cpp]
+[doc_iterator_from_value]
+
+[endsect]
+
+[section:any_hooks Any Hooks: A single hook for any Intrusive container]
+
+Sometimes, a class programmer wants to place a class in several intrusive
+containers but no at the same time. In this case, the programmer might
+decide to insert two hooks in the same class.
+
+[c++]
+
+ class MyClass
+ : public list_base_hook<>, public slist_base_hook<> //...
+ {};
+
+However, there is a more size-efficient alternative in [*Boost.Intrusive]: "any" hooks
+([classref boost::intrusive::any_base_hook any_base_hook] and
+[classref boost::intrusive::any_member_hook any_member_hook]).
+These hooks can be used to store a type in several containers
+offered by [*Boost.Intrusive] minimizing the size of the class.
+
+These hooks support these options:
+
+* [*`tag<class Tag>`] (for base hooks only): This argument serves as a tag,
+ so you can derive from more than one slist hook.
+ Default: `tag<default_tag>`.
+
+* [*`link_mode<link_mode_type LinkMode>`]: The linking policy.
+ `link_mode<auto_unlink>` is [*not] supported and `link_mode<safe_mode>`
+ might offer weaker error detection in any hooks than in other hooks.
+ Default: `link_mode<safe_link>`.
+
+* [*`void_pointer<class VoidPointer>`]: The pointer type to be used
+ internally in the hook and propagated to the container.
+ Default: `void_pointer<void*>`.
+
+`auto_unlink` can't be supported because the hook does not know in which type of
+container might be currently inserted. Additionally, these hooks don't support `unlink()` and
+`swap_nodes()` operations for the same reason.
+
+Here is an example that creates a class with two any hooks, and uses one to insert the
+class in a [classref slist] and the other one in a [classref list].
+
+[import ../example/doc_any_hook.cpp]
+[doc_any_hook]
+
+[endsect]
+
+[section:concepts Concepts explained]
+
+This section will expand the explanation of previously presented basic concepts
+before explaining the customization options of [*Boost.Intrusive].
+
+* [*Node Algorithms]: A set of static functions that implement basic operations
+ on a group of nodes: initialize a node, link_mode_type a node to a group of nodes,
+ unlink a node from another group of nodes, etc. For example, a circular
+ singly linked list is a group of nodes, where each node has a pointer to the
+ next node. [*Node Algorithms] just require a [*NodeTraits]
+ template parameter and they can work with any [*NodeTraits] class that fulfills
+ the needed interface. As an example, here is a class that implements operations7'
+ to manage a group of nodes forming a circular singly linked list:
+
+[c++]
+
+ template<class NodeTraits>
+ struct my_slist_algorithms
+ {
+ typedef typename NodeTraits::node_ptr node_ptr;
+ typedef typename NodeTraits::const_node_ptr const_node_ptr;
+
+ //Get the previous node of "this_node"
+ static node_ptr get_prev_node(node_ptr this_node)
+ {
+ node_ptr p = this_node;
+ while (this_node != NodeTraits::get_next(p))
+ p = NodeTraits::get_next(p);
+ return p;
+ }
+
+ // number of elements in the group of nodes containing "this_node"
+ static std::size_t count(const_node_ptr this_node)
+ {
+ std::size_t result = 0;
+ const_node_ptr p = this_node;
+ do{
+ p = NodeTraits::get_next(p);
+ ++result;
+ } while (p != this_node);
+ return result;
+ }
+
+ // More operations
+ // ...
+ };
+
+* [*Node Traits]: A class that encapsulates the basic information and
+ operations on a node within a group of nodes:
+ the type of the node, a function to obtain the pointer to the next node, etc.
+ [*Node Traits] specify the configuration information [*Node Algorithms]
+ need. Each type of [*Node Algorithm] expects an interface that compatible
+ [*Node Traits] classes must implement.
+ As an example, this is the definition of a [*Node Traits] class that
+ is compatible with the previously presented `my_slist_algorithms`:
+
+[c++]
+
+ struct my_slist_node_traits
+ {
+ //The type of the node
+ struct node
+ {
+ node *next_;
+ };
+
+ typedef node * node_ptr;
+ typedef const node * const_node_ptr;
+
+ //A function to obtain a pointer to the next node
+ static node_ptr get_next(const_node_ptr n)
+ { return n->next_; }
+
+ //A function to set the pointer to the next node
+ static void set_next(node_ptr n, node_ptr next)
+ { n->next_ = next; }
+ };
+
+
+* [*Hook]: A class that the user must add as a base class or as a member to his own
+ class to make that class insertable in an intrusive container. Usually the hook
+ contains a node object that will be used to form the group of nodes:
+ For example, the following class is a [*Hook] that the user can add as a base class,
+ to make the user class compatible with a singly linked list container:
+
+[c++]
+
+ class my_slist_base_hook
+ //This hook contains a node, that will be used
+ //to link the user object in the group of nodes
+ : private my_slist_node_traits::node
+ {
+ typedef my_slist_node_traits::node_ptr node_ptr;
+ typedef my_slist_node_traits::const_node_ptr const_node_ptr;
+
+ //Converts the generic node to the hook
+ static my_slist_base_hook *to_hook_ptr(node_ptr p)
+ { return static_cast<my_slist_base_hook*>(p); }
+
+ //Returns the generic node stored by this hook
+ node_ptr to_node_ptr()
+ { return static_cast<node *const>(this); }
+
+ // More operations
+ // ...
+ };
+
+ //To make MyClass compatible with an intrusive singly linked list
+ //derive our class from the hook.
+ class MyClass
+ : public my_slist_base_hook
+ {
+ void set(int value);
+ int get() const;
+
+ private:
+ int value_;
+ };
+
+* [*Intrusive Container]: A container that offers a STL-like interface to store
+ user objects. An intrusive container can be templatized to store different
+ value types that use different hooks. An intrusive container is also more elaborate
+ than a group of nodes: it can store the number of elements to achieve constant-time
+ size information, it can offer debugging facilities, etc.
+ For example, an [classref boost::intrusive::slist slist] container
+ (intrusive singly linked list) should
+ be able to hold `MyClass` objects that might have decided to store the hook
+ as a base class or as a member. Internally, the container will use [*Node Algorithms]
+ to implement its operations, and an intrusive container is configured using
+ a template parameter called [*ValueTraits]. [*ValueTraits] will contain
+ the information to convert user classes in nodes compatible with [*Node Algorithms].
+ For example, this a possible [classref boost::intrusive::slist slist] implementation:
+
+[c++]
+
+ template<class ValueTraits, ...>
+ class slist
+ {
+ public:
+ typedef typename ValueTraits::value_type value_type;
+
+ //More typedefs and functions
+ // ...
+
+ //Insert the value as the first element of the list
+ void push_front (reference value)
+ {
+ node_ptr to_insert(ValueTraits::to_node_ptr(value));
+ circular_list_algorithms::link_after(to_insert, get_root_node());
+ }
+
+ // More operations
+ // ...
+ };
+
+* [*Semi-Intrusive Container]: A semi-intrusive container is similar to an
+ intrusive container, but apart from the values to be inserted in the container,
+ it needs additional memory (for example, auxiliary arrays or indexes).
+
+* [*Value Traits]: As we can see, to make our classes intrusive-friendly we add
+ a simple hook as a member or base class. The hook contains a generic node
+ that will be inserted in a group of nodes. [*Node Algorithms] just work
+ with nodes and don't know anything about user classes. On the other
+ hand, an intrusive container needs to know how to obtain a node from a user class,
+ and also the inverse operation.
+ So we can define [*ValueTraits] as the glue between user classes and nodes
+ required by [*Node Algorithms].
+ Let's see a possible implementation of a value traits class that glues MyClass
+ and the node stored in the hook:
+
+[c++]
+
+ struct my_slist_derivation_value_traits
+ {
+ public:
+ typedef slist_node_traits node_traits;
+ typedef MyClass value_type;
+ typedef node_traits::node_ptr node_ptr;
+ typedef value_type* pointer;
+ //...
+
+ //Converts user's value to a generic node
+ static node_ptr to_node_ptr(reference value)
+ { return static_cast<slist_base_hook &>(value).to_node_ptr(); }
+
+ //Converts a generic node into user's value
+ static value_type *to_value_ptr(node_traits::node *n)
+ { static_cast<value_type*>(slist_base_hook::to_hook_ptr(n)); }
+
+ // More operations
+ // ...
+ };
+
+[endsect]
+
+[section:node_algorithms Node algorithms with custom NodeTraits]
+
+As explained in the [link intrusive.concepts Concepts] section, [*Boost.Intrusive]
+containers are implemented using node algorithms that work on generic nodes.
+
+Sometimes, the use of intrusive containers is expensive for some environments
+and the programmer might want to avoid all the template instantiations
+related to [*Boost.Intrusive] containers. However, the user can still benefit
+from [*Boost.Intrusive] using the node algorithms, because some of those algorithms,
+like red-black tree algorithms, are not trivial to write.
+
+All node algorithm classes are
+templatized by a `NodeTraits` class. This class encapsulates the needed internal
+type declarations and operations to make a node compatible with node algorithms.
+Each type of node algorithms has its own requirements:
+
+[section:circular_slist_algorithms Intrusive singly linked list algorithms]
+
+These algorithms are static
+members of the [classref boost::intrusive::circular_slist_algorithms circular_slist_algorithms] class:
+
+[c++]
+
+ template<class NodeTraits>
+ struct circular_slist_algorithms;
+
+An empty list is formed by a node whose pointer to the next node points
+to itself. [classref boost::intrusive::circular_slist_algorithms circular_slist_algorithms]
+is configured with a NodeTraits class, which encapsulates
+the information about the node to be manipulated. NodeTraits must support the
+following interface:
+
+[*Typedefs]:
+
+* `node`: The type of the node that forms the circular list
+
+* `node_ptr`: The type of a pointer to a node (usually node*)
+
+* `const_node_ptr`: The type of a pointer to a const node (usually const node*)
+
+[*Static functions]:
+
+* `static node_ptr get_next(const_node_ptr n);`:
+ Returns a pointer to the next node stored in "n".
+
+* `static void set_next(node_ptr n, node_ptr next);`:
+ Sets the pointer to the next node stored in "n" to "next".
+
+Once we have a node traits configuration we can use [*Boost.Intrusive] algorithms
+with our nodes:
+
+[import ../example/doc_slist_algorithms.cpp]
+[doc_slist_algorithms_code]
+
+For a complete list of functions see
+[classref boost::intrusive::circular_slist_algorithms circular_slist_algorithms reference].
+
+[endsect]
+
+[section:circular_list_algorithms Intrusive doubly linked list algorithms]
+
+These algorithms are static
+members of the [classref boost::intrusive::circular_list_algorithms circular_list_algorithms] class:
+
+[c++]
+
+ template<class NodeTraits>
+ struct circular_list_algorithms;
+
+An empty list is formed by a node whose pointer to the next node points
+to itself. [classref boost::intrusive::circular_list_algorithms circular_list_algorithms]
+is configured with a NodeTraits class, which encapsulates
+the information about the node to be manipulated. NodeTraits must support the
+following interface:
+
+[*Typedefs]:
+
+* `node`: The type of the node that forms the circular list
+
+* `node_ptr`: The type of a pointer to a node (usually node*)
+
+* `const_node_ptr`: The type of a pointer to a const node (usually const node*)
+
+[*Static functions]:
+
+* `static node_ptr get_next(const_node_ptr n);`:
+ Returns a pointer to the next node stored in "n".
+
+* `static void set_next(node_ptr n, node_ptr next);`:
+ Sets the pointer to the next node stored in "n" to "next".
+
+* `static node_ptr get_previous(const_node_ptr n);`:
+ Returns a pointer to the previous node stored in "n".
+
+* `static void set_previous(node_ptr n, node_ptr prev);`:
+ Sets the pointer to the previous node stored in "n" to "prev".
+
+Once we have a node traits configuration we can use [*Boost.Intrusive] algorithms
+with our nodes:
+
+[import ../example/doc_list_algorithms.cpp]
+[doc_list_algorithms_code]
+
+For a complete list of functions see
+[classref boost::intrusive::circular_list_algorithms circular_list_algorithms reference].
+
+[endsect]
+
+[section:rbtree_algorithms Intrusive red-black tree algorithms]
+
+These algorithms are static
+members of the [classref boost::intrusive::rbtree_algorithms rbtree_algorithms] class:
+
+[c++]
+
+ template<class NodeTraits>
+ struct rbtree_algorithms;
+
+
+An empty tree is formed by a node whose pointer to the parent node is null,
+the left and right node pointers point to itself, and whose color is red.
+[classref boost::intrusive::rbtree_algorithms rbtree_algorithms]
+is configured with a NodeTraits class, which encapsulates
+the information about the node to be manipulated. NodeTraits must support the
+following interface:
+
+[*Typedefs]:
+
+* `node`: The type of the node that forms the circular rbtree
+
+* `node_ptr`: The type of a pointer to a node (usually node*)
+
+* `const_node_ptr`: The type of a pointer to a const node (usually const node*)
+
+* `color`: The type that can store the color of a node
+
+[*Static functions]:
+
+* `static node_ptr get_parent(const_node_ptr n);`:
+ Returns a pointer to the parent node stored in "n".
+
+* `static void set_parent(node_ptr n, node_ptr p);`:
+ Sets the pointer to the parent node stored in "n" to "p".
+
+* `static node_ptr get_left(const_node_ptr n);`:
+ Returns a pointer to the left node stored in "n".
+
+* `static void set_left(node_ptr n, node_ptr l);`:
+ Sets the pointer to the left node stored in "n" to "l".
+
+* `static node_ptr get_right(const_node_ptr n);`:
+ Returns a pointer to the right node stored in "n".
+
+* `static void set_right(node_ptr n, node_ptr r);`:
+ Sets the pointer to the right node stored in "n" to "r".
+
+* `static color get_color(const_node_ptr n);`:
+ Returns the color stored in "n".
+
+* `static void set_color(node_ptr n, color c);`:
+ Sets the color stored in "n" to "c".
+
+* `static color black();`:
+ Returns a value representing the black color.
+
+* `static color red();`:
+ Returns a value representing the red color.
+
+Once we have a node traits configuration we can use [*Boost.Intrusive] algorithms
+with our nodes:
+
+[import ../example/doc_rbtree_algorithms.cpp]
+[doc_rbtree_algorithms_code]
+
+For a complete list of functions see
+[classref boost::intrusive::rbtree_algorithms rbtree_algorithms reference].
+
+[endsect]
+
+[section:splaytree_algorithms Intrusive splay tree algorithms]
+
+These algorithms are static
+members of the [classref boost::intrusive::splaytree_algorithms splaytree_algorithms] class:
+
+[c++]
+
+ template<class NodeTraits>
+ struct splaytree_algorithms;
+
+
+An empty tree is formed by a node whose pointer to the parent node is null,
+and whose left and right nodes pointers point to itself.
+[classref boost::intrusive::splaytree_algorithms splaytree_algorithms]
+is configured with a NodeTraits class, which encapsulates
+the information about the node to be manipulated. NodeTraits must support the
+following interface:
+
+[*Typedefs]:
+
+* `node`: The type of the node that forms the circular splaytree
+
+* `node_ptr`: The type of a pointer to a node (usually node*)
+
+* `const_node_ptr`: The type of a pointer to a const node (usually const node*)
+
+[*Static functions]:
+
+* `static node_ptr get_parent(const_node_ptr n);`:
+ Returns a pointer to the parent node stored in "n".
+
+* `static void set_parent(node_ptr n, node_ptr p);`:
+ Sets the pointer to the parent node stored in "n" to "p".
+
+* `static node_ptr get_left(const_node_ptr n);`:
+ Returns a pointer to the left node stored in "n".
+
+* `static void set_left(node_ptr n, node_ptr l);`:
+ Sets the pointer to the left node stored in "n" to "l".
+
+* `static node_ptr get_right(const_node_ptr n);`:
+ Returns a pointer to the right node stored in "n".
+
+* `static void set_right(node_ptr n, node_ptr r);`:
+ Sets the pointer to the right node stored in "n" to "r".
+
+Once we have a node traits configuration we can use [*Boost.Intrusive] algorithms
+with our nodes:
+
+[import ../example/doc_splaytree_algorithms.cpp]
+[doc_splaytree_algorithms_code]
+
+For a complete list of functions see
+[classref boost::intrusive::splaytree_algorithms splaytree_algorithms reference].
+
+[endsect]
+
+[section:avltree_algorithms Intrusive avl tree algorithms]
+
+[classref boost::intrusive::avltree_algorithms avltree_algorithms] have the same
+interface as [classref boost::intrusive::rbtree_algorithms rbtree_algorithms].
+
+[c++]
+
+ template<class NodeTraits>
+ struct avltree_algorithms;
+
+[classref boost::intrusive::avltree_algorithms avltree_algorithms]
+is configured with a NodeTraits class, which encapsulates
+the information about the node to be manipulated. NodeTraits must support the
+following interface:
+
+[*Typedefs]:
+
+* `node`: The type of the node that forms the circular avltree
+
+* `node_ptr`: The type of a pointer to a node (usually node*)
+
+* `const_node_ptr`: The type of a pointer to a const node (usually const node*)
+
+* `balance`: A type that can represent 3 balance types (usually an integer)
+
+[*Static functions]:
+
+* `static node_ptr get_parent(const_node_ptr n);`:
+ Returns a pointer to the parent node stored in "n".
+
+* `static void set_parent(node_ptr n, node_ptr p);`:
+ Sets the pointer to the parent node stored in "n" to "p".
+
+* `static node_ptr get_left(const_node_ptr n);`:
+ Returns a pointer to the left node stored in "n".
+
+* `static void set_left(node_ptr n, node_ptr l);`:
+ Sets the pointer to the left node stored in "n" to "l".
+
+* `static node_ptr get_right(const_node_ptr n);`:
+ Returns a pointer to the right node stored in "n".
+
+* `static void set_right(node_ptr n, node_ptr r);`:
+ Sets the pointer to the right node stored in "n" to "r".
+
+* `static balance get_balance(const_node_ptr n);`:
+ Returns the balance factor stored in "n".
+
+* `static void set_balance(node_ptr n, balance b);`:
+ Sets the balance factor stored in "n" to "b".
+
+* `static balance negative();`:
+ Returns a value representing a negative balance factor.
+
+* `static balance zero();`:
+ Returns a value representing a zero balance factor.
+
+* `static balance positive();`:
+ Returns a value representing a positive balance factor.
+
+Once we have a node traits configuration we can use [*Boost.Intrusive] algorithms
+with our nodes:
+
+[import ../example/doc_avltree_algorithms.cpp]
+[doc_avltree_algorithms_code]
+
+For a complete list of functions see
+[classref boost::intrusive::avltree_algorithms avltree_algorithms reference].
+
+[endsect]
+
+
+[section:treap_algorithms Intrusive treap algorithms]
+
+[classref boost::intrusive::treap_algorithms treap_algorithms] have the same
+interface as [classref boost::intrusive::rbtree_algorithms rbtree_algorithms].
+
+[c++]
+
+ template<class NodeTraits>
+ struct treap_algorithms;
+
+[classref boost::intrusive::treap_algorithms treap_algorithms]
+is configured with a NodeTraits class, which encapsulates
+the information about the node to be manipulated. NodeTraits must support the
+following interface:
+
+[*Typedefs]:
+
+* `node`: The type of the node that forms the circular treap
+
+* `node_ptr`: The type of a pointer to a node (usually node*)
+
+* `const_node_ptr`: The type of a pointer to a const node (usually const node*)
+
+[*Static functions]:
+
+* `static node_ptr get_parent(const_node_ptr n);`:
+ Returns a pointer to the parent node stored in "n".
+
+* `static void set_parent(node_ptr n, node_ptr p);`:
+ Sets the pointer to the parent node stored in "n" to "p".
+
+* `static node_ptr get_left(const_node_ptr n);`:
+ Returns a pointer to the left node stored in "n".
+
+* `static void set_left(node_ptr n, node_ptr l);`:
+ Sets the pointer to the left node stored in "n" to "l".
+
+* `static node_ptr get_right(const_node_ptr n);`:
+ Returns a pointer to the right node stored in "n".
+
+* `static void set_right(node_ptr n, node_ptr r);`:
+ Sets the pointer to the right node stored in "n" to "r".
+
+Once we have a node traits configuration we can use [*Boost.Intrusive] algorithms
+with our nodes:
+
+[import ../example/doc_treap_algorithms.cpp]
+[doc_treap_algorithms_code]
+
+For a complete list of functions see
+[classref boost::intrusive::treap_algorithms treap_algorithms reference].
+
+[endsect]
+
+
+[/
+/
+/[section:sgtree_algorithms Intrusive sg tree algorithms]
+/
+/
+/[classref boost::intrusive::sgtree_algorithms sgtree_algorithms] have the same
+/interface as [classref boost::intrusive::rbtree_algorithms rbtree_algorithms].
+/
+/[c++]
+/
+/ template<class NodeTraits>
+/ struct sgtree_algorithms;
+/
+/[classref boost::intrusive::sgtree_algorithms sgtree_algorithms]
+/is configured with a NodeTraits class, which encapsulates
+/the information about the node to be manipulated. NodeTraits must support the
+/following interface:
+/
+/[*Typedefs]:
+/
+/* `node`: The type of the node that forms the circular sgtree
+/
+/* `node_ptr`: The type of a pointer to a node (usually node*)
+/
+/* `const_node_ptr`: The type of a pointer to a const node (usually const node*)
+/
+/[*Static functions]:
+/
+/* `static node_ptr get_parent(const_node_ptr n);`:
+/ Returns a pointer to the parent node stored in "n".
+/
+/* `static void set_parent(node_ptr n, node_ptr p);`:
+/ Sets the pointer to the parent node stored in "n" to "p".
+/
+/* `static node_ptr get_left(const_node_ptr n);`:
+/ Returns a pointer to the left node stored in "n".
+/
+/* `static void set_left(node_ptr n, node_ptr l);`:
+/ Sets the pointer to the left node stored in "n" to "l".
+/
+/* `static node_ptr get_right(const_node_ptr n);`:
+/ Returns a pointer to the right node stored in "n".
+/
+/* `static void set_right(node_ptr n, node_ptr r);`:
+/ Sets the pointer to the right node stored in "n" to "r".
+/
+/Once we have a node traits configuration we can use [*Boost.Intrusive] algorithms
+/with our nodes:
+/
+/[import ../example/doc_sgtree_algorithms.cpp]
+/[doc_sgtree_algorithms_code]
+/
+/For a complete list of functions see
+/[classref boost::intrusive::sgtree_algorithms sgtree_algorithms reference].
+/
+/[endsect]
+/]
+[endsect]
+
+[section:value_traits Containers with custom ValueTraits]
+
+As explained in the [link intrusive.concepts Concepts] section, [*Boost.Intrusive]
+containers need a `ValueTraits` class to perform transformations between nodes and
+user values. `ValueTraits` can be explicitly configured (using the `value_traits<>` option)
+or implicitly configured (using hooks and their `base_hook<>`/`member_hook<>` options).
+`ValueTraits` contains
+all the information to glue the `value_type` of the containers and the node to be
+used in node algorithms, since these types can be different. Apart from this,
+`ValueTraits` also stores information about the link policy of the values to be inserted.
+
+Instead of using [*Boost.Intrusive] predefined hooks
+a user might want to develop customized containers, for example, using nodes that are
+optimized for a specific
+application or that are compatible with a legacy ABI. A user might want
+to have only two additional pointers in his class and insert the class in a doubly
+linked list sometimes and in a singly linked list in other situations. You can't
+achieve this using [*Boost.Intrusive] predefined hooks. Now, instead of using
+`base_hook<...>` or `member_hook<...>` options the user will specify the
+`value_traits<...>` options. Let's see how we can do this:
+
+[section:value_traits_interface ValueTraits interface]
+
+`ValueTraits` has the following interface:
+
+[c++]
+
+ #include <boost/pointer_to_other.hpp>
+ #include <boost/intrusive/link_mode.hpp>
+
+ struct my_value_traits
+ {
+ typedef implementation_defined node_traits;
+ typedef implementation_defined value_type;
+ typedef node_traits::node_ptr node_ptr;
+ typedef node_traits::const_node_ptr const_node_ptr;
+ typedef boost::pointer_to_other<node_ptr, value_type>::type pointer;
+ typedef boost::pointer_to_other<node_ptr, const value_type>::type const_pointer;
+
+ static const link_mode_type link_mode = some_linking_policy;
+
+ static node_ptr to_node_ptr (value_type &value);
+ static const_node_ptr to_node_ptr (const value_type &value);
+ static pointer to_value_ptr (node_ptr n);
+ static const_pointer to_value_ptr (const_node_ptr n);
+ };
+
+Let's explain each type and function:
+
+* [*['node_traits]]: The node configuration that is needed by node algorithms.
+ These node traits and algorithms are
+ described in the previous chapter: [link intrusive.node_algorithms Node Algorithms].
+
+ * If my_value_traits is meant to be used with [classref boost::intrusive::slist slist],
+ `node_traits` should follow
+ the interface needed by [classref boost::intrusive::circular_slist_algorithms circular_slist_algorithms].
+
+ * If my_value_traits is meant to be used with [classref boost::intrusive::list list],
+ `node_traits` should follow
+ the interface needed by [classref boost::intrusive::circular_list_algorithms circular_list_algorithms].
+
+ * If my_value_traits is meant to be used with [classref boost::intrusive::set set]/[classref boost::intrusive::multiset multiset],
+ `node_traits` should follow
+ the interface needed by [classref boost::intrusive::rbtree_algorithms rbtree_algorithms].
+
+ * If my_value_traits is meant to be used with [classref boost::intrusive::unordered_set unordered_set]/
+ [classref boost::intrusive::unordered_multiset unordered_multiset], `node_traits`
+ should follow the interface needed by [classref boost::intrusive::circular_slist_algorithms circular_slist_algorithms].
+
+* [*['node_ptr]]: A typedef for `node_traits::node_ptr`.
+
+* [*['const_node_ptr]]: A typedef for `node_traits::const_node_ptr`.
+
+* [*['value_type]]: The type that the user wants to insert in the container. This type can be
+ the same as `node_traits::node` but it can be different (for example, `node_traits::node`
+ can be a member type of `value_type`). If `value_type` and `node_traits::node` are the
+ same type, the `to_node_ptr` and `to_value_ptr` functions are trivial.
+
+* [*['pointer]]: The type of a pointer to a `value_type`. It must be the same pointer type
+ as `node_ptr`: If `node_ptr` is `node*`, `pointer` must be `value_type*`. If
+ `node_ptr` is `smart_ptr<node_traits::node>`, `pointer` must be `smart_ptr<value_type>`.
+ This can be generically achieved using `boost::pointer_to_other` utility from [*Boost SmartPointers]
+ defined in `<boost/pointer_to_other.hpp>`.
+
+* [*['const_pointer]]: The type of a pointer to a `const value_type`. It must be the same pointer type
+ as `node_ptr`: If `node_ptr` is `node*`, `const_pointer` must be `const value_type*`. If
+ `node_ptr` is `smart_ptr<node_traits::node>`, `const_pointer` must be `smart_ptr<const value_type>`
+ This can be generically achieved using `boost::pointer_to_other` utility from [*Boost SmartPointers]
+ defined in `<boost/pointer_to_other.hpp>`.
+
+* [*['link_mode]]: Indicates that `value_traits` needs some additional work or checks from the
+ container. The types are enumerations defined in the `link_mode.hpp` header.
+ These are the possible types:
+
+ * [*`normal_link`]: If this linking policy is specified in a `ValueTraits` class
+ as the link mode, containers
+ configured with such `ValueTraits` won't set the hooks
+ of the erased values to a default state. Containers also won't
+ check that the hooks of the new values are default initialized.
+
+ * [*`safe_link`]: If this linking policy is specified as the link mode
+ in a `ValueTraits` class, containers
+ configured with this `ValueTraits` will set the hooks
+ of the erased values to a default state. Containers also will
+ check that the hooks of the new values are default initialized.
+
+ * [*`auto_unlink`]: Same as "safe_link" but containers with
+ constant-time size features won't be
+ compatible with `ValueTraits` configured with this policy.
+ Containers also know that a value can be silently erased from
+ the container without using any function provided by the containers.
+
+* [*['static node_ptr to_node_ptr (value_type &value)]] and
+ [*['static const_node_ptr to_node_ptr (const value_type &value)]]:
+ These functions take a reference to a value_type and return a pointer to the node
+ to be used with node algorithms.
+
+* [*['static pointer to_value_ptr (node_ptr n)]] and
+ [*['static const_pointer to_value_ptr (const_node_ptr n)]]:
+ These functions take a pointer to a node and return a pointer to the value
+ that contains the node.
+
+[endsect]
+
+[section:value_traits_example Custom ValueTraits example]
+
+Let's define our own `value_traits` class to be able to use [*Boost.Intrusive]
+containers with an old C structure whose definition can't be changed.
+That legacy type has two pointers that can be used to build singly and doubly linked
+lists: in singly linked lists we only need a pointer, whereas in doubly
+linked lists, we need two pointers. Since we only have two pointers, we can't insert
+the object in both a singly and a doubly linked list at the same time.
+This is the definition of the old node:
+
+[import ../example/doc_value_traits.cpp]
+[doc_value_traits_code_legacy]
+
+Now we have to define a NodeTraits class that will implement the functions/typedefs
+that will make the legacy node compatible with [*Boost.Intrusive] algorithms. After that,
+we'll define a ValueTraits class that will configure [*Boost.Intrusive] containers:
+
+[doc_value_traits_value_traits]
+
+Defining a value traits class that simply defines `value_type` as
+`legacy_node_traits::node` is a common approach when defining customized
+intrusive containers, so [*Boost.Intrusive] offers a templatized
+[classref boost::intrusive::trivial_value_traits trivial_value_traits] class
+that does exactly what we want:
+
+[c++]
+
+ #include <boost/intrusive/trivial_value_traits.hpp>
+
+ //Now we can define legacy_value_traits just with a single line
+ using namespace boost::intrusive;
+ typedef trivial_value_traits<legacy_node_traits, normal_link> legacy_value_traits;
+
+
+Now we can just define the containers that will store the legacy abi objects and write
+a little test:
+
+[doc_value_traits_test]
+
+As seen, several key elements of [*Boost.Intrusive] can be reused with custom user types,
+if the user does not want to use the provided [*Boost.Intrusive] facilities.
+
+[endsect]
+
+[section:reusing_node_algorithms Reusing node algorithms for different values]
+
+In the previous example, `legacy_node_traits::node` type and
+`legacy_value_traits::value_type` are the same type, but this is not necessary. It's possible
+to have several `ValueTraits` defining the same `node_traits` type (and thus, the same `node_traits::node`).
+This reduces the number of node algorithm instantiations, but
+now `ValueTraits::to_node_ptr` and `ValueTraits::to_value_ptr` functions need to offer
+conversions between both types. Let's see a small example:
+
+First, we'll define the node to be used in the algorithms. For a linked list,
+we just need a node that stores two pointers:
+
+[import ../example/doc_advanced_value_traits.cpp]
+[doc_advanced_value_traits_code]
+
+Now we'll define two different types that will be inserted in intrusive lists and
+a templatized `ValueTraits` that will work for both types:
+
+[doc_advanced_value_traits_value_traits]
+
+Now define two containers. Both containers will instantiate the same list algorithms
+(`circular_list_algorithms<simple_node_traits>`),
+due to the fact that the value traits used to define the containers provide the same `node_traits` type:
+
+[doc_advanced_value_traits_containers]
+
+All [*Boost.Intrusive] containers using predefined hooks use this technique to minimize code size:
+all possible [classref boost::intrusive::list list] containers
+created with predefined hooks that define the same `VoidPointer` type
+share the same list algorithms.
+
+[endsect]
+
+[section:simplifying_value_traits Simplifying value traits definition]
+
+The previous example can be further simplified using the
+[classref boost::intrusive::derivation_value_traits derivation_value_traits]
+class to define a value traits class with a value that stores the
+`simple_node` as a base class:
+
+[c++]
+
+ #include <boost/intrusive/derivation_value_traits.hpp>
+
+ //value_1, value_2, simple_node and simple_node_traits are defined
+ //as in the previous example...
+ //...
+
+ using namespace boost::intrusive;
+
+ //Now define the needed value traits using
+ typedef derivation_value_traits<value_1, simple_node_traits, normal_link> ValueTraits1;
+ typedef derivation_value_traits<value_2, simple_node_traits, normal_link> ValueTraits2;
+
+ //Now define the containers
+ typedef list <value1, value_traits<ValueTraits1> > Value1List;
+ typedef list <value2, value_traits<ValueTraits2> > Value2List;
+
+We can even choose to store `simple_node` as a member of `value_1` and `value_2`
+classes and use [classref boost::intrusive::member_value_traits member_value_traits]
+to define the needed value traits classes:
+
+[import ../example/doc_advanced_value_traits2.cpp]
+[doc_advanced_value_traits2_value_traits]
+
+[endsect]
+
+[section:stateful_value_traits Stateful value traits]
+
+Until now all shown custom value traits are stateless, that is, [*the transformation between nodes
+and values is implemented in terms of static functions]. It's possible to use [*stateful] value traits
+so that we can separate nodes and values and [*avoid modifying types to insert nodes].
+[*Boost.Intrusive] differentiates between stateful and stateless value traits by checking if all
+Node <-> Value transformation functions are static or not:
+
+* If all Node <-> Value transformation functions are static , a [*stateless]
+ value traits is assumed. transformations must be static functions.
+* Otherwise a [*stateful] value traits is assumed.
+
+Using stateful value traits it's possible to create containers of non-copyable/movable objects [*without modifying]
+the definition of the class to be inserted. This interesting property is achieved without using global variables
+(stateless value traits could use global variables to achieve the same goal), so:
+
+* [*Thread-safety guarantees]: Better thread-safety guarantees can be achieved with stateful
+ value traits, since accessing global resources might require synchronization primitives that
+ can be avoided when using internal state.
+* [*Flexibility]: A stateful value traits type can be configured at run-time.
+* [*Run-time polymorphism]: A value traits might implement node <-> value
+ transformations as virtual functions. A single container type could be
+ configured at run-time to use different node <-> value relationships.
+
+Stateful value traits have many advantages but also some downsides:
+
+* [*Performance]: Value traits operations should be very efficient since they are basic operations used by containers.
+ [*A heavy node <-> value transformation will hurt intrusive containers' performance].
+* [*Exception guarantees]: The stateful ValueTraits must maintain no-throw guarantees, otherwise, the
+ container invariants won't be preserved.
+* [*Static functions]: Some static functions offered by intrusive containers are not
+ available because node <-> value transformations are not static.
+* [*Bigger iterators]: The size of some iterators is increased because the iterator
+ needs to store a pointer to the stateful value traits to implement node to value
+ transformations (e.g. `operator*()` and `operator->()`).
+
+An easy and useful example of stateful value traits is when an array of values can be indirectly introduced
+in a list guaranteeing no additional allocation apart from the initial resource reservation:
+
+[import ../example/doc_stateful_value_traits.cpp]
+[doc_stateful_value_traits]
+
+[endsect]
+
+[endsect]
+
+[section:thread_safety Thread safety guarantees]
+
+Intrusive containers have thread safety guarantees similar to STL containers.
+
+* Several threads having read or write access to different instances is safe as long as inserted
+ objects are different.
+* Concurrent read-only access to the same container is safe.
+
+Some Intrusive hooks (auto-unlink hooks, for example) modify containers without
+having a reference to them: this is considered a write access to the container.
+
+Other functions, like checking if an object is already inserted in a container using the `is_linked()`
+member of safe hooks, constitute read access on the container without having a reference to it, so no other
+thread should have write access (direct or indirect) to that container.
+
+Since the same object can be inserted in several containers at the same time using different hooks,
+the thread safety of [*Boost.Intrusive] is related to the containers and also to the object whose lifetime
+is manually managed by the user.
+
+As we can see, the analysis of the thread-safety of a program using [*Boost.Intrusive] is harder
+than with non-intrusive containers.
+
+To analyze the thread safety, consider the following points:
+
+* The auto-unlink hook's destructor and `unlink()` functions modify the container indirectly.
+* The safe mode and auto-unlink hooks' `is_linked()` functions are a read access to the container.
+* Inserting an object in containers that will be modified by different threads has no thread safety
+ guarantee, although in most platforms it will be thread-safe without locking.
+
+[endsect]
+
+[section:obtaining_same_type_reducing_space Obtaining the same types and reducing symbol length]
+
+The flexible option specification mechanism used by [*Boost.Intrusive] for hooks and containers
+has a couple of downsides:
+
+* If a user specifies the same options in different order or specifies some options and leaves the
+ rest as defaults, the type of the created container/hook will be different. Sometimes
+ this is annoying, because two programmers specifying the same options might end up with incompatible
+ types. For example, the following two lists, although using the same options, do not have
+ the same type:
+
+[c++]
+
+ #include <boost/intrusive/list.hpp>
+
+ using namespace boost::intrusive;
+
+ //Explicitly specify constant-time size and size type
+ typedef list<T, constant_time_size<true>, size_type<std::size_t> List1;
+
+ //Implicitly specify constant-time size and size type
+ typedef list<T> List2;
+
+* Option specifiers lead to long template symbols for classes and functions. Option specifiers themselves
+ are verbose and without variadic templates, several default template parameters are assigned for
+ non-specified options. Object and debugging information files can grow and compilation times
+ may suffer if long names are produced.
+
+To solve these issues [*Boost.Intrusive] offers some helper metafunctions that reduce symbol lengths
+and create the same type if the same options (either explicitly or implicitly) are used. These also
+improve compilation times. All containers and hooks have their respective `make_xxx` versions.
+The previously shown example can be rewritten like this to obtain the same list type:
+
+[c++]
+
+ #include <boost/intrusive/list.hpp>
+
+ using namespace boost::intrusive;
+
+ #include <boost/intrusive/list.hpp>
+
+ using namespace boost::intrusive;
+
+ //Explicitly specify constant-time size and size type
+ typedef make_list<T, constant_time_size<true>, size_type<std::size_t>::type List1;
+
+ //Implicitly specify constant-time size and size type
+ typedef make_list<T>::type List2;
+
+Produced symbol lengths and compilation times will usually be shorter and object/debug files smaller.
+If you are concerned with file sizes and compilation times, this option is your best choice.
+
+[endsect]
+
+[section:design_notes Design Notes]
+
+When designing [*Boost.Intrusive] the following guidelines have been taken into account:
+
+[section: Boost.Intrusive in performance sensitive environments]
+
+[*Boost.Intrusive] should be a valuable tool in performance sensitive environments,
+and following this guideline, [*Boost.Intrusive] has been designed to offer well
+known complexity guarantees. Apart from that, some options, like optional
+constant-time, have been designed to offer faster complexity guarantees in some
+functions, like `slist::splice`.
+
+The advanced lookup and insertion functions for associative containers, taking
+an arbitrary key type and predicates, were designed to avoid unnecessary object
+constructions.
+
+[endsect]
+
+[section: Boost.Intrusive in space constrained environments]
+
+[*Boost.Intrusive] should be useful in space constrained environments,
+and following this guideline [*Boost.Intrusive] separates node algorithms
+and intrusive containers to avoid instantiating node algorithms for each
+user type. For example, a single class of red-black algorithms will be instantiated
+to implement all set and multiset containers using raw pointers. This way,
+[*Boost.Intrusive] seeks to avoid any code size overhead associated with templates.
+
+Apart from that, [*Boost.Intrusive] implements some size improvements: for example,
+red-black trees embed the color bit in the parent pointer lower bit, if nodes
+are two-byte aligned. The option to forgo constant-time size operations can
+reduce container size, and this extra size optimization is noticeable
+when the container is empty or contains few values.
+
+[endsect]
+
+[section: Boost.Intrusive as a basic building block]
+
+[*Boost.Intrusive] can be a basic building block to build more complex containers
+and this potential has motivated many design decisions. For example, the ability
+to have more than one hook per user type opens the opportunity to implement multi-index
+containers on top of [*Boost.Intrusive].
+
+[*Boost.Intrusive] containers implement advanced functions taking function objects
+as arguments (`clone_from`, `erase_and_dispose`, `insert_check`, etc.). These
+functions come in handy when implementing non-intrusive containers
+(for example, STL-like containers) on top of intrusive containers.
+
+[endsect]
+
+[section: Extending Boost.Intrusive]
+
+[*Boost.Intrusive] offers a wide range of containers but also allows the
+construction of custom containers reusing [*Boost.Intrusive] elements.
+The programmer might want to use node algorithms directly or
+build special hooks that take advantage of an application environment.
+
+For example, the programmer can customize parts of [*Boost.Intrusive]
+to manage old data structures whose definition can't be changed.
+
+[endsect]
+
+[endsect]
+
+[section:performance Performance]
+
+[*Boost.Intrusive] containers offer speed improvements compared to non-intrusive containers
+primarily because:
+
+* They minimize memory allocation/deallocation calls.
+* They obtain better memory locality.
+
+This section will show performance tests comparing some operations on
+`boost::intrusive::list` and `std::list`:
+
+* Insertions using `push_back` and container destruction will show the
+ overhead associated with memory allocation/deallocation.
+* The `reverse` member function will show the advantages of the compact
+ memory representation that can be achieved with intrusive containers.
+* The `sort` and `write access` tests will show the advantage of intrusive containers
+ minimizing memory accesses compared to containers of pointers.
+
+Given an object of type `T`, [classref boost::intrusive::list boost::intrusive::list<T>]
+can replace `std::list<T>` to avoid memory allocation overhead,
+or it can replace `std::list<T*>` when the user wants containers with
+polymorphic values or wants to share values between several containers.
+Because of this versatility, the performance tests will be executed for 6 different
+list types:
+
+* 3 intrusive lists holding a class named `itest_class`,
+ each one with a different linking policy (`normal_link`, `safe_link`, `auto_unlink`).
+ The `itest_class` objects will be tightly packed in a `std::vector<itest_class>` object.
+
+* `std::list<test_class>`, where `test_class` is exactly the same as `itest_class`,
+ but without the intrusive hook.
+
+* `std::list<test_class*>`. The list will contain pointers to `test_class` objects
+ tightly packed in a `std::vector<test_class>` object. We'll call this configuration ['compact pointer list]
+
+* `std::list<test_class*>`. The list will contain pointers to `test_class` objects owned by a
+ `std::list<test_class>` object. We'll call this configuration ['disperse pointer list].
+
+Both `test_class` and `itest_class` are templatized classes that can be configured with
+a boolean to increase the size of the object. This way, the tests can be executed with
+small and big objects. Here is the first part of the testing code, which shows
+the definitions of `test_class` and `itest_class` classes, and some other
+utilities:
+
+[import ../perf/perf_list.cpp]
+[perf_list_value_type]
+
+As we can see, `test_class` is a very simple class holding an `int`. `itest_class`
+is just a class that has a base hook ([classref boost::intrusive::list_base_hook list_base_hook])
+and also derives from `test_class`.
+
+`func_ptr_adaptor` is just a functor adaptor to convert function objects taking
+`test_list` objects to function objects taking pointers to them.
+
+You can find the full test code code in the
+[@../../libs/intrusive/perf/perf_list.cpp perf_list.cpp] source file.
+
+[section:performance_results_push_back Back insertion and destruction]
+
+The first test will measure the benefits we can obtain with intrusive containers
+avoiding memory allocations and deallocations. All the objects to be
+inserted in intrusive containers are allocated in a single allocation call,
+whereas `std::list` will need to allocate memory for each object and deallocate it
+for every erasure (or container destruction).
+
+Let's compare the code to be executed for each container type for different insertion tests:
+
+[perf_list_push_back_intrusive]
+
+For intrusive containers, all the values are created in a vector and after that
+inserted in the intrusive list.
+
+[perf_list_push_back_stdlist]
+
+For a standard list, elements are pushed back using push_back().
+
+[perf_list_push_back_stdptrlist]
+
+For a standard compact pointer list, elements are created in a vector and pushed back
+in the pointer list using push_back().
+
+[perf_list_push_back_disperse_stdptrlist]
+
+For a ['disperse pointer list], elements are created in a list and pushed back
+in the pointer list using push_back().
+
+These are the times in microseconds for each case, and the normalized time:
+
+[table Back insertion + destruction times for Visual C++ 7.1 / Windows XP
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [5000 / 22500] [1 / 1]]
+ [[`safe_link` intrusive list] [7812 / 32187] [1.56 / 1.43]]
+ [[`auto_unlink` intrusive list] [10156 / 41562] [2.03 / 1.84]]
+ [[Standard list] [76875 / 97500] [5.37 / 4.33]]
+ [[Standard compact pointer list] [76406 / 86718] [15.28 / 3.85]]
+ [[Standard disperse pointer list] [146562 / 175625] [29.31 / 7.80]]
+]
+
+[table Back insertion + destruction times for GCC 4.1.1 / MinGW over Windows XP
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [4375 / 22187] [1 / 1]]
+ [[`safe_link` intrusive list] [7812 / 32812] [1.78 / 1.47]]
+ [[`auto_unlink` intrusive list] [10468 / 42031] [2.39 / 1.89]]
+ [[Standard list] [81250 / 98125] [18.57 / 4.42]]
+ [[Standard compact pointer list] [83750 / 94218] [19.14 / 4.24]]
+ [[Standard disperse pointer list] [155625 / 175625] [35.57 / 7.91]]
+]
+
+[table Back insertion + destruction times for GCC 4.1.2 / Linux Kernel 2.6.18 (OpenSuse 10.2)
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [4792 / 20495] [1 / 1]]
+ [[`safe_link` intrusive list] [7709 / 30803] [1.60 / 1.5]]
+ [[`auto_unlink` intrusive list] [10180 / 41183] [2.12 / 2.0]]
+ [[Standard list] [17031 / 32586] [3.55 / 1.58]]
+ [[Standard compact pointer list] [27221 / 34823] [5.68 / 1.69]]
+ [[Standard disperse pointer list] [102272 / 60056] [21.34 / 2.93]]
+]
+
+The results are logical: intrusive lists just need one allocation. The destruction
+time of the `normal_link` intrusive container is trivial (complexity: `O(1)`),
+whereas `safe_link` and `auto_unlink` intrusive containers need to put the hooks of
+erased values in the default state (complexity: `O(NumElements)`). That's why
+`normal_link` intrusive list shines in this test.
+
+Non-intrusive containers need to make many more allocations and that's why they
+lag behind. The `disperse pointer list` needs to make `NumElements*2` allocations,
+so the result is not surprising.
+
+The Linux test shows that standard containers perform very well against intrusive containers
+with big objects. Nearly the same GCC version in MinGW performs worse, so maybe
+a good memory allocator is the reason for these excellent results.
+
+[endsect]
+
+[section:performance_results_reversing Reversing]
+
+The next test measures the time needed to complete calls to the member function `reverse()`.
+Values (`test_class` and `itest_class`) and lists are created as explained in the
+previous section.
+
+Note that for pointer lists, `reverse` [*does not need to access `test_class` values
+stored in another list or vector],
+since this function just needs to adjust internal pointers, so in theory all tested
+lists need to perform the same operations.
+
+These are the results:
+
+[table Reverse times for Visual C++ 7.1 / Windows XP
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [2656 / 10625] [1 / 1.83]]
+ [[`safe_link` intrusive list] [2812 / 10937] [1.05 / 1.89]]
+ [[`auto_unlink` intrusive list] [2710 / 10781] [1.02 / 1.86]]
+ [[Standard list] [5781 / 14531] [2.17 / 2.51]]
+ [[Standard compact pointer list] [5781 / 5781] [2.17 / 1]]
+ [[Standard disperse pointer list] [10781 / 15781] [4.05 / 2.72]]
+]
+
+[table Reverse times for GCC 4.1.1 / MinGW over Windows XP
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [2656 / 10781] [1 / 2.22]]
+ [[`safe_link` intrusive list] [2656 / 10781] [1 / 2.22]]
+ [[`auto_unlink` intrusive list] [2812 / 10781] [1.02 / 2.22]]
+ [[Standard list] [4843 / 12500] [1.82 / 2.58]]
+ [[Standard compact pointer list] [4843 / 4843] [1.82 / 1]]
+ [[Standard disperse pointer list] [9218 / 12968] [3.47 / 2.67]]
+]
+
+[table Reverse times for GCC 4.1.2 / Linux Kernel 2.6.18 (OpenSuse 10.2)
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [2742 / 10847] [1 / 3.41]]
+ [[`safe_link` intrusive list] [2742 / 10847] [1 / 3.41]]
+ [[`auto_unlink` intrusive list] [2742 / 11027] [1 / 3.47]]
+ [[Standard list] [3184 / 10942] [1.16 / 3.44]]
+ [[Standard compact pointer list] [3207 / 3176] [1.16 / 1]]
+ [[Standard disperse pointer list] [5814 / 13381] [2.12 / 4.21]]
+]
+
+For small objects the results show that the compact storage of values in intrusive
+containers improve locality and reversing is faster than with standard containers,
+whose values might be dispersed in memory because each value is independently
+allocated. Note that the dispersed pointer list (a list of pointers to values
+allocated in another list) suffers more because nodes of the pointer list
+might be more dispersed, since allocations from both lists are interleaved
+in the code:
+
+[c++]
+
+ //Object list (holding `test_class`)
+ stdlist objects;
+
+ //Pointer list (holding `test_class` pointers)
+ stdptrlist l;
+
+ for(int i = 0; i < NumElements; ++i){
+ //Allocation from the object list
+ objects.push_back(stdlist::value_type(i));
+ //Allocation from the pointer list
+ l.push_back(&objects.back());
+ }
+
+For big objects the compact pointer list wins because the reversal test doesn't need access
+to values stored in another container. Since all the allocations for nodes of
+this pointer list are likely to be close (since there is no other allocation in the
+process until the pointer list is created) locality is better than with intrusive
+containers. The dispersed pointer list, as with small values, has poor locality.
+
+[endsect]
+
+[section:performance_results_sorting Sorting]
+
+The next test measures the time needed to complete calls to the member function
+`sort(Pred pred)`. Values (`test_class` and `itest_class`) and lists are created as explained in the
+first section. The values will be sorted in ascending and descending order each
+iteration. For example, if ['l] is a list:
+
+[c++]
+
+ for(int i = 0; i < NumIter; ++i){
+ if(!(i % 2))
+ l.sort(std::greater<stdlist::value_type>());
+ else
+ l.sort(std::less<stdlist::value_type>());
+ }
+
+For a pointer list, the function object will be adapted using `func_ptr_adaptor`:
+
+[c++]
+
+ for(int i = 0; i < NumIter; ++i){
+ if(!(i % 2))
+ l.sort(func_ptr_adaptor<std::greater<stdlist::value_type> >());
+ else
+ l.sort(func_ptr_adaptor<std::less<stdlist::value_type> >());
+ }
+
+Note that for pointer lists, `sort` will take a function object that [*will access
+`test_class` values stored in another list or vector], so pointer lists will suffer
+an extra indirection: they will need to access the `test_class` values stored in
+another container to compare two elements.
+
+These are the results:
+
+[table Sort times for Visual C++ 7.1 / Windows XP
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [16093 / 38906] [1 / 1]]
+ [[`safe_link` intrusive list] [16093 / 39062] [1 / 1]]
+ [[`auto_unlink` intrusive list] [16093 / 38906] [1 / 1]]
+ [[Standard list] [32343 / 56406] [2.0 / 1.44]]
+ [[Standard compact pointer list] [33593 / 46093] [2.08 / 1.18]]
+ [[Standard disperse pointer list] [46875 / 68593] [2.91 / 1.76]]
+]
+
+[table Sort times for GCC 4.1.1 / MinGW over Windows XP
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [15000 / 39218] [1 / 1]]
+ [[`safe_link` intrusive list] [15156 / 39531] [1.01 / 1.01]]
+ [[`auto_unlink` intrusive list] [15156 / 39531] [1.01 / 1.01]]
+ [[Standard list] [34218 / 56875] [2.28 / 1.45]]
+ [[Standard compact pointer list] [35468 / 49218] [2.36 / 1.25]]
+ [[Standard disperse pointer list] [47656 / 70156] [3.17 / 1.78]]
+]
+
+[table Sort times for GCC 4.1.2 / Linux Kernel 2.6.18 (OpenSuse 10.2)
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [18003 / 40795] [1 / 1]]
+ [[`safe_link` intrusive list] [18003 / 41017] [1 / 1]]
+ [[`auto_unlink` intrusive list] [18230 / 40941] [1.01 / 1]]
+ [[Standard list] [26273 / 49643] [1.45 / 1.21]]
+ [[Standard compact pointer list] [28540 / 43172] [1.58 / 1.05]]
+ [[Standard disperse pointer list] [35077 / 57638] [1.94 / 1.41]]
+]
+
+The results show that intrusive containers are faster than standard
+containers. We can see that the pointer
+list holding pointers to values stored in a vector is quite fast, so the extra
+indirection that is needed to access the value is minimized because all the values
+are tightly stored, improving caching. The disperse list, on the other hand, is
+slower because the indirection to access values stored in the object list is
+more expensive than accessing values stored in a vector.
+
+[endsect]
+
+[section:performance_results_write_access Write access]
+
+The next test measures the time needed to iterate through all the elements of a list, and
+increment the value of the internal `i_` member:
+
+[c++]
+
+ stdlist::iterator it(l.begin()), end(l.end());
+ for(; it != end; ++it)
+ ++(it->i_);
+
+Values (`test_class` and `itest_class`) and lists are created as explained in
+the first section. Note that for pointer lists, the iteration will suffer
+an extra indirection: they will need to access the `test_class` values stored in
+another container:
+
+[c++]
+
+ stdptrlist::iterator it(l.begin()), end(l.end());
+ for(; it != end; ++it)
+ ++((*it)->i_);
+
+These are the results:
+
+[table Write access times for Visual C++ 7.1 / Windows XP
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [2031 / 8125] [1 / 1]]
+ [[`safe_link` intrusive list] [2031 / 8281] [1 / 1.01]]
+ [[`auto_unlink` intrusive list] [2031 / 8281] [1 / 1.01]]
+ [[Standard list] [4218 / 10000] [2.07 / 1.23]]
+ [[Standard compact pointer list] [4062 / 8437] [2.0 / 1.03]]
+ [[Standard disperse pointer list] [8593 / 13125] [4.23 / 1.61]]
+]
+
+[table Write access times for GCC 4.1.1 / MinGW over Windows XP
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [2343 / 8281] [1 / 1]]
+ [[`safe_link` intrusive list] [2500 / 8281] [1.06 / 1]]
+ [[`auto_unlink` intrusive list] [2500 / 8281] [1.06 / 1]]
+ [[Standard list] [4218 / 10781] [1.8 / 1.3]]
+ [[Standard compact pointer list] [3906 / 8281] [1.66 / 1]]
+ [[Standard disperse pointer list] [8281 / 13750] [3.53 / 1.66]]
+]
+
+[table Write access times for GCC 4.1.2 / Linux Kernel 2.6.18 (OpenSuse 10.2)
+ [[Container] [Time in us/iteration (small object / big object)] [Normalized time (small object / big object)]]
+ [[`normal_link` intrusive list] [2286 / 8468] [1 / 1.1]]
+ [[`safe_link` intrusive list] [2381 / 8412] [1.04 / 1.09]]
+ [[`auto_unlink` intrusive list] [2301 / 8437] [1.01 / 1.1]]
+ [[Standard list] [3044 / 9061] [1.33 / 1.18]]
+ [[Standard compact pointer list] [2755 / 7660] [1.20 / 1]]
+ [[Standard disperse pointer list] [6118 / 12453] [2.67 / 1.62]]
+]
+
+As with the read access test, the results show that intrusive containers outperform
+all other containers if the values are tightly packed in a vector.
+The disperse list is again the slowest.
+
+[endsect]
+
+[section:performance_results_conclusions Conclusions]
+
+Intrusive containers can offer performance benefits that cannot be achieved with
+equivalent non-intrusive containers. Memory locality improvements are noticeable
+when the objects to be inserted are small. Minimizing memory allocation/deallocation calls is also
+an important factor and intrusive containers make this simple if the user allocates
+all the objects to be inserted in intrusive containers in containers like `std::vector` or `std::deque`.
+
+[endsect]
+
+[endsect]
+
+[section:release_notes Release Notes]
+
+[section:release_notes_boost_1_40_00 Boost 1.40 Release]
+
+* Code cleanup in tree_algorithms.hpp and avl_tree_algorithms.hpp
+* Fixed bug
+ [@https://svn.boost.org/trac/boost/ticket/3164 #3164].
+
+[endsect]
+
+
+[section:release_notes_boost_1_39_00 Boost 1.39 Release]
+
+* Optimized `list::merge` and `slist::merge`
+* `list::sort` and `slist::sort` are now stable.
+* Fixed bugs
+ [@https://svn.boost.org/trac/boost/ticket/2689 #2689],
+ [@https://svn.boost.org/trac/boost/ticket/2755 #2755],
+ [@https://svn.boost.org/trac/boost/ticket/2786 #2786],
+ [@https://svn.boost.org/trac/boost/ticket/2807 #2807],
+ [@https://svn.boost.org/trac/boost/ticket/2810 #2810],
+ [@https://svn.boost.org/trac/boost/ticket/2862 #2862].
+
+[endsect]
+
+[section:release_notes_boost_1_38_00 Boost 1.38 Release]
+
+* New treap-based containers: treap, treap_set, treap_multiset.
+* Corrected compilation bug for Windows-based 64 bit compilers.
+* Corrected exception-safety bugs in container constructors.
+* Updated documentation to show rvalue-references functions instead of emulation functions.
+
+[endsect]
+
+[section:release_notes_boost_1_37_00 Boost 1.37 Release]
+
+* Intrusive now takes advantage of compilers with variadic templates.
+* `clone_from` functions now copy predicates and hash functions of associative containers.
+* Added incremental hashing to unordered containers via `incremental<>` option.
+* Update some function parameters from `iterator` to `const_iterator` in containers
+ to keep up with the draft of the next standard.
+* Added an option to specify include files for intrusive configurable assertion macros.
+
+[endsect]
+
+[section:release_notes_boost_1_36_00 Boost 1.36 Release]
+
+* Added `linear<>` and `cache_last<>` options to singly linked lists.
+* Added `optimize_multikey<>` option to unordered container hooks.
+* Optimized unordered containers when `store_hash` option is used in the hook.
+* Implementation changed to be exception agnostic so that it can be used
+ in environments without exceptions.
+* Added `container_from_iterator` function to tree-based containers.
+
+[endsect]
+
+[endsect]
+
+[section:tested_compilers Tested compilers]
+
+[*Boost.Intrusive] has been tested on the following compilers/platforms:
+
+* Visual 7.1/WinXP
+* Visual 8.0/WinXP
+* Visual 9.0/WinXP
+* GCC 4.1.1/MinGW
+* GCC 3.4.4/Cygwin
+* Intel 9.1/WinXP
+* GCC 4.1.2/Linux
+* GCC 3.4.3/Solaris 11
+* GCC 4.0/Mac Os 10.4.1
+
+[endsect]
+
+[section:references References]
+
+* SGI's [@http://www.sgi.com/tech/stl/ STL Programmer's Guide].
+ [*Boost.Intrusive] is based on STL concepts and interfaces.
+
+* Dr. Dobb's, September 1, 2005: [@http://www.ddj.com/architect/184402007 ['Implementing Splay Trees in C++] ].
+ [*Boost.Intrusive] splay containers code is based on this article.
+
+* Olaf's original intrusive container library: [@http://freenet-homepage.de/turtle++/intrusive.html ['STL-like intrusive containers] ].
+
+[endsect]
+
+[section:acknowledgements Acknowledgements]
+
+[*Olaf Krzikalla] would like to thank:
+
+* [*Markus Schaaf] for pointing out the possibility and the advantages of the derivation
+approach.
+
+* [*Udo Steinbach] for encouragements to present this work for boost, a lot of fixes and
+helpful discussions.
+
+* [*Jaap Suter] for the initial hint, which eventually lead to the member value_traits.
+
+[*Ion Gaztanaga] would like to thank:
+
+* [*Olaf Krzikalla] for the permission to continue his great work.
+
+* [*Joaquin M. Lopez Munoz] for his thorough review, help, and ideas.
+
+* [*Cory Nelson], [*Daniel James], [*Dave Harris], [*Guillaume Melquiond],
+ [*Henri Bavestrello], [*Hervé Bronnimann], [*Kai Bruning], [*Kevin Sopp],
+ [*Paul Rose], [*Pavel Vozelinek], [*Howard Hinnant], [*Olaf Krzikalla],
+ [*Samuel Debionne], [*Stjepan Rajko], [*Thorsten Ottosen], [*Tobias Schwinger],
+ [*Tom Brinkman] and [*Steven Watanabe]
+ for their comments and reviews in the Boost.Intrusive formal review.
+
+* Thanks to [*Julienne Walker] and [*The EC Team] ([@http://eternallyconfuzzled.com])
+ for their great algorithms.
+
+* Thanks to [*Daniel K. O.] for his AVL tree rebalancing code.
+
+* Thanks to [*Ralf Mattethat] for his splay tree article and code.
+
+* Special thanks to [*Steven Watanabe] and [*Tobias Schwinger] for their
+ invaluable suggestions and improvements.
+
+[endsect]
+
+[xinclude autodoc.xml]
+
+[section:license_notices License notices]
+
+Most of the internal implementation of red-black trees is based on that of SGI STL stl_tree.h file:
+
+['Copyright (c) 1996,1997 Silicon Graphics Computer Systems, Inc.
+Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Silicon Graphics makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.]
+
+['Copyright (c) 1994 Hewlett-Packard Company
+Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Hewlett-Packard Company makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.]
+
+The tree destruction algorithm is based on Julienne Walker and The EC Team code:
+
+['This code is in the public domain. Anyone may
+use it or change it in any way that they see
+fit. The author assumes no responsibility for
+damages incurred through use of the original
+code or any variations thereof.]
+
+['It is requested, but not required, that due
+credit is given to the original author and
+anyone who has modified the code through
+a header comment, such as this one.]
+
+[endsect]
Added: sandbox/move/libs/intrusive/example/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/Jamfile.v2 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,34 @@
+# Boost Intrusive Library Example Jamfile
+
+# (C) Copyright Ion Gaztanaga 2006-2007.
+# 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)
+
+# Adapted from John Maddock's TR1 Jamfile.v2
+# Copyright John Maddock 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)
+
+# this rule enumerates through all the sources and invokes
+# the run rule for each source, the result is a list of all
+# the run rules, which we can pass on to the test_suite rule:
+
+rule test_all
+{
+ local all_rules = ;
+
+ for local fileb in [ glob *.cpp ]
+ {
+ all_rules += [ run $(fileb) /boost/thread//boost_thread
+ : # additional args
+ : # test-files
+ : # requirements
+ ] ;
+ }
+
+ return $(all_rules) ;
+}
+
+test-suite intrusive_example : [ test_all r ] : <threading>multi ;
\ No newline at end of file
Added: sandbox/move/libs/intrusive/example/doc_advanced_value_traits.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_advanced_value_traits.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,105 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_advanced_value_traits_code
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/list.hpp>
+#include <vector>
+
+//This is the node that will be used with algorithms.
+struct simple_node
+{
+ simple_node *prev_;
+ simple_node *next_;
+};
+//]
+
+//[doc_advanced_value_traits_value_traits
+class base_1{};
+class base_2{};
+
+struct value_1 : public base_1, public simple_node
+{ int id_; };
+
+struct value_2 : public base_1, public base_2, public simple_node
+{ float id_; };
+
+//Define the node traits. A single node_traits will be enough.
+struct simple_node_traits
+{
+ typedef simple_node node;
+ typedef node * node_ptr;
+ typedef const node * const_node_ptr;
+ static node *get_next(const node *n) { return n->next_; }
+ static void set_next(node *n, node *next) { n->next_ = next; }
+ static node *get_previous(const node *n) { return n->prev_; }
+ static void set_previous(node *n, node *prev) { n->prev_ = prev; }
+};
+
+//A templatized value traits for value_1 and value_2
+template<class ValueType>
+struct simple_value_traits
+{
+ typedef simple_node_traits node_traits;
+ typedef node_traits::node_ptr node_ptr;
+ typedef node_traits::const_node_ptr const_node_ptr;
+ typedef ValueType value_type;
+ typedef ValueType * pointer;
+ typedef const ValueType * const_pointer;
+ static const boost::intrusive::link_mode_type link_mode = boost::intrusive::normal_link;
+ static node_ptr to_node_ptr (value_type &value) { return node_ptr(&value); }
+ static const_node_ptr to_node_ptr (const value_type &value) { return const_node_ptr(&value); }
+ static pointer to_value_ptr(node_ptr n) { return static_cast<value_type*>(n); }
+ static const_pointer to_value_ptr(const_node_ptr n) { return static_cast<const value_type*>(n); }
+};
+//]
+
+//[doc_advanced_value_traits_containers
+//Now define two intrusive lists. Both lists will use the same algorithms:
+// circular_list_algorithms<simple_node_traits>
+
+using namespace boost::intrusive;
+typedef list <value_1, value_traits<simple_value_traits<value_1> > > Value1List;
+typedef list <value_2, value_traits<simple_value_traits<value_2> > > Value2List;
+//]
+
+//[doc_advanced_value_traits_test
+int main()
+{
+ typedef std::vector<value_1> Vect1;
+ typedef std::vector<value_2> Vect2;
+
+ //Create values, with a different internal number
+ Vect1 values1;
+ Vect2 values2;
+ for(int i = 0; i < 100; ++i){
+ value_1 v1; v1.id_ = i; values1.push_back(v1);
+ value_2 v2; v2.id_ = (float)i; values2.push_back(v2);
+ }
+
+ //Create the lists with the objects
+ Value1List list1(values1.begin(), values1.end());
+ Value2List list2(values2.begin(), values2.end());
+
+ //Now test both lists
+ Value1List::const_iterator bit1(list1.begin()), bitend1(list1.end());
+ Value2List::const_iterator bit2(list2.begin()), bitend2(list2.end());
+
+ Vect1::const_iterator it1(values1.begin()), itend1(values1.end());
+ Vect2::const_iterator it2(values2.begin()), itend2(values2.end());
+
+ //Test the objects inserted in our lists
+ for(; it1 != itend1; ++it1, ++bit1, ++it2, ++bit2){
+ if(&*bit1 != &*it1 || &*bit2 != &*it2) return false;
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_advanced_value_traits2.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_advanced_value_traits2.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,95 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/member_value_traits.hpp>
+#include <vector>
+
+struct simple_node
+{
+ simple_node *prev_;
+ simple_node *next_;
+};
+
+//Define the node traits. A single node_traits will be enough.
+struct simple_node_traits
+{
+ typedef simple_node node;
+ typedef node * node_ptr;
+ typedef const node * const_node_ptr;
+ static node *get_next(const node *n) { return n->next_; }
+ static void set_next(node *n, node *next) { n->next_ = next; }
+ static node *get_previous(const node *n) { return n->prev_; }
+ static void set_previous(node *n, node *prev) { n->prev_ = prev; }
+};
+
+//[doc_advanced_value_traits2_value_traits
+class base_1{};
+class base_2{};
+
+struct value_1 : public base_1, public simple_node
+{
+ int id_;
+ simple_node node_;
+};
+
+struct value_2 : public base_1, public base_2, public simple_node
+{
+ simple_node node_;
+ float id_;
+};
+
+using namespace boost::intrusive;
+
+typedef member_value_traits
+ <value_1, simple_node_traits, &value_1::node_, normal_link> ValueTraits1;
+typedef member_value_traits
+<value_2, simple_node_traits, &value_2::node_, normal_link> ValueTraits2;
+
+//Now define two intrusive lists. Both lists will use the same algorithms:
+// circular_list_algorithms<simple_node_traits>
+typedef list <value_1, value_traits<ValueTraits1> > Value1List;
+typedef list <value_2, value_traits<ValueTraits2> > Value2List;
+//]
+
+//[doc_advanced_value_traits2_test
+int main()
+{
+ typedef std::vector<value_1> Vect1;
+ typedef std::vector<value_2> Vect2;
+
+ //Create values, with a different internal number
+ Vect1 values1;
+ Vect2 values2;
+ for(int i = 0; i < 100; ++i){
+ value_1 v1; v1.id_ = i; values1.push_back(v1);
+ value_2 v2; v2.id_ = (float)i; values2.push_back(v2);
+ }
+
+ //Create the lists with the objects
+ Value1List list1(values1.begin(), values1.end());
+ Value2List list2(values2.begin(), values2.end());
+
+ //Now test both lists
+ Value1List::const_iterator bit1(list1.begin()), bitend1(list1.end());
+ Value2List::const_iterator bit2(list2.begin()), bitend2(list2.end());
+
+ Vect1::const_iterator it1(values1.begin()), itend1(values1.end());
+ Vect2::const_iterator it2(values2.begin()), itend2(values2.end());
+
+ //Test the objects inserted in our lists
+ for(; it1 != itend1; ++it1, ++bit1, ++it2, ++bit2){
+ if(&*bit1 != &*it1 || &*bit2 != &*it2) return false;
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_any_hook.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_any_hook.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,62 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2008
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_any_hook
+#include <vector>
+#include <boost/intrusive/any_hook.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/list.hpp>
+
+using namespace boost::intrusive;
+
+class MyClass : public any_base_hook<> //Base hook
+{
+ int int_;
+
+ public:
+ any_member_hook<> member_hook_; //Member hook
+
+ MyClass(int i = 0) : int_(i)
+ {}
+};
+
+int main()
+{
+ //Define a base hook option that converts any_base_hook to a slist hook
+ typedef any_to_slist_hook < base_hook< any_base_hook<> > > BaseSlistOption;
+ typedef slist<MyClass, BaseSlistOption> BaseSList;
+
+ //Define a member hook option that converts any_member_hook to a list hook
+ typedef any_to_list_hook< member_hook
+ < MyClass, any_member_hook<>, &MyClass::member_hook_> > MemberListOption;
+ typedef list<MyClass, MemberListOption> MemberList;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i){ values.push_back(MyClass(i)); }
+
+ BaseSList base_slist; MemberList member_list;
+
+ //Now insert them in reverse order in the slist and in order in the list
+ for(std::vector<MyClass>::iterator it(values.begin()), itend(values.end()); it != itend; ++it)
+ base_slist.push_front(*it), member_list.push_back(*it);
+
+ //Now test lists
+ BaseSList::iterator bit(base_slist.begin()), bitend(base_slist.end());
+ MemberList::reverse_iterator mrit(member_list.rbegin()), mritend(member_list.rend());
+ std::vector<MyClass>::reverse_iterator rit(values.rbegin()), ritend(values.rend());
+
+ //Test the objects inserted in the base hook list
+ for(; rit != ritend; ++rit, ++bit, ++mrit)
+ if(&*bit != &*rit || &*mrit != &*rit) return 1;
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_assoc_optimized_code.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_assoc_optimized_code.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,260 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_assoc_optimized_code_normal_find
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <cstring>
+
+using namespace boost::intrusive;
+
+// Hash function for strings
+struct StrHasher
+{
+ std::size_t operator()(const char *str) const
+ {
+ std::size_t seed = 0;
+ for(; *str; ++str) boost::hash_combine(seed, *str);
+ return seed;
+ }
+};
+
+class Expensive : public set_base_hook<>, public unordered_set_base_hook<>
+{
+ std::string key_;
+ // Other members...
+
+ public:
+ Expensive(const char *key)
+ : key_(key)
+ {} //other expensive initializations...
+
+ const std::string & get_key() const
+ { return key_; }
+
+ friend bool operator < (const Expensive &a, const Expensive &b)
+ { return a.key_ < b.key_; }
+
+ friend bool operator == (const Expensive &a, const Expensive &b)
+ { return a.key_ == b.key_; }
+
+ friend std::size_t hash_value(const Expensive &object)
+ { return StrHasher()(object.get_key().c_str()); }
+};
+
+// A set and unordered_set that store Expensive objects
+typedef set<Expensive> Set;
+typedef unordered_set<Expensive> UnorderedSet;
+
+// Search functions
+Expensive *get_from_set(const char* key, Set &set_object)
+{
+ Set::iterator it = set_object.find(Expensive(key));
+ if( it == set_object.end() ) return 0;
+ return &*it;
+}
+
+Expensive *get_from_uset(const char* key, UnorderedSet &uset_object)
+{
+ UnorderedSet::iterator it = uset_object.find(Expensive (key));
+ if( it == uset_object.end() ) return 0;
+ return &*it;
+}
+//]
+
+//[doc_assoc_optimized_code_optimized_find
+// These compare Expensive and a c-string
+struct StrExpComp
+{
+ bool operator()(const char *str, const Expensive &c) const
+ { return std::strcmp(str, c.get_key().c_str()) < 0; }
+
+ bool operator()(const Expensive &c, const char *str) const
+ { return std::strcmp(c.get_key().c_str(), str) < 0; }
+};
+
+struct StrExpEqual
+{
+ bool operator()(const char *str, const Expensive &c) const
+ { return std::strcmp(str, c.get_key().c_str()) == 0; }
+
+ bool operator()(const Expensive &c, const char *str) const
+ { return std::strcmp(c.get_key().c_str(), str) == 0; }
+};
+
+// Optimized search functions
+Expensive *get_from_set_optimized(const char* key, Set &set_object)
+{
+ Set::iterator it = set_object.find(key, StrExpComp());
+ if( it == set_object.end() ) return 0;
+ return &*it;
+}
+
+Expensive *get_from_uset_optimized(const char* key, UnorderedSet &uset_object)
+{
+ UnorderedSet::iterator it = uset_object.find(key, StrHasher(), StrExpEqual());
+ if( it == uset_object.end() ) return 0;
+ return &*it;
+}
+//]
+
+//[doc_assoc_optimized_code_normal_insert
+// Insertion functions
+bool insert_to_set(const char* key, Set &set_object)
+{
+ Expensive *pobject = new Expensive(key);
+ bool success = set_object.insert(*pobject).second;
+ if(!success) delete pobject;
+ return success;
+}
+
+bool insert_to_uset(const char* key, UnorderedSet &uset_object)
+{
+ Expensive *pobject = new Expensive(key);
+ bool success = uset_object.insert(*pobject).second;
+ if(!success) delete pobject;
+ return success;
+}
+//]
+
+//[doc_assoc_optimized_code_optimized_insert
+// Optimized insertion functions
+bool insert_to_set_optimized(const char* key, Set &set_object)
+{
+ Set::insert_commit_data insert_data;
+ bool success = set_object.insert_check(key, StrExpComp(), insert_data).second;
+ if(success) set_object.insert_commit(*new Expensive(key), insert_data);
+ return success;
+}
+
+bool insert_to_uset_optimized(const char* key, UnorderedSet &uset_object)
+{
+ UnorderedSet::insert_commit_data insert_data;
+ bool success = uset_object.insert_check
+ (key, StrHasher(), StrExpEqual(), insert_data).second;
+ if(success) uset_object.insert_commit(*new Expensive(key), insert_data);
+ return success;
+}
+//]
+
+int main()
+{
+ Set set;
+ UnorderedSet::bucket_type buckets[10];
+ UnorderedSet unordered_set(UnorderedSet::bucket_traits(buckets, 10));
+
+ const char * const expensive_key
+ = "A long string that avoids small string optimization";
+
+ Expensive value(expensive_key);
+
+ if(get_from_set(expensive_key, set)){
+ return 1;
+ }
+
+ if(get_from_uset(expensive_key, unordered_set)){
+ return 1;
+ }
+
+ if(get_from_set_optimized(expensive_key, set)){
+ return 1;
+ }
+
+ if(get_from_uset_optimized(expensive_key, unordered_set)){
+ return 1;
+ }
+
+ Set::iterator setit = set.insert(value).first;
+ UnorderedSet::iterator unordered_setit = unordered_set.insert(value).first;
+
+ if(!get_from_set(expensive_key, set)){
+ return 1;
+ }
+
+ if(!get_from_uset(expensive_key, unordered_set)){
+ return 1;
+ }
+
+ if(!get_from_set_optimized(expensive_key, set)){
+ return 1;
+ }
+
+ if(!get_from_uset_optimized(expensive_key, unordered_set)){
+ return 1;
+ }
+
+ set.erase(setit);
+ unordered_set.erase(unordered_setit);
+
+ if(!insert_to_set(expensive_key, set)){
+ return 1;
+ }
+
+ if(!insert_to_uset(expensive_key, unordered_set)){
+ return 1;
+ }
+
+ {
+ Expensive *ptr = &*set.begin();
+ set.clear();
+ delete ptr;
+ }
+
+ {
+ Expensive *ptr = &*unordered_set.begin();
+ unordered_set.clear();
+ delete ptr;
+ }
+
+ if(!insert_to_set_optimized(expensive_key, set)){
+ return 1;
+ }
+
+ if(!insert_to_uset_optimized(expensive_key, unordered_set)){
+ return 1;
+ }
+
+ {
+ Expensive *ptr = &*set.begin();
+ set.clear();
+ delete ptr;
+ }
+
+ {
+ Expensive *ptr = &*unordered_set.begin();
+ unordered_set.clear();
+ delete ptr;
+ }
+
+ setit = set.insert(value).first;
+ unordered_setit = unordered_set.insert(value).first;
+
+ if(insert_to_set(expensive_key, set)){
+ return 1;
+ }
+
+ if(insert_to_uset(expensive_key, unordered_set)){
+ return 1;
+ }
+
+ if(insert_to_set_optimized(expensive_key, set)){
+ return 1;
+ }
+
+ if(insert_to_uset_optimized(expensive_key, unordered_set)){
+ return 1;
+ }
+
+ set.erase(value);
+ unordered_set.erase(value);
+
+ return 0;
+}
Added: sandbox/move/libs/intrusive/example/doc_auto_unlink.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_auto_unlink.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,82 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_auto_unlink_code
+#include <boost/intrusive/list.hpp>
+#include <cassert>
+
+using namespace boost::intrusive;
+
+typedef list_base_hook<link_mode<auto_unlink> > auto_unlink_hook;
+
+class MyClass : public auto_unlink_hook
+ //This hook removes the node in the destructor
+{
+ int int_;
+
+ public:
+ MyClass(int i = 0) : int_(i) {}
+ void unlink() { auto_unlink_hook::unlink(); }
+ bool is_linked() { return auto_unlink_hook::is_linked(); }
+};
+
+//Define a list that will store values using the base hook
+//The list can't have constant-time size!
+typedef list< MyClass, constant_time_size<false> > List;
+
+int main()
+{
+ //Create the list
+ List l;
+ {
+ //Create myclass and check it's linked
+ MyClass myclass;
+ assert(myclass.is_linked() == false);
+
+ //Insert the object
+ l.push_back(myclass);
+
+ //Check that we have inserted the object
+ assert(l.empty() == false);
+ assert(&l.front() == &myclass);
+ assert(myclass.is_linked() == true);
+
+ //Now myclass' destructor will unlink it
+ //automatically
+ }
+
+ //Check auto-unlink has been executed
+ assert(l.empty() == true);
+
+ {
+ //Now test the unlink() function
+
+ //Create myclass and check it's linked
+ MyClass myclass;
+ assert(myclass.is_linked() == false);
+
+ //Insert the object
+ l.push_back(myclass);
+
+ //Check that we have inserted the object
+ assert(l.empty() == false);
+ assert(&l.front() == &myclass);
+ assert(myclass.is_linked() == true);
+
+ //Now unlink the node
+ myclass.unlink();
+
+ //Check auto-unlink has been executed
+ assert(l.empty() == true);
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_avl_set.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_avl_set.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,86 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_avl_set_code
+#include <boost/intrusive/avl_set.hpp>
+#include <vector>
+#include <algorithm>
+#include <cassert>
+
+using namespace boost::intrusive;
+
+ //This is a base hook optimized for size
+class MyClass : public avl_set_base_hook<optimize_size<true> >
+{
+ int int_;
+
+ public:
+ //This is a member hook
+ avl_set_member_hook<> member_hook_;
+
+ MyClass(int i)
+ : int_(i)
+ {}
+ friend bool operator< (const MyClass &a, const MyClass &b)
+ { return a.int_ < b.int_; }
+ friend bool operator> (const MyClass &a, const MyClass &b)
+ { return a.int_ > b.int_; }
+ friend bool operator== (const MyClass &a, const MyClass &b)
+ { return a.int_ == b.int_; }
+};
+
+//Define an avl_set using the base hook that will store values in reverse order
+typedef avl_set< MyClass, compare<std::greater<MyClass> > > BaseSet;
+
+//Define an multiset using the member hook
+typedef member_hook<MyClass, avl_set_member_hook<>, &MyClass::member_hook_> MemberOption;
+typedef avl_multiset< MyClass, MemberOption> MemberMultiset;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseSet baseset;
+ MemberMultiset membermultiset;
+
+ //Check that size optimization is activated in the base hook
+ assert(sizeof(avl_set_base_hook<optimize_size<true> >) == 3*sizeof(void*));
+ //Check that size optimization is deactivated in the member hook
+ assert(sizeof(avl_set_member_hook<>) > 3*sizeof(void*));
+
+ //Now insert them in the sets
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
+ baseset.insert(*it);
+ membermultiset.insert(*it);
+ }
+
+ //Now test avl_sets
+ {
+ BaseSet::reverse_iterator rbit(baseset.rbegin()), rbitend(baseset.rend());
+ MemberMultiset::iterator mit(membermultiset.begin()), mitend(membermultiset.end());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook avl_set
+ for(; it != itend; ++it, ++rbit)
+ if(&*rbit != &*it) return 1;
+
+ //Test the objects inserted in the member hook avl_set
+ for(it = values.begin(); it != itend; ++it, ++mit)
+ if(&*mit != &*it) return 1;
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_avltree_algorithms.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_avltree_algorithms.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,85 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_avltree_algorithms_code
+#include <boost/intrusive/avltree_algorithms.hpp>
+#include <cassert>
+
+struct my_node
+{
+ my_node(int i = 0)
+ : int_(i)
+ {}
+ my_node *parent_, *left_, *right_;
+ int balance_;
+ //other members
+ int int_;
+};
+
+//Define our own avltree_node_traits
+struct my_avltree_node_traits
+{
+ typedef my_node node;
+ typedef my_node * node_ptr;
+ typedef const my_node * const_node_ptr;
+ typedef int balance;
+
+ static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
+ static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
+ static node_ptr get_left(const_node_ptr n) { return n->left_; }
+ static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
+ static node_ptr get_right(const_node_ptr n) { return n->right_; }
+ static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
+ static balance get_balance(const_node_ptr n) { return n->balance_; }
+ static void set_balance(node_ptr n, balance b) { n->balance_ = b; }
+ static balance negative() { return -1; }
+ static balance zero() { return 0; }
+ static balance positive() { return 1; }
+};
+
+struct node_ptr_compare
+{
+ bool operator()(const my_node *a, const my_node *b)
+ { return a->int_ < b->int_; }
+};
+
+int main()
+{
+ typedef boost::intrusive::avltree_algorithms<my_avltree_node_traits> algo;
+ my_node header, two(2), three(3);
+
+ //Create an empty avltree container:
+ //"header" will be the header node of the tree
+ algo::init_header(&header);
+
+ //Now insert node "two" in the tree using the sorting functor
+ algo::insert_equal_upper_bound(&header, &two, node_ptr_compare());
+
+ //Now insert node "three" in the tree using the sorting functor
+ algo::insert_equal_lower_bound(&header, &three, node_ptr_compare());
+
+ //Now take the first node (the left node of the header)
+ my_node *n = header.left_;
+ assert(n == &two);
+
+ //Now go to the next node
+ n = algo::next_node(n);
+ assert(n == &three);
+
+ //Erase a node just using a pointer to it
+ algo::unlink(&two);
+
+ //Erase a node using also the header (faster)
+ algo::erase(&header, &three);
+ return 0;
+}
+
+//]
Added: sandbox/move/libs/intrusive/example/doc_bucket_traits.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_bucket_traits.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,83 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_bucket_traits
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/functional/hash.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+//A class to be inserted in an unordered_set
+class MyClass : public unordered_set_base_hook<>
+{
+ int int_;
+
+ public:
+ MyClass(int i = 0) : int_(i)
+ {}
+
+ friend bool operator==(const MyClass &l, const MyClass &r)
+ { return l.int_ == r.int_; }
+ friend std::size_t hash_value(const MyClass &v)
+ { return boost::hash_value(v.int_); }
+};
+
+//Define the base hook option
+typedef base_hook< unordered_set_base_hook<> > BaseHookOption;
+
+//Obtain the types of the bucket and the bucket pointer
+typedef unordered_bucket<BaseHookOption>::type BucketType;
+typedef unordered_bucket_ptr<BaseHookOption>::type BucketPtr;
+
+//The custom bucket traits.
+class custom_bucket_traits
+{
+ public:
+ static const int NumBuckets = 100;
+
+ custom_bucket_traits(BucketPtr buckets)
+ : buckets_(buckets)
+ {}
+
+ //Functions to be implemented by custom bucket traits
+ BucketPtr bucket_begin() const { return buckets_; }
+ std::size_t bucket_count() const { return NumBuckets;}
+
+ private:
+ BucketPtr buckets_;
+};
+
+//Define the container using the custom bucket traits
+typedef unordered_set<MyClass, bucket_traits<custom_bucket_traits> > BucketTraitsUset;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ std::vector<MyClass> values;
+
+ //Fill values
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ //Now create the bucket array and the custom bucket traits object
+ BucketType buckets[custom_bucket_traits::NumBuckets];
+ custom_bucket_traits btraits(buckets);
+
+ //Now create the unordered set
+ BucketTraitsUset uset(btraits);
+
+ //Insert the values in the unordered set
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ uset.insert(*it);
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_clone_from.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_clone_from.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,74 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_clone_from
+#include <boost/intrusive/list.hpp>
+#include <iostream>
+#include <vector>
+
+using namespace boost::intrusive;
+
+//A class that can be inserted in an intrusive list
+class my_class : public list_base_hook<>
+{
+ public:
+ friend bool operator==(const my_class &a, const my_class &b)
+ { return a.int_ == b.int_; }
+
+ int int_;
+
+ //...
+};
+
+//Definition of the intrusive list
+typedef list<my_class> my_class_list;
+
+//Cloner object function
+struct new_cloner
+{
+ my_class *operator()(const my_class &clone_this)
+ { return new my_class(clone_this); }
+};
+
+//The disposer object function
+struct delete_disposer
+{
+ void operator()(my_class *delete_this)
+ { delete delete_this; }
+};
+
+int main()
+{
+ const int MaxElem = 100;
+ std::vector<my_class> nodes(MaxElem);
+
+ //Fill all the nodes and insert them in the list
+ my_class_list list;
+
+ for(int i = 0; i < MaxElem; ++i) nodes[i].int_ = i;
+
+ list.insert(list.end(), nodes.begin(), nodes.end());
+
+ //Now clone "list" using "new" and "delete" object functions
+ my_class_list cloned_list;
+ cloned_list.clone_from(list, new_cloner(), delete_disposer());
+
+ //Test that both are equal
+ if(cloned_list != list)
+ std::cout << "Both lists are different" << std::endl;
+ else
+ std::cout << "Both lists are equal" << std::endl;
+
+ //Don't forget to free the memory from the second list
+ cloned_list.clear_and_dispose(delete_disposer());
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_entity.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_entity.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,60 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_entity_code
+#include <boost/intrusive/list.hpp>
+
+using namespace boost::intrusive;
+
+//A class that can be inserted in an intrusive list
+class entity : public list_base_hook<>
+{
+ public:
+ virtual ~entity();
+ //...
+};
+
+//"some_entity" derives from "entity"
+class some_entity : public entity
+{/**/};
+
+//Definition of the intrusive list
+typedef list<entity> entity_list;
+
+//A global list
+entity_list global_list;
+
+//The destructor removes itself from the global list
+entity::~entity()
+{ global_list.erase(entity_list::s_iterator_to(*this)); }
+
+//Function to insert a new "some_entity" in the global list
+void insert_some_entity()
+{ global_list.push_back (*new some_entity(/*...*/)); }
+
+//Function to clear an entity from the intrusive global list
+void clear_list ()
+{
+ // entity's destructor removes itself from the global list implicitly
+ while (!global_list.empty())
+ delete &global_list.front();
+}
+
+int main()
+{
+ //Insert some new entities
+ insert_some_entity();
+ insert_some_entity();
+ //global_list's destructor will free objects
+ return 0;
+}
+
+//]
Added: sandbox/move/libs/intrusive/example/doc_erasing_and_disposing.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_erasing_and_disposing.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,70 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_erasing_and_disposing
+#include <boost/intrusive/list.hpp>
+
+using namespace boost::intrusive;
+
+//A class that can be inserted in an intrusive list
+class my_class : public list_base_hook<>
+{
+ public:
+ my_class(int i)
+ : int_(i)
+ {}
+
+ int int_;
+ //...
+};
+
+//Definition of the intrusive list
+typedef list<my_class> my_class_list;
+
+//The predicate function
+struct is_even
+{
+ bool operator()(const my_class &c) const
+ { return 0 == (c.int_ % 2); }
+};
+
+//The disposer object function
+struct delete_disposer
+{
+ void operator()(my_class *delete_this)
+ { delete delete_this; }
+};
+
+int main()
+{
+ const int MaxElem = 100;
+
+ //Fill all the nodes and insert them in the list
+ my_class_list list;
+
+ try{
+ //Insert new objects in the container
+ for(int i = 0; i < MaxElem; ++i) list.push_back(*new my_class(i));
+
+ //Now use remove_and_dispose_if to erase and delete the objects
+ list.remove_and_dispose_if(is_even(), delete_disposer());
+ }
+ catch(...){
+ //If something throws, make sure that all the memory is freed
+ list.clear_and_dispose(delete_disposer());
+ throw;
+ }
+
+ //Dispose remaining elements
+ list.erase_and_dispose(list.begin(), list.end(), delete_disposer());
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_external_value_traits.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_external_value_traits.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,129 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_external_value_traits
+#include <boost/intrusive/list.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+//This type is not modifiable so we can't store hooks or custom nodes
+typedef int identifier_t;
+
+//This value traits will associate elements from an array of identifiers with
+//elements of an array of nodes. The element i of the value array will use the
+//node i of the node array:
+class external_traits
+{
+ //Non-copyable
+ external_traits(const external_traits &);
+ external_traits& operator=(const external_traits &);
+
+ public:
+ typedef list_node_traits<void*> node_traits;
+ typedef node_traits::node node;
+ typedef node * node_ptr;
+ typedef const node * const_node_ptr;
+ typedef identifier_t value_type;
+ typedef identifier_t * pointer;
+ typedef const identifier_t * const_pointer;
+ static const link_mode_type link_mode = normal_link;
+
+ external_traits(pointer ids, std::size_t NumElements)
+ : ids_(ids), nodes_(NumElements)
+ {}
+
+ ///Note: non static functions!
+ node_ptr to_node_ptr (value_type &value)
+ { return &this->nodes_[0] + (&value - this->ids_); }
+ const_node_ptr to_node_ptr (const value_type &value) const
+ { return &this->nodes_[0] + (&value - this->ids_); }
+ pointer to_value_ptr(node_ptr n)
+ { return this->ids_ + (n - &this->nodes_[0]); }
+ const_pointer to_value_ptr(const_node_ptr n) const
+ { return this->ids_ + (n - &this->nodes_[0]); }
+
+ private:
+ pointer ids_;
+ //This is an array of nodes that is necessary to form the linked list
+ std::vector<list_node_traits<void*>::node> nodes_;
+};
+
+//This is the value traits class that will be stored in the container
+//and that will lead to the external traits using the address
+//of the container.
+struct internal_traits
+{
+ static const bool external_value_traits = true;
+ typedef external_traits value_traits;
+
+ template<class Container>
+ value_traits &get_value_traits(Container &cont);
+
+ template<class Container>
+ const value_traits &get_value_traits(const Container &cont) const;
+};
+
+//The intrusive list that will use external value traits
+typedef list<identifier_t, value_traits<internal_traits> > List;
+
+class data_holder
+ : public List
+{
+ public:
+ data_holder(identifier_t *ids, std::size_t NumElements)
+ : List()
+ , external_traits_(ids, NumElements)
+ {}
+ external_traits external_traits_;
+};
+
+template<class Container>
+internal_traits::value_traits &internal_traits::get_value_traits(Container &cont)
+{ return static_cast<data_holder&>(cont).external_traits_; }
+
+template<class Container>
+const internal_traits::value_traits &internal_traits::get_value_traits(const Container &cont) const
+{ return static_cast<const data_holder&>(cont).external_traits_; }
+
+int main()
+{
+ const int NumElements = 100;
+
+ //This is an array of ids that we want to "store"
+ identifier_t ids [NumElements];
+
+ //Initialize id objects, each one with a different number
+ for(int i = 0; i != NumElements; ++i) ids[i] = i;
+
+ //The data holding the list and the external traits
+ data_holder data(ids, NumElements);
+
+ //This list will store ids without modifying identifier_t instances
+ //Stateful value traits must be explicitly passed in the constructor.
+ List &my_list = data;
+
+ //Insert ids in reverse order in the list
+ for(identifier_t * it(&ids[0]), *itend(&ids[NumElements]); it != itend; ++it)
+ my_list.push_front(*it);
+
+ //Now test lists
+ List::const_iterator list_it (my_list.cbegin());
+ identifier_t *it_val(&ids[NumElements]-1), *it_rbeg_val(&ids[0] -1);
+
+ //Test the objects inserted in the base hook list
+ for(; it_val != it_rbeg_val; --it_val, ++list_it){
+ if(&*list_it != &*it_val) return 1;
+ }
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_how_to_use.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_how_to_use.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,75 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_how_to_use_code
+#include <boost/intrusive/list.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+class MyClass : public list_base_hook<>
+{
+ int int_;
+
+ public:
+ list_member_hook<> member_hook_;
+
+ MyClass(int i) : int_(i) {}
+};
+
+//Define a list that will store MyClass using the base hook
+typedef list<MyClass> BaseList;
+
+//Define a list that will store MyClass using the member hook
+typedef member_hook
+ < MyClass, list_member_hook<>, &MyClass::member_hook_> MemberOption;
+typedef list<MyClass, MemberOption> MemberList;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseList baselist;
+ MemberList memberlist;
+
+ //Now insert them in the reverse order in the base hook list
+ for(VectIt it(values.begin()), itend(values.end())
+ ; it != itend ; ++it){
+ baselist.push_front(*it);
+ }
+
+ //Now insert them in the same order as in vector in the member hook list
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ memberlist.push_back(*it);
+
+ //Now test lists
+ {
+ BaseList::reverse_iterator rbit(baselist.rbegin()), rbitend(baselist.rend());
+ MemberList::iterator mit(memberlist.begin()), mitend(memberlist.end());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook list
+ for(; it != itend; ++it, ++rbit)
+ if(&*rbit != &*it) return 1;
+
+ //Test the objects inserted in the member hook list
+ for(it = values.begin(); it != itend; ++it, ++mit)
+ if(&*mit != &*it) return 1;
+ }
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_iterator_from_value.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_iterator_from_value.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,97 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_iterator_from_value
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/functional/hash.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+class intrusive_data
+{
+ int data_id_;
+ public:
+
+ void set(int id) { data_id_ = id; }
+
+ //This class can be inserted in an intrusive list
+ list_member_hook<> list_hook_;
+
+ //This class can be inserted in an intrusive unordered_set
+ unordered_set_member_hook<> unordered_set_hook_;
+
+ //Comparison operators
+ friend bool operator==(const intrusive_data &a, const intrusive_data &b)
+ { return a.data_id_ == b.data_id_; }
+
+ friend bool operator!=(const intrusive_data &a, const intrusive_data &b)
+ { return a.data_id_ != b.data_id_; }
+
+ //The hash function
+ friend std::size_t hash_value(const intrusive_data &i)
+ { return boost::hash<int>()(i.data_id_); }
+};
+
+//Definition of the intrusive list that will hold intrusive_data
+typedef member_hook<intrusive_data, list_member_hook<>
+ , &intrusive_data::list_hook_> MemberListOption;
+typedef list<intrusive_data, MemberListOption> list_t;
+
+//Definition of the intrusive unordered_set that will hold intrusive_data
+typedef member_hook
+ < intrusive_data, unordered_set_member_hook<>
+ , &intrusive_data::unordered_set_hook_> MemberUsetOption;
+typedef boost::intrusive::unordered_set
+ < intrusive_data, MemberUsetOption> unordered_set_t;
+
+int main()
+{
+ //Create MaxElem objects
+ const int MaxElem = 100;
+ std::vector<intrusive_data> nodes(MaxElem);
+
+ //Declare the intrusive containers
+ list_t list;
+ unordered_set_t::bucket_type buckets[MaxElem];
+ unordered_set_t unordered_set
+ (unordered_set_t::bucket_traits(buckets, MaxElem));
+
+ //Initialize all the nodes
+ for(int i = 0; i < MaxElem; ++i) nodes[i].set(i);
+
+ //Now insert them in both intrusive containers
+ list.insert(list.end(), nodes.begin(), nodes.end());
+ unordered_set.insert(nodes.begin(), nodes.end());
+
+ //Now check the iterator_to function
+ list_t::iterator list_it(list.begin());
+ for(int i = 0; i < MaxElem; ++i, ++list_it)
+ if(list.iterator_to(nodes[i]) != list_it ||
+ list_t::s_iterator_to(nodes[i]) != list_it)
+ return 1;
+
+ //Now check unordered_set::s_iterator_to (which is a member function)
+ //and unordered_set::s_local_iterator_to (which is an static member function)
+ unordered_set_t::iterator unordered_set_it(unordered_set.begin());
+ for(int i = 0; i < MaxElem; ++i){
+ unordered_set_it = unordered_set.find(nodes[i]);
+ if(unordered_set.iterator_to(nodes[i]) != unordered_set_it)
+ return 1;
+ if(*unordered_set.local_iterator_to(nodes[i]) != *unordered_set_it ||
+ *unordered_set_t::s_local_iterator_to(nodes[i]) != *unordered_set_it )
+ return 1;
+ }
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_list.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_list.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,76 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_list_code
+#include <boost/intrusive/list.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+class MyClass : public list_base_hook<> //This is a derivation hook
+{
+ int int_;
+
+ public:
+ //This is a member hook
+ list_member_hook<> member_hook_;
+
+ MyClass(int i)
+ : int_(i)
+ {}
+};
+
+//Define a list that will store MyClass using the public base hook
+typedef list<MyClass> BaseList;
+
+//Define a list that will store MyClass using the public member hook
+typedef list< MyClass
+ , member_hook< MyClass, list_member_hook<>, &MyClass::member_hook_>
+ > MemberList;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseList baselist;
+ MemberList memberlist;
+
+ //Now insert them in the reverse order in the base hook list
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ baselist.push_front(*it);
+
+ //Now insert them in the same order as in vector in the member hook list
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ memberlist.push_back(*it);
+
+ //Now test lists
+ {
+ BaseList::reverse_iterator rbit(baselist.rbegin()), rbitend(baselist.rend());
+ MemberList::iterator mit(memberlist.begin()), mitend(memberlist.end());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook list
+ for(; it != itend; ++it, ++rbit)
+ if(&*rbit != &*it) return 1;
+
+ //Test the objects inserted in the member hook list
+ for(it = values.begin(); it != itend; ++it, ++mit)
+ if(&*mit != &*it) return 1;
+ }
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_list_algorithms.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_list_algorithms.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,66 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_list_algorithms_code
+#include <boost/intrusive/circular_list_algorithms.hpp>
+#include <cassert>
+
+struct my_node
+{
+ my_node *next_, *prev_;
+ //other members...
+};
+
+//Define our own list_node_traits
+struct my_list_node_traits
+{
+ typedef my_node node;
+ typedef my_node * node_ptr;
+ typedef const my_node * const_node_ptr;
+ static node_ptr get_next(const_node_ptr n) { return n->next_; }
+ static void set_next(node_ptr n, node_ptr next) { n->next_ = next; }
+ static node *get_previous(const_node_ptr n) { return n->prev_; }
+ static void set_previous(node_ptr n, node_ptr prev){ n->prev_ = prev; }
+};
+
+int main()
+{
+ typedef boost::intrusive::circular_list_algorithms<my_list_node_traits> algo;
+ my_node one, two, three;
+
+ //Create an empty doubly linked list container:
+ //"one" will be the first node of the container
+ algo::init_header(&one);
+ assert(algo::count(&one) == 1);
+
+ //Now add a new node before "one"
+ algo::link_before(&one, &two);
+ assert(algo::count(&one) == 2);
+
+ //Now add a new node after "two"
+ algo::link_after(&two, &three);
+ assert(algo::count(&one) == 3);
+
+ //Now unlink the node after one
+ algo::unlink(&three);
+ assert(algo::count(&one) == 2);
+
+ //Now unlink two
+ algo::unlink(&two);
+ assert(algo::count(&one) == 1);
+
+ //Now unlink one
+ algo::unlink(&one);
+ assert(algo::count(&one) == 1);
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_offset_ptr.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_offset_ptr.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,100 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+//This is needed to allow concurrent test execution in
+//several platforms. The shared memory must be unique
+//for each process...
+#include <boost/interprocess/detail/os_thread_functions.hpp>
+#include <sstream>
+
+const char *get_shared_memory_name()
+{
+ std::stringstream s;
+ s << "process_" << boost::interprocess::detail::get_current_process_id();
+ static std::string str = s.str();
+ return str.c_str();
+}
+
+//[doc_offset_ptr_0
+#include <boost/intrusive/list.hpp>
+#include <boost/interprocess/offset_ptr.hpp>
+
+using namespace boost::intrusive;
+namespace ip = boost::interprocess;
+
+class shared_memory_data
+ //Declare the hook with an offset_ptr from Boost.Interprocess
+ //to make this class compatible with shared memory
+ : public list_base_hook< void_pointer< ip::offset_ptr<void> > >
+{
+ int data_id_;
+ public:
+
+ int get() const { return data_id_; }
+ void set(int id) { data_id_ = id; }
+};
+//]
+
+//[doc_offset_ptr_1
+#include <boost/interprocess/managed_shared_memory.hpp>
+#include <boost/interprocess/containers/vector.hpp>
+#include <boost/interprocess/containers/list.hpp>
+#include <boost/interprocess/allocators/allocator.hpp>
+
+//Definition of the shared memory friendly intrusive list
+typedef ip::list<shared_memory_data> shm_list_t;
+
+int main()
+{
+ //Now create an intrusive list in shared memory:
+ //nodes and the container itself must be created in shared memory
+ const int MaxElem = 100;
+ const int ShmSize = 50000;
+ const char *ShmName = get_shared_memory_name();
+ {
+ //Erase all old shared memory
+ ip::shared_memory_object::remove(ShmName);
+ ip::managed_shared_memory shm(ip::create_only, ShmName, ShmSize);
+
+ //Create all nodes in shared memory using a shared memory vector
+ //See Boost.Interprocess documentation for more information on this
+ typedef ip::allocator
+ < shared_memory_data, ip::managed_shared_memory::segment_manager>
+ shm_allocator_t;
+ typedef ip::vector<shared_memory_data, shm_allocator_t> shm_vector_t;
+ shm_allocator_t shm_alloc(shm.get_segment_manager());
+ shm_vector_t *pshm_vect =
+ shm.construct<shm_vector_t>(ip::anonymous_instance)(shm_alloc);
+ pshm_vect->resize(MaxElem);
+
+ //Initialize all the nodes
+ for(int i = 0; i < MaxElem; ++i) (*pshm_vect)[i].set(i);
+
+ //Now create the shared memory intrusive list
+ shm_list_t *plist = shm.construct<shm_list_t>(ip::anonymous_instance)();
+ plist->insert(plist->end(), pshm_vect->begin(), pshm_vect->end());
+
+ //Check all the inserted nodes
+ int checker = 0;
+ for( shm_list_t::const_iterator it = plist->begin(), itend(plist->end())
+ ; it != itend; ++it, ++checker){
+ if(it->get() != checker) return false;
+ }
+
+ //Now delete the list and after that, the nodes
+ shm.destroy_ptr(plist);
+ shm.destroy_ptr(pshm_vect);
+ }
+ ip::shared_memory_object::remove(ShmName);
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_positional_insertion.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_positional_insertion.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,74 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2009-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_positional_insertion
+#include <boost/intrusive/set.hpp>
+#include <vector>
+#include <algorithm>
+#include <cassert>
+
+using namespace boost::intrusive;
+
+//A simple class with a set hook
+class MyClass : public set_base_hook<>
+{
+ public:
+ int int_;
+
+ MyClass(int i) : int_(i) {}
+ friend bool operator< (const MyClass &a, const MyClass &b)
+ { return a.int_ < b.int_; }
+ friend bool operator> (const MyClass &a, const MyClass &b)
+ { return a.int_ > b.int_; }
+};
+
+int main()
+{
+ //Create some ORDERED elements
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ { //Data is naturally ordered in the vector with the same criteria
+ //as multiset's comparison predicate, so we can just push back
+ //all elements, which is more efficient than normal insertion
+ multiset<MyClass> mset;
+ for(int i = 0; i < 100; ++i) mset.push_back(values[i]);
+
+ //Now check orderd invariant
+ multiset<MyClass>::const_iterator next(mset.cbegin()), it(next++);
+ for(int i = 0; i < 99; ++i, ++it, ++next) assert(*it < *next);
+ }
+ { //Now the correct order for the set is the reverse order
+ //so let's push front all elements
+ multiset<MyClass, compare< std::greater<MyClass> > > mset;
+ for(int i = 0; i < 100; ++i) mset.push_front(values[i]);
+
+ //Now check orderd invariant
+ multiset<MyClass, compare< std::greater<MyClass> > >::
+ const_iterator next(mset.cbegin()), it(next++);
+ for(int i = 0; i < 99; ++i, ++it, ++next) assert(*it > *next);
+ }
+ { //Now push the first and the last and insert the rest
+ //before the last position using "insert_before"
+ multiset<MyClass> mset;
+ mset.insert_before(mset.begin(), values[0]);
+ multiset<MyClass>::const_iterator pos =
+ mset.insert_before(mset.end(), values[99]);
+ for(int i = 1; i < 99; ++i) mset.insert_before(pos, values[i]);
+
+ //Now check orderd invariant
+ multiset<MyClass>::const_iterator next(mset.cbegin()), it(next++);
+ for(int i = 0; i < 99; ++i, ++it, ++next) assert(*it < *next);
+ }
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_rbtree_algorithms.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_rbtree_algorithms.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,83 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_rbtree_algorithms_code
+#include <boost/intrusive/rbtree_algorithms.hpp>
+#include <cassert>
+
+struct my_node
+{
+ my_node(int i = 0)
+ : int_(i)
+ {}
+ my_node *parent_, *left_, *right_;
+ int color_;
+ //other members
+ int int_;
+};
+
+//Define our own rbtree_node_traits
+struct my_rbtree_node_traits
+{
+ typedef my_node node;
+ typedef my_node * node_ptr;
+ typedef const my_node * const_node_ptr;
+ typedef int color;
+ static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
+ static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
+ static node_ptr get_left(const_node_ptr n) { return n->left_; }
+ static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
+ static node_ptr get_right(const_node_ptr n) { return n->right_; }
+ static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
+ static color get_color(const_node_ptr n) { return n->color_; }
+ static void set_color(node_ptr n, color c) { n->color_ = c; }
+ static color black() { return color(0); }
+ static color red() { return color(1); }
+};
+
+struct node_ptr_compare
+{
+ bool operator()(const my_node *a, const my_node *b)
+ { return a->int_ < b->int_; }
+};
+
+int main()
+{
+ typedef boost::intrusive::rbtree_algorithms<my_rbtree_node_traits> algo;
+ my_node header, two(2), three(3);
+
+ //Create an empty rbtree container:
+ //"header" will be the header node of the tree
+ algo::init_header(&header);
+
+ //Now insert node "two" in the tree using the sorting functor
+ algo::insert_equal_upper_bound(&header, &two, node_ptr_compare());
+
+ //Now insert node "three" in the tree using the sorting functor
+ algo::insert_equal_lower_bound(&header, &three, node_ptr_compare());
+
+ //Now take the first node (the left node of the header)
+ my_node *n = header.left_;
+ assert(n == &two);
+
+ //Now go to the next node
+ n = algo::next_node(n);
+ assert(n == &three);
+
+ //Erase a node just using a pointer to it
+ algo::unlink(&two);
+
+ //Erase a node using also the header (faster)
+ algo::erase(&header, &three);
+ return 0;
+}
+
+//]
Added: sandbox/move/libs/intrusive/example/doc_set.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_set.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,86 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_set_code
+#include <boost/intrusive/set.hpp>
+#include <vector>
+#include <algorithm>
+#include <cassert>
+
+using namespace boost::intrusive;
+
+ //This is a base hook optimized for size
+class MyClass : public set_base_hook<optimize_size<true> >
+{
+ int int_;
+
+ public:
+ //This is a member hook
+ set_member_hook<> member_hook_;
+
+ MyClass(int i)
+ : int_(i)
+ {}
+ friend bool operator< (const MyClass &a, const MyClass &b)
+ { return a.int_ < b.int_; }
+ friend bool operator> (const MyClass &a, const MyClass &b)
+ { return a.int_ > b.int_; }
+ friend bool operator== (const MyClass &a, const MyClass &b)
+ { return a.int_ == b.int_; }
+};
+
+//Define a set using the base hook that will store values in reverse order
+typedef set< MyClass, compare<std::greater<MyClass> > > BaseSet;
+
+//Define an multiset using the member hook
+typedef member_hook<MyClass, set_member_hook<>, &MyClass::member_hook_> MemberOption;
+typedef multiset< MyClass, MemberOption> MemberMultiset;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseSet baseset;
+ MemberMultiset membermultiset;
+
+ //Check that size optimization is activated in the base hook
+ assert(sizeof(set_base_hook<optimize_size<true> >) == 3*sizeof(void*));
+ //Check that size optimization is deactivated in the member hook
+ assert(sizeof(set_member_hook<>) > 3*sizeof(void*));
+
+ //Now insert them in the reverse order in the base hook set
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
+ baseset.insert(*it);
+ membermultiset.insert(*it);
+ }
+
+ //Now test sets
+ {
+ BaseSet::reverse_iterator rbit(baseset.rbegin()), rbitend(baseset.rend());
+ MemberMultiset::iterator mit(membermultiset.begin()), mitend(membermultiset.end());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook set
+ for(; it != itend; ++it, ++rbit)
+ if(&*rbit != &*it) return 1;
+
+ //Test the objects inserted in the member hook set
+ for(it = values.begin(); it != itend; ++it, ++mit)
+ if(&*mit != &*it) return 1;
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_sg_set.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_sg_set.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,85 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_sg_set_code
+#include <boost/intrusive/sg_set.hpp>
+#include <vector>
+#include <algorithm>
+#include <cassert>
+
+using namespace boost::intrusive;
+
+class MyClass : public bs_set_base_hook<>
+{
+ int int_;
+
+ public:
+ //This is a member hook
+ bs_set_member_hook<> member_hook_;
+
+ MyClass(int i)
+ : int_(i)
+ {}
+ friend bool operator< (const MyClass &a, const MyClass &b)
+ { return a.int_ < b.int_; }
+ friend bool operator> (const MyClass &a, const MyClass &b)
+ { return a.int_ > b.int_; }
+ friend bool operator== (const MyClass &a, const MyClass &b)
+ { return a.int_ == b.int_; }
+};
+
+//Define an sg_set using the base hook that will store values in reverse order
+//and won't execute floating point operations.
+typedef sg_set
+ < MyClass, compare<std::greater<MyClass> >, floating_point<false> > BaseSet;
+
+//Define an multiset using the member hook
+typedef member_hook<MyClass, bs_set_member_hook<>, &MyClass::member_hook_> MemberOption;
+typedef sg_multiset< MyClass, MemberOption> MemberMultiset;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseSet baseset;
+ MemberMultiset membermultiset;
+
+ //Now insert them in the reverse order in the base hook sg_set
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
+ baseset.insert(*it);
+ membermultiset.insert(*it);
+ }
+
+ //Change balance factor
+ membermultiset.balance_factor(0.9f);
+
+ //Now test sg_sets
+ {
+ BaseSet::reverse_iterator rbit(baseset.rbegin()), rbitend(baseset.rend());
+ MemberMultiset::iterator mit(membermultiset.begin()), mitend(membermultiset.end());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook sg_set
+ for(; it != itend; ++it, ++rbit)
+ if(&*rbit != &*it) return 1;
+
+ //Test the objects inserted in the member hook sg_set
+ for(it = values.begin(); it != itend; ++it, ++mit)
+ if(&*mit != &*it) return 1;
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_slist.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_slist.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,79 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_slist_code
+#include <boost/intrusive/slist.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+ //This is a base hook
+class MyClass : public slist_base_hook<>
+{
+ int int_;
+
+ public:
+ //This is a member hook
+ slist_member_hook<> member_hook_;
+
+ MyClass(int i)
+ : int_(i)
+ {}
+};
+
+//Define an slist that will store MyClass using the public base hook
+typedef slist<MyClass> BaseList;
+
+//Define an slist that will store MyClass using the public member hook
+typedef member_hook<MyClass, slist_member_hook<>, &MyClass::member_hook_> MemberOption;
+typedef slist<MyClass, MemberOption> MemberList;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseList baselist;
+ MemberList memberlist;
+
+ //Now insert them in the reverse order in the base hook list
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ baselist.push_front(*it);
+
+ //Now insert them in the same order as in vector in the member hook list
+ for(BaseList::iterator it(baselist.begin()), itend(baselist.end())
+ ; it != itend; ++it){
+ memberlist.push_front(*it);
+ }
+
+ //Now test lists
+ {
+ BaseList::iterator bit(baselist.begin()), bitend(baselist.end());
+ MemberList::iterator mit(memberlist.begin()), mitend(memberlist.end());
+ VectRit rit(values.rbegin()), ritend(values.rend());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook list
+ for(; rit != ritend; ++rit, ++bit)
+ if(&*bit != &*rit) return 1;
+
+ //Test the objects inserted in the member hook list
+ for(; it != itend; ++it, ++mit)
+ if(&*mit != &*it) return 1;
+ }
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_slist_algorithms.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_slist_algorithms.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,60 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_slist_algorithms_code
+#include <boost/intrusive/circular_slist_algorithms.hpp>
+#include <cassert>
+
+struct my_node
+{
+ my_node *next_;
+ //other members...
+};
+
+//Define our own slist_node_traits
+struct my_slist_node_traits
+{
+ typedef my_node node;
+ typedef my_node * node_ptr;
+ typedef const my_node * const_node_ptr;
+ static node_ptr get_next(const_node_ptr n) { return n->next_; }
+ static void set_next(node_ptr n, node_ptr next) { n->next_ = next; }
+};
+
+int main()
+{
+ typedef boost::intrusive::circular_slist_algorithms<my_slist_node_traits> algo;
+ my_node one, two, three;
+
+ //Create an empty singly linked list container:
+ //"one" will be the first node of the container
+ algo::init_header(&one);
+ assert(algo::count(&one) == 1);
+
+ //Now add a new node
+ algo::link_after(&one, &two);
+ assert(algo::count(&one) == 2);
+
+ //Now add a new node after "one"
+ algo::link_after(&one, &three);
+ assert(algo::count(&one) == 3);
+
+ //Now unlink the node after one
+ algo::unlink_after(&one);
+ assert(algo::count(&one) == 2);
+
+ //Now unlink two
+ algo::unlink(&two);
+ assert(algo::count(&one) == 1);
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_splay_algorithms.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_splay_algorithms.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,78 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_splaytree_algorithms_code
+#include <boost/intrusive/splaytree_algorithms.hpp>
+#include <cassert>
+
+struct my_node
+{
+ my_node(int i = 0)
+ : int_(i)
+ {}
+ my_node *parent_, *left_, *right_;
+ int color_;
+ //other members
+ int int_;
+};
+
+//Define our own splaytree_node_traits
+struct my_splaytree_node_traits
+{
+ typedef my_node node;
+ typedef my_node * node_ptr;
+ typedef const my_node * const_node_ptr;
+
+ static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
+ static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
+ static node_ptr get_left(const_node_ptr n) { return n->left_; }
+ static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
+ static node_ptr get_right(const_node_ptr n) { return n->right_; }
+ static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
+};
+
+struct node_ptr_compare
+{
+ bool operator()(const my_node *a, const my_node *b)
+ { return a->int_ < b->int_; }
+};
+
+int main()
+{
+ typedef boost::intrusive::splaytree_algorithms<my_splaytree_node_traits> algo;
+ my_node header, two(2), three(3);
+
+ //Create an empty splaytree container:
+ //"header" will be the header node of the tree
+ algo::init_header(&header);
+
+ //Now insert node "two" in the tree using the sorting functor
+ algo::insert_equal_upper_bound(&header, &two, node_ptr_compare());
+
+ //Now insert node "three" in the tree using the sorting functor
+ algo::insert_equal_lower_bound(&header, &three, node_ptr_compare());
+
+ //Now take the first node (the left node of the header)
+ my_node *n = header.left_;
+ assert(n == &two);
+
+ //Now go to the next node
+ n = algo::next_node(n);
+ assert(n == &three);
+
+ //Erase a node just using a pointer to it
+ algo::unlink(&two);
+
+ //Erase a node using also the header (faster)
+ algo::erase(&header, &three);
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_splay_set.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_splay_set.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,93 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_splay_set_code
+#include <boost/intrusive/splay_set.hpp>
+#include <boost/intrusive/bs_set_hook.hpp>
+#include <vector>
+#include <algorithm>
+
+using namespace boost::intrusive;
+
+class MyClass
+ : public splay_set_base_hook<> //This is an splay tree base hook
+ , public bs_set_base_hook<> //This is a binary search tree base hook
+
+{
+ int int_;
+
+ public:
+ //This is a member hook
+ splay_set_member_hook<> member_hook_;
+
+ MyClass(int i)
+ : int_(i)
+ {}
+ friend bool operator< (const MyClass &a, const MyClass &b)
+ { return a.int_ < b.int_; }
+ friend bool operator> (const MyClass &a, const MyClass &b)
+ { return a.int_ > b.int_; }
+ friend bool operator== (const MyClass &a, const MyClass &b)
+ { return a.int_ == b.int_; }
+};
+
+//Define a set using the base hook that will store values in reverse order
+typedef splay_set< MyClass, compare<std::greater<MyClass> > > BaseSplaySet;
+
+//Define a set using the binary search tree hook
+typedef splay_set< MyClass, base_hook<bs_set_base_hook<> > > BaseBsSplaySet;
+
+//Define an multiset using the member hook
+typedef member_hook<MyClass, splay_set_member_hook<>, &MyClass::member_hook_> MemberOption;
+typedef splay_multiset< MyClass, MemberOption> MemberSplayMultiset;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseSplaySet baseset;
+ BaseBsSplaySet bsbaseset;
+ MemberSplayMultiset membermultiset;
+
+
+ //Insert values in the container
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
+ baseset.insert(*it);
+ bsbaseset.insert(*it);
+ membermultiset.insert(*it);
+ }
+
+ //Now test sets
+ {
+ BaseSplaySet::reverse_iterator rbit(baseset.rbegin()), rbitend(baseset.rend());
+ BaseBsSplaySet::iterator bsit(bsbaseset.begin()), bsitend(bsbaseset.end());
+ MemberSplayMultiset::iterator mit(membermultiset.begin()), mitend(membermultiset.end());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook set
+ for(; it != itend; ++it, ++rbit){
+ if(&*rbit != &*it) return 1;
+ }
+
+ //Test the objects inserted in member and binary search hook sets
+ for(it = values.begin(); it != itend; ++it, ++bsit, ++mit){
+ if(&*bsit != &*it) return 1;
+ if(&*mit != &*it) return 1;
+ }
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_splaytree_algorithms.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_splaytree_algorithms.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,78 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_splaytree_algorithms_code
+#include <boost/intrusive/splaytree_algorithms.hpp>
+#include <cassert>
+
+struct my_node
+{
+ my_node(int i = 0)
+ : int_(i)
+ {}
+ my_node *parent_, *left_, *right_;
+ //other members
+ int int_;
+};
+
+//Define our own splaytree_node_traits
+struct my_splaytree_node_traits
+{
+ typedef my_node node;
+ typedef my_node * node_ptr;
+ typedef const my_node * const_node_ptr;
+
+ static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
+ static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
+ static node_ptr get_left(const_node_ptr n) { return n->left_; }
+ static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
+ static node_ptr get_right(const_node_ptr n) { return n->right_; }
+ static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
+};
+
+struct node_ptr_compare
+{
+ bool operator()(const my_node *a, const my_node *b)
+ { return a->int_ < b->int_; }
+};
+
+int main()
+{
+ typedef boost::intrusive::splaytree_algorithms<my_splaytree_node_traits> algo;
+ my_node header, two(2), three(3);
+
+ //Create an empty splaytree container:
+ //"header" will be the header node of the tree
+ algo::init_header(&header);
+
+ //Now insert node "two" in the tree using the sorting functor
+ algo::insert_equal_upper_bound(&header, &two, node_ptr_compare());
+
+ //Now insert node "three" in the tree using the sorting functor
+ algo::insert_equal_lower_bound(&header, &three, node_ptr_compare());
+
+ //Now take the first node (the left node of the header)
+ my_node *n = header.left_;
+ assert(n == &two);
+
+ //Now go to the next node
+ n = algo::next_node(n);
+ assert(n == &three);
+
+ //Erase a node just using a pointer to it
+ algo::unlink(&two);
+
+ //Erase a node using also the header (faster)
+ algo::erase(&header, &three);
+ return 0;
+}
+
+//]
Added: sandbox/move/libs/intrusive/example/doc_stateful_value_traits.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_stateful_value_traits.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,87 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_stateful_value_traits
+#include <boost/intrusive/list.hpp>
+
+using namespace boost::intrusive;
+
+//This type is not modifiable so we can't store hooks or custom nodes
+typedef int identifier_t;
+
+//This value traits will associate elements from an array of identifiers with
+//elements of an array of nodes. The element i of the value array will use the
+//node i of the node array:
+struct stateful_value_traits
+{
+ typedef list_node_traits<void*> node_traits;
+ typedef node_traits::node node;
+ typedef node * node_ptr;
+ typedef const node * const_node_ptr;
+ typedef identifier_t value_type;
+ typedef identifier_t * pointer;
+ typedef const identifier_t * const_pointer;
+ static const link_mode_type link_mode = normal_link;
+
+ stateful_value_traits(pointer ids, node_ptr node_array)
+ : ids_(ids), nodes_(node_array)
+ {}
+
+ ///Note: non static functions!
+ node_ptr to_node_ptr (value_type &value)
+ { return this->nodes_ + (&value - this->ids_); }
+ const_node_ptr to_node_ptr (const value_type &value) const
+ { return this->nodes_ + (&value - this->ids_); }
+ pointer to_value_ptr(node_ptr n)
+ { return this->ids_ + (n - this->nodes_); }
+ const_pointer to_value_ptr(const_node_ptr n) const
+ { return this->ids_ + (n - this->nodes_); }
+
+ private:
+ pointer ids_;
+ node_ptr nodes_;
+};
+
+int main()
+{
+ const int NumElements = 100;
+
+ //This is an array of ids that we want to "store"
+ identifier_t ids [NumElements];
+
+ //This is an array of nodes that is necessary to form the linked list
+ list_node_traits<void*>::node nodes [NumElements];
+
+ //Initialize id objects, each one with a different number
+ for(int i = 0; i != NumElements; ++i) ids[i] = i;
+
+ //Define a list that will "link" identifiers using external nodes
+ typedef list<identifier_t, value_traits<stateful_value_traits> > List;
+
+ //This list will store ids without modifying identifier_t instances
+ //Stateful value traits must be explicitly passed in the constructor.
+ List my_list (stateful_value_traits (ids, nodes));
+
+ //Insert ids in reverse order in the list
+ for(identifier_t * it(&ids[0]), *itend(&ids[NumElements]); it != itend; ++it)
+ my_list.push_front(*it);
+
+ //Now test lists
+ List::const_iterator list_it (my_list.cbegin());
+ identifier_t *it_val(&ids[NumElements-1]), *it_rbeg_val(&ids[0]-1);
+
+ //Test the objects inserted in the base hook list
+ for(; it_val != it_rbeg_val; --it_val, ++list_it)
+ if(&*list_it != &*it_val) return 1;
+
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_treap_algorithms.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_treap_algorithms.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,79 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_treap_algorithms_code
+#include <boost/intrusive/treap_algorithms.hpp>
+#include <cassert>
+
+struct my_node
+{
+ my_node(int i = 0, unsigned int priority = 0)
+ : prio_(priority), int_(i)
+ {}
+ my_node *parent_, *left_, *right_;
+ int prio_;
+ //other members
+ int int_;
+};
+
+//Define our own treap_node_traits
+struct my_treap_node_traits
+{
+ typedef my_node node;
+ typedef my_node * node_ptr;
+ typedef const my_node * const_node_ptr;
+
+ static node_ptr get_parent(const_node_ptr n) { return n->parent_; }
+ static void set_parent(node_ptr n, node_ptr parent){ n->parent_ = parent; }
+ static node_ptr get_left(const_node_ptr n) { return n->left_; }
+ static void set_left(node_ptr n, node_ptr left) { n->left_ = left; }
+ static node_ptr get_right(const_node_ptr n) { return n->right_; }
+ static void set_right(node_ptr n, node_ptr right) { n->right_ = right; }
+};
+
+struct node_ptr_compare
+{ bool operator()(const my_node *a, const my_node *b) { return a->int_ < b->int_; } };
+
+struct node_ptr_priority
+{ bool operator()(const my_node *a, const my_node *b) { return a->prio_ < b->prio_;} };
+
+int main()
+{
+ typedef boost::intrusive::treap_algorithms<my_treap_node_traits> algo;
+ my_node header, two(2, 5), three(3, 1);
+
+ //Create an empty treap container:
+ //"header" will be the header node of the tree
+ algo::init_header(&header);
+
+ //Now insert node "two" in the tree using the sorting functor
+ algo::insert_equal_upper_bound(&header, &two, node_ptr_compare(), node_ptr_priority());
+
+ //Now insert node "three" in the tree using the sorting functor
+ algo::insert_equal_lower_bound(&header, &three, node_ptr_compare(), node_ptr_priority());
+
+ //Now take the first node (the left node of the header)
+ my_node *n = header.left_;
+ assert(n == &two);
+
+ //Now go to the next node
+ n = algo::next_node(n);
+ assert(n == &three);
+
+ //Erase a node just using a pointer to it
+ algo::unlink(&two, node_ptr_priority());
+
+ //Erase a node using also the header (faster)
+ algo::erase(&header, &three, node_ptr_priority());
+ return 0;
+}
+
+//]
Added: sandbox/move/libs/intrusive/example/doc_treap_set.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_treap_set.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,106 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_treap_set_code
+#include <boost/intrusive/treap_set.hpp>
+#include <vector>
+#include <algorithm>
+#include <cassert>
+
+using namespace boost::intrusive;
+
+class MyClass : public bs_set_base_hook<> //This is a base hook
+{
+ int int_;
+ unsigned int prio_;
+
+ public:
+ //This is a member hook
+ bs_set_member_hook<> member_hook_;
+
+ MyClass(int i, unsigned int prio) : int_(i), prio_(prio)
+ {}
+
+ unsigned int get_priority() const
+ { return this->prio_; }
+
+ //Less and greater operators
+ friend bool operator< (const MyClass &a, const MyClass &b)
+ { return a.int_ < b.int_; }
+ friend bool operator> (const MyClass &a, const MyClass &b)
+ { return a.int_ > b.int_; }
+ //Default priority compare
+ friend bool priority_order (const MyClass &a, const MyClass &b)
+ { return a.prio_ < b.prio_; } //Lower value means higher priority
+ //Inverse priority compare
+ friend bool priority_inverse_order (const MyClass &a, const MyClass &b)
+ { return a.prio_ > b.prio_; } //Higher value means higher priority
+};
+
+struct inverse_priority
+{
+ bool operator()(const MyClass &a, const MyClass &b) const
+ { return priority_inverse_order(a, b); }
+};
+
+
+//Define an treap_set using the base hook that will store values in reverse order
+typedef treap_set< MyClass, compare<std::greater<MyClass> > > BaseSet;
+
+//Define an multiset using the member hook that will store
+typedef member_hook<MyClass, bs_set_member_hook<>, &MyClass::member_hook_> MemberOption;
+typedef treap_multiset
+ < MyClass, MemberOption, priority<inverse_priority> > MemberMultiset;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i, (i % 10)));
+
+ BaseSet baseset;
+ MemberMultiset membermultiset;
+
+ //Now insert them in the sets
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
+ baseset.insert(*it);
+ membermultiset.insert(*it);
+ }
+
+ //Now test treap_sets
+ {
+ BaseSet::reverse_iterator rbit(baseset.rbegin()), rbitend(baseset.rend());
+ MemberMultiset::iterator mit(membermultiset.begin()), mitend(membermultiset.end());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook treap_set
+ for(; it != itend; ++it, ++rbit)
+ if(&*rbit != &*it) return 1;
+
+ //Test the objects inserted in the member hook treap_set
+ for(it = values.begin(); it != itend; ++it, ++mit)
+ if(&*mit != &*it) return 1;
+
+ //Test priority order
+ for(int i = 0; i < 100; ++i){
+ if(baseset.top()->get_priority() != static_cast<unsigned int>(i/10))
+ return 1;
+ if(membermultiset.top()->get_priority() != 9u - static_cast<unsigned int>(i/10))
+ return 1;
+ baseset.erase(baseset.top());
+ membermultiset.erase(membermultiset.top());
+ }
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_unordered_set.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_unordered_set.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,94 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_unordered_set_code
+#include <boost/intrusive/unordered_set.hpp>
+#include <vector>
+#include <algorithm>
+#include <boost/functional/hash.hpp>
+
+using namespace boost::intrusive;
+
+class MyClass : public unordered_set_base_hook<>
+{ //This is a derivation hook
+ int int_;
+
+ public:
+ unordered_set_member_hook<> member_hook_; //This is a member hook
+
+ MyClass(int i)
+ : int_(i)
+ {}
+
+ friend bool operator== (const MyClass &a, const MyClass &b)
+ { return a.int_ == b.int_; }
+
+ friend std::size_t hash_value(const MyClass &value)
+ { return std::size_t(value.int_); }
+};
+
+//Define an unordered_set that will store MyClass objects using the base hook
+typedef unordered_set<MyClass> BaseSet;
+
+//Define an unordered_multiset that will store MyClass using the member hook
+typedef member_hook<MyClass, unordered_set_member_hook<>, &MyClass::member_hook_>
+ MemberOption;
+typedef unordered_multiset< MyClass, MemberOption> MemberMultiSet;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create a vector with 100 different MyClass objects
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ //Create a copy of the vector
+ std::vector<MyClass> values2(values);
+
+ //Create a bucket array for base_set
+ BaseSet::bucket_type base_buckets[100];
+
+ //Create a bucket array for member_multi_set
+ MemberMultiSet::bucket_type member_buckets[200];
+
+ //Create unordered containers taking buckets as arguments
+ BaseSet base_set(BaseSet::bucket_traits(base_buckets, 100));
+ MemberMultiSet member_multi_set
+ (MemberMultiSet::bucket_traits(member_buckets, 200));
+
+ //Now insert values's elements in the unordered_set
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ base_set.insert(*it);
+
+ //Now insert values's and values2's elements in the unordered_multiset
+ for(VectIt it(values.begin()), itend(values.end()),
+ it2(values2.begin()),itend2(values2.end())
+ ; it != itend; ++it, ++it2){
+ member_multi_set.insert(*it);
+ member_multi_set.insert(*it2);
+ }
+
+ //Now find every element
+ {
+ VectIt it(values.begin()), itend(values.end());
+
+ for(; it != itend; ++it){
+ //base_set should contain one element for each key
+ if(base_set.count(*it) != 1) return 1;
+ //member_multi_set should contain two elements for each key
+ if(member_multi_set.count(*it) != 2) return 1;
+ }
+ }
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_value_traits.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_value_traits.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,103 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_value_traits_code_legacy
+#include <boost/intrusive/link_mode.hpp>
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <vector>
+
+//This node is the legacy type we can't modify and we want to insert in
+//intrusive list and slist containers using only two pointers, since
+//we know the object will never be at the same time in both lists.
+struct legacy_value
+{
+ legacy_value *prev_;
+ legacy_value *next_;
+ int id_;
+};
+//]
+
+//[doc_value_traits_value_traits
+//Define our own NodeTraits that will configure singly and doubly linked
+//list algorithms. Note that this node traits is compatible with
+//circular_slist_algorithms and circular_list_algorithms.
+
+namespace bi = boost::intrusive;
+
+struct legacy_node_traits
+{
+ typedef legacy_value node;
+ typedef legacy_value * node_ptr;
+ typedef const legacy_value * const_node_ptr;
+
+ static node *get_next(const node *n) { return n->next_; }
+ static void set_next(node *n, node *next) { n->next_ = next; }
+ static node *get_previous(const node *n) { return n->prev_; }
+ static void set_previous(node *n, node *prev) { n->prev_ = prev; }
+};
+
+//This ValueTraits will configure list and slist. In this case,
+//legacy_node_traits::node is the same as the
+//legacy_value_traits::value_type so to_node_ptr/to_value_ptr
+//functions are trivial.
+struct legacy_value_traits
+{
+ typedef legacy_node_traits node_traits;
+ typedef node_traits::node_ptr node_ptr;
+ typedef node_traits::const_node_ptr const_node_ptr;
+ typedef legacy_value value_type;
+ typedef legacy_value * pointer;
+ typedef const legacy_value * const_pointer;
+ static const bi::link_mode_type link_mode = bi::normal_link;
+ static node_ptr to_node_ptr (value_type &value) { return node_ptr(&value); }
+ static const_node_ptr to_node_ptr (const value_type &value) { return const_node_ptr(&value); }
+ static pointer to_value_ptr(node_ptr n) { return pointer(n); }
+ static const_pointer to_value_ptr(const_node_ptr n) { return const_pointer(n); }
+};
+
+//]
+
+//[doc_value_traits_test
+//Now define an intrusive list and slist that will store legacy_value objects
+typedef bi::value_traits<legacy_value_traits> ValueTraitsOption;
+typedef bi::list<legacy_value, ValueTraitsOption> LegacyAbiList;
+typedef bi::slist<legacy_value, ValueTraitsOption> LegacyAbiSlist;
+
+template<class List>
+bool test_list()
+{
+ typedef std::vector<legacy_value> Vect;
+
+ //Create legacy_value objects, with a different internal number
+ Vect legacy_vector;
+ for(int i = 0; i < 100; ++i){
+ legacy_value value; value.id_ = i; legacy_vector.push_back(value);
+ }
+
+ //Create the list with the objects
+ List mylist(legacy_vector.begin(), legacy_vector.end());
+
+ //Now test both lists
+ typename List::const_iterator bit(mylist.begin()), bitend(mylist.end());
+ typename Vect::const_iterator it(legacy_vector.begin()), itend(legacy_vector.end());
+
+ //Test the objects inserted in our list
+ for(; it != itend; ++it, ++bit)
+ if(&*bit != &*it) return false;
+ return true;
+}
+
+int main()
+{
+ return test_list<LegacyAbiList>() && test_list<LegacyAbiSlist>() ? 0 : 1;
+}
+//]
Added: sandbox/move/libs/intrusive/example/doc_window.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/example/doc_window.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,83 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+//[doc_window_code
+#include <boost/intrusive/list.hpp>
+
+using namespace boost::intrusive;
+
+//An abstract class that can be inserted in an intrusive list
+class Window : public list_base_hook<>
+{
+ public:
+ //This is a container those value is an abstract class: you can't do this with std::list.
+ typedef list<Window> win_list;
+
+ //A static intrusive list declaration
+ static win_list all_windows;
+
+ //Constructor. Includes this window in the list
+ Window() { all_windows.push_back(*this); }
+ //Destructor. Removes this node from the list
+ virtual ~Window() { all_windows.erase(win_list::s_iterator_to(*this)); }
+ //Pure virtual function to be implemented by derived classes
+ virtual void Paint() = 0;
+};
+
+//The static intrusive list declaration
+Window::win_list Window::all_windows;
+
+//Some Window derived classes
+class FrameWindow : public Window
+{ void Paint(){/**/} };
+
+class EditWindow : public Window
+{ void Paint(){/**/} };
+
+class CanvasWindow : public Window
+{ void Paint(){/**/} };
+
+//A function that prints all windows stored in the intrusive list
+void paint_all_windows()
+{
+ for(Window::win_list::iterator i(Window::all_windows.begin())
+ , e(Window::all_windows.end())
+ ; i != e; ++i)
+ i->Paint();
+}
+
+//...
+
+//A class derived from Window
+class MainWindow : public Window
+{
+ FrameWindow frame_; //these are derived from Window too
+ EditWindow edit_;
+ CanvasWindow canvas_;
+
+ public:
+ void Paint(){/**/}
+ //...
+};
+
+//Main function
+int main()
+{
+ //When a Window class is created, is automatically registered in the global list
+ MainWindow window;
+
+ //Paint all the windows, sub-windows and so on
+ paint_all_windows();
+
+ //All the windows are automatically unregistered in their destructors.
+ return 0;
+}
+//]
Added: sandbox/move/libs/intrusive/index.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/index.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,14 @@
+<!--
+Copyright 2005-2009 Ion Gaztanaga
+Distributed under the Boost Software License, Version 1.0. (See accompanying
+file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+-->
+<html>
+<head>
+ <meta http-equiv="refresh" content="0; URL=../../doc/html/intrusive.html">
+</head>
+<body>
+Automatic redirection failed, please go to
+../../doc/html/intrusive.html
+</body>
+</html>
Added: sandbox/move/libs/intrusive/module.cmake
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/module.cmake 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1 @@
+boost_module(intrusive DEPENDS utility)
\ No newline at end of file
Added: sandbox/move/libs/intrusive/perf/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/perf/Jamfile.v2 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,34 @@
+# Boost Intrusive Library Performance test Jamfile
+
+# (C) Copyright Ion Gaztanaga 2006-2007.
+# 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)
+
+# Adapted from John Maddock's TR1 Jamfile.v2
+# Copyright John Maddock 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)
+
+# this rule enumerates through all the sources and invokes
+# the run rule for each source, the result is a list of all
+# the run rules, which we can pass on to the test_suite rule:
+
+rule test_all
+{
+ local all_rules = ;
+
+ for local fileb in [ glob *.cpp ]
+ {
+ all_rules += [ run $(fileb)
+ : # additional args
+ : # test-files
+ : # requirements
+ ] ;
+ }
+
+ return $(all_rules) ;
+}
+
+test-suite intrusive_perf : [ test_all r ] ;
\ No newline at end of file
Added: sandbox/move/libs/intrusive/perf/perf_list.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/perf/perf_list.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,550 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+//Includes for tests
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/config.hpp>
+#include <list>
+#include <functional>
+#include <iostream>
+#include <boost/intrusive/list.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+using namespace boost::posix_time;
+
+//[perf_list_value_type
+//Iteration and element count defines
+const int NumIter = 100;
+const int NumElements = 50000;
+
+using namespace boost::intrusive;
+
+template<bool BigSize> struct filler { int dummy[10]; };
+template <> struct filler<false> {};
+
+template<bool BigSize> //The object for non-intrusive containers
+struct test_class : private filler<BigSize>
+{
+ int i_;
+ test_class() {}
+ test_class(int i) : i_(i) {}
+ friend bool operator <(const test_class &l, const test_class &r) { return l.i_ < r.i_; }
+ friend bool operator >(const test_class &l, const test_class &r) { return l.i_ > r.i_; }
+};
+
+template <bool BigSize, link_mode_type LinkMode>
+struct itest_class //The object for intrusive containers
+ : public list_base_hook<link_mode<LinkMode> >, public test_class<BigSize>
+{
+ itest_class() {}
+ itest_class(int i) : test_class<BigSize>(i) {}
+};
+
+template<class FuncObj> //Adapts functors taking values to functors taking pointers
+struct func_ptr_adaptor : public FuncObj
+{
+ typedef typename FuncObj::first_argument_type* first_argument_type;
+ typedef typename FuncObj::second_argument_type* second_argument_type;
+ typedef typename FuncObj::result_type result_type;
+ result_type operator()(first_argument_type a, second_argument_type b) const
+ { return FuncObj::operator()(*a, *b); }
+};
+//]
+
+template <bool BigSize, link_mode_type LinkMode>
+struct get_ilist //Helps to define an intrusive list from a policy
+{
+ typedef list<itest_class<BigSize, LinkMode>, constant_time_size<false> > type;
+};
+
+template <bool BigSize> //Helps to define an std list
+struct get_list { typedef std::list<test_class<BigSize> > type; };
+
+template <bool BigSize> //Helps to define an std pointer list
+struct get_ptrlist { typedef std::list<test_class<BigSize>*> type; };
+
+////////////////////////////////////////////////////////////////////////
+//
+// PUSH_BACK
+//
+////////////////////////////////////////////////////////////////////////
+
+template <bool BigSize, link_mode_type LinkMode>
+void test_intrusive_list_push_back()
+{
+ typedef typename get_ilist<BigSize, LinkMode>::type ilist;
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ //First create the elements and insert them in the intrusive list
+ //[perf_list_push_back_intrusive
+ std::vector<typename ilist::value_type> objects(NumElements);
+ ilist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(objects[i]);
+ //Elements are unlinked in ilist's destructor
+ //Elements are destroyed in vector's destructor
+ //]
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "link_mode: " << LinkMode << ", usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_std_list_push_back()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ //Now create the std list and insert
+ //[perf_list_push_back_stdlist
+ stdlist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(typename stdlist::value_type(i));
+ //Elements unlinked and destroyed in stdlist's destructor
+ //]
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_compact_std_ptrlist_push_back()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ typedef typename get_ptrlist<BigSize>::type stdptrlist;
+ //Now measure insertion time, including element creation
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ //Create elements and insert their pointer in the list
+ //[perf_list_push_back_stdptrlist
+ std::vector<typename stdlist::value_type> objects(NumElements);
+ stdptrlist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(&objects[i]);
+ //Pointers to elements unlinked and destroyed in stdptrlist's destructor
+ //Elements destroyed in vector's destructor
+ //]
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "compact std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_disperse_std_ptrlist_push_back()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ typedef typename get_ptrlist<BigSize>::type stdptrlist;
+ //Now measure insertion time, including element creation
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ //Create elements and insert their pointer in the list
+ //[perf_list_push_back_disperse_stdptrlist
+ stdlist objects; stdptrlist l;
+ for(int i = 0; i < NumElements; ++i){
+ objects.push_back(typename stdlist::value_type(i));
+ l.push_back(&objects.back());
+ }
+ //Pointers to elements unlinked and destroyed in stdptrlist's destructor
+ //Elements unlinked and destroyed in stdlist's destructor
+ //]
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "disperse std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+////////////////////////////////////////////////////////////////////////
+//
+// REVERSE
+//
+////////////////////////////////////////////////////////////////////////
+
+//[perf_list_reverse
+template <bool BigSize, link_mode_type LinkMode>
+void test_intrusive_list_reverse()
+{
+ typedef typename get_ilist<BigSize, LinkMode>::type ilist;
+ //First create the elements
+ std::vector<typename ilist::value_type> objects(NumElements);
+
+ //Now create the intrusive list and insert data
+ ilist l(objects.begin(), objects.end());
+
+ //Now measure sorting time
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ l.reverse();
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "link_mode: " << LinkMode << ", usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_std_list_reverse()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+
+ //Create the list and insert values
+ stdlist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(typename stdlist::value_type());
+
+ //Now measure sorting time
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ l.reverse();
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_compact_std_ptrlist_reverse()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ typedef typename get_ptrlist<BigSize>::type stdptrlist;
+
+ //First create the elements
+ std::vector<typename stdlist::value_type> objects(NumElements);
+
+ //Now create the std list and insert
+ stdptrlist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(&objects[i]);
+
+ //Now measure sorting time
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ l.reverse();
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "compact std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_disperse_std_ptrlist_reverse()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ typedef typename get_ptrlist<BigSize>::type stdptrlist;
+
+ //First create the elements
+ std::list<typename stdlist::value_type> objects;
+ //Now create the std list and insert
+ stdptrlist l;
+ for(int i = 0; i < NumElements; ++i){
+ objects.push_back(typename stdlist::value_type());
+ l.push_back(&objects.back());
+ }
+
+ //Now measure sorting time
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ l.reverse();
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "disperse std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+//]
+
+////////////////////////////////////////////////////////////////////////
+//
+// SORT
+//
+////////////////////////////////////////////////////////////////////////
+
+//[perf_list_sort
+template <bool BigSize, link_mode_type LinkMode>
+void test_intrusive_list_sort()
+{
+ typedef typename get_ilist<BigSize, LinkMode>::type ilist;
+
+ //First create the elements
+ std::vector<typename ilist::value_type> objects(NumElements);
+ for(int i = 0; i < NumElements; ++i)
+ objects[i].i_ = i;
+
+ //Now create the intrusive list and insert data
+ ilist l(objects.begin(), objects.end());
+
+ //Now measure sorting time
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ if(!(i % 2)){
+ l.sort(std::greater<typename ilist::value_type>());
+ }
+ else{
+ l.sort(std::less<typename ilist::value_type>());
+ }
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "link_mode: " << LinkMode << ", usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_std_list_sort()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+
+ //Create the list and insert values
+ stdlist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(typename stdlist::value_type(i));
+
+ //Now measure sorting time
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ if(!(i % 2)){
+ l.sort(std::greater<typename stdlist::value_type>());
+ }
+ else{
+ l.sort(std::less<typename stdlist::value_type>());
+ }
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_compact_std_ptrlist_sort()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ typedef typename get_ptrlist<BigSize>::type stdptrlist;
+
+ //First create the elements
+ std::vector<typename stdlist::value_type> objects(NumElements);
+ for(int i = 0; i < NumElements; ++i)
+ objects[i].i_ = i;
+ //Now create the std list and insert
+ stdptrlist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(&objects[i]);
+
+ //Now measure sorting time
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ if(!(i % 2)){
+ l.sort(func_ptr_adaptor<std::greater<typename stdlist::value_type> >());
+ }
+ else{
+ l.sort(func_ptr_adaptor<std::less<typename stdlist::value_type> >());
+ }
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "compact std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_disperse_std_ptrlist_sort()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ typedef typename get_ptrlist<BigSize>::type stdptrlist;
+
+ //First create the elements and the list
+ std::list<typename stdlist::value_type> objects;
+ stdptrlist l;
+ for(int i = 0; i < NumElements; ++i){
+ objects.push_back(typename stdlist::value_type(i));
+ l.push_back(&objects.back());
+ }
+
+ //Now measure sorting time
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ if(!(i % 2)){
+ l.sort(func_ptr_adaptor<std::greater<typename stdlist::value_type> >());
+ }
+ else{
+ l.sort(func_ptr_adaptor<std::less<typename stdlist::value_type> >());
+ }
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "disperse std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+//]
+
+////////////////////////////////////////////////////////////////////////
+//
+// WRITE ACCESS
+//
+////////////////////////////////////////////////////////////////////////
+//[perf_list_write_access
+template <bool BigSize, link_mode_type LinkMode>
+void test_intrusive_list_write_access()
+{
+ typedef typename get_ilist<BigSize, LinkMode>::type ilist;
+
+ //First create the elements
+ std::vector<typename ilist::value_type> objects(NumElements);
+ for(int i = 0; i < NumElements; ++i){
+ objects[i].i_ = i;
+ }
+
+ //Now create the intrusive list and insert data
+ ilist l(objects.begin(), objects.end());
+
+ //Now measure access time to the value type
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ typename ilist::iterator it(l.begin()), end(l.end());
+ for(; it != end; ++it){
+ ++(it->i_);
+ }
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "link_mode: " << LinkMode << ", usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_std_list_write_access()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+
+ //Create the list and insert values
+ stdlist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(typename stdlist::value_type(i));
+
+ //Now measure access time to the value type
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ typename stdlist::iterator it(l.begin()), end(l.end());
+ for(; it != end; ++it){
+ ++(it->i_);
+ }
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_compact_std_ptrlist_write_access()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ typedef typename get_ptrlist<BigSize>::type stdptrlist;
+
+ //First create the elements
+ std::vector<typename stdlist::value_type> objects(NumElements);
+ for(int i = 0; i < NumElements; ++i){
+ objects[i].i_ = i;
+ }
+
+ //Now create the std list and insert
+ stdptrlist l;
+ for(int i = 0; i < NumElements; ++i)
+ l.push_back(&objects[i]);
+
+ //Now measure access time to the value type
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ typename stdptrlist::iterator it(l.begin()), end(l.end());
+ for(; it != end; ++it){
+ ++((*it)->i_);
+ }
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "compact std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+
+template <bool BigSize>
+void test_disperse_std_ptrlist_write_access()
+{
+ typedef typename get_list<BigSize>::type stdlist;
+ typedef typename get_ptrlist<BigSize>::type stdptrlist;
+
+ //First create the elements
+ std::list<typename stdlist::value_type> objects;
+ //Now create the std list and insert
+ stdptrlist l;
+ for(int i = 0; i < NumElements; ++i){
+ objects.push_back(typename stdlist::value_type(i));
+ l.push_back(&objects.back());
+ }
+
+ //Now measure access time to the value type
+ ptime tini = microsec_clock::universal_time();
+ for(int i = 0; i < NumIter; ++i){
+ typename stdptrlist::iterator it(l.begin()), end(l.end());
+ for(; it != end; ++it){
+ ++((*it)->i_);
+ }
+ }
+ ptime tend = microsec_clock::universal_time();
+ std::cout << "disperse std::list usecs/iteration: "
+ << (tend-tini).total_microseconds()/NumIter << std::endl;
+}
+//]
+
+////////////////////////////////////////////////////////////////////////
+//
+// ALL TESTS
+//
+////////////////////////////////////////////////////////////////////////
+template<bool BigSize>
+void do_all_tests()
+{
+ std::cout << "\n\nTesting push back() with BigSize:" << BigSize << std::endl;
+ test_intrusive_list_push_back<BigSize, normal_link>();
+ test_intrusive_list_push_back<BigSize, safe_link>();
+ test_intrusive_list_push_back<BigSize, auto_unlink>();
+ test_std_list_push_back<BigSize> ();
+ test_compact_std_ptrlist_push_back<BigSize>();
+ test_disperse_std_ptrlist_push_back<BigSize>();
+ //reverse
+ std::cout << "\n\nTesting reverse() with BigSize:" << BigSize << std::endl;
+ test_intrusive_list_reverse<BigSize, normal_link>();
+ test_intrusive_list_reverse<BigSize, safe_link>();
+ test_intrusive_list_reverse<BigSize, auto_unlink>();
+ test_std_list_reverse<BigSize>();
+ test_compact_std_ptrlist_reverse<BigSize>();
+ test_disperse_std_ptrlist_reverse<BigSize>();
+ //sort
+ std::cout << "\n\nTesting sort() with BigSize:" << BigSize << std::endl;
+ test_intrusive_list_sort<BigSize, normal_link>();
+ test_intrusive_list_sort<BigSize, safe_link>();
+ test_intrusive_list_sort<BigSize, auto_unlink>();
+ test_std_list_sort<BigSize>();
+ test_compact_std_ptrlist_sort<BigSize>();
+ test_disperse_std_ptrlist_sort<BigSize>();
+ //write_access
+ std::cout << "\n\nTesting write_access() with BigSize:" << BigSize << std::endl;
+ test_intrusive_list_write_access<BigSize, normal_link>();
+ test_intrusive_list_write_access<BigSize, safe_link>();
+ test_intrusive_list_write_access<BigSize, auto_unlink>();
+ test_std_list_write_access<BigSize>();
+ test_compact_std_ptrlist_write_access<BigSize>();
+ test_disperse_std_ptrlist_write_access<BigSize>();
+}
+
+int main()
+{
+ //First pass the tests with a small size class
+ do_all_tests<false>();
+ //Now pass the tests with a big size class
+ do_all_tests<true>();
+ return 0;
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/proj/vc7ide/Intrusive.sln
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/Intrusive.sln 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,199 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "list", "list\list.vcproj", "{977B61B4-9968-497C-9F0B-24A8145473B8}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "slist", "slist\slist.vcproj", "{5A02061D-3728-4C49-AFC8-0130C1F161C0}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multiset", "multiset\multiset.vcproj", "{961F0E06-C092-4AF7-ABC5-2A49999F3B79}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_intrusivelib", "_intrusivelib\_intrusivelib.vcproj", "{90F3C5BD-8E6C-4629-BC71-A1009EC88059}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "set", "set\set.vcproj", "{960E01F6-92C1-F74A-BCA5-2A9F3B994979}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unordered_set", "unordered_set\unordered_set.vcproj", "{90E701E6-2C91-F4A7-BA6C-A9F3B0949279}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unordered_multiset", "unordered_multiset\unordered_multiset.vcproj", "{9101EE76-BB6C-2C91-F4B7-A9F3B9490279}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "perf_test", "perf_test\perf_test.vcproj", "{910E70E6-2C91-AA67-BF4C-A9C74A309927}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "default_hook", "default_hook\default_hook.vcproj", "{761A79B4-9968-CB81-F02B-2A4497345475}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stateful_value_traits", "stateful_value_traits\stateful_value_traits.vcproj", "{9571A7B4-9968-B9C1-17FB-134547B46975}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "virtual_base", "virtual_base\virtual_base.vcproj", "{3579B1A4-9894-02AB-CB81-297B46154345}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_functions", "make_functions\make_functions.vcproj", "{7679B41B-F2B4-9176-CB81-35449467B435}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "custom_bucket_traits", "custom_bucket_traits\custom_bucket_traits.vcproj", "{31C77B84-0B2C-9481-CB81-27A149F33825}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "external_value_traits", "external_value_traits\external_value_traits.vcproj", "{97B69A72-B9D3-7389-17FB-74612F4A9543}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "splay_multiset", "splay_multiset\splay_multiset.vcproj", "{01E70176-B6C5-BF47-2C91-A949077BA323}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "splay_set", "splay_set\splay_set.vcproj", "{1E6909E7-C971-F24A-6C7B-A92094B71B59}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avl_multiset", "avl_multiset\avl_multiset.vcproj", "{0AE70176-5B8C-4BC7-392C-A4A312B07893}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "avl_set", "avl_set\avl_set.vcproj", "{16909EE7-24AF-97C1-C76B-204B971BA959}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sg_multiset", "sg_multiset\sg_multiset.vcproj", "{07022E76-6CB5-92C1-B47F-A10772A79B43}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sg_set", "sg_set\sg_set.vcproj", "{1690A9E7-DB57-971C-F24A-09B752A942F7}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "any_hook", "any_test\any_test.vcproj", "{97B61B24-4C97-9681-50BF-243175A813B6}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "treap_set", "treap_set\treap_set.vcproj", "{1E09E697-4A2F-BC76-7C91-2BA479B29159}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "treap_multiset", "treap_multiset\treap_multiset.vcproj", "{16E09E95-F4A2-C971-BC76-9BA407191C59}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {977B61B4-9968-497C-9F0B-24A8145473B8}.Debug.ActiveCfg = Debug|Win32
+ {977B61B4-9968-497C-9F0B-24A8145473B8}.Debug.Build.0 = Debug|Win32
+ {977B61B4-9968-497C-9F0B-24A8145473B8}.Release.ActiveCfg = Release|Win32
+ {977B61B4-9968-497C-9F0B-24A8145473B8}.Release.Build.0 = Release|Win32
+ {5A02061D-3728-4C49-AFC8-0130C1F161C0}.Debug.ActiveCfg = Debug|Win32
+ {5A02061D-3728-4C49-AFC8-0130C1F161C0}.Debug.Build.0 = Debug|Win32
+ {5A02061D-3728-4C49-AFC8-0130C1F161C0}.Release.ActiveCfg = Release|Win32
+ {5A02061D-3728-4C49-AFC8-0130C1F161C0}.Release.Build.0 = Release|Win32
+ {961F0E06-C092-4AF7-ABC5-2A49999F3B79}.Debug.ActiveCfg = Debug|Win32
+ {961F0E06-C092-4AF7-ABC5-2A49999F3B79}.Debug.Build.0 = Debug|Win32
+ {961F0E06-C092-4AF7-ABC5-2A49999F3B79}.Release.ActiveCfg = Release|Win32
+ {961F0E06-C092-4AF7-ABC5-2A49999F3B79}.Release.Build.0 = Release|Win32
+ {90F3C5BD-8E6C-4629-BC71-A1009EC88059}.Debug.ActiveCfg = Debug|Win32
+ {90F3C5BD-8E6C-4629-BC71-A1009EC88059}.Debug.Build.0 = Debug|Win32
+ {90F3C5BD-8E6C-4629-BC71-A1009EC88059}.Release.ActiveCfg = Release|Win32
+ {90F3C5BD-8E6C-4629-BC71-A1009EC88059}.Release.Build.0 = Release|Win32
+ {960E01F6-92C1-F74A-BCA5-2A9F3B994979}.Debug.ActiveCfg = Debug|Win32
+ {960E01F6-92C1-F74A-BCA5-2A9F3B994979}.Debug.Build.0 = Debug|Win32
+ {960E01F6-92C1-F74A-BCA5-2A9F3B994979}.Release.ActiveCfg = Release|Win32
+ {960E01F6-92C1-F74A-BCA5-2A9F3B994979}.Release.Build.0 = Release|Win32
+ {90E701E6-2C91-F4A7-BA6C-A9F3B0949279}.Debug.ActiveCfg = Debug|Win32
+ {90E701E6-2C91-F4A7-BA6C-A9F3B0949279}.Debug.Build.0 = Debug|Win32
+ {90E701E6-2C91-F4A7-BA6C-A9F3B0949279}.Release.ActiveCfg = Release|Win32
+ {90E701E6-2C91-F4A7-BA6C-A9F3B0949279}.Release.Build.0 = Release|Win32
+ {9101EE76-BB6C-2C91-F4B7-A9F3B9490279}.Debug.ActiveCfg = Debug|Win32
+ {9101EE76-BB6C-2C91-F4B7-A9F3B9490279}.Debug.Build.0 = Debug|Win32
+ {9101EE76-BB6C-2C91-F4B7-A9F3B9490279}.Release.ActiveCfg = Release|Win32
+ {9101EE76-BB6C-2C91-F4B7-A9F3B9490279}.Release.Build.0 = Release|Win32
+ {910E70E6-2C91-AA67-BF4C-A9C74A309927}.Debug.ActiveCfg = Debug|Win32
+ {910E70E6-2C91-AA67-BF4C-A9C74A309927}.Debug.Build.0 = Debug|Win32
+ {910E70E6-2C91-AA67-BF4C-A9C74A309927}.Release.ActiveCfg = Release|Win32
+ {910E70E6-2C91-AA67-BF4C-A9C74A309927}.Release.Build.0 = Release|Win32
+ {761A79B4-9968-CB81-F02B-2A4497345475}.Debug.ActiveCfg = Debug|Win32
+ {761A79B4-9968-CB81-F02B-2A4497345475}.Debug.Build.0 = Debug|Win32
+ {761A79B4-9968-CB81-F02B-2A4497345475}.Release.ActiveCfg = Release|Win32
+ {761A79B4-9968-CB81-F02B-2A4497345475}.Release.Build.0 = Release|Win32
+ {9571A7B4-9968-B9C1-17FB-134547B46975}.Debug.ActiveCfg = Debug|Win32
+ {9571A7B4-9968-B9C1-17FB-134547B46975}.Debug.Build.0 = Debug|Win32
+ {9571A7B4-9968-B9C1-17FB-134547B46975}.Release.ActiveCfg = Release|Win32
+ {9571A7B4-9968-B9C1-17FB-134547B46975}.Release.Build.0 = Release|Win32
+ {3579B1A4-9894-02AB-CB81-297B46154345}.Debug.ActiveCfg = Debug|Win32
+ {3579B1A4-9894-02AB-CB81-297B46154345}.Debug.Build.0 = Debug|Win32
+ {3579B1A4-9894-02AB-CB81-297B46154345}.Release.ActiveCfg = Release|Win32
+ {3579B1A4-9894-02AB-CB81-297B46154345}.Release.Build.0 = Release|Win32
+ {7679B41B-F2B4-9176-CB81-35449467B435}.Debug.ActiveCfg = Debug|Win32
+ {7679B41B-F2B4-9176-CB81-35449467B435}.Debug.Build.0 = Debug|Win32
+ {7679B41B-F2B4-9176-CB81-35449467B435}.Release.ActiveCfg = Release|Win32
+ {7679B41B-F2B4-9176-CB81-35449467B435}.Release.Build.0 = Release|Win32
+ {31C77B84-0B2C-9481-CB81-27A149F33825}.Debug.ActiveCfg = Debug|Win32
+ {31C77B84-0B2C-9481-CB81-27A149F33825}.Debug.Build.0 = Debug|Win32
+ {31C77B84-0B2C-9481-CB81-27A149F33825}.Release.ActiveCfg = Release|Win32
+ {31C77B84-0B2C-9481-CB81-27A149F33825}.Release.Build.0 = Release|Win32
+ {97B69A72-B9D3-7389-17FB-74612F4A9543}.Debug.ActiveCfg = Debug|Win32
+ {97B69A72-B9D3-7389-17FB-74612F4A9543}.Debug.Build.0 = Debug|Win32
+ {97B69A72-B9D3-7389-17FB-74612F4A9543}.Release.ActiveCfg = Release|Win32
+ {97B69A72-B9D3-7389-17FB-74612F4A9543}.Release.Build.0 = Release|Win32
+ {01E70176-B6C5-BF47-2C91-A949077BA323}.Debug.ActiveCfg = Debug|Win32
+ {01E70176-B6C5-BF47-2C91-A949077BA323}.Debug.Build.0 = Debug|Win32
+ {01E70176-B6C5-BF47-2C91-A949077BA323}.Release.ActiveCfg = Release|Win32
+ {01E70176-B6C5-BF47-2C91-A949077BA323}.Release.Build.0 = Release|Win32
+ {1E6909E7-C971-F24A-6C7B-A92094B71B59}.Debug.ActiveCfg = Debug|Win32
+ {1E6909E7-C971-F24A-6C7B-A92094B71B59}.Debug.Build.0 = Debug|Win32
+ {1E6909E7-C971-F24A-6C7B-A92094B71B59}.Release.ActiveCfg = Release|Win32
+ {1E6909E7-C971-F24A-6C7B-A92094B71B59}.Release.Build.0 = Release|Win32
+ {0AE70176-5B8C-4BC7-392C-A4A312B07893}.Debug.ActiveCfg = Debug|Win32
+ {0AE70176-5B8C-4BC7-392C-A4A312B07893}.Debug.Build.0 = Debug|Win32
+ {0AE70176-5B8C-4BC7-392C-A4A312B07893}.Release.ActiveCfg = Release|Win32
+ {0AE70176-5B8C-4BC7-392C-A4A312B07893}.Release.Build.0 = Release|Win32
+ {16909EE7-24AF-97C1-C76B-204B971BA959}.Debug.ActiveCfg = Debug|Win32
+ {16909EE7-24AF-97C1-C76B-204B971BA959}.Debug.Build.0 = Debug|Win32
+ {16909EE7-24AF-97C1-C76B-204B971BA959}.Release.ActiveCfg = Release|Win32
+ {16909EE7-24AF-97C1-C76B-204B971BA959}.Release.Build.0 = Release|Win32
+ {07022E76-6CB5-92C1-B47F-A10772A79B43}.Debug.ActiveCfg = Debug|Win32
+ {07022E76-6CB5-92C1-B47F-A10772A79B43}.Debug.Build.0 = Debug|Win32
+ {07022E76-6CB5-92C1-B47F-A10772A79B43}.Release.ActiveCfg = Release|Win32
+ {07022E76-6CB5-92C1-B47F-A10772A79B43}.Release.Build.0 = Release|Win32
+ {1690A9E7-DB57-971C-F24A-09B752A942F7}.Debug.ActiveCfg = Debug|Win32
+ {1690A9E7-DB57-971C-F24A-09B752A942F7}.Debug.Build.0 = Debug|Win32
+ {1690A9E7-DB57-971C-F24A-09B752A942F7}.Release.ActiveCfg = Release|Win32
+ {1690A9E7-DB57-971C-F24A-09B752A942F7}.Release.Build.0 = Release|Win32
+ {97B61B24-4C97-9681-50BF-243175A813B6}.Debug.ActiveCfg = Debug|Win32
+ {97B61B24-4C97-9681-50BF-243175A813B6}.Debug.Build.0 = Debug|Win32
+ {97B61B24-4C97-9681-50BF-243175A813B6}.Release.ActiveCfg = Release|Win32
+ {97B61B24-4C97-9681-50BF-243175A813B6}.Release.Build.0 = Release|Win32
+ {1E09E697-4A2F-BC76-7C91-2BA479B29159}.Debug.ActiveCfg = Debug|Win32
+ {1E09E697-4A2F-BC76-7C91-2BA479B29159}.Debug.Build.0 = Debug|Win32
+ {1E09E697-4A2F-BC76-7C91-2BA479B29159}.Release.ActiveCfg = Release|Win32
+ {1E09E697-4A2F-BC76-7C91-2BA479B29159}.Release.Build.0 = Release|Win32
+ {16E09E95-F4A2-C971-BC76-9BA407191C59}.Debug.ActiveCfg = Debug|Win32
+ {16E09E95-F4A2-C971-BC76-9BA407191C59}.Debug.Build.0 = Debug|Win32
+ {16E09E95-F4A2-C971-BC76-9BA407191C59}.Release.ActiveCfg = Release|Win32
+ {16E09E95-F4A2-C971-BC76-9BA407191C59}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
Added: sandbox/move/libs/intrusive/proj/vc7ide/Intrusive.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/Intrusive.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="list"
+ ProjectGUID="{B1F70826-C6CF-47EF-B7C9-FC9C8BB63A79}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/Intrusive.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/Intrusive.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/Intrusive.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,462 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="_intrusivelib"
+ ProjectGUID="{90F3C5BD-8E6C-4629-BC71-A1009EC88059}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="4"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/_intrusivelib.lib"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="4"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLibrarianTool"
+ OutputFile="$(OutDir)/_intrusivelib.lib"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Jamfile"
+ Filter=""
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\..\test\Jamfile.v2">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\any_hook.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\avl_set.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\avl_set_hook.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\avltree.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\avltree_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\bs_set_hook.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\circular_list_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\circular_slist_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\derivation_value_traits.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\hashtable.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\intrusive_fwd.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\linear_slist_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\link_mode.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\list.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\list_hook.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\member_value_traits.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\options.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\pointer_plus_bits.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\rbtree.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\rbtree_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\set.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\set_hook.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\sg_set.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\sgtree.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\sgtree_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\slist.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\slist_hook.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\splay_set.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\splay_set_hook.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\splaytree.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\splaytree_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\treap.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\treap_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\treap_set.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\trivial_value_traits.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\unordered_set.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\unordered_set_hook.hpp">
+ </File>
+ <Filter
+ Name="detail"
+ Filter="">
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\any_node_and_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\assert.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\avltree_node.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\clear_on_destructor_base.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\common_slist_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\config_begin.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\config_end.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\ebo_functor_holder.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\function_detector.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\generic_hook.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\hashtable_node.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\is_stateful_value_traits.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\list_node.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\mpl.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\parent_from_member.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\pointer_to_other.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\rbtree_node.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\slist_node.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\transform_iterator.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\tree_algorithms.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\tree_node.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\utilities.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\boost\intrusive\detail\workaround.hpp">
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="doc"
+ Filter="">
+ <File
+ RelativePath="..\..\..\doc\intrusive.qbk">
+ </File>
+ <File
+ RelativePath="..\..\..\doc\Jamfile.v2">
+ </File>
+ </Filter>
+ <Filter
+ Name="Test headers"
+ Filter="">
+ <File
+ RelativePath="..\..\..\test\common_functors.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\generic_assoc_test.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\generic_multiset_test.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\generic_set_test.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\itestvalue.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\smart_ptr.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\stateful_value_traits.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\test_container.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\test_macros.hpp">
+ </File>
+ <File
+ RelativePath="..\..\..\test\test_templates.hpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="example"
+ Filter="">
+ <File
+ RelativePath="..\..\..\example\doc_advanced_value_traits.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_advanced_value_traits2.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_any_hook.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_assoc_optimized_code.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_auto_unlink.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_avl_set.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_avltree_algorithms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_bucket_traits.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_clone_from.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_entity.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_erasing_and_disposing.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_external_value_traits.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_how_to_use.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_iterator_from_value.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_list.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_list_algorithms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_offset_ptr.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_positional_insertion.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_rbtree_algorithms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_set.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_sg_set.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_slist.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_slist_algorithms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_splay_algorithms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_splay_set.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_splaytree_algorithms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_stateful_value_traits.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_treap_algorithms.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_treap_set.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_unordered_set.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_value_traits.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\doc_window.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\example\Jamfile.v2">
+ </File>
+ </Filter>
+ <Filter
+ Name="perf"
+ Filter="">
+ <File
+ RelativePath="..\..\..\perf\Jamfile.v2">
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="TRUE">
+ <Tool
+ Name="VCCustomBuildTool"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\..\perf\perf_list.cpp">
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\to-do.txt">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/any_test/any_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/any_test/any_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="any_hook"
+ ProjectGUID="{97B61B24-4C97-9681-50BF-243175A813B6}"
+ RootNamespace="any_hook"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/any_hook.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/any_hook.pdb"
+ GenerateMapFile="FALSE"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/any_hook.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4737FFC1-76A6-A5C7-4376-2EA02C41523F}">
+ <File
+ RelativePath="..\..\..\test\any_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/avl_multiset/avl_multiset.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/avl_multiset/avl_multiset.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="avl_multiset"
+ ProjectGUID="{0AE70176-5B8C-4BC7-392C-A4A312B07893}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/avl_multiset.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/avl_multiset.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/avl_multiset.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{F9A837FC-4236-A8D7-745E-2D383A2E13EA}">
+ <File
+ RelativePath="..\..\..\test\avl_multiset_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/avl_set/avl_set.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/avl_set/avl_set.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="avl_set"
+ ProjectGUID="{16909EE7-24AF-97C1-C76B-204B971BA959}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/avl_set.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/avl_set.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/avl_set.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{FC776C11-2A4F-326F-1E35-4C72A23B325A}">
+ <File
+ RelativePath="..\..\..\test\avl_set_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/custom_bucket_traits/custom_bucket_traits.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/custom_bucket_traits/custom_bucket_traits.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="custom_bucket_traits"
+ ProjectGUID="{31C77B84-0B2C-9481-CB81-27A149F33825}"
+ RootNamespace="custom_bucket_traits"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/custom_bucket_traits.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/custom_bucket_traits.pdb"
+ GenerateMapFile="TRUE"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/custom_bucket_traits.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{51BA5F47-A612-6376-7AB5-73F17F5C84BC}">
+ <File
+ RelativePath="..\..\..\test\custom_bucket_traits_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/default_hook/default_hook.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/default_hook/default_hook.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="default_hook"
+ ProjectGUID="{761A79B4-9968-CB81-F02B-2A4497345475}"
+ RootNamespace="default_hook"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/default_hook.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/default_hook.pdb"
+ GenerateMapFile="TRUE"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/default_hook.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4C737FF1-7AB5-3764-A066-252B75A372FF}">
+ <File
+ RelativePath="..\..\..\test\default_hook_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/external_value_traits/external_value_traits.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/external_value_traits/external_value_traits.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="external_value_traits"
+ ProjectGUID="{97B69A72-B9D3-7389-17FB-74612F4A9543}"
+ RootNamespace="external_value_traits"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/external_value_traits.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/external_value_traits.pdb"
+ GenerateMapFile="TRUE"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/external_value_traits.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{7FAFEA31-6364-FB35-16A6-77AF315C236A}">
+ <File
+ RelativePath="..\..\..\test\external_value_traits_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/list/list.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/list/list.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="list"
+ ProjectGUID="{977B61B4-9968-497C-9F0B-24A8145473B8}"
+ RootNamespace="list"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/list.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/list.pdb"
+ GenerateMapFile="FALSE"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/list.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\..\test\list_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/make_functions/make_functions.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/make_functions/make_functions.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="make_functions"
+ ProjectGUID="{7679B41B-F2B4-9176-CB81-35449467B435}"
+ RootNamespace="make_functions"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/make_functions.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/make_functions.pdb"
+ GenerateMapFile="TRUE"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/make_functions.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4F537F31-AB85-7644-A616-25727F35FA5F}">
+ <File
+ RelativePath="..\..\..\test\make_functions_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/multiset/multiset.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/multiset/multiset.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="multiset"
+ ProjectGUID="{961F0E06-C092-4AF7-ABC5-2A49999F3B79}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/multiset.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/multiset.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="_WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/multiset.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\..\test\multiset_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/perf_test/perf_test.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/perf_test/perf_test.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="perf_test"
+ ProjectGUID="{910E70E6-2C91-AA67-BF4C-A9C74A309927}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="FALSE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/perf_test.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/perf_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/perf_test.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{43C77EF1-B78A-73C5-7346-2D7522AE2C3F}">
+ <File
+ RelativePath="..\..\..\perf\perf_list.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/set/set.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/set/set.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="set"
+ ProjectGUID="{960E01F6-92C1-F74A-BCA5-2A9F3B994979}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/set.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/set.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/set.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4F73C7F1-C745-4726-06A6-2D752AA322FF}">
+ <File
+ RelativePath="..\..\..\test\set_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/sg_multiset/sg_multiset.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/sg_multiset/sg_multiset.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="sg_multiset"
+ ProjectGUID="{07022E76-6CB5-92C1-B47F-A10772A79B43}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/sg_multiset.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/sg_multiset.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/sg_multiset.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{7F97AC3C-5426-8CA7-5D74-2B385DAA232F}">
+ <File
+ RelativePath="..\..\..\test\sg_multiset_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/sg_set/sg_set.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/sg_set/sg_set.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="sg_set"
+ ProjectGUID="{1690A9E7-DB57-971C-F24A-09B752A942F7}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/sg_set.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/sg_set.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/sg_set.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{FC770E61-A263-71E5-72AF-2E7D2C33A42A}">
+ <File
+ RelativePath="..\..\..\test\sg_set_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/slist/slist.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/slist/slist.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="slist"
+ ProjectGUID="{5A02061D-3728-4C49-AFC8-0130C1F161C0}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/slist.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/slist.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/slist.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath="..\..\..\test\slist_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/splay_multiset/splay_multiset.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/splay_multiset/splay_multiset.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="splay_multiset"
+ ProjectGUID="{01E70176-B6C5-BF47-2C91-A949077BA323}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/splay_multiset.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/splay_multiset.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/splay_multiset.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{C737F9AC-78CA-745E-5426-2DA33852B2FA}">
+ <File
+ RelativePath="..\..\..\test\splay_multiset_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/splay_set/splay_set.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/splay_set/splay_set.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="splay_set"
+ ProjectGUID="{1E6909E7-C971-F24A-6C7B-A92094B71B59}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/splay_set.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/splay_set.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/splay_set.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{FF1C7761-72AF-26A3-71E5-2743AA32D2CA}">
+ <File
+ RelativePath="..\..\..\test\splay_set_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/stateful_value_traits/stateful_value_traits.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/stateful_value_traits/stateful_value_traits.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="stateful_value_traits"
+ ProjectGUID="{9571A7B4-9968-B9C1-17FB-134547B46975}"
+ RootNamespace="stateful_value_traits"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/stateful_value_traits.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/stateful_value_traits.pdb"
+ GenerateMapFile="TRUE"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/stateful_value_traits.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{C7F4F831-AB76-7634-16A6-2A37523FB75A}">
+ <File
+ RelativePath="..\..\..\test\stateful_value_traits_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/to-do.txt
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/to-do.txt 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,16 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+-> Implement C++0x features (rvalue references)
+-> Offer bidirectional iterator for hashtables
+-> Non-array buckets
+-> Document incremental<> option better
+-> Assure stable order for optimize_multikey and inverse order otherwise
Added: sandbox/move/libs/intrusive/proj/vc7ide/treap_multiset/treap_multiset.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/treap_multiset/treap_multiset.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="treap_multiset"
+ ProjectGUID="{16E09E95-F4A2-C971-BC76-9BA407191C59}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/treap_multiset.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/treap_multiset.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/treap_multiset.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{F0B77631-E357-26F3-A4F5-2FA254B7E734}">
+ <File
+ RelativePath="..\..\..\test\treap_multiset_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/treap_set/treap_set.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/treap_set/treap_set.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="treap_set"
+ ProjectGUID="{1E09E697-4A2F-BC76-7C91-2BA479B29159}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/treap_set.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/treap_set.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/treap_set.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{FB776C10-E357-A4F5-326F-42A2D7254B3F}">
+ <File
+ RelativePath="..\..\..\test\treap_set_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="unordered_multiset"
+ ProjectGUID="{9101EE76-BB6C-2C91-F4B7-A9F3B9490279}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/unordered_multiset.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/unordered_multiset.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/unordered_multiset.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4F3C77F1-B78A-C745-4726-2D752AA322FF}">
+ <File
+ RelativePath="..\..\..\test\unordered_multiset_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/unordered_set/unordered_set.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/unordered_set/unordered_set.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="unordered_set"
+ ProjectGUID="{9101EE76-BB6C-2C91-F4B7-A27B94908F19}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ GeneratePreprocessedFile="0"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/unordered_set.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/unordered_set.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/unordered_set.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4F3C77F1-B78A-C745-4726-252AD75C322E}">
+ <File
+ RelativePath="..\..\..\test\unordered_set_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/proj/vc7ide/virtual_base/virtual_base.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/proj/vc7ide/virtual_base/virtual_base.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="virtual_base"
+ ProjectGUID="{3579B1A4-9894-02AB-CB81-297B46154345}"
+ RootNamespace="virtual_base"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ GeneratePreprocessedFile="0"
+ KeepComments="FALSE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ DisableLanguageExtensions="TRUE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/virtual_base.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/virtual_base.pdb"
+ GenerateMapFile="TRUE"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../../../"
+ PreprocessorDefinitions="BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="4"
+ DisableLanguageExtensions="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/virtual_base.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{75137BAF-6764-7AB5-3A06-25A73D48B7FC}">
+ <File
+ RelativePath="..\..\..\test\virtual_base_test.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/intrusive/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/Jamfile.v2 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,33 @@
+# Boost Intrusive Library Test Jamfile
+# (C) Copyright Ion Gaztanaga 2006.
+# 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)
+
+# Adapted from John Maddock's TR1 Jamfile.v2
+# Copyright John Maddock 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)
+
+# this rule enumerates through all the sources and invokes
+# the run rule for each source, the result is a list of all
+# the run rules, which we can pass on to the test_suite rule:
+
+rule test_all
+{
+ local all_rules = ;
+
+ for local fileb in [ glob *.cpp ]
+ {
+ all_rules += [ run $(fileb)
+ : # additional args
+ : # test-files
+ : # requirements
+ ] ;
+ }
+
+ return $(all_rules) ;
+}
+
+test-suite intrusive_test : [ test_all r ] : <threading>multi ;
\ No newline at end of file
Added: sandbox/move/libs/intrusive/test/any_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/any_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,218 @@
+/*
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include<boost/intrusive/detail/config_begin.hpp>
+#include<boost/intrusive/any_hook.hpp>
+#include<boost/intrusive/slist.hpp>
+#include<boost/intrusive/rbtree.hpp>
+#include<boost/intrusive/list.hpp>
+#include<boost/intrusive/avltree.hpp>
+#include<boost/intrusive/sgtree.hpp>
+#include<boost/intrusive/splaytree.hpp>
+#include<boost/intrusive/treap.hpp>
+#include<boost/intrusive/hashtable.hpp>
+#include<boost/functional/hash.hpp>
+#include <vector> //std::vector
+#include <cstddef> //std::size_t
+
+using namespace boost::intrusive;
+
+class MyClass : public any_base_hook<>
+{
+ int int_;
+
+ public:
+ //This is a member hook
+ any_member_hook<> member_hook_;
+
+ MyClass(int i = 0)
+ : int_(i)
+ {}
+
+ int get() const
+ { return this->int_; }
+
+ friend bool operator < (const MyClass &l, const MyClass &r)
+ { return l.int_ < r.int_; }
+
+ friend bool operator == (const MyClass &l, const MyClass &r)
+ { return l.int_ == r.int_; }
+
+ friend std::size_t hash_value(const MyClass &o)
+ { return boost::hash<int>()(o.get()); }
+
+ friend bool priority_order(const MyClass &a, const MyClass &b)
+ { return a.int_ < b.int_; }
+};
+
+
+void instantiation_test()
+{
+ typedef member_hook< MyClass, any_member_hook<>, &MyClass::member_hook_> MemberHook;
+ typedef base_hook< any_base_hook<> > BaseHook;
+
+ MyClass myclass;
+ {
+ slist < MyClass, any_to_slist_hook< BaseHook > > slist_base;
+ slist_base.push_front(myclass);
+ }
+ {
+ slist < MyClass, any_to_slist_hook< MemberHook > > slist_member;
+ slist_member.push_front(myclass);
+ }
+ {
+ list < MyClass, any_to_list_hook< BaseHook > > list_base;
+ list_base.push_front(myclass);
+ }
+ {
+ list < MyClass, any_to_list_hook< MemberHook > > list_member;
+ list_member.push_front(myclass);
+ }
+ {
+ rbtree < MyClass, any_to_set_hook< BaseHook > > rbtree_base;
+ rbtree_base.insert_unique(myclass);
+ }
+ {
+ rbtree < MyClass, any_to_set_hook< MemberHook > > rbtree_member;
+ rbtree_member.insert_unique(myclass);
+ }
+ {
+ avltree < MyClass, any_to_avl_set_hook< BaseHook > > avltree_base;
+ avltree_base.insert_unique(myclass);
+ }
+ {
+ avltree < MyClass, any_to_avl_set_hook< MemberHook > > avltree_member;
+ avltree_member.insert_unique(myclass);
+ }
+ {
+ sgtree < MyClass, any_to_bs_set_hook< BaseHook > > sgtree_base;
+ sgtree_base.insert_unique(myclass);
+ }
+ {
+ sgtree < MyClass, any_to_bs_set_hook< MemberHook > > sgtree_member;
+ sgtree_member.insert_unique(myclass);
+ }
+ {
+ treap < MyClass, any_to_bs_set_hook< BaseHook > > treap_base;
+ treap_base.insert_unique(myclass);
+ }
+ {
+ treap < MyClass, any_to_bs_set_hook< MemberHook > > treap_member;
+ treap_member.insert_unique(myclass);
+ }
+ {
+ splaytree < MyClass, any_to_bs_set_hook< BaseHook > > splaytree_base;
+ splaytree_base.insert_unique(myclass);
+ }
+ {
+ splaytree < MyClass, any_to_bs_set_hook< MemberHook > > splaytree_member;
+ splaytree_member.insert_unique(myclass);
+ }
+ typedef unordered_bucket<any_to_unordered_set_hook< BaseHook > >::type bucket_type;
+ typedef unordered_default_bucket_traits<any_to_unordered_set_hook< BaseHook > >::type bucket_traits;
+ bucket_type buckets[2];
+ {
+ hashtable < MyClass, any_to_unordered_set_hook< BaseHook > >
+ hashtable_base(bucket_traits(&buckets[0], 1));
+ hashtable_base.insert_unique(myclass);
+ }
+ {
+ hashtable < MyClass, any_to_unordered_set_hook< MemberHook > >
+ hashtable_member(bucket_traits(&buckets[1], 1));
+ hashtable_member.insert_unique(myclass);
+ }
+}
+
+bool simple_slist_test()
+{
+ //Define an slist that will store MyClass using the public base hook
+ typedef any_to_slist_hook< base_hook< any_base_hook<> > >BaseOption;
+ typedef slist<MyClass, BaseOption, constant_time_size<false> > BaseList;
+
+ //Define an slist that will store MyClass using the public member hook
+ typedef any_to_slist_hook< member_hook<MyClass, any_member_hook<>, &MyClass::member_hook_> > MemberOption;
+ typedef slist<MyClass, MemberOption> MemberList;
+
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseList baselist;
+ MemberList memberlist;
+
+ //Now insert them in the reverse order in the base hook list
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ baselist.push_front(*it);
+
+ //Now insert them in the same order as in vector in the member hook list
+ for(BaseList::iterator it(baselist.begin()), itend(baselist.end())
+ ; it != itend; ++it){
+ memberlist.push_front(*it);
+ }
+
+ //Now test lists
+ {
+ BaseList::iterator bit(baselist.begin()), bitend(baselist.end());
+ MemberList::iterator mit(memberlist.begin()), mitend(memberlist.end());
+ VectRit rit(values.rbegin()), ritend(values.rend());
+ VectIt it(values.begin()), itend(values.end());
+
+ //Test the objects inserted in the base hook list
+ for(; rit != ritend; ++rit, ++bit)
+ if(&*bit != &*rit) return false;
+
+ //Test the objects inserted in the member hook list
+ for(; it != itend; ++it, ++mit)
+ if(&*mit != &*it) return false;
+ }
+ return true;
+}
+
+int main()
+{
+ if(!simple_slist_test())
+ return 1;
+ instantiation_test();
+ return 0;
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
+*/
+
+#include <boost/intrusive/detail/function_detector.hpp>
+
+#include <boost/static_assert.hpp>
+#include <cassert>
+
+class myclass
+{
+ public:
+ bool some_func(int);
+ static bool some_static_func(int);
+};
+
+BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(some_func)
+BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(some_static_func)
+BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(inexistent_func)
+
+int main()
+{
+ using namespace boost::intrusive::function_detector;
+ BOOST_STATIC_ASSERT(( NonStaticFunction == BOOST_INTRUSIVE_DETECT_FUNCTION(myclass, bool, some_func, (int)) ));
+ BOOST_STATIC_ASSERT(( StaticFunction == BOOST_INTRUSIVE_DETECT_FUNCTION(myclass, bool, some_static_func, (int)) ));
+ BOOST_STATIC_ASSERT(( NotFound == BOOST_INTRUSIVE_DETECT_FUNCTION(myclass, bool, inexistent_func, (int)) ));
+ return 0;
+}
Added: sandbox/move/libs/intrusive/test/avl_multiset_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/avl_multiset_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,158 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/avl_set.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_multiset_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_insert_before<boost::intrusive::avl_multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef avl_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef avl_set_base_hook
+ <link_mode<auto_unlink>
+ , void_pointer<VoidPointer>
+ , tag<my_tag>
+ , optimize_size<true> > auto_base_hook_type;
+ typedef avl_set_member_hook
+ <void_pointer<VoidPointer> > member_hook_type;
+ typedef avl_set_member_hook
+ < link_mode<auto_unlink>
+ , void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::avl_multiset
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, true>()();
+ return boost::report_errors();
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/avl_set_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/avl_set_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,160 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/avl_set.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_set_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_insert_before<boost::intrusive::avl_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef avl_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef avl_set_base_hook
+ <link_mode<auto_unlink>
+ , void_pointer<VoidPointer>
+ , tag<my_tag>
+ , optimize_size<true> > auto_base_hook_type;
+ typedef avl_set_member_hook
+ <void_pointer<VoidPointer> > member_hook_type;
+ typedef avl_set_member_hook
+ < link_mode<auto_unlink>
+ , void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::avl_set
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, true>()();
+
+ return boost::report_errors();
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/common_functors.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/common_functors.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,56 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_TEST_COMMON_FUNCTORS_HPP
+#define BOOST_INTRUSIVE_TEST_COMMON_FUNCTORS_HPP
+
+#include<boost/intrusive/detail/utilities.hpp>
+#include<boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace test {
+
+template<class T>
+class delete_disposer
+{
+ public:
+ template <class Pointer>
+ void operator()(Pointer p)
+ {
+ typedef typename std::iterator_traits<Pointer>::value_type value_type;
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(( detail::is_same<T, value_type>::value ));
+ delete detail::get_pointer(p);
+ }
+};
+
+template<class T>
+class new_cloner
+{
+ public:
+ T *operator()(const T &t)
+ { return new T(t); }
+};
+
+template<class T>
+class new_default_factory
+{
+ public:
+ T *operator()()
+ { return new T(); }
+};
+
+} //namespace test {
+} //namespace intrusive {
+} //namespace boost {
+
+#endif
Added: sandbox/move/libs/intrusive/test/custom_bucket_traits_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/custom_bucket_traits_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,127 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include <boost/functional/hash.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+class MyClass : public unordered_set_base_hook<>
+{
+ int int_;
+
+ public:
+ MyClass(int i = 0) : int_(i)
+ {}
+ unordered_set_member_hook<> member_hook_;
+
+ friend bool operator==(const MyClass &l, const MyClass &r)
+ { return l.int_ == r.int_; }
+
+ friend std::size_t hash_value(const MyClass &v)
+ { return boost::hash_value(v.int_); }
+};
+
+struct uset_value_traits
+{
+ typedef slist_node_traits<void*> node_traits;
+ typedef node_traits::node_ptr node_ptr;
+ typedef node_traits::const_node_ptr const_node_ptr;
+ typedef MyClass value_type;
+ typedef MyClass * pointer;
+ typedef const MyClass * const_pointer;
+ static const link_mode_type link_mode = normal_link;
+
+ static node_ptr to_node_ptr (value_type &value)
+ { return node_ptr(&value); }
+ static const_node_ptr to_node_ptr (const value_type &value)
+ { return const_node_ptr(&value); }
+ static pointer to_value_ptr(node_ptr n)
+ { return static_cast<value_type*>(n); }
+ static const_pointer to_value_ptr(const_node_ptr n)
+ { return static_cast<const value_type*>(n); }
+};
+
+//Base
+typedef base_hook< unordered_set_base_hook<> > BaseHook;
+typedef unordered_bucket<BaseHook>::type BaseBucketType;
+typedef unordered_set<MyClass, BaseHook> BaseUset;
+//Member
+typedef member_hook
+ < MyClass, unordered_set_member_hook<>
+ , &MyClass::member_hook_ > MemberHook;
+typedef unordered_bucket<MemberHook>::type MemberBucketType;
+typedef unordered_set<MyClass, MemberHook> MemberUset;
+//Explicit
+typedef value_traits< uset_value_traits > Traits;
+typedef unordered_bucket<Traits>::type TraitsBucketType;
+typedef unordered_set<MyClass, Traits> TraitsUset;
+
+struct uset_bucket_traits
+{
+ //Power of two bucket length
+ static const std::size_t NumBuckets = 128;
+
+ uset_bucket_traits(BaseBucketType *buckets)
+ : buckets_(buckets)
+ {}
+
+ uset_bucket_traits(const uset_bucket_traits &other)
+ : buckets_(other.buckets_)
+ {}
+
+ BaseBucketType * bucket_begin() const
+ { return buckets_; }
+
+ std::size_t bucket_count() const
+ { return NumBuckets; }
+
+ BaseBucketType *buckets_;
+};
+
+typedef unordered_set
+ <MyClass, bucket_traits<uset_bucket_traits>, power_2_buckets<true> >
+ BucketTraitsUset;
+
+int main()
+{
+ if(!detail::is_same<BaseUset::bucket_type, BaseBucketType>::value)
+ return 1;
+ if(!detail::is_same<MemberUset::bucket_type, MemberBucketType>::value)
+ return 1;
+ if(!detail::is_same<TraitsUset::bucket_type, TraitsBucketType>::value)
+ return 1;
+ if(!detail::is_same<BaseBucketType, MemberBucketType>::value)
+ return 1;
+ if(!detail::is_same<BaseBucketType, TraitsBucketType>::value)
+ return 1;
+
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+ std::vector<MyClass> values;
+
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ BaseBucketType buckets[uset_bucket_traits::NumBuckets];
+ uset_bucket_traits btraits(buckets);
+ BucketTraitsUset uset(btraits);
+
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ uset.insert(*it);
+
+ for( VectRit it(values.rbegin()), itend(values.rend()); it != itend; ++it){
+ if(uset.find(*it) == uset.cend()) return 1;
+ }
+
+ return 0;
+}
Added: sandbox/move/libs/intrusive/test/default_hook_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/default_hook_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,126 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/intrusive/splay_set.hpp>
+#include <boost/intrusive/avl_set.hpp>
+#include <boost/intrusive/sg_set.hpp>
+#include "smart_ptr.hpp"
+#include <vector>
+
+using namespace boost::intrusive;
+
+class MyClass
+
+: public list_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >
+, public slist_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >
+, public set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >
+, public unordered_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >
+, public avl_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >
+, public splay_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >
+, public bs_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >
+{
+ int int_;
+
+ public:
+ MyClass(int i)
+ : int_(i)
+ {}
+
+ friend bool operator<(const MyClass &l, const MyClass &r)
+ { return l.int_ < r.int_; }
+
+ friend bool operator==(const MyClass &l, const MyClass &r)
+ { return l.int_ == r.int_; }
+
+ friend std::size_t hash_value(const MyClass &v)
+ { return boost::hash_value(v.int_); }
+};
+
+//Define a list that will store MyClass using the public base hook
+typedef list<MyClass> List;
+typedef slist<MyClass> Slist;
+typedef set<MyClass> Set;
+typedef unordered_set<MyClass> USet;
+typedef avl_set<MyClass> AvlSet;
+typedef splay_set<MyClass> SplaySet;
+typedef sg_set<MyClass> SgSet;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ USet::bucket_type buckets[100];
+
+ List my_list;
+ Slist my_slist;
+ Set my_set;
+ USet my_uset(USet::bucket_traits(buckets, 100));
+ AvlSet my_avlset;
+ SplaySet my_splayset;
+ SgSet my_sgset;
+
+ //Now insert them in the reverse order
+ //in the base hook intrusive list
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
+ my_list.push_front(*it);
+ my_slist.push_front(*it);
+ my_set.insert(*it);
+ my_uset.insert(*it);
+ my_avlset.insert(*it);
+ my_splayset.insert(*it);
+ my_sgset.insert(*it);
+ }
+
+ //Now test lists
+ {
+ List::const_iterator list_it(my_list.cbegin());
+ Slist::const_iterator slist_it(my_slist.cbegin());
+ Set::const_reverse_iterator set_rit(my_set.crbegin());
+ AvlSet::const_reverse_iterator avl_set_rit(my_avlset.crbegin());
+ SplaySet::const_reverse_iterator splay_set_rit(my_splayset.crbegin());
+ SgSet::const_reverse_iterator sg_set_rit(my_sgset.crbegin());
+
+ VectRit vect_it(values.rbegin()), vect_itend(values.rend());
+
+ //Test the objects inserted in the base hook list
+ for(; vect_it != vect_itend
+ ; ++vect_it, ++list_it
+ , ++slist_it, ++set_rit
+ , ++avl_set_rit, ++splay_set_rit
+ , ++sg_set_rit){
+ if(&*list_it != &*vect_it) return 1;
+ if(&*slist_it != &*vect_it) return 1;
+ if(&*set_rit != &*vect_it) return 1;
+ if(&*avl_set_rit != &*vect_it) return 1;
+ if(&*splay_set_rit != &*vect_it)return 1;
+ if(&*sg_set_rit != &*vect_it) return 1;
+ if(my_uset.find(*set_rit) == my_uset.cend()) return 1;
+ }
+ }
+
+ return 0;
+}
Added: sandbox/move/libs/intrusive/test/external_value_traits_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/external_value_traits_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,239 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/rbtree.hpp>
+#include <boost/intrusive/hashtable.hpp>
+#include <boost/pointer_to_other.hpp>
+#include <functional>
+#include <vector>
+
+using namespace boost::intrusive;
+
+class MyClass
+{
+ public:
+ int int_;
+
+ MyClass(int i = 0)
+ : int_(i)
+ {}
+ friend bool operator > (const MyClass &l, const MyClass &r)
+ { return l.int_ > r.int_; }
+ friend bool operator == (const MyClass &l, const MyClass &r)
+ { return l.int_ == r.int_; }
+ friend std::size_t hash_value(const MyClass &v)
+ { return boost::hash_value(v.int_); }
+};
+
+const int NumElements = 100;
+
+template<class NodeTraits>
+struct external_traits
+{
+ typedef NodeTraits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+ typedef MyClass value_type;
+ typedef typename boost::pointer_to_other
+ <node_ptr, MyClass>::type pointer;
+ typedef typename boost::pointer_to_other
+ <node_ptr, const MyClass>::type const_pointer;
+ static const link_mode_type link_mode = normal_link;
+
+ external_traits(pointer values, std::size_t NumElem)
+ : values_(values), node_array_(NumElem)
+ {}
+
+ node_ptr to_node_ptr (value_type &value)
+ { return (&node_array_[0]) + (&value - values_); }
+
+ const_node_ptr to_node_ptr (const value_type &value) const
+ { return &node_array_[0] + (&value - values_); }
+
+ pointer to_value_ptr(node_ptr n)
+ { return values_ + (n - &node_array_[0]); }
+
+ const_pointer to_value_ptr(const_node_ptr n) const
+ { return values_ + (n - &node_array_[0]); }
+
+ pointer values_;
+ std::vector<node> node_array_;
+};
+
+template<class NodeTraits>
+struct value_traits_proxy;
+
+template<class T>
+struct traits_holder
+ : public T
+{};
+
+typedef value_traits_proxy<list_node_traits<void*> > list_value_traits_proxy;
+typedef value_traits_proxy<slist_node_traits<void*> > slist_value_traits_proxy;
+typedef value_traits_proxy<rbtree_node_traits<void*> > rbtree_value_traits_proxy;
+typedef value_traits_proxy<traits_holder<slist_node_traits<void*> > > hash_value_traits_proxy;
+
+struct uset_bucket_traits
+{
+ private:
+ typedef unordered_bucket<value_traits<external_traits
+ <traits_holder<slist_node_traits<void*> > > > >::type bucket_type;
+
+ //Non-copyable
+ uset_bucket_traits(const uset_bucket_traits &other);
+ uset_bucket_traits & operator=(const uset_bucket_traits &other);
+
+ public:
+ static const std::size_t NumBuckets = 100;
+
+ uset_bucket_traits(){}
+
+ bucket_type * bucket_begin() const
+ { return buckets_; }
+
+ std::size_t bucket_count() const
+ { return NumBuckets; }
+
+ mutable bucket_type buckets_[NumBuckets];
+};
+
+struct bucket_traits_proxy
+{
+ static const bool external_bucket_traits = true;
+ typedef uset_bucket_traits bucket_traits;
+
+ template<class Container>
+ bucket_traits &get_bucket_traits(Container &cont);
+
+ template<class Container>
+ const bucket_traits &get_bucket_traits(const Container &cont) const;
+};
+
+//Define a list that will store MyClass using the external hook
+typedef list<MyClass, value_traits<list_value_traits_proxy> > List;
+//Define a slist that will store MyClass using the external hook
+typedef slist<MyClass, value_traits<slist_value_traits_proxy> > Slist;
+//Define a rbtree that will store MyClass using the external hook
+typedef rbtree< MyClass
+ , value_traits<rbtree_value_traits_proxy>
+ , compare<std::greater<MyClass> > > Rbtree;
+//Define a hashtable that will store MyClass using the external hook
+typedef hashtable< MyClass
+ , value_traits<hash_value_traits_proxy>
+ , bucket_traits<bucket_traits_proxy>
+ > Hash;
+
+template<class NodeTraits>
+struct value_traits_proxy
+{
+ static const bool external_value_traits = true;
+ typedef external_traits<NodeTraits> value_traits;
+
+ template<class Container>
+ const value_traits &get_value_traits(const Container &cont) const;
+
+ template<class Container>
+ value_traits &get_value_traits(Container &cont);
+};
+
+struct ContainerHolder
+ : public uset_bucket_traits
+ , public List
+ , public external_traits<list_node_traits<void*> >
+ , public Slist
+ , public external_traits<slist_node_traits<void*> >
+ , public Rbtree
+ , public external_traits<rbtree_node_traits<void*> >
+ , public Hash
+ , public external_traits<traits_holder<slist_node_traits<void*> > >
+{
+ static const std::size_t NumBucket = 100;
+ ContainerHolder(MyClass *values, std::size_t num_elem)
+ : uset_bucket_traits()
+ , List()
+ , external_traits<list_node_traits<void*> >(values, num_elem)
+ , Slist()
+ , external_traits<slist_node_traits<void*> >(values, num_elem)
+ , Rbtree()
+ , external_traits<rbtree_node_traits<void*> >(values, num_elem)
+ , Hash(Hash::bucket_traits())
+ , external_traits<traits_holder<slist_node_traits<void*> > >(values, num_elem)
+ {}
+};
+
+template<class NodeTraits>
+template<class Container>
+typename value_traits_proxy<NodeTraits>::value_traits &
+ value_traits_proxy<NodeTraits>::get_value_traits(Container &cont)
+{ return static_cast<value_traits&>(static_cast<ContainerHolder&>(cont)); }
+
+template<class NodeTraits>
+template<class Container>
+const typename value_traits_proxy<NodeTraits>::value_traits &
+ value_traits_proxy<NodeTraits>::get_value_traits(const Container &cont) const
+{ return static_cast<const value_traits&>(static_cast<const ContainerHolder&>(cont)); }
+
+template<class Container>
+typename bucket_traits_proxy::bucket_traits &
+ bucket_traits_proxy::get_bucket_traits(Container &cont)
+{ return static_cast<bucket_traits&>(static_cast<ContainerHolder&>(cont)); }
+
+template<class Container>
+const typename bucket_traits_proxy::bucket_traits &
+ bucket_traits_proxy::get_bucket_traits(const Container &cont) const
+{ return static_cast<const bucket_traits&>(static_cast<const ContainerHolder&>(cont)); }
+
+int main()
+{
+ MyClass values [NumElements];
+ //Create several MyClass objects, each one with a different value
+ for(int i = 0; i < NumElements; ++i)
+ values[i].int_ = i;
+
+ ContainerHolder cont_holder(values, NumElements);
+ List &my_list = static_cast<List &> (cont_holder);
+ Slist &my_slist = static_cast<Slist &> (cont_holder);
+ Rbtree &my_rbtree = static_cast<Rbtree &> (cont_holder);
+ Hash &my_hash = static_cast<Hash &> (cont_holder);
+
+ //Now insert them in containers
+ for(MyClass * it(&values[0]), *itend(&values[NumElements])
+ ; it != itend; ++it){
+ my_list.push_front(*it);
+ my_slist.push_front(*it);
+ my_rbtree.insert_unique(*it);
+ my_hash.insert_unique(*it);
+ }
+
+ //Now test containers
+ {
+ List::const_iterator list_it (my_list.cbegin());
+ Slist::const_iterator slist_it (my_slist.cbegin());
+ Rbtree::const_iterator rbtree_it (my_rbtree.cbegin());
+ Hash::const_iterator hash_it (my_hash.cbegin());
+ MyClass *it_val(&values[NumElements] - 1), *it_rbeg_val(&values[0]-1);
+
+ //Test inserted objects
+ for(; it_val != it_rbeg_val; --it_val, ++list_it, ++slist_it, ++rbtree_it){
+ if(&*list_it != &*it_val) return 1;
+ if(&*slist_it != &*it_val) return 1;
+ if(&*rbtree_it != &*it_val) return 1;
+ hash_it = my_hash.find(*it_val);
+ if(hash_it == my_hash.cend() || &*hash_it != &*it_val)
+ return 1;
+ }
+ }
+
+ return 0;
+}
Added: sandbox/move/libs/intrusive/test/generic_assoc_test.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/generic_assoc_test.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,447 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <vector> //vector
+#include <algorithm> //sort, random_shuffle
+#include <boost/intrusive/detail/config_begin.hpp>
+#include "common_functors.hpp"
+#include <boost/intrusive/options.hpp>
+#include <boost/detail/lightweight_test.hpp>
+#include "test_macros.hpp"
+#include "test_container.hpp"
+
+namespace boost{
+namespace intrusive{
+namespace test{
+
+template<class T>
+struct has_splay
+{
+ static const bool value = false;
+};
+
+template<class T>
+struct has_rebalance
+{
+ static const bool value = false;
+};
+
+template<class T>
+struct has_insert_before
+{
+ static const bool value = false;
+};
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+struct test_generic_assoc
+{
+ typedef typename ValueTraits::value_type value_type;
+ static void test_all(std::vector<value_type>& values);
+ static void test_clone(std::vector<value_type>& values);
+ static void test_insert_erase_burst();
+ static void test_container_from_end(std::vector<value_type>& values);
+ static void test_splay_up(std::vector<value_type>& values);
+ static void test_splay_up(std::vector<value_type>& values, boost::intrusive::detail::true_type);
+ static void test_splay_up(std::vector<value_type>& values, boost::intrusive::detail::false_type);
+ static void test_splay_down(std::vector<value_type>& values);
+ static void test_splay_down(std::vector<value_type>& values, boost::intrusive::detail::true_type);
+ static void test_splay_down(std::vector<value_type>& values, boost::intrusive::detail::false_type);
+ static void test_rebalance(std::vector<value_type>& values);
+ static void test_rebalance(std::vector<value_type>& values, boost::intrusive::detail::true_type);
+ static void test_rebalance(std::vector<value_type>& values, boost::intrusive::detail::false_type);
+ static void test_insert_before(std::vector<value_type>& values);
+ static void test_insert_before(std::vector<value_type>& values, boost::intrusive::detail::true_type);
+ static void test_insert_before(std::vector<value_type>& values, boost::intrusive::detail::false_type);
+ static void test_container_from_iterator(std::vector<value_type>& values);
+};
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::
+ test_container_from_iterator(std::vector<value_type>& values)
+{
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+
+ assoc_type testset(values.begin(), values.end());
+ typedef typename assoc_type::iterator it_type;
+ typedef typename assoc_type::const_iterator cit_type;
+ typedef typename assoc_type::size_type sz_type;
+ sz_type sz = testset.size();
+ for(it_type b(testset.begin()), e(testset.end()); b != e; ++b)
+ {
+ assoc_type &s = assoc_type::container_from_iterator(b);
+ const assoc_type &cs = assoc_type::container_from_iterator(cit_type(b));
+ BOOST_TEST(&s == &cs);
+ BOOST_TEST(&s == &testset);
+ s.erase(b);
+ BOOST_TEST(testset.size() == (sz-1));
+ s.insert(*b);
+ BOOST_TEST(testset.size() == sz);
+ }
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_insert_erase_burst()
+{
+ typedef typename ValueTraits::value_type value_type;
+
+ std::vector<value_type> values;
+ const int MaxValues = 100;
+ for(int i = 0; i != MaxValues; ++i){
+ values.push_back(value_type(i));
+ }
+
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ typedef typename assoc_type::iterator iterator;
+
+ //First ordered insertions
+ assoc_type testset (&values[0], &values[0] + values.size());
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(testset, testset.begin());
+
+ //Ordered erasure
+ iterator it(testset.begin()), itend(testset.end());
+ for(int i = 0; it != itend; ++i){
+ BOOST_TEST(&*it == &values[i]);
+ it = testset.erase(it);
+ }
+
+ BOOST_TEST(testset.empty());
+
+ //Now random insertions
+ std::random_shuffle(values.begin(), values.end());
+ testset.insert(&values[0], &values[0] + values.size());
+ std::vector<value_type> values_ordered(values);
+ std::sort(values_ordered.begin(), values_ordered.end());
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(testset, testset.begin());
+
+ {
+ typedef typename std::vector<value_type>::const_iterator cvec_iterator;
+ //Random erasure
+ std::vector<cvec_iterator> it_vector;
+
+ for(cvec_iterator it(values.begin()), itend(values.end())
+ ; it != itend
+ ; ++it){
+ it_vector.push_back(it);
+ }
+ std::random_shuffle(it_vector.begin(), it_vector.end());
+ for(int i = 0; i != MaxValues; ++i){
+ testset.erase(testset.iterator_to(*it_vector[i]));
+ }
+
+ BOOST_TEST(testset.empty());
+ }
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_all(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ test_clone(values);
+ test_container_from_end(values);
+ test_splay_up(values);
+ test_splay_down(values);
+ test_rebalance(values);
+ test_insert_before(values);
+ test_insert_erase_burst();
+ test_container_from_iterator(values);
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>
+ ::test_clone(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+
+ assoc_type testset1 (&values[0], &values[0] + values.size());
+ assoc_type testset2;
+
+ testset2.clone_from(testset1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ BOOST_TEST (testset2 == testset1);
+ testset2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testset2.empty());
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>
+ ::test_container_from_end(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ assoc_type testset (&values[0], &values[0] + values.size());
+ BOOST_TEST (testset == assoc_type::container_from_end_iterator(testset.end()));
+ BOOST_TEST (testset == assoc_type::container_from_end_iterator(testset.cend()));
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_splay_up
+(std::vector<typename ValueTraits::value_type>& values, boost::intrusive::detail::true_type)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ typedef typename assoc_type::iterator iterator;
+ typedef std::vector<value_type> orig_set_t;
+ std::size_t num_values;
+ orig_set_t original_testset;
+ {
+ assoc_type testset (values.begin(), values.end());
+ num_values = testset.size();
+ original_testset.insert(original_testset.end(), testset.begin(), testset.end());
+ }
+
+ for(std::size_t i = 0; i != num_values; ++i){
+ assoc_type testset (values.begin(), values.end());
+ {
+ iterator it = testset.begin();
+ for(std::size_t j = 0; j != i; ++j, ++it){}
+ testset.splay_up(it);
+ }
+ BOOST_TEST (testset.size() == num_values);
+ iterator it = testset.begin();
+ for( typename orig_set_t::const_iterator origit = original_testset.begin()
+ , origitend = original_testset.end()
+ ; origit != origitend
+ ; ++origit, ++it){
+ BOOST_TEST(*origit == *it);
+ }
+ }
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_splay_up
+(std::vector<typename ValueTraits::value_type>&, boost::intrusive::detail::false_type)
+{}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_splay_up
+(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ typedef typename detail::remove_const<assoc_type>::type Type;
+ typedef detail::bool_<has_splay<Type>::value> enabler;
+ test_splay_up(values, enabler());
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_splay_down
+(std::vector<typename ValueTraits::value_type>& values, boost::intrusive::detail::true_type)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ typedef typename assoc_type::iterator iterator;
+ typedef std::vector<value_type> orig_set_t;
+ std::size_t num_values;
+ orig_set_t original_testset;
+ {
+ assoc_type testset (values.begin(), values.end());
+ num_values = testset.size();
+ original_testset.insert(original_testset.end(), testset.begin(), testset.end());
+ }
+
+ for(std::size_t i = 0; i != num_values; ++i){
+ assoc_type testset (values.begin(), values.end());
+ BOOST_TEST(testset.size() == num_values);
+ {
+ iterator it = testset.begin();
+ for(std::size_t j = 0; j != i; ++j, ++it){}
+ BOOST_TEST(*it == *testset.splay_down(*it));
+ }
+ BOOST_TEST (testset.size() == num_values);
+ iterator it = testset.begin();
+ for( typename orig_set_t::const_iterator origit = original_testset.begin()
+ , origitend = original_testset.end()
+ ; origit != origitend
+ ; ++origit, ++it){
+ BOOST_TEST(*origit == *it);
+ }
+ }
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_splay_down
+(std::vector<typename ValueTraits::value_type>&, boost::intrusive::detail::false_type)
+{}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_splay_down
+(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ typedef typename detail::remove_const<assoc_type>::type Type;
+ typedef detail::bool_<has_splay<Type>::value> enabler;
+ test_splay_down(values, enabler());
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_rebalance
+(std::vector<typename ValueTraits::value_type>& values, boost::intrusive::detail::true_type)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ typedef std::vector<value_type> orig_set_t;
+ typedef typename orig_set_t::iterator iterator_t;
+ std::size_t num_values;
+ orig_set_t original_testset;
+ {
+ assoc_type testset (values.begin(), values.end());
+ num_values = testset.size();
+ original_testset.insert(original_testset.end(), testset.begin(), testset.end());
+ }
+ {
+ assoc_type testset(values.begin(), values.end());
+ testset.rebalance();
+ iterator_t it = original_testset.begin();
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(original_testset, testset.begin());
+ }
+
+ {
+ std::size_t numdata;
+ {
+ assoc_type testset(values.begin(), values.end());
+ numdata = testset.size();
+ }
+
+ for(int i = 0; i != (int)numdata; ++i){
+ assoc_type testset(values.begin(), values.end());
+ typename assoc_type::iterator it = testset.begin();
+ for(int j = 0; j != i; ++j) ++it;
+ testset.rebalance_subtree(it);
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(original_testset, testset.begin());
+ }
+ }
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_rebalance
+(std::vector<typename ValueTraits::value_type>&, boost::intrusive::detail::false_type)
+{}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_rebalance
+(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ typedef typename detail::remove_const<assoc_type>::type Type;
+ typedef detail::bool_<has_rebalance<Type>::value> enabler;
+ test_rebalance(values, enabler());
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_insert_before
+(std::vector<typename ValueTraits::value_type>& values, boost::intrusive::detail::true_type)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ {
+ assoc_type testset;
+ typedef typename std::vector<value_type>::iterator vec_iterator;
+ for(vec_iterator it(values.begin()), itend(values.end())
+ ; it != itend
+ ; ++it){
+ testset.push_back(*it);
+ }
+ BOOST_TEST(testset.size() == values.size());
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(values, testset.begin());
+ }
+ {
+ assoc_type testset;
+ typedef typename std::vector<value_type>::iterator vec_iterator;
+ for(vec_iterator it(--values.end()), itend(--values.begin())
+ ; it != itend
+ ; --it){
+ testset.push_front(*it);
+ }
+ BOOST_TEST(testset.size() == values.size());
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(values, testset.begin());
+ }
+ {
+ assoc_type testset;
+ typedef typename std::vector<value_type>::iterator vec_iterator;
+ typename assoc_type::iterator it_pos =
+ testset.insert_before(testset.end(), *values.rbegin());
+ testset.insert_before(testset.begin(), *values.begin());
+ for(vec_iterator it(++values.begin()), itend(--values.end())
+ ; it != itend
+ ; ++it){
+ testset.insert_before(it_pos, *it);
+ }
+ BOOST_TEST(testset.size() == values.size());
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(values, testset.begin());
+ }
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_insert_before
+(std::vector<typename ValueTraits::value_type>&, boost::intrusive::detail::false_type)
+{}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_assoc<ValueTraits, ContainerDefiner>::test_insert_before
+(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type assoc_type;
+ typedef typename detail::remove_const<assoc_type>::type Type;
+ typedef detail::bool_<has_insert_before<Type>::value> enabler;
+ test_insert_before(values, enabler());
+}
+
+}}} //namespace boost::intrusive::test
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/generic_multiset_test.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/generic_multiset_test.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,227 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <vector>
+#include <boost/intrusive/detail/config_begin.hpp>
+#include "common_functors.hpp"
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/intrusive/options.hpp>
+#include "test_macros.hpp"
+#include "test_container.hpp"
+#include "generic_assoc_test.hpp"
+
+namespace boost{
+namespace intrusive{
+namespace test{
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+struct test_generic_multiset
+{
+ typedef typename ValueTraits::value_type value_type;
+ static void test_all ();
+ static void test_sort(std::vector<value_type>& values);
+ static void test_insert(std::vector<value_type>& values);
+ static void test_swap(std::vector<value_type>& values);
+ static void test_find(std::vector<value_type>& values);
+ static void test_impl();
+};
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_multiset<ValueTraits, ContainerDefiner>::test_all ()
+{
+ typedef typename ValueTraits::value_type value_type;
+ static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
+ std::vector<value_type> values (6);
+ for (int i = 0; i < 6; ++i)
+ values[i].value_ = random_init[i];
+
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type multiset_type;
+ {
+ multiset_type testset(values.begin(), values.end());
+ test::test_container(testset);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_common_unordered_and_associative_container(testset, values);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_associative_container(testset, values);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_non_unique_container(testset, values);
+ }
+ test_sort(values);
+ test_insert(values);
+ test_swap(values);
+ test_find(values);
+ test_impl();
+ test_generic_assoc<ValueTraits, ContainerDefiner>::test_all(values);
+}
+
+//test case due to an error in tree implementation:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_multiset<ValueTraits, ContainerDefiner>::test_impl()
+{
+ typedef typename ValueTraits::value_type value_type;
+ std::vector<value_type> values (5);
+ for (int i = 0; i < 5; ++i)
+ values[i].value_ = i;
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type multiset_type;
+
+ multiset_type testset;
+ for (int i = 0; i < 5; ++i)
+ testset.insert (values[i]);
+
+ testset.erase (testset.iterator_to (values[0]));
+ testset.erase (testset.iterator_to (values[1]));
+ testset.insert (values[1]);
+
+ testset.erase (testset.iterator_to (values[2]));
+ testset.erase (testset.iterator_to (values[3]));
+}
+
+//test: constructor, iterator, clear, reverse_iterator, front, back, size:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_multiset<ValueTraits, ContainerDefiner>::test_sort(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type multiset_type;
+
+ multiset_type testset1 (values.begin(), values.end());
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ testset1.clear();
+ BOOST_TEST (testset1.empty());
+
+ typedef typename ContainerDefiner
+ <value_type
+ , compare<even_odd>
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type multiset_type2;
+ multiset_type2 testset2 (&values[0], &values[0] + 6);
+ { int init_values [] = { 5, 3, 1, 4, 2, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.rbegin() ); }
+
+ BOOST_TEST (testset2.begin()->value_ == 2);
+ BOOST_TEST (testset2.rbegin()->value_ == 5);
+}
+
+//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_multiset<ValueTraits, ContainerDefiner>::test_insert(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ >::type multiset_type;
+
+ multiset_type testset;
+ testset.insert(&values[0] + 2, &values[0] + 5);
+ { int init_values [] = { 1, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.begin() ); }
+
+ typename multiset_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 1);
+
+ i = testset.insert (i, values[0]);
+ BOOST_TEST (&*i == &values[0]);
+
+ { int init_values [] = { 5, 4, 3, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.rbegin() ); }
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+
+ i = multiset_type::s_iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+
+ testset.erase(i);
+
+ { int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.begin() ); }
+}
+
+//test: insert (seq-version), swap, erase (seq-version), size:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_multiset<ValueTraits, ContainerDefiner>::test_swap(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ >::type multiset_type;
+ multiset_type testset1 (&values[0], &values[0] + 2);
+ multiset_type testset2;
+ testset2.insert (&values[0] + 2, &values[0] + 6);
+ testset1.swap (testset2);
+
+ { int init_values [] = { 1, 2, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ { int init_values [] = { 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.begin() ); }
+
+ testset1.erase (testset1.iterator_to(values[5]), testset1.end());
+ BOOST_TEST (testset1.size() == 1);
+ BOOST_TEST (&*testset1.begin() == &values[3]);
+}
+
+//test: find, equal_range (lower_bound, upper_bound):
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_multiset<ValueTraits, ContainerDefiner>::test_find(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ >::type multiset_type;
+ multiset_type testset (values.begin(), values.end());
+ typedef typename multiset_type::iterator iterator;
+
+ value_type cmp_val;
+ cmp_val.value_ = 2;
+ iterator i = testset.find (cmp_val);
+ BOOST_TEST (i->value_ == 2);
+ BOOST_TEST ((++i)->value_ == 2);
+ std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
+
+ BOOST_TEST (range.first->value_ == 2);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 2);
+
+ cmp_val.value_ = 7;
+ BOOST_TEST (testset.find (cmp_val) == testset.end());
+}
+
+}}} //namespace boost::intrusive::test
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/generic_set_test.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/generic_set_test.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,298 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <vector>
+#include <boost/intrusive/detail/config_begin.hpp>
+#include "common_functors.hpp"
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/intrusive/options.hpp>
+#include "test_macros.hpp"
+#include "test_container.hpp"
+#include "generic_assoc_test.hpp"
+
+namespace boost{
+namespace intrusive{
+namespace test{
+
+template<class T>
+struct is_treap
+{
+ static const bool value = false;
+};
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+struct test_generic_set
+{
+ typedef typename ValueTraits::value_type value_type;
+ static void test_all();
+ static void test_sort(std::vector<value_type>& values);
+ static void test_insert(std::vector<value_type>& values);
+ static void test_insert_advanced(std::vector<value_type>& values, boost::intrusive::detail::true_type);
+ static void test_insert_advanced(std::vector<value_type>& values, boost::intrusive::detail::false_type);
+ static void test_insert_advanced(std::vector<value_type>& values);
+ static void test_swap(std::vector<value_type>& values);
+ static void test_find(std::vector<value_type>& values);
+ static void test_impl();
+};
+
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_all()
+{
+ typedef typename ValueTraits::value_type value_type;
+ static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
+ std::vector<value_type> values (6);
+ for (int i = 0; i < 6; ++i)
+ values[i].value_ = random_init[i];
+
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ {
+ set_type testset(values.begin(), values.end());
+ test::test_container(testset);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_common_unordered_and_associative_container(testset, values);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_associative_container(testset, values);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_unique_container(testset, values);
+ }
+ test_sort(values);
+ test_insert(values);
+ test_insert_advanced(values);
+ test_swap(values);
+ test_find(values);
+ test_impl();
+ test_generic_assoc<ValueTraits, ContainerDefiner>::test_all(values);
+}
+
+//test case due to an error in tree implementation:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_impl()
+{
+ typedef typename ValueTraits::value_type value_type;
+ std::vector<value_type> values (5);
+ for (int i = 0; i < 5; ++i)
+ values[i].value_ = i;
+
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ set_type testset;
+ for (int i = 0; i < 5; ++i)
+ testset.insert (values[i]);
+
+ testset.erase (testset.iterator_to (values[0]));
+ testset.erase (testset.iterator_to (values[1]));
+ testset.insert (values[1]);
+
+ testset.erase (testset.iterator_to (values[2]));
+ testset.erase (testset.iterator_to (values[3]));
+}
+
+//test: constructor, iterator, clear, reverse_iterator, front, back, size:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_sort(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ set_type testset1 (values.begin(), values.end());
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ testset1.clear();
+ BOOST_TEST (testset1.empty());
+
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , compare<even_odd>
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type2;
+ set_type2 testset2 (&values[0], &values[0] + 6);
+ { int init_values [] = { 5, 3, 1, 4, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.rbegin() ); }
+ BOOST_TEST (testset2.begin()->value_ == 2);
+ BOOST_TEST (testset2.rbegin()->value_ == 5);
+}
+
+//test: insert, const_iterator, const_reverse_iterator, erase, s_iterator_to:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_insert(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ {
+ set_type testset;
+ testset.insert(&values[0] + 2, &values[0] + 5);
+
+ const set_type& const_testset = testset;
+ { int init_values [] = { 1, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ typename set_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 1);
+
+ i = testset.insert (i, values[0]);
+ BOOST_TEST (&*i == &values[0]);
+
+ { int init_values [] = { 5, 4, 3, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.rbegin() ); }
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+
+ i = set_type::s_iterator_to(values[2]);
+ BOOST_TEST (&*i == &values[2]);
+
+ testset.erase (i);
+ { int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset.begin() ); }
+ }
+}
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_insert_advanced
+(std::vector<typename ValueTraits::value_type>& values, boost::intrusive::detail::true_type)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ {
+ set_type testset;
+ testset.insert(&values[0], &values[0] + values.size());
+ value_type v(1);
+ typename set_type::insert_commit_data data;
+ BOOST_TEST (!testset.insert_check(v, testset.value_comp(), testset.priority_comp(), data).second);
+ BOOST_TEST (!testset.insert_check(testset.begin(), v, testset.value_comp(), testset.priority_comp(), data).second);
+ }
+}
+
+
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_insert_advanced
+(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ typedef typename detail::remove_const<set_type>::type Type;
+ typedef detail::bool_<is_treap<Type>::value> enabler;
+ test_insert_advanced(values, enabler());
+}
+
+
+//test: insert, const_iterator, const_reverse_iterator, erase, s_iterator_to:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_insert_advanced
+ ( std::vector<typename ValueTraits::value_type>& values
+ , boost::intrusive::detail::false_type)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ {
+ set_type testset;
+ testset.insert(&values[0], &values[0] + values.size());
+ value_type v(1);
+ typename set_type::insert_commit_data data;
+ BOOST_TEST (!testset.insert_check(v, testset.value_comp(), data).second);
+ BOOST_TEST (!testset.insert_check(testset.begin(), v, testset.value_comp(), data).second);
+ }
+}
+
+
+//test: insert (seq-version), swap, erase (seq-version), size:
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_swap(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ set_type testset1 (&values[0], &values[0] + 2);
+ set_type testset2;
+ testset2.insert (&values[0] + 2, &values[0] + 6);
+ testset1.swap (testset2);
+
+ { int init_values [] = { 1, 2, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ { int init_values [] = { 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.begin() ); }
+
+ testset1.erase (testset1.iterator_to(values[5]), testset1.end());
+ BOOST_TEST (testset1.size() == 1);
+ // BOOST_TEST (&testset1.front() == &values[3]);
+ BOOST_TEST (&*testset1.begin() == &values[3]);
+}
+
+//test: find, equal_range (lower_bound, upper_bound):
+template<class ValueTraits, template <class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none, class = ::boost::intrusive::none> class ContainerDefiner>
+void test_generic_set<ValueTraits, ContainerDefiner>::test_find(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef typename ContainerDefiner
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ >::type set_type;
+ set_type testset (values.begin(), values.end());
+ typedef typename set_type::iterator iterator;
+
+ value_type cmp_val;
+ cmp_val.value_ = 2;
+ iterator i = testset.find (cmp_val);
+ BOOST_TEST (i->value_ == 2);
+ BOOST_TEST ((++i)->value_ != 2);
+ std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
+
+ BOOST_TEST (range.first->value_ == 2);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 1);
+
+ cmp_val.value_ = 7;
+ BOOST_TEST (testset.find (cmp_val) == testset.end());
+}
+
+}}} //namespace boost::intrusive::test
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/itestvalue.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/itestvalue.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,183 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#ifndef BOOST_INTRUSIVE_DETAIL_ITESTVALUE_HPP
+#define BOOST_INTRUSIVE_DETAIL_ITESTVALUE_HPP
+
+#include <iostream>
+#include <boost/intrusive/options.hpp>
+#include <boost/functional/hash.hpp>
+
+namespace boost{
+namespace intrusive{
+
+struct testvalue_filler
+{
+ void *dummy_[3];
+};
+
+template<class Hooks, bool ConstantTimeSize>
+struct testvalue
+ : testvalue_filler
+ , Hooks::base_hook_type
+ , Hooks::auto_base_hook_type
+{
+ typename Hooks::member_hook_type node_;
+ typename Hooks::auto_member_hook_type auto_node_;
+ int value_;
+
+ static const bool constant_time_size = ConstantTimeSize;
+
+ testvalue()
+ {}
+
+ testvalue(int i)
+ : value_(i)
+ {}
+
+ testvalue (const testvalue& src)
+ : value_ (src.value_)
+ {}
+
+ // testvalue is used in std::vector and thus prev and next
+ // have to be handled appropriately when copied:
+ testvalue & operator= (const testvalue& src)
+ {
+ Hooks::base_hook_type::operator=(src);
+ Hooks::auto_base_hook_type::operator=(src);
+ this->node_ = src.node_;
+ this->auto_node_ = src.auto_node_;
+ value_ = src.value_;
+ return *this;
+ }
+
+ void swap_nodes(testvalue &other)
+ {
+ Hooks::base_hook_type::swap_nodes(other);
+ Hooks::auto_base_hook_type::swap_nodes(other);
+ node_.swap_nodes(other.node_);
+ auto_node_.swap_nodes(other.auto_node_);
+ }
+
+ bool is_linked() const
+ {
+ return Hooks::base_hook_type::is_linked() ||
+ Hooks::auto_base_hook_type::is_linked() ||
+ node_.is_linked() ||
+ auto_node_.is_linked();
+ }
+
+ ~testvalue()
+ {}
+
+ bool operator< (const testvalue &other) const
+ { return value_ < other.value_; }
+
+ bool operator==(const testvalue &other) const
+ { return value_ == other.value_; }
+
+ bool operator!=(const testvalue &other) const
+ { return value_ != other.value_; }
+
+ friend bool operator< (int other1, const testvalue &other2)
+ { return other1 < other2.value_; }
+
+ friend bool operator< (const testvalue &other1, int other2)
+ { return other1.value_ < other2; }
+
+ friend bool operator== (int other1, const testvalue &other2)
+ { return other1 == other2.value_; }
+
+ friend bool operator== (const testvalue &other1, int other2)
+ { return other1.value_ == other2; }
+
+ friend bool operator!= (int other1, const testvalue &other2)
+ { return other1 != other2.value_; }
+
+ friend bool operator!= (const testvalue &other1, int other2)
+ { return other1.value_ != other2; }
+};
+
+template<class Hooks, bool ConstantTimeSize>
+std::size_t hash_value(const testvalue<Hooks, ConstantTimeSize> &t)
+{
+ boost::hash<int> hasher;
+ return hasher(t.value_);
+}
+
+template<class Hooks, bool ConstantTimeSize>
+bool priority_order( const testvalue<Hooks, ConstantTimeSize> &t1
+ , const testvalue<Hooks, ConstantTimeSize> &t2)
+{
+ std::size_t hash1 = hash_value(t1);
+ boost::hash_combine(hash1, &t1);
+ std::size_t hash2 = hash_value(t2);
+ boost::hash_combine(hash2, &t2);
+ return hash1 < hash2;
+}
+
+template<class Hooks, bool constant_time_size>
+std::ostream& operator<<
+ (std::ostream& s, const testvalue<Hooks, constant_time_size>& t)
+{ return s << t.value_; }
+
+struct even_odd
+{
+ template<class Hooks, bool constant_time_size>
+ bool operator()
+ (const testvalue<Hooks, constant_time_size>& v1
+ ,const testvalue<Hooks, constant_time_size>& v2) const
+ {
+ if ((v1.value_ & 1) == (v2.value_ & 1))
+ return v1.value_ < v2.value_;
+ else
+ return v2.value_ & 1;
+ }
+};
+
+struct is_even
+{
+ template<class Hooks, bool constant_time_size>
+ bool operator()
+ (const testvalue<Hooks, constant_time_size>& v1) const
+ { return (v1.value_ & 1) == 0; }
+};
+/*
+struct int_testvalue_comp
+{
+ template<class Hooks, bool constant_time_size>
+ bool operator()
+ (const testvalue<Hooks, constant_time_size>& v1, const int &i) const
+ { return v1.value_ < i; }
+ template<class Hooks, bool constant_time_size>
+ bool operator()
+ (const int &i, const testvalue<Hooks, constant_time_size>& v1) const
+ { return i < v1.value_; }
+};
+
+struct int_testvalue_pcomp
+{
+ template<class Hooks, bool constant_time_size>
+ bool operator()
+ (const testvalue<Hooks, constant_time_size>& v1, const int &i) const
+ { return v1.value_ < i; }
+ template<class Hooks, bool constant_time_size>
+ bool operator()
+ (const int &i, const testvalue<Hooks, constant_time_size>& v1) const
+ { return i < v1.value_; }
+};
+*/
+
+} //namespace boost{
+} //namespace intrusive{
+
+#endif
Added: sandbox/move/libs/intrusive/test/list_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/list_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,503 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/list.hpp>
+
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "common_functors.hpp"
+#include <vector>
+#include <boost/detail/lightweight_test.hpp>
+#include "test_macros.hpp"
+#include "test_container.hpp"
+
+using namespace boost::intrusive;
+
+class my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef list_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef list_base_hook< link_mode<auto_unlink>
+ , void_pointer<VoidPointer>, tag<my_tag> > auto_base_hook_type;
+ typedef list_member_hook<void_pointer<VoidPointer>, tag<my_tag> > member_hook_type;
+ typedef list_member_hook< link_mode<auto_unlink>
+ , void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template<class ValueTraits>
+struct test_list
+{
+ typedef typename ValueTraits::value_type value_type;
+ static void test_all(std::vector<value_type>& values);
+ static void test_front_back(std::vector<value_type>& values);
+ static void test_sort(std::vector<value_type>& values);
+ static void test_merge(std::vector<value_type>& values);
+ static void test_remove_unique(std::vector<value_type>& values);
+ static void test_insert(std::vector<value_type>& values);
+ static void test_shift(std::vector<value_type>& values);
+ static void test_swap(std::vector<value_type>& values);
+ static void test_clone(std::vector<value_type>& values);
+ static void test_container_from_end(std::vector<value_type>& values);
+};
+
+template<class ValueTraits>
+void test_list<ValueTraits>::test_all(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ {
+ list_type list(values.begin(), values.end());
+ test::test_container(list);
+ list.clear();
+ list.insert(list.end(), values.begin(), values.end());
+ test::test_sequence_container(list, values);
+ }
+
+ test_front_back(values);
+ test_sort(values);
+ test_merge(values);
+ test_remove_unique(values);
+ test_insert(values);
+ test_shift(values);
+ test_swap(values);
+ test_clone(values);
+ test_container_from_end(values);
+}
+
+//test: push_front, pop_front, push_back, pop_back, front, back, size, empty:
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_front_back(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ list_type testlist;
+ BOOST_TEST (testlist.empty());
+
+ testlist.push_back (values[0]);
+ BOOST_TEST (testlist.size() == 1);
+ BOOST_TEST (&testlist.front() == &values[0]);
+ BOOST_TEST (&testlist.back() == &values[0]);
+
+ testlist.push_front (values[1]);
+ BOOST_TEST (testlist.size() == 2);
+ BOOST_TEST (&testlist.front() == &values[1]);
+ BOOST_TEST (&testlist.back() == &values[0]);
+
+ testlist.pop_back();
+ BOOST_TEST (testlist.size() == 1);
+ const list_type &const_testlist = testlist;
+ BOOST_TEST (&const_testlist.front() == &values[1]);
+ BOOST_TEST (&const_testlist.back() == &values[1]);
+
+ testlist.pop_front();
+ BOOST_TEST (testlist.empty());
+}
+
+
+//test: constructor, iterator, reverse_iterator, sort, reverse:
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_sort(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ list_type testlist(values.begin(), values.end());
+
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.begin() ); }
+
+ testlist.sort (even_odd());
+ { int init_values [] = { 5, 3, 1, 4, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.rbegin() ); }
+
+ testlist.reverse();
+ { int init_values [] = { 5, 3, 1, 4, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.begin() ); }
+}
+
+//test: merge due to error in merge implementation:
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_remove_unique (std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ {
+ list_type list(values.begin(), values.end());
+ list.remove_if(is_even());
+ int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, list.begin() );
+ }
+ {
+ std::vector<typename ValueTraits::value_type> values2(values);
+ list_type list(values.begin(), values.end());
+ list.insert(list.end(), values2.begin(), values2.end());
+ list.sort();
+ int init_values [] = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, list.begin() );
+ list.unique();
+ int init_values2 [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values2, list.begin() );
+ }
+}
+
+//test: merge due to error in merge implementation:
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_merge (std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ list_type testlist1, testlist2;
+ testlist1.push_front (values[0]);
+ testlist2.push_front (values[4]);
+ testlist2.push_front (values[3]);
+ testlist2.push_front (values[2]);
+ testlist1.merge (testlist2);
+
+ int init_values [] = { 1, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() );
+}
+
+//test: assign, insert, const_iterator, const_reverse_iterator, erase, s_iterator_to:
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_insert(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ list_type testlist;
+ testlist.assign (&values[0] + 2, &values[0] + 5);
+
+ const list_type& const_testlist = testlist;
+ { int init_values [] = { 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
+
+ typename list_type::iterator i = ++testlist.begin();
+ BOOST_TEST (i->value_ == 4);
+
+ {
+ typename list_type::const_iterator ci = typename list_type::iterator();
+ //typename list_type::iterator i = typename list_type::const_iterator();
+ }
+
+ testlist.insert (i, values[0]);
+ { int init_values [] = { 5, 4, 1, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.rbegin() ); }
+
+ i = testlist.iterator_to (values[4]);
+ BOOST_TEST (&*i == &values[4]);
+
+ i = list_type::s_iterator_to (values[4]);
+ BOOST_TEST (&*i == &values[4]);
+
+ i = testlist.erase (i);
+ BOOST_TEST (i == testlist.end());
+
+ { int init_values [] = { 3, 1, 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
+}
+
+
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_shift(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ list_type testlist;
+ const int num_values = (int)values.size();
+ std::vector<int> expected_values(num_values);
+
+ for(int s = 1; s <= num_values; ++s){
+ expected_values.resize(s);
+ //Shift forward all possible positions 3 times
+ for(int i = 0; i < s*3; ++i){
+ testlist.insert(testlist.begin(), &values[0], &values[0] + s);
+ testlist.shift_forward(i);
+ for(int j = 0; j < s; ++j){
+ expected_values[(j + s - i%s) % s] = (j + 1);
+ }
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin());
+ testlist.clear();
+ }
+
+ //Shift backwards all possible positions
+ for(int i = 0; i < s*3; ++i){
+ testlist.insert(testlist.begin(), &values[0], &values[0] + s);
+ testlist.shift_backwards(i);
+ for(int j = 0; j < s; ++j){
+ expected_values[(j + i) % s] = (j + 1);
+ }
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin());
+ testlist.clear();
+ }
+ }
+}
+
+//test: insert (seq-version), swap, splice, erase (seq-version):
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_swap(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ {
+ list_type testlist1 (&values[0], &values[0] + 2);
+ list_type testlist2;
+ testlist2.insert (testlist2.end(), &values[0] + 2, &values[0] + 5);
+ testlist1.swap (testlist2);
+
+ { int init_values [] = { 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 1, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+
+ testlist2.splice (++testlist2.begin(), testlist1);
+ { int init_values [] = { 1, 3, 4, 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+
+ BOOST_TEST (testlist1.empty());
+
+ testlist1.splice (testlist1.end(), testlist2, ++(++testlist2.begin()));
+ { int init_values [] = { 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ { int init_values [] = { 1, 3, 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+
+ testlist1.splice (testlist1.end(), testlist2,
+ testlist2.begin(), ----testlist2.end());
+ { int init_values [] = { 4, 1, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+
+ testlist1.erase (testlist1.iterator_to(values[0]), testlist1.end());
+ BOOST_TEST (testlist1.size() == 1);
+ BOOST_TEST (&testlist1.front() == &values[3]);
+ }
+ {
+ list_type testlist1 (&values[0], &values[0] + 2);
+ list_type testlist2 (&values[0] + 3, &values[0] + 5);
+
+ values[0].swap_nodes(values[2]);
+ { int init_values [] = { 3, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ values[2].swap_nodes(values[4]);
+ { int init_values [] = { 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 4, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+ }
+ {
+ list_type testlist1 (&values[0], &values[1]);
+
+ { int init_values [] = { 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ values[1].swap_nodes(values[2]);
+
+ { int init_values [] = { 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ values[0].swap_nodes(values[2]);
+
+ { int init_values [] = { 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ values[0].swap_nodes(values[2]);
+
+ { int init_values [] = { 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ }
+
+}
+
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_container_from_end(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ list_type testlist1 (&values[0], &values[0] + values.size());
+ BOOST_TEST (testlist1 == list_type::container_from_end_iterator(testlist1.end()));
+ BOOST_TEST (testlist1 == list_type::container_from_end_iterator(testlist1.cend()));
+}
+
+
+template<class ValueTraits>
+void test_list<ValueTraits>
+ ::test_clone(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef list
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ > list_type;
+ list_type testlist1 (&values[0], &values[0] + values.size());
+ list_type testlist2;
+
+ testlist2.clone_from(testlist1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ BOOST_TEST (testlist2 == testlist1);
+ testlist2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testlist2.empty());
+}
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ typedef testvalue<hooks<VoidPointer>, constant_time_size> value_type;
+ std::vector<value_type> data (5);
+ for (int i = 0; i < 5; ++i)
+ data[i].value_ = i + 1;
+
+ test_list < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ >::test_all(data);
+ test_list < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ >::test_all(data);
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ typedef testvalue<hooks<VoidPointer>, false> value_type;
+ std::vector<value_type> data (5);
+ for (int i = 0; i < 5; ++i)
+ data[i].value_ = i + 1;
+
+ test_list < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ >::test_all(data);
+
+ test_list < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ >::test_all(data);
+
+// test_list<stateful_value_traits
+// < value_type
+// , list_node_traits<VoidPointer>
+// , safe_link>
+// >::test_all(data);
+ test_list < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ >::test_all(data);
+
+ test_list < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ >::test_all(data);
+
+// test_list<stateful_value_traits
+// < value_type
+// , list_node_traits<VoidPointer>
+// , auto_unlink>
+// >::test_all(data);
+
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<smart_ptr<void>, true>()();
+
+ return boost::report_errors();
+}
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/make_functions_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/make_functions_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,231 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/intrusive/avl_set.hpp>
+#include <boost/intrusive/sg_set.hpp>
+#include <boost/intrusive/splay_set.hpp>
+#include <boost/intrusive/treap_set.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+#include "smart_ptr.hpp"
+#include <vector>
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+typedef make_bs_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link>
+ , tag<my_tag> >::type TreapHook;
+
+class MyClass
+: public make_list_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >::type
+, public make_slist_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >::type
+, public make_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >::type
+, public make_unordered_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >::type
+, public make_avl_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >::type
+, public make_splay_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >::type
+, public make_bs_set_base_hook
+ < void_pointer<smart_ptr<void> >, link_mode<normal_link> >::type
+, public TreapHook
+{
+ int int_;
+
+ public:
+ MyClass(int i)
+ : int_(i)
+ {}
+
+ friend bool operator<(const MyClass &l, const MyClass &r)
+ { return l.int_ < r.int_; }
+
+ friend bool operator==(const MyClass &l, const MyClass &r)
+ { return l.int_ == r.int_; }
+
+ friend std::size_t hash_value(const MyClass &v)
+ { return boost::hash_value(v.int_); }
+
+ friend bool priority_order(const MyClass &l, const MyClass &r)
+ { return l.int_ < r.int_; }
+};
+
+//Define a list that will store MyClass using the public base hook
+typedef make_list<MyClass>::type List;
+typedef make_slist<MyClass>::type Slist;
+typedef make_set<MyClass>::type Set;
+typedef make_unordered_set<MyClass>::type USet;
+
+typedef make_avl_set<MyClass>::type AvlSet;
+typedef make_splay_set<MyClass>::type SplaySet;
+typedef make_sg_set<MyClass>::type SgSet;
+typedef make_treap_set<MyClass
+ , base_hook<TreapHook> >::type TreapSet;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ USet::bucket_type buckets[100];
+
+ List my_list;
+ Slist my_slist;
+ Set my_set;
+ USet my_uset(USet::bucket_traits(buckets, 100));
+
+ AvlSet my_avlset;
+ SplaySet my_splayset;
+ SgSet my_sgset;
+ TreapSet my_treapset;
+
+ //Now insert them in containers
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
+ my_list.push_front(*it);
+ my_slist.push_front(*it);
+ my_set.insert(*it);
+ my_uset.insert(*it);
+ my_avlset.insert(*it);
+ my_splayset.insert(*it);
+ my_sgset.insert(*it);
+ my_treapset.insert(*it);
+ }
+
+ //Now test lists
+ {
+ List::const_iterator list_it(my_list.cbegin());
+ Slist::const_iterator slist_it(my_slist.cbegin());
+ Set::const_reverse_iterator set_rit(my_set.crbegin());
+
+ AvlSet::const_reverse_iterator avlset_rit(my_avlset.crbegin());
+ SplaySet::const_reverse_iterator splayset_rit(my_splayset.crbegin());
+ SgSet::const_reverse_iterator sgset_rit(my_sgset.crbegin());
+ TreapSet::const_reverse_iterator treapset_rit(my_treapset.crbegin());
+
+ VectRit vect_it(values.rbegin()), vect_itend(values.rend());
+
+ //Test the objects inserted in the base hook list
+ for( ; vect_it != vect_itend
+ ; ++vect_it, ++list_it, ++slist_it, ++set_rit
+ , ++avlset_rit, ++splayset_rit, ++sgset_rit, ++treapset_rit
+ ){
+ if(&*list_it != &*vect_it) return 1;
+ if(&*slist_it != &*vect_it) return 1;
+ if(&*set_rit != &*vect_it) return 1;
+ if(my_uset.find(*set_rit) == my_uset.cend()) return 1;
+ if(&*avlset_rit != &*vect_it) return 1;
+ if(&*splayset_rit != &*vect_it) return 1;
+ if(&*sgset_rit != &*vect_it) return 1;
+ if(&*treapset_rit != &*vect_it) return 1;
+ }
+ }
+
+ //Check defined types and implicitly defined types are equal
+ if(detail::is_same<make_list_base_hook<void_pointer<void*>, link_mode<safe_link> >::type
+ ,make_list_base_hook<>::type
+ >::value == false){
+ return 1;
+ }
+
+ if(detail::is_same<make_slist_base_hook<void_pointer<void*>, link_mode<safe_link> >::type
+ ,make_slist_base_hook<>::type
+ >::value == false){
+ return 1;
+ }
+
+ if(detail::is_same<make_set_base_hook<void_pointer<void*>, link_mode<safe_link> >::type
+ ,make_set_base_hook<>::type
+ >::value == false){
+ return 1;
+ }
+
+ if(detail::is_same<make_unordered_set_base_hook<void_pointer<void*>, link_mode<safe_link> >::type
+ ,make_unordered_set_base_hook<>::type
+ >::value == false){
+ return 1;
+ }
+
+ if(detail::is_same<make_avl_set_base_hook<void_pointer<void*>, link_mode<safe_link> >::type
+ ,make_avl_set_base_hook<>::type
+ >::value == false){
+ return 1;
+ }
+
+ if(detail::is_same<make_bs_set_base_hook<void_pointer<void*>, link_mode<safe_link> >::type
+ ,make_bs_set_base_hook<>::type
+ >::value == false){
+ return 1;
+ }
+
+ if(detail::is_same<make_splay_set_base_hook<void_pointer<void*>, link_mode<safe_link> >::type
+ ,make_splay_set_base_hook<>::type
+ >::value == false){
+ return 1;
+ }
+
+ //Check defined types and implicitly defined types are unequal
+ if(detail::is_same<make_list_base_hook<void_pointer<void*>, link_mode<normal_link> >::type
+ ,make_list_base_hook<>::type
+ >::value == true){
+ return 1;
+ }
+
+ if(detail::is_same<make_slist_base_hook<void_pointer<void*>, link_mode<normal_link> >::type
+ ,make_slist_base_hook<>::type
+ >::value == true){
+ return 1;
+ }
+
+ if(detail::is_same<make_set_base_hook<void_pointer<void*>, link_mode<normal_link> >::type
+ ,make_set_base_hook<>::type
+ >::value == true){
+ return 1;
+ }
+
+ if(detail::is_same<make_unordered_set_base_hook<void_pointer<void*>, link_mode<normal_link> >::type
+ ,make_unordered_set_base_hook<>::type
+ >::value == true){
+ return 1;
+ }
+
+ if(detail::is_same<make_avl_set_base_hook<void_pointer<void*>, link_mode<normal_link> >::type
+ ,make_avl_set_base_hook<>::type
+ >::value == true){
+ return 1;
+ }
+
+ if(detail::is_same<make_splay_set_base_hook<void_pointer<void*>, link_mode<normal_link> >::type
+ ,make_splay_set_base_hook<>::type
+ >::value == true){
+ return 1;
+ }
+
+ if(detail::is_same<make_bs_set_base_hook<void_pointer<void*>, link_mode<normal_link> >::type
+ ,make_bs_set_base_hook<>::type
+ >::value == true){
+ return 1;
+ }
+
+
+ return 0;
+}
Added: sandbox/move/libs/intrusive/test/multiset_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/multiset_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,157 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/set.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_multiset_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_insert_before<boost::intrusive::multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef set_base_hook
+ <void_pointer<VoidPointer> > base_hook_type;
+ typedef set_base_hook
+ <link_mode<auto_unlink>
+ , void_pointer<VoidPointer>
+ , tag<my_tag>
+ , optimize_size<true> > auto_base_hook_type;
+ typedef set_member_hook<void_pointer
+ <VoidPointer>, optimize_size<true> > member_hook_type;
+ typedef set_member_hook
+ <link_mode<auto_unlink>, void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::multiset
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, true>()();
+ return boost::report_errors();
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/set_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/set_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,159 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+
+#include <boost/intrusive/set.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_set_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_insert_before<boost::intrusive::set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+struct my_tag;
+
+using namespace boost::intrusive;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef set_base_hook
+ <void_pointer<VoidPointer> > base_hook_type;
+ typedef set_base_hook
+ <link_mode<auto_unlink>
+ , void_pointer<VoidPointer>
+ , tag<my_tag>
+ , optimize_size<true> > auto_base_hook_type;
+ typedef set_member_hook<void_pointer
+ <VoidPointer>, optimize_size<true> > member_hook_type;
+ typedef set_member_hook
+ <link_mode<auto_unlink>, void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::set
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, true>()();
+ return boost::report_errors();
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/sg_multiset_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/sg_multiset_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,151 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/sg_set.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_multiset_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_rebalance<boost::intrusive::sg_multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_insert_before<boost::intrusive::sg_multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef bs_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef bs_set_member_hook<void_pointer<VoidPointer> > member_hook_type;
+ typedef member_hook_type auto_member_hook_type;
+ struct auto_base_hook_type
+ : bs_set_base_hook<void_pointer<VoidPointer>, tag<my_tag> >
+ {};
+};
+
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::sg_multiset
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainerFixedAlpha
+{
+ typedef boost::intrusive::sg_multiset
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ , boost::intrusive::floating_point<false>
+ > type;
+};
+
+template<class VoidPointer>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , true> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainerFixedAlpha
+ >::test_all();
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainerFixedAlpha
+ >::test_all();
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*>()();
+ test_main_template<boost::intrusive::smart_ptr<void> >()();
+ return boost::report_errors();
+}
Added: sandbox/move/libs/intrusive/test/sg_set_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/sg_set_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,151 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/sg_set.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_set_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_rebalance<boost::intrusive::sg_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_insert_before<boost::intrusive::sg_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef bs_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef bs_set_member_hook<void_pointer<VoidPointer> > member_hook_type;
+ typedef member_hook_type auto_member_hook_type;
+ struct auto_base_hook_type
+ : bs_set_base_hook<void_pointer<VoidPointer>, tag<my_tag> >
+ {};
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::sg_set
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainerFixedAlpha
+{
+ typedef boost::intrusive::sg_set
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ , boost::intrusive::floating_point<false>
+ > type;
+};
+
+template<class VoidPointer>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , true> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainerFixedAlpha
+ >::test_all();
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainerFixedAlpha
+ >::test_all();
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*>()();
+ test_main_template<boost::intrusive::smart_ptr<void> >()();
+ return boost::report_errors();
+}
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/slist_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/slist_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,732 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "common_functors.hpp"
+#include <vector>
+#include <boost/detail/lightweight_test.hpp>
+#include "test_macros.hpp"
+#include "test_container.hpp"
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef slist_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef slist_base_hook< link_mode<auto_unlink>
+ , void_pointer<VoidPointer>, tag<my_tag> > auto_base_hook_type;
+ typedef slist_member_hook<void_pointer<VoidPointer>, tag<my_tag> > member_hook_type;
+ typedef slist_member_hook< link_mode<auto_unlink>
+ , void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template<class ValueTraits, bool Linear, bool CacheLast>
+struct test_slist
+{
+ typedef typename ValueTraits::value_type value_type;
+ static void test_all(std::vector<value_type>& values);
+ static void test_front(std::vector<value_type>& values);
+ static void test_back(std::vector<value_type>& values, detail::bool_<true>);
+ static void test_back(std::vector<value_type>& values, detail::bool_<false>);
+ static void test_sort(std::vector<value_type>& values);
+ static void test_merge(std::vector<value_type>& values);
+ static void test_remove_unique(std::vector<value_type>& values);
+ static void test_insert(std::vector<value_type>& values);
+ static void test_shift(std::vector<value_type>& values);
+ static void test_swap(std::vector<value_type>& values);
+ static void test_slow_insert(std::vector<value_type>& values);
+ static void test_clone(std::vector<value_type>& values);
+ static void test_container_from_end(std::vector<value_type> &, detail::bool_<true>){}
+ static void test_container_from_end(std::vector<value_type> &values, detail::bool_<false>);
+};
+
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_all (std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ {
+ list_type list(values.begin(), values.end());
+ test::test_container(list);
+ list.clear();
+ list.insert(list.end(), values.begin(), values.end());
+ test::test_sequence_container(list, values);
+ }
+ test_front(values);
+ test_back(values, detail::bool_<CacheLast>());
+ test_sort(values);
+ test_merge (values);
+ test_remove_unique(values);
+ test_insert(values);
+ test_shift(values);
+ test_slow_insert (values);
+ test_swap(values);
+ test_clone(values);
+ test_container_from_end(values, detail::bool_<Linear>());
+}
+
+//test: push_front, pop_front, front, size, empty:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_front(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ list_type testlist;
+ BOOST_TEST (testlist.empty());
+
+ testlist.push_front (values[0]);
+ BOOST_TEST (testlist.size() == 1);
+ BOOST_TEST (&testlist.front() == &values[0]);
+
+ testlist.push_front (values[1]);
+ BOOST_TEST (testlist.size() == 2);
+ BOOST_TEST (&testlist.front() == &values[1]);
+
+ testlist.pop_front();
+ BOOST_TEST (testlist.size() == 1);
+ BOOST_TEST (&testlist.front() == &values[0]);
+
+ testlist.pop_front();
+ BOOST_TEST (testlist.empty());
+}
+
+//test: push_front, pop_front, front, size, empty:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_back(std::vector<typename ValueTraits::value_type>& values, detail::bool_<true>)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ list_type testlist;
+ BOOST_TEST (testlist.empty());
+
+ testlist.push_back (values[0]);
+ BOOST_TEST (testlist.size() == 1);
+ BOOST_TEST (&testlist.front() == &values[0]);
+ BOOST_TEST (&testlist.back() == &values[0]);
+ testlist.push_back(values[1]);
+ BOOST_TEST(*testlist.previous(testlist.end()) == values[1]);
+ BOOST_TEST (&testlist.front() == &values[0]);
+ BOOST_TEST (&testlist.back() == &values[1]);
+}
+
+//test: push_front, pop_front, front, size, empty:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_back(std::vector<typename ValueTraits::value_type>&, detail::bool_<false>)
+{}
+
+
+//test: merge due to error in merge implementation:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_merge (std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ list_type testlist1, testlist2;
+ testlist1.push_front (values[0]);
+ testlist2.push_front (values[4]);
+ testlist2.push_front (values[3]);
+ testlist2.push_front (values[2]);
+ testlist1.merge (testlist2);
+
+ int init_values [] = { 1, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() );
+}
+
+//test: merge due to error in merge implementation:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_remove_unique (std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ {
+ list_type list(values.begin(), values.end());
+ list.remove_if(is_even());
+ int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, list.begin() );
+ }
+ {
+ std::vector<typename ValueTraits::value_type> values2(values);
+ list_type list(values.begin(), values.end());
+ list.insert_after(list.before_begin(), values2.begin(), values2.end());
+ list.sort();
+ int init_values [] = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, list.begin() );
+ list.unique();
+ int init_values2 [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values2, list.begin() );
+ }
+}
+
+//test: constructor, iterator, sort, reverse:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_sort(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ list_type testlist (values.begin(), values.end());
+
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.begin() ); }
+
+ testlist.sort (even_odd());
+ { int init_values [] = { 2, 4, 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.begin() ); }
+
+ testlist.reverse();
+ { int init_values [] = { 5, 3, 1, 4, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist.begin() ); }
+}
+
+//test: assign, insert_after, const_iterator, erase_after, s_iterator_to, previous:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_insert(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ list_type testlist;
+ testlist.assign (&values[0] + 2, &values[0] + 5);
+
+ const list_type& const_testlist = testlist;
+ { int init_values [] = { 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
+
+ typename list_type::iterator i = ++testlist.begin();
+ BOOST_TEST (i->value_ == 4);
+
+ testlist.insert_after (i, values[0]);
+ { int init_values [] = { 3, 4, 1, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
+
+ i = testlist.iterator_to (values[4]);
+ BOOST_TEST (&*i == &values[4]);
+ i = list_type::s_iterator_to (values[4]);
+ BOOST_TEST (&*i == &values[4]);
+ i = testlist.previous (i);
+ BOOST_TEST (&*i == &values[0]);
+
+ testlist.erase_after (i);
+ BOOST_TEST (&*i == &values[0]);
+ { int init_values [] = { 3, 4, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
+}
+
+//test: insert, const_iterator, erase, siterator_to:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_slow_insert (std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ list_type testlist;
+ testlist.push_front (values[4]);
+ testlist.insert (testlist.begin(), &values[0] + 2, &values[0] + 4);
+
+ const list_type& const_testlist = testlist;
+ { int init_values [] = { 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
+
+ typename list_type::iterator i = ++testlist.begin();
+ BOOST_TEST (i->value_ == 4);
+
+ testlist.insert (i, values[0]);
+ { int init_values [] = { 3, 1, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
+
+ i = testlist.iterator_to (values[4]);
+ BOOST_TEST (&*i == &values[4]);
+
+ i = list_type::s_iterator_to (values[4]);
+ BOOST_TEST (&*i == &values[4]);
+
+ i = testlist.erase (i);
+ BOOST_TEST (i == testlist.end());
+
+ { int init_values [] = { 3, 1, 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testlist.begin() ); }
+
+ testlist.erase (++testlist.begin(), testlist.end());
+ BOOST_TEST (testlist.size() == 1);
+ BOOST_TEST (testlist.front().value_ == 3);
+}
+
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_shift(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ list_type testlist;
+
+ const int num_values = (int)values.size();
+ std::vector<int> expected_values(num_values);
+
+ //Shift forward all possible positions 3 times
+ for(int s = 1; s <= num_values; ++s){
+ expected_values.resize(s);
+ for(int i = 0; i < s*3; ++i){
+ testlist.insert_after(testlist.before_begin(), &values[0], &values[0] + s);
+ testlist.shift_forward(i);
+ for(int j = 0; j < s; ++j){
+ expected_values[(j + s - i%s) % s] = (j + 1);
+ }
+
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin())
+ testlist.clear();
+ }
+
+ //Shift backwards all possible positions
+ for(int i = 0; i < s*3; ++i){
+ testlist.insert_after(testlist.before_begin(), &values[0], &values[0] + s);
+ testlist.shift_backwards(i);
+ for(int j = 0; j < s; ++j){
+ expected_values[(j + i) % s] = (j + 1);
+ }
+
+ TEST_INTRUSIVE_SEQUENCE_EXPECTED(expected_values, testlist.begin())
+ testlist.clear();
+ }
+ }
+}
+
+//test: insert_after (seq-version), swap, splice_after:
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_swap(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ {
+ list_type testlist1 (&values[0], &values[0] + 2);
+ list_type testlist2;
+ testlist2.insert_after (testlist2.before_begin(), &values[0] + 2, &values[0] + 5);
+ testlist1.swap(testlist2);
+ { int init_values [] = { 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 1, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+ testlist2.splice_after (testlist2.begin(), testlist1);
+ { int init_values [] = { 1, 3, 4, 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+ BOOST_TEST (testlist1.empty());
+
+ testlist1.splice_after (testlist1.before_begin(), testlist2, ++testlist2.begin());
+ { int init_values [] = { 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 1, 3, 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+
+ testlist1.splice_after (testlist1.begin(), testlist2,
+ testlist2.before_begin(), ++++testlist2.begin());
+ { int init_values [] = { 4, 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+ }
+ { //Now test swap when testlist2 is empty
+ list_type testlist1 (&values[0], &values[0] + 2);
+ list_type testlist2;
+ testlist1.swap(testlist2);
+ BOOST_TEST (testlist1.empty());
+ { int init_values [] = { 1, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+ }
+ { //Now test swap when testlist1 is empty
+ list_type testlist2 (&values[0], &values[0] + 2);
+ list_type testlist1;
+ testlist1.swap(testlist2);
+ BOOST_TEST (testlist2.empty());
+ { int init_values [] = { 1, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ }
+ { //Now test when both are empty
+ list_type testlist1, testlist2;
+ testlist2.swap(testlist1);
+ BOOST_TEST (testlist1.empty() && testlist2.empty());
+ }
+
+ if(!list_type::linear)
+ {
+ list_type testlist1 (&values[0], &values[0] + 2);
+ list_type testlist2 (&values[0] + 3, &values[0] + 5);
+
+ values[0].swap_nodes(values[2]);
+ { int init_values [] = { 3, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ values[2].swap_nodes(values[4]);
+ { int init_values [] = { 5, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ { int init_values [] = { 4, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist2.begin() ); }
+ }
+ if(!list_type::linear)
+ {
+ list_type testlist1 (&values[0], &values[1]);
+
+ { int init_values [] = { 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ values[1].swap_nodes(values[2]);
+
+ { int init_values [] = { 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ values[0].swap_nodes(values[2]);
+
+ { int init_values [] = { 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+
+ values[0].swap_nodes(values[2]);
+
+ { int init_values [] = { 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
+ }
+}
+
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_clone(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+
+ list_type testlist1 (&values[0], &values[0] + values.size());
+ list_type testlist2;
+
+ testlist2.clone_from(testlist1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ BOOST_TEST (testlist2 == testlist1);
+ testlist2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testlist2.empty());
+}
+
+template<class ValueTraits, bool Linear, bool CacheLast>
+void test_slist<ValueTraits, Linear, CacheLast>
+ ::test_container_from_end(std::vector<typename ValueTraits::value_type>& values
+ ,detail::bool_<false>)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef slist
+ < value_type
+ , value_traits<ValueTraits>
+ , size_type<std::size_t>
+ , constant_time_size<value_type::constant_time_size>
+ , linear<Linear>
+ , cache_last<CacheLast>
+ > list_type;
+ list_type testlist1 (&values[0], &values[0] + values.size());
+ BOOST_TEST (testlist1 == list_type::container_from_end_iterator(testlist1.end()));
+ BOOST_TEST (testlist1 == list_type::container_from_end_iterator(testlist1.cend()));
+}
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+ std::vector<value_type> data (5);
+ for (int i = 0; i < 5; ++i)
+ data[i].value_ = i + 1;
+
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , false
+ , false
+ >::test_all(data);
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , false
+ , false
+ >::test_all(data);
+
+ //Now linear slists
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , true
+ , false
+ >::test_all(data);
+
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , true
+ , false
+ >::test_all(data);
+
+ //Now the same but caching the last node
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , false
+ , true
+ >::test_all(data);
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , false
+ , true
+ >::test_all(data);
+
+ //Now linear slists
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , true
+ , true
+ >::test_all(data);
+
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , true
+ , true
+ >::test_all(data);
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+ std::vector<value_type> data (5);
+ for (int i = 0; i < 5; ++i)
+ data[i].value_ = i + 1;
+
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , false
+ , false
+ >::test_all(data);
+
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , false
+ , false
+ >::test_all(data);
+
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , false
+ , false
+ >::test_all(data);
+
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , false
+ , false
+ >::test_all(data);
+
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , true
+ , false
+ >::test_all(data);
+
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , true
+ , false
+ >::test_all(data);
+
+ //Now cache last
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , false
+ , true
+ >::test_all(data);
+
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , false
+ , true
+ >::test_all(data);
+
+ test_slist < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , true
+ , true
+ >::test_all(data);
+
+ test_slist < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , true
+ , true
+ >::test_all(data);
+ return 0;
+ }
+};
+
+int main(int, char* [])
+{
+ test_main_template<void*, false>()();
+ test_main_template<smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<smart_ptr<void>, true>()();
+ return boost::report_errors();
+}
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/smart_ptr.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/smart_ptr.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,388 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_SMART_PTR_HPP
+#define BOOST_INTRUSIVE_SMART_PTR_HPP
+
+#include <boost/iterator.hpp>
+#include <boost/intrusive/pointer_plus_bits.hpp>
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+namespace boost{
+namespace intrusive{
+
+namespace detail {
+
+struct static_cast_tag {};
+struct const_cast_tag {};
+struct dynamic_cast_tag {};
+struct reinterpret_cast_tag {};
+
+} //namespace detail {
+
+//Empty class
+struct empty_type{};
+
+template<class T>
+struct random_it
+: public boost::iterator<std::random_access_iterator_tag,
+ T, std::ptrdiff_t, T*, T&>
+{
+ typedef const T* const_pointer;
+ typedef const T& const_reference;
+};
+
+template<> struct random_it<void>
+{
+ typedef const void * const_pointer;
+ typedef empty_type& reference;
+ typedef const empty_type& const_reference;
+ typedef empty_type difference_type;
+ typedef empty_type iterator_category;
+};
+
+template<> struct random_it<const void>
+{
+ typedef const void * const_pointer;
+ typedef const empty_type & reference;
+ typedef const empty_type & const_reference;
+ typedef empty_type difference_type;
+ typedef empty_type iterator_category;
+};
+
+template<> struct random_it<volatile void>
+{
+ typedef const volatile void * const_pointer;
+ typedef empty_type& reference;
+ typedef const empty_type& const_reference;
+ typedef empty_type difference_type;
+ typedef empty_type iterator_category;
+};
+
+template<> struct random_it<const volatile void>
+{
+ typedef const volatile void * const_pointer;
+ typedef const empty_type & reference;
+ typedef const empty_type & const_reference;
+ typedef empty_type difference_type;
+ typedef empty_type iterator_category;
+};
+
+} //namespace intrusive {
+} //namespace boost {
+
+
+namespace boost {
+namespace intrusive {
+
+template <class PointedType>
+class smart_ptr
+{
+ typedef random_it<PointedType> random_it_t;
+ typedef smart_ptr<PointedType> self_t;
+ typedef typename random_it_t::const_pointer const_pointer_t;
+ typedef typename random_it_t::const_reference const_reference_t;
+
+ void unspecified_bool_type_func() const {}
+ typedef void (self_t::*unspecified_bool_type)() const;
+
+ public:
+ typedef PointedType * pointer;
+ typedef typename random_it_t::reference reference;
+ typedef PointedType value_type;
+ typedef typename random_it_t::difference_type difference_type;
+ typedef typename random_it_t::iterator_category iterator_category;
+
+ PointedType *m_ptr;
+
+ public: //Public Functions
+
+ //!Constructor from raw pointer (allows "0" pointer conversion). Never throws.
+ explicit smart_ptr(pointer ptr = 0)
+ : m_ptr(ptr)
+ {}
+
+ //!Constructor from other pointer. Never throws.
+ template <class T>
+ smart_ptr(T *ptr)
+ : m_ptr(ptr)
+ {}
+
+ //!Constructor from other smart_ptr
+ smart_ptr(const smart_ptr& ptr)
+ : m_ptr(ptr.m_ptr)
+ {}
+
+ //!Constructor from other smart_ptr. If pointers of pointee types are
+ //!convertible, offset_ptrs will be convertibles. Never throws.
+ template<class T2>
+ smart_ptr(const smart_ptr<T2> &ptr)
+ : m_ptr(ptr.m_ptr)
+ {}
+
+ //!Emulates static_cast operator. Never throws.
+ template<class Y>
+ smart_ptr(const smart_ptr<Y> & r, detail::static_cast_tag)
+ : m_ptr(static_cast<PointedType*>(r.get()))
+ {}
+
+ //!Emulates const_cast operator. Never throws.
+ template<class Y>
+ smart_ptr(const smart_ptr<Y> & r, detail::const_cast_tag)
+ : m_ptr(const_cast<PointedType*>(r.get()))
+ {}
+
+ //!Emulates dynamic_cast operator. Never throws.
+ template<class Y>
+ smart_ptr(const smart_ptr<Y> & r, detail::dynamic_cast_tag)
+ : m_ptr(dynamic_cast<PointedType*>(r.get()))
+ {}
+
+ //!Emulates reinterpret_cast operator. Never throws.
+ template<class Y>
+ smart_ptr(const smart_ptr<Y> & r, detail::reinterpret_cast_tag)
+ : m_ptr(reinterpret_cast<PointedType*>(r.get()))
+ {}
+
+ //!Obtains raw pointer from offset. Never throws.
+ pointer get() const
+ { return m_ptr; }
+
+ //!Pointer-like -> operator. It can return 0 pointer. Never throws.
+ pointer operator->() const
+ { return this->get(); }
+
+ //!Dereferencing operator, if it is a null smart_ptr behavior
+ //! is undefined. Never throws.
+ reference operator* () const
+ { return *(this->get()); }
+
+ //!Indexing operator. Never throws.
+ reference operator[](std::ptrdiff_t idx) const
+ { return this->get()[idx]; }
+
+ //!Assignment from pointer (saves extra conversion). Never throws.
+ smart_ptr& operator= (pointer from)
+ { m_ptr = from; return *this; }
+
+ //!Assignment from other smart_ptr. Never throws.
+ smart_ptr& operator= (const smart_ptr & pt)
+ { m_ptr = pt.m_ptr; return *this; }
+
+ //!Assignment from related smart_ptr. If pointers of pointee types
+ //! are assignable, offset_ptrs will be assignable. Never throws.
+ template <class T2>
+ smart_ptr& operator= (const smart_ptr<T2> & pt)
+ { m_ptr = pt.m_ptr; return *this; }
+
+ //!smart_ptr + std::ptrdiff_t. Never throws.
+ smart_ptr operator+ (std::ptrdiff_t offset) const
+ { return smart_ptr(this->get()+offset); }
+
+ //!smart_ptr - std::ptrdiff_t. Never throws.
+ smart_ptr operator- (std::ptrdiff_t offset) const
+ { return smart_ptr(this->get()-offset); }
+
+ //!smart_ptr += std::ptrdiff_t. Never throws.
+ smart_ptr &operator+= (std::ptrdiff_t offset)
+ { m_ptr += offset; return *this; }
+
+ //!smart_ptr -= std::ptrdiff_t. Never throws.
+ smart_ptr &operator-= (std::ptrdiff_t offset)
+ { m_ptr -= offset; return *this; }
+
+ //!++smart_ptr. Never throws.
+ smart_ptr& operator++ (void)
+ { ++m_ptr; return *this; }
+
+ //!smart_ptr++. Never throws.
+ smart_ptr operator++ (int)
+ { smart_ptr temp(*this); ++*this; return temp; }
+
+ //!--smart_ptr. Never throws.
+ smart_ptr& operator-- (void)
+ { --m_ptr; return *this; }
+
+ //!smart_ptr--. Never throws.
+ smart_ptr operator-- (int)
+ { smart_ptr temp(*this); --*this; return temp; }
+
+ //!safe bool conversion operator. Never throws.
+ operator unspecified_bool_type() const
+ { return this->get()? &self_t::unspecified_bool_type_func : 0; }
+
+ //!Not operator. Not needed in theory, but improves portability.
+ //!Never throws.
+ bool operator! () const
+ { return this->get() == 0; }
+/*
+ friend void swap (smart_ptr &pt, smart_ptr &pt2)
+ {
+ value_type *ptr = pt.get();
+ pt = pt2;
+ pt2 = ptr;
+ }
+*/
+};
+
+//!smart_ptr<T1> == smart_ptr<T2>. Never throws.
+template<class T1, class T2>
+inline bool operator== (const smart_ptr<T1> &pt1,
+ const smart_ptr<T2> &pt2)
+{ return pt1.get() == pt2.get(); }
+
+//!smart_ptr<T1> != smart_ptr<T2>. Never throws.
+template<class T1, class T2>
+inline bool operator!= (const smart_ptr<T1> &pt1,
+ const smart_ptr<T2> &pt2)
+{ return pt1.get() != pt2.get(); }
+
+//!smart_ptr<T1> < smart_ptr<T2>. Never throws.
+template<class T1, class T2>
+inline bool operator< (const smart_ptr<T1> &pt1,
+ const smart_ptr<T2> &pt2)
+{ return pt1.get() < pt2.get(); }
+
+//!smart_ptr<T1> <= smart_ptr<T2>. Never throws.
+template<class T1, class T2>
+inline bool operator<= (const smart_ptr<T1> &pt1,
+ const smart_ptr<T2> &pt2)
+{ return pt1.get() <= pt2.get(); }
+
+//!smart_ptr<T1> > smart_ptr<T2>. Never throws.
+template<class T1, class T2>
+inline bool operator> (const smart_ptr<T1> &pt1,
+ const smart_ptr<T2> &pt2)
+{ return pt1.get() > pt2.get(); }
+
+//!smart_ptr<T1> >= smart_ptr<T2>. Never throws.
+template<class T1, class T2>
+inline bool operator>= (const smart_ptr<T1> &pt1,
+ const smart_ptr<T2> &pt2)
+{ return pt1.get() >= pt2.get(); }
+
+//!operator<<
+template<class E, class T, class Y>
+inline std::basic_ostream<E, T> & operator<<
+ (std::basic_ostream<E, T> & os, smart_ptr<Y> const & p)
+{ return os << p.get(); }
+
+//!operator>>
+template<class E, class T, class Y>
+inline std::basic_istream<E, T> & operator>>
+ (std::basic_istream<E, T> & os, smart_ptr<Y> & p)
+{ Y * tmp; return os >> tmp; p = tmp; }
+
+//!std::ptrdiff_t + smart_ptr
+template<class T>
+inline smart_ptr<T> operator+(std::ptrdiff_t diff, const smart_ptr<T>& right)
+{ return right + diff; }
+
+//!smart_ptr - smart_ptr
+template<class T, class T2>
+inline std::ptrdiff_t operator- (const smart_ptr<T> &pt, const smart_ptr<T2> &pt2)
+{ return pt.get()- pt2.get(); }
+
+//!swap specialization
+template<class T>
+inline void swap (smart_ptr<T> &pt,
+ smart_ptr<T> &pt2)
+{
+ typename smart_ptr<T>::value_type *ptr = pt.get();
+ pt = pt2;
+ pt2 = ptr;
+}
+
+//!detail::get_pointer() enables boost::mem_fn to recognize smart_ptr.
+//!Never throws.
+template<class T>
+inline T* get_pointer(const smart_ptr<T> & p)
+{ return p.get(); }
+
+//!Simulation of static_cast between pointers. Never throws.
+template<class T, class U>
+inline smart_ptr<T>
+ static_pointer_cast(smart_ptr<U> const & r)
+{
+ return smart_ptr<T>(r, detail::static_cast_tag());
+}
+
+//!Simulation of const_cast between pointers. Never throws.
+template<class T, class U>
+inline smart_ptr<T>const_pointer_cast(smart_ptr<U> const & r)
+{
+ return smart_ptr<T>(r, detail::const_cast_tag());
+}
+
+//!Simulation of dynamic_cast between pointers. Never throws.
+template<class T, class U>
+inline smart_ptr<T>
+ dynamic_pointer_cast(smart_ptr<U> const & r)
+{
+ return smart_ptr<T>
+ (r, detail::dynamic_cast_tag());
+}
+
+//!Simulation of reinterpret_cast between pointers. Never throws.
+template<class T, class U>
+inline smart_ptr<T>
+ reinterpret_pointer_cast(smart_ptr<U> const & r)
+{
+ return smart_ptr<T>(r, detail::reinterpret_cast_tag());
+}
+
+} //namespace intrusive {
+} //namespace boost {
+
+namespace boost{
+
+//This is to support embedding a bit in the pointer
+//for intrusive containers, saving space
+namespace intrusive {
+
+template<std::size_t Alignment>
+struct max_pointer_plus_bits<smart_ptr<void>, Alignment>
+{
+ static const std::size_t value = max_pointer_plus_bits<void*, Alignment>::value;
+};
+
+template<class T, std::size_t NumBits>
+struct pointer_plus_bits<smart_ptr<T>, NumBits>
+{
+ typedef smart_ptr<T> pointer;
+
+ static pointer get_pointer(const pointer &n)
+ { return pointer_plus_bits<T*, NumBits>::get_pointer(n.get()); }
+
+ static void set_pointer(pointer &n, pointer p)
+ {
+ T *raw_n = n.get();
+ pointer_plus_bits<T*, NumBits>::set_pointer(raw_n, p.get());
+ n = raw_n;
+ }
+
+ static std::size_t get_bits(const pointer &n)
+ { return pointer_plus_bits<T*, NumBits>::get_bits(n.get()); }
+
+ static void set_bits(pointer &n, std::size_t c)
+ {
+ T *raw_n = n.get();
+ pointer_plus_bits<T*, NumBits>::set_bits(raw_n, c);
+ n = raw_n;
+ }
+};
+
+} //namespace intrusive
+} //namespace boost{
+
+#endif //#ifndef BOOST_INTRUSIVE_SMART_PTR_HPP
Added: sandbox/move/libs/intrusive/test/splay_multiset_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/splay_multiset_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,187 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/splay_set.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_multiset_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_const_overloads<boost::intrusive::splay_multiset<
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+T, O1, O2, O3, O4
+#else
+T, Options...
+#endif
+>
+>
+{
+ static const bool value = false;
+};
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_splay<boost::intrusive::splay_multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_rebalance<boost::intrusive::splay_multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef splay_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef splay_set_base_hook
+ < link_mode<auto_unlink>
+ , void_pointer<VoidPointer>
+ , tag<my_tag> > auto_base_hook_type;
+ typedef splay_set_member_hook<void_pointer<VoidPointer> > member_hook_type;
+ typedef splay_set_member_hook
+ < link_mode<auto_unlink>
+ , void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::splay_multiset
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, true>()();
+ return boost::report_errors();
+}
Added: sandbox/move/libs/intrusive/test/splay_set_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/splay_set_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,186 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/splay_set.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_set_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_const_overloads<boost::intrusive::splay_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = false;
+};
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_splay<boost::intrusive::splay_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_rebalance<boost::intrusive::splay_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef splay_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef splay_set_base_hook
+ < link_mode<auto_unlink>
+ , void_pointer<VoidPointer>
+ , tag<my_tag> > auto_base_hook_type;
+ typedef splay_set_member_hook<void_pointer<VoidPointer> > member_hook_type;
+ typedef splay_set_member_hook
+ < link_mode<auto_unlink>
+ , void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::splay_set
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, true>()();
+ return boost::report_errors();
+}
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/stateful_value_traits_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/stateful_value_traits_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,147 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/functional/hash.hpp>
+#include <boost/pointer_to_other.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+class MyClass
+{
+ public:
+ int int_;
+
+ MyClass(int i = 0)
+ : int_(i)
+ {}
+
+ friend bool operator<(const MyClass &l, const MyClass &r)
+ { return l.int_ < r.int_; }
+
+ friend bool operator==(const MyClass &l, const MyClass &r)
+ { return l.int_ == r.int_; }
+
+ friend std::size_t hash_value(const MyClass &v)
+ { return boost::hash_value(v.int_); }
+};
+
+template<class T, class NodeTraits>
+struct stateful_value_traits
+{
+ typedef NodeTraits node_traits;
+ typedef typename node_traits::node node;
+ typedef typename node_traits::node_ptr node_ptr;
+ typedef typename node_traits::const_node_ptr const_node_ptr;
+ typedef T value_type;
+ typedef typename boost::pointer_to_other
+ <node_ptr, T>::type pointer;
+ typedef typename boost::pointer_to_other
+ <node_ptr, const T>::type const_pointer;
+ static const link_mode_type link_mode = normal_link;
+
+ stateful_value_traits(pointer values, node_ptr node_array)
+ : values_(values), node_array_(node_array)
+ {}
+
+ node_ptr to_node_ptr (value_type &value)
+ { return node_array_ + (&value - values_); }
+
+ const_node_ptr to_node_ptr (const value_type &value) const
+ { return node_array_ + (&value - values_); }
+
+ pointer to_value_ptr(node_ptr n)
+ { return values_ + (n - node_array_); }
+
+ const_pointer to_value_ptr(const_node_ptr n) const
+ { return values_ + (n - node_array_); }
+
+ pointer values_;
+ node_ptr node_array_;
+};
+
+//Define a list that will store MyClass using the external hook
+typedef stateful_value_traits< MyClass, list_node_traits<void*> > list_traits;
+typedef list<MyClass, value_traits<list_traits> > List;
+
+//Define a slist that will store MyClass using the external hook
+typedef stateful_value_traits< MyClass, slist_node_traits<void*> > slist_traits;
+typedef slist<MyClass, value_traits<slist_traits> > Slist;
+
+//Define a set that will store MyClass using the external hook
+typedef stateful_value_traits< MyClass, rbtree_node_traits<void*> > rbtree_traits;
+typedef set<MyClass, value_traits<rbtree_traits> > Set;
+
+//uset uses the same traits as slist
+typedef unordered_set<MyClass, value_traits<slist_traits> > Uset;
+
+
+typedef list_traits::node list_node_t;
+typedef slist_traits::node slist_node_t;
+typedef rbtree_traits::node rbtree_node_t;
+
+const int NumElements = 100;
+
+MyClass values [NumElements];
+list_node_t list_hook_array [NumElements];
+slist_node_t slist_hook_array [NumElements];
+rbtree_node_t rbtree_hook_array [NumElements];
+slist_node_t uset_hook_array [NumElements];
+
+int main()
+{
+ //Create several MyClass objects, each one with a different value
+ for(int i = 0; i < NumElements; ++i)
+ values[i].int_ = i;
+
+ Uset::bucket_type buckets[NumElements];
+
+ List my_list (list_traits (values, list_hook_array));
+ Slist my_slist(slist_traits(values, slist_hook_array));
+ Set my_set (std::less<MyClass>(), rbtree_traits(values, rbtree_hook_array));
+ Uset my_uset ( Uset::bucket_traits(buckets, NumElements)
+ , boost::hash<MyClass>()
+ , std::equal_to<MyClass>()
+ , slist_traits(values, uset_hook_array)
+ );
+
+ //Now insert them in containers
+ for(MyClass * it(&values[0]), *itend(&values[NumElements])
+ ; it != itend
+ ; ++it){
+ my_list.push_front(*it);
+ my_slist.push_front(*it);
+ my_set.insert(*it);
+ my_uset.insert(*it);
+ }
+
+ //Now test lists
+ {
+ List::const_iterator list_it (my_list.cbegin());
+ Slist::const_iterator slist_it(my_slist.cbegin());
+ Set::const_reverse_iterator set_rit(my_set.crbegin());
+ MyClass *it_val(&values[NumElements-1]), *it_rbeg_val(&values[0]-1);
+
+ //Test the objects inserted in the base hook list
+ for(; it_val != it_rbeg_val; --it_val, ++list_it, ++slist_it, ++set_rit){
+ if(&*list_it != &*it_val) return 1;
+ if(&*slist_it != &*it_val) return 1;
+ if(&*set_rit != &*it_val) return 1;
+ if(my_uset.find(*it_val) == my_uset.cend()) return 1;
+ }
+ }
+
+ return 0;
+}
Added: sandbox/move/libs/intrusive/test/test_container.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/test_container.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,397 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_TEST_CONTAINER_HPP
+#define BOOST_INTRUSIVE_TEST_CONTAINER_HPP
+
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/intrusive/detail/mpl.hpp>
+
+namespace boost {
+namespace intrusive {
+namespace test {
+
+template<class T>
+struct is_unordered
+{
+ static const bool value = false;
+};
+
+template<class T>
+struct has_const_overloads
+{
+ static const bool value = true;
+};
+
+template< class Container >
+void test_container( Container & c )
+{
+ typedef typename Container::value_type value_type;
+ typedef typename Container::iterator iterator;
+ typedef typename Container::const_iterator const_iterator;
+ typedef typename Container::reference reference;
+ typedef typename Container::const_reference const_reference;
+ typedef typename Container::pointer pointer;
+ typedef typename Container::const_pointer const_pointer;
+ typedef typename Container::difference_type difference_type;
+ typedef typename Container::size_type size_type;
+ typedef typename Container::difference_type difference_type;
+ typedef typename Container::size_type size_type;
+ typedef typename Container::value_traits value_traits;
+
+ const size_type num_elem = c.size();
+ BOOST_TEST( c.empty() == (num_elem == 0) );
+ {
+ iterator it(c.begin()), itend(c.end());
+ size_type i;
+ for(i = 0; i < num_elem; ++i){
+ ++it;
+ }
+ BOOST_TEST( it == c.end() );
+ BOOST_TEST( c.size() == i );
+ }
+
+ //Check iterator conversion
+ BOOST_TEST( const_iterator(c.begin()) == c.cbegin() );
+ {
+ const_iterator it(c.cbegin()), itend(c.cend());
+ size_type i;
+ for(i = 0; i < num_elem; ++i){
+ ++it;
+ }
+ BOOST_TEST( it == c.cend() );
+ BOOST_TEST( c.size() == i );
+ }
+}
+
+
+template< class Container, class Data >
+void test_sequence_container(Container & c, Data & d)
+{
+ assert( d.size() > 2 );
+
+ c.clear();
+
+ BOOST_TEST( c.size() == 0 );
+ BOOST_TEST( c.empty() );
+
+
+ {
+ typename Data::iterator i = d.begin();
+ c.insert( c.begin(), *i );
+ c.insert( c.end(), *(++i) );
+ }
+
+ BOOST_TEST( c.size() == 2 );
+ BOOST_TEST( !c.empty() );
+
+ typename Container::iterator i;
+ i = c.erase( c.begin() );
+
+ BOOST_TEST( c.size() == 1 );
+
+ {
+ typename Data::iterator i = d.begin();
+ ++++i;
+ c.insert( c.begin(), *(i) );
+ }
+
+ i = c.erase( c.begin(), c.end() );
+ BOOST_TEST( i == c.end() );
+
+ BOOST_TEST( c.empty() );
+
+ c.insert( c.begin(), *d.begin() );
+
+ BOOST_TEST( c.size() == 1 );
+
+ BOOST_TEST( c.begin() != c.end() );
+
+ i = c.erase_and_dispose( c.begin(), detail::null_disposer() );
+ BOOST_TEST( i == c.begin() );
+
+ c.assign(d.begin(), d.end());
+
+ BOOST_TEST( c.size() == d.size() );
+
+ c.clear();
+
+ BOOST_TEST( c.size() == 0 );
+ BOOST_TEST( c.empty() );
+}
+
+template< class Container, class Data >
+void test_common_unordered_and_associative_container(Container & c, Data & d, boost::intrusive::detail::true_ unordered)
+{
+ (void)unordered;
+ typedef typename Container::size_type size_type;
+
+ assert( d.size() > 2 );
+
+ c.clear();
+ c.insert(d.begin(), d.end());
+
+ for( typename Data::const_iterator di = d.begin(), de = d.end();
+ di != de; ++di )
+ {
+ BOOST_TEST( c.find(*di) != c.end() );
+ }
+
+ typename Data::const_iterator db = d.begin();
+ typename Data::const_iterator da = db++;
+
+ size_type old_size = c.size();
+
+ c.erase(*da, c.hash_function(), c.key_eq());
+ BOOST_TEST( c.size() == old_size-1 );
+ //This should not eras anyone
+ size_type second_erase = c.erase_and_dispose
+ ( *da, c.hash_function(), c.key_eq(), detail::null_disposer() );
+ BOOST_TEST( second_erase == 0 );
+
+ BOOST_TEST( c.count(*da, c.hash_function(), c.key_eq()) == 0 );
+ BOOST_TEST( c.count(*db, c.hash_function(), c.key_eq()) != 0 );
+
+ BOOST_TEST( c.find(*da, c.hash_function(), c.key_eq()) == c.end() );
+ BOOST_TEST( c.find(*db, c.hash_function(), c.key_eq()) != c.end() );
+
+ BOOST_TEST( c.equal_range(*db, c.hash_function(), c.key_eq()).first != c.end() );
+
+ c.clear();
+
+ BOOST_TEST( c.equal_range(*da, c.hash_function(), c.key_eq()).first == c.end() );
+}
+
+template< class Container, class Data >
+void test_common_unordered_and_associative_container(Container & c, Data & d, boost::intrusive::detail::false_ unordered)
+{
+ (void)unordered;
+ typedef typename Container::size_type size_type;
+
+ assert( d.size() > 2 );
+
+ c.clear();
+ c.insert(d.begin(), d.end());
+
+ for( typename Data::const_iterator di = d.begin(), de = d.end();
+ di != de; ++di )
+ {
+ BOOST_TEST( c.find(*di, c.key_comp()) != c.end() );
+ }
+
+ typename Data::const_iterator db = d.begin();
+ typename Data::const_iterator da = db++;
+
+ size_type old_size = c.size();
+
+ c.erase(*da, c.key_comp());
+ BOOST_TEST( c.size() == old_size-1 );
+ //This should not eras anyone
+ size_type second_erase = c.erase_and_dispose( *da, c.key_comp(), detail::null_disposer() );
+ BOOST_TEST( second_erase == 0 );
+
+ BOOST_TEST( c.count(*da, c.key_comp()) == 0 );
+ BOOST_TEST( c.count(*db, c.key_comp()) != 0 );
+ BOOST_TEST( c.find(*da, c.key_comp()) == c.end() );
+ BOOST_TEST( c.find(*db, c.key_comp()) != c.end() );
+ BOOST_TEST( c.equal_range(*db, c.key_comp()).first != c.end() );
+ c.clear();
+ BOOST_TEST( c.equal_range(*da, c.key_comp()).first == c.end() );
+}
+
+
+template< class Container, class Data >
+void test_common_unordered_and_associative_container(Container & c, Data & d)
+{
+ {
+ typedef typename Container::size_type size_type;
+
+ assert( d.size() > 2 );
+
+ c.clear();
+ c.insert(d.begin(), d.end());
+
+ for( typename Data::const_iterator di = d.begin(), de = d.end();
+ di != de; ++di )
+ {
+ BOOST_TEST( c.find(*di) != c.end() );
+ }
+
+ typename Data::const_iterator db = d.begin();
+ typename Data::const_iterator da = db++;
+
+ size_type old_size = c.size();
+
+ c.erase(*da);
+ BOOST_TEST( c.size() == old_size-1 );
+ //This should not eras anyone
+ size_type second_erase = c.erase_and_dispose( *da, detail::null_disposer() );
+ BOOST_TEST( second_erase == 0 );
+
+ BOOST_TEST( c.count(*da) == 0 );
+ BOOST_TEST( c.count(*db) != 0 );
+
+ BOOST_TEST( c.find(*da) == c.end() );
+ BOOST_TEST( c.find(*db) != c.end() );
+
+ BOOST_TEST( c.equal_range(*db).first != c.end() );
+
+ c.clear();
+
+ BOOST_TEST( c.equal_range(*da).first == c.end() );
+ }
+ typedef detail::bool_<is_unordered<Container>::value> enabler;
+ test_common_unordered_and_associative_container(c, d, enabler());
+}
+
+template< class Container, class Data >
+void test_associative_container_invariants(Container & c, Data & d, boost::intrusive::detail::true_type)
+{
+ typedef typename Container::const_iterator const_iterator;
+ for( typename Data::const_iterator di = d.begin(), de = d.end();
+ di != de; ++di)
+ {
+ const_iterator ci = c.find(*di);
+ BOOST_TEST( ci != c.end() );
+ BOOST_TEST( ! c.value_comp()(*ci, *di) );
+ const_iterator cil = c.lower_bound(*di);
+ const_iterator ciu = c.upper_bound(*di);
+ std::pair<const_iterator, const_iterator> er = c.equal_range(*di);
+ BOOST_TEST( cil == er.first );
+ BOOST_TEST( ciu == er.second );
+ if(ciu != c.end()){
+ BOOST_TEST( c.value_comp()(*cil, *ciu) );
+ }
+ if(c.count(*di) > 1){
+ const_iterator ci_next = cil; ++ci_next;
+ for( ; ci_next != ciu; ++cil, ++ci_next){
+ BOOST_TEST( !c.value_comp()(*ci_next, *cil) );
+ }
+ }
+ }
+}
+
+template< class Container, class Data >
+void test_associative_container_invariants(Container &, Data &, boost::intrusive::detail::false_type)
+{}
+
+template< class Container, class Data >
+void test_associative_container_invariants(Container & c, Data & d)
+{
+ using namespace boost::intrusive;
+ typedef typename detail::remove_const<Container>::type Type;
+ typedef detail::bool_<has_const_overloads<Type>::value> enabler;
+ test_associative_container_invariants(c, d, enabler());
+}
+
+template< class Container, class Data >
+void test_associative_container(Container & c, Data & d)
+{
+ typedef typename Container::const_iterator const_iterator;
+ assert( d.size() > 2 );
+
+ c.clear();
+ c.insert(d.begin(),d.end());
+
+ test_associative_container_invariants(c, d);
+
+ const Container & cr = c;
+
+ test_associative_container_invariants(cr, d);
+}
+
+template< class Container, class Data >
+void test_unordered_associative_container_invariants(Container & c, Data & d, boost::intrusive::detail::true_type)
+{
+ typedef typename Container::size_type size_type;
+ typedef typename Container::const_iterator const_iterator;
+
+ for( typename Data::const_iterator di = d.begin(), de = d.end() ;
+ di != de ; ++di ){
+ const_iterator i = c.find(*di);
+ size_type nb = c.bucket(*i);
+ size_type bucket_elem = std::distance(c.begin(nb), c.end(nb));
+ BOOST_TEST( bucket_elem == c.bucket_size(nb) );
+ BOOST_TEST( &*c.local_iterator_to(*c.find(*di)) == &*i );
+ std::pair<const_iterator, const_iterator> er = c.equal_range(*di);
+ size_type cnt = std::distance(er.first, er.second);
+ BOOST_TEST( cnt == c.count(*di));
+ if(cnt > 1)
+ for(const_iterator n = er.first, i = n++, e = er.second; n != e; ++i, ++n){
+ BOOST_TEST( c.key_eq()(*i, *n) );
+ BOOST_TEST( c.hash_function()(*i) == c.hash_function()(*n) );
+ }
+ }
+
+ size_type blen = c.bucket_count();
+ size_type total_objects = 0;
+ for(size_type i = 0; i < blen; ++i){
+ total_objects += c.bucket_size(i);
+ }
+ BOOST_TEST( total_objects == c.size() );
+}
+
+template< class Container, class Data >
+void test_unordered_associative_container_invariants(Container &, Data &, boost::intrusive::detail::false_type)
+{}
+
+template< class Container, class Data >
+void test_unordered_associative_container_invariants(Container & c, Data & d)
+{
+ using namespace boost::intrusive;
+ typedef typename detail::remove_const<Container>::type Type;
+ typedef detail::bool_<has_const_overloads<Type>::value> enabler;
+ test_unordered_associative_container_invariants(c, d, enabler());
+}
+
+template< class Container, class Data >
+void test_unordered_associative_container(Container & c, Data & d)
+{
+ c.clear();
+ c.insert( d.begin(), d.end() );
+
+ test_unordered_associative_container_invariants(c, d);
+
+ const Container & cr = c;
+
+ test_unordered_associative_container_invariants(cr, d);
+}
+
+template< class Container, class Data >
+void test_unique_container(Container & c, Data & d)
+{
+ typedef typename Container::value_type value_type;
+ c.clear();
+ c.insert(d.begin(),d.end());
+ typename Container::size_type old_size = c.size();
+ value_type v(*d.begin());
+ c.insert(v);
+ BOOST_TEST( c.size() == old_size );
+ c.clear();
+}
+
+template< class Container, class Data >
+void test_non_unique_container(Container & c, Data & d)
+{
+ typedef typename Container::value_type value_type;
+ c.clear();
+ c.insert(d.begin(),d.end());
+ typename Container::size_type old_size = c.size();
+ value_type v(*d.begin());
+ c.insert(v);
+ BOOST_TEST( c.size() == (old_size+1) );
+ c.clear();
+}
+
+}}}
+
+#endif //#ifndef BOOST_INTRUSIVE_TEST_CONTAINER_HPP
Added: sandbox/move/libs/intrusive/test/test_macros.hpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/test_macros.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,26 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_INTRUSIVE_TEST_TEST_MACROS_HPP
+#define BOOST_INTRUSIVE_TEST_TEST_MACROS_HPP
+
+#define TEST_INTRUSIVE_SEQUENCE( INTVALUES, ITERATOR )\
+{ \
+ BOOST_TEST (std::equal(&INTVALUES[0], &INTVALUES[0] + sizeof(INTVALUES)/sizeof(INTVALUES[0]), ITERATOR) ); \
+}
+
+#define TEST_INTRUSIVE_SEQUENCE_EXPECTED( EXPECTEDVECTOR, ITERATOR )\
+{ \
+ BOOST_TEST (std::equal(EXPECTEDVECTOR.begin(), EXPECTEDVECTOR.end(), ITERATOR) ); \
+}
+
+#endif
Added: sandbox/move/libs/intrusive/test/treap_multiset_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/treap_multiset_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,155 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/treap_set.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_multiset_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_insert_before<boost::intrusive::treap_multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef bs_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef bs_set_base_hook
+ < void_pointer<VoidPointer>
+ , tag<my_tag> > auto_base_hook_type;
+ typedef bs_set_member_hook
+ < void_pointer<VoidPointer> > member_hook_type;
+ typedef bs_set_member_hook
+ < void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::treap_multiset
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, true>()();
+ return boost::report_errors();
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/treap_set_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/treap_set_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,171 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/treap_set.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "generic_set_test.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct has_insert_before<boost::intrusive::treap_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4>
+#else
+template<class T, class ...Options>
+#endif
+struct is_treap<boost::intrusive::treap_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef bs_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef bs_set_base_hook
+ < void_pointer<VoidPointer>
+ , tag<my_tag> > auto_base_hook_type;
+ typedef bs_set_member_hook
+ < void_pointer<VoidPointer> > member_hook_type;
+ typedef bs_set_member_hook
+ < void_pointer<VoidPointer> > auto_member_hook_type;
+};
+
+template< class ValueType
+ , class Option1 = boost::intrusive::none
+ , class Option2 = boost::intrusive::none
+ , class Option3 = boost::intrusive::none
+ >
+struct GetContainer
+{
+ typedef boost::intrusive::treap_set
+ < ValueType
+ , Option1
+ , Option2
+ , Option3
+ > type;
+};
+
+template<class VoidPointer, bool constant_time_size>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+ return 0;
+ }
+};
+
+template<class VoidPointer>
+class test_main_template<VoidPointer, false>
+{
+ public:
+ int operator()()
+ {
+ using namespace boost::intrusive;
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , GetContainer
+ >::test_all();
+
+ test::test_generic_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , GetContainer
+ >::test_all();
+
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, false>()();
+ test_main_template<void*, true>()();
+ test_main_template<boost::intrusive::smart_ptr<void>, true>()();
+ return boost::report_errors();
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/unordered_multiset_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/unordered_multiset_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,816 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "common_functors.hpp"
+#include <vector>
+#include <algorithm> //std::sort std::find
+#include <set>
+#include <boost/detail/lightweight_test.hpp>
+#include "test_macros.hpp"
+#include "test_container.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
+#else
+template<class T, class ...Options>
+#endif
+struct is_unordered<boost::intrusive::unordered_multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef unordered_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef unordered_set_base_hook
+ < link_mode<auto_unlink>
+ , void_pointer<VoidPointer>
+ , tag<my_tag>
+ , store_hash<true>
+ > auto_base_hook_type;
+
+ typedef unordered_set_member_hook
+ < void_pointer<VoidPointer>
+ , optimize_multikey<true>
+ > member_hook_type;
+ typedef unordered_set_member_hook
+ < link_mode<auto_unlink>, void_pointer<VoidPointer>
+ , store_hash<true>
+ , optimize_multikey<true>
+ > auto_member_hook_type;
+};
+
+static const std::size_t BucketSize = 8;
+
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+struct test_unordered_multiset
+{
+ typedef typename ValueTraits::value_type value_type;
+ static void test_all (std::vector<value_type>& values);
+ static void test_sort(std::vector<value_type>& values);
+ static void test_insert(std::vector<value_type>& values);
+ static void test_swap(std::vector<value_type>& values);
+ static void test_rehash(std::vector<value_type>& values, detail::true_);
+ static void test_rehash(std::vector<value_type>& values, detail::false_);
+ static void test_find(std::vector<value_type>& values);
+ static void test_impl();
+ static void test_clone(std::vector<value_type>& values);
+};
+
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_all (std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ < value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ {
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+ typename unordered_multiset_type::bucket_type buckets [BucketSize];
+ unordered_multiset_type testset(bucket_traits(buckets, BucketSize));
+ testset.insert(values.begin(), values.end());
+ test::test_container(testset);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_common_unordered_and_associative_container(testset, values);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_unordered_associative_container(testset, values);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_non_unique_container(testset, values);
+ }
+ test_sort(values);
+ test_insert(values);
+ test_swap(values);
+ test_rehash(values, detail::bool_<Incremental>());
+ test_find(values);
+ test_impl();
+ test_clone(values);
+}
+
+//test case due to an error in tree implementation:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
+ ::test_impl()
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+
+ std::vector<value_type> values (5);
+ for (int i = 0; i < 5; ++i)
+ values[i].value_ = i;
+
+ typename unordered_multiset_type::bucket_type buckets [BucketSize];
+ unordered_multiset_type testset(bucket_traits(buckets, BucketSize));
+
+ for (int i = 0; i < 5; ++i)
+ testset.insert (values[i]);
+
+ testset.erase (testset.iterator_to (values[0]));
+ testset.erase (testset.iterator_to (values[1]));
+ testset.insert (values[1]);
+
+ testset.erase (testset.iterator_to (values[2]));
+ testset.erase (testset.iterator_to (values[3]));
+}
+
+//test: constructor, iterator, clear, reverse_iterator, front, back, size:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
+ ::test_sort(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+
+ typename unordered_multiset_type::bucket_type buckets [BucketSize];
+ unordered_multiset_type testset1(values.begin(), values.end(), bucket_traits(buckets, BucketSize));
+
+ if(Incremental){
+ { int init_values [] = { 4, 5, 1, 2, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ }
+ else{
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ }
+ testset1.clear();
+ BOOST_TEST (testset1.empty());
+}
+
+//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
+ ::test_insert(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+ typedef typename unordered_multiset_type::iterator iterator;
+ typename unordered_multiset_type::bucket_type buckets [BucketSize];
+ unordered_multiset_type testset(bucket_traits(buckets, BucketSize));
+
+ testset.insert(&values[0] + 2, &values[0] + 5);
+
+ const unordered_multiset_type& const_testset = testset;
+
+ if(Incremental){
+ {
+ { int init_values [] = { 4, 5, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ typename unordered_multiset_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 4);
+
+ i = testset.insert (values[0]);
+ BOOST_TEST (&*i == &values[0]);
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+ testset.erase(i);
+
+ { int init_values [] = { 5, 1, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ testset.clear();
+ testset.insert(&values[0], &values[0] + values.size());
+
+ { int init_values [] = { 4, 5, 1, 2, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ BOOST_TEST (testset.erase(1) == 1);
+ BOOST_TEST (testset.erase(2) == 2);
+ BOOST_TEST (testset.erase(3) == 1);
+ BOOST_TEST (testset.erase(4) == 1);
+ BOOST_TEST (testset.erase(5) == 1);
+ BOOST_TEST (testset.empty() == true);
+
+ //Now with a single bucket
+ typename unordered_multiset_type::bucket_type single_bucket[1];
+ unordered_multiset_type testset2(bucket_traits(single_bucket, 1));
+ testset2.insert(&values[0], &values[0] + values.size());
+ BOOST_TEST (testset2.erase(5) == 1);
+ BOOST_TEST (testset2.erase(2) == 2);
+ BOOST_TEST (testset2.erase(1) == 1);
+ BOOST_TEST (testset2.erase(4) == 1);
+ BOOST_TEST (testset2.erase(3) == 1);
+ BOOST_TEST (testset2.empty() == true);
+ }
+ }
+ else{
+ {
+ { int init_values [] = { 1, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ typename unordered_multiset_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 1);
+
+ i = testset.insert (values[0]);
+ BOOST_TEST (&*i == &values[0]);
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+ testset.erase(i);
+
+ { int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ testset.clear();
+ testset.insert(&values[0], &values[0] + values.size());
+
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ BOOST_TEST (testset.erase(1) == 1);
+ BOOST_TEST (testset.erase(2) == 2);
+ BOOST_TEST (testset.erase(3) == 1);
+ BOOST_TEST (testset.erase(4) == 1);
+ BOOST_TEST (testset.erase(5) == 1);
+ BOOST_TEST (testset.empty() == true);
+
+ //Now with a single bucket
+ typename unordered_multiset_type::bucket_type single_bucket[1];
+ unordered_multiset_type testset2(bucket_traits(single_bucket, 1));
+ testset2.insert(&values[0], &values[0] + values.size());
+ BOOST_TEST (testset2.erase(5) == 1);
+ BOOST_TEST (testset2.erase(2) == 2);
+ BOOST_TEST (testset2.erase(1) == 1);
+ BOOST_TEST (testset2.erase(4) == 1);
+ BOOST_TEST (testset2.erase(3) == 1);
+ BOOST_TEST (testset2.empty() == true);
+ }
+ }
+ {
+ //Now erase just one per loop
+ const int random_init[] = { 3, 2, 4, 1, 5, 2, 2 };
+ const unsigned int random_size = sizeof(random_init)/sizeof(random_init[0]);
+ typename unordered_multiset_type::bucket_type single_bucket[1];
+ for(unsigned int i = 0, max = random_size; i != max; ++i){
+ std::vector<typename ValueTraits::value_type> data (random_size);
+ for (unsigned int j = 0; j < random_size; ++j)
+ data[j].value_ = random_init[j];
+ unordered_multiset_type testset_new(bucket_traits(single_bucket, 1));
+ testset_new.insert(&data[0], &data[0]+max);
+ testset_new.erase(testset_new.iterator_to(data[i]));
+ BOOST_TEST (testset_new.size() == (max -1));
+ }
+ }
+ {
+ typename unordered_multiset_type::bucket_type buckets [BucketSize];
+ const unsigned int NumBucketSize = BucketSize;
+ const unsigned int LoadFactor = 3;
+ const unsigned int NumIterations = NumBucketSize*LoadFactor;
+ std::vector<value_type> random_init(NumIterations);//Preserve memory
+ std::vector<value_type> set_tester;
+ set_tester.reserve(NumIterations);
+
+ //Initialize values
+ for (unsigned int i = 0; i < NumIterations; ++i){
+ random_init[i].value_ = i*2;//(i/LoadFactor)*LoadFactor;
+ }
+
+ for(unsigned int initial_pos = 0; initial_pos != (NumIterations+1); ++initial_pos){
+ for(unsigned int final_pos = initial_pos; final_pos != (NumIterations+1); ++final_pos){
+
+ //Create intrusive container inserting values
+ unordered_multiset_type testset
+ ( &random_init[0]
+ , &random_init[0] + random_init.size()
+ , bucket_traits(buckets, NumBucketSize));
+
+ BOOST_TEST (testset.size() == random_init.size());
+
+ //Obtain the iterator range to erase
+ iterator it_beg_pos = testset.begin();
+ for(unsigned int it_beg_pos_num = 0; it_beg_pos_num != initial_pos; ++it_beg_pos_num){
+ ++it_beg_pos;
+ }
+ iterator it_end_pos(it_beg_pos);
+ for(unsigned int it_end_pos_num = 0; it_end_pos_num != (final_pos - initial_pos); ++it_end_pos_num){
+ ++it_end_pos;
+ }
+
+ //Erase the same values in both the intrusive and original vector
+ std::size_t erased_cnt = std::distance(it_beg_pos, it_end_pos);
+
+ //Erase values from the intrusive container
+ testset.erase(it_beg_pos, it_end_pos);
+
+ BOOST_TEST (testset.size() == (random_init.size()-(final_pos - initial_pos)));
+
+ //Now test...
+ BOOST_TEST ((random_init.size() - erased_cnt) == testset.size());
+
+ //Create an ordered copy of the intrusive container
+ set_tester.insert(set_tester.end(), testset.begin(), testset.end());
+ std::sort(set_tester.begin(), set_tester.end());
+ {
+ typename std::vector<value_type>::iterator it = set_tester.begin(), itend = set_tester.end();
+ typename std::vector<value_type>::iterator random_init_it(random_init.begin());
+ for( ; it != itend; ++it){
+ while(!random_init_it->is_linked())
+ ++random_init_it;
+ BOOST_TEST(*it == *random_init_it);
+ ++random_init_it;
+ }
+ }
+ set_tester.clear();
+ }
+ }
+ }
+}
+
+//test: insert (seq-version), swap, erase (seq-version), size:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_swap(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+ typename unordered_multiset_type::bucket_type buckets [BucketSize];
+
+ typename unordered_multiset_type::bucket_type buckets2 [BucketSize];
+ unordered_multiset_type testset1(&values[0], &values[0] + 2, bucket_traits(buckets, BucketSize));
+ unordered_multiset_type testset2(bucket_traits(buckets2, BucketSize));
+
+ testset2.insert (&values[0] + 2, &values[0] + 6);
+ testset1.swap (testset2);
+
+ if(Incremental){
+ { int init_values [] = { 4, 5, 1, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ { int init_values [] = { 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.begin() ); }
+ testset1.erase (testset1.iterator_to(values[4]), testset1.end());
+ BOOST_TEST (testset1.size() == 1);
+ // BOOST_TEST (&testset1.front() == &values[3]);
+ BOOST_TEST (&*testset1.begin() == &values[2]);
+ }
+ else{
+ { int init_values [] = { 1, 2, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ { int init_values [] = { 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.begin() ); }
+ testset1.erase (testset1.iterator_to(values[5]), testset1.end());
+ BOOST_TEST (testset1.size() == 1);
+ // BOOST_TEST (&testset1.front() == &values[3]);
+ BOOST_TEST (&*testset1.begin() == &values[3]);
+ }
+}
+
+
+
+//test: rehash:
+
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
+ ::test_rehash(std::vector<typename ValueTraits::value_type>& values, detail::true_)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+ //Build a uset
+ typename unordered_multiset_type::bucket_type buckets1 [BucketSize];
+ typename unordered_multiset_type::bucket_type buckets2 [BucketSize*2];
+ unordered_multiset_type testset1(&values[0], &values[0] + values.size(), bucket_traits(buckets1, BucketSize));
+ //Test current state
+ BOOST_TEST(testset1.split_count() == BucketSize/2);
+ { int init_values [] = { 4, 5, 1, 2, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Incremental rehash step
+ BOOST_TEST (testset1.incremental_rehash() == true);
+ BOOST_TEST(testset1.split_count() == (BucketSize/2+1));
+ { int init_values [] = { 5, 1, 2, 2, 3, 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Rest of incremental rehashes should lead to the same sequence
+ for(std::size_t split_bucket = testset1.split_count(); split_bucket != BucketSize; ++split_bucket){
+ BOOST_TEST (testset1.incremental_rehash() == true);
+ BOOST_TEST(testset1.split_count() == (split_bucket+1));
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ }
+ //This incremental rehash should fail because we've reached the end of the bucket array
+ BOOST_TEST (testset1.incremental_rehash() == false);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //
+ //Try incremental hashing specifying a new bucket traits pointing to the same array
+ //
+ //This incremental rehash should fail because the new size is not twice the original
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets1, BucketSize)) == false);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //This incremental rehash should success because the new size is twice the original
+ //and split_count is the same as the old bucket count
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets1, BucketSize*2)) == true);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //This incremental rehash should also success because the new size is half the original
+ //and split_count is the same as the new bucket count
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets1, BucketSize)) == true);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //
+ //Try incremental hashing specifying a new bucket traits pointing to the same array
+ //
+ //This incremental rehash should fail because the new size is not twice the original
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets2, BucketSize)) == false);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //This incremental rehash should success because the new size is twice the original
+ //and split_count is the same as the old bucket count
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets2, BucketSize*2)) == true);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //This incremental rehash should also success because the new size is half the original
+ //and split_count is the same as the new bucket count
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets1, BucketSize)) == true);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //Full shrink rehash
+ testset1.rehash(bucket_traits(buckets1, 4));
+ BOOST_TEST (testset1.size() == values.size());
+ BOOST_TEST (testset1.incremental_rehash() == false);
+ { int init_values [] = { 4, 5, 1, 2, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Full shrink rehash again
+ testset1.rehash(bucket_traits(buckets1, 2));
+ BOOST_TEST (testset1.size() == values.size());
+ BOOST_TEST (testset1.incremental_rehash() == false);
+ { int init_values [] = { 2, 2, 4, 3, 5, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Full growing rehash
+ testset1.rehash(bucket_traits(buckets1, BucketSize));
+ BOOST_TEST (testset1.size() == values.size());
+ BOOST_TEST (testset1.incremental_rehash() == false);
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Incremental rehash shrinking
+ //First incremental rehashes should lead to the same sequence
+ for(std::size_t split_bucket = testset1.split_count(); split_bucket > 6; --split_bucket){
+ BOOST_TEST (testset1.incremental_rehash(false) == true);
+ BOOST_TEST(testset1.split_count() == (split_bucket-1));
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ }
+ //Incremental rehash step
+ BOOST_TEST (testset1.incremental_rehash(false) == true);
+ BOOST_TEST(testset1.split_count() == (BucketSize/2+1));
+ { int init_values [] = { 5, 1, 2, 2, 3, 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Incremental rehash step 2
+ BOOST_TEST (testset1.incremental_rehash(false) == true);
+ BOOST_TEST(testset1.split_count() == (BucketSize/2));
+ { int init_values [] = { 4, 5, 1, 2, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //This incremental rehash should fail because we've reached the half of the bucket array
+ BOOST_TEST(testset1.incremental_rehash(false) == false);
+ BOOST_TEST(testset1.split_count() == BucketSize/2);
+ { int init_values [] = { 4, 5, 1, 2, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+}
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
+ ::test_rehash(std::vector<typename ValueTraits::value_type>& values, detail::false_)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+
+ typename unordered_multiset_type::bucket_type buckets1 [BucketSize];
+ typename unordered_multiset_type::bucket_type buckets2 [2];
+ typename unordered_multiset_type::bucket_type buckets3 [BucketSize*2];
+
+ unordered_multiset_type testset1(&values[0], &values[0] + 6, bucket_traits(buckets1, BucketSize));
+ BOOST_TEST (testset1.size() == values.size());
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ testset1.rehash(bucket_traits(buckets2, 2));
+ BOOST_TEST (testset1.size() == values.size());
+ { int init_values [] = { 4, 2, 2, 5, 3, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ testset1.rehash(bucket_traits(buckets3, BucketSize*2));
+ BOOST_TEST (testset1.size() == values.size());
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //Now rehash reducing the buckets
+ testset1.rehash(bucket_traits(buckets3, 2));
+ BOOST_TEST (testset1.size() == values.size());
+ { int init_values [] = { 4, 2, 2, 5, 3, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //Now rehash increasing the buckets
+ testset1.rehash(bucket_traits(buckets3, BucketSize*2));
+ BOOST_TEST (testset1.size() == values.size());
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+}
+
+//test: find, equal_range (lower_bound, upper_bound):
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_find(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+
+ typename unordered_multiset_type::bucket_type buckets[BucketSize];
+ unordered_multiset_type testset(values.begin(), values.end(), bucket_traits(buckets, BucketSize));
+
+ typedef typename unordered_multiset_type::iterator iterator;
+
+ value_type cmp_val;
+ cmp_val.value_ = 2;
+ iterator i = testset.find (cmp_val);
+ BOOST_TEST (i->value_ == 2);
+ BOOST_TEST ((++i)->value_ == 2);
+ std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
+
+ BOOST_TEST (range.first->value_ == 2);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 2);
+
+ cmp_val.value_ = 7;
+ BOOST_TEST (testset.find (cmp_val) == testset.end());
+}
+
+
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_multiset<ValueTraits, CacheBegin, CompareHash, Incremental>
+ ::test_clone(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_multiset
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_multiset_type;
+ typedef typename unordered_multiset_type::bucket_traits bucket_traits;
+ {
+ //Test with equal bucket arrays
+ typename unordered_multiset_type::bucket_type buckets1 [BucketSize];
+ typename unordered_multiset_type::bucket_type buckets2 [BucketSize];
+ unordered_multiset_type testset1 (values.begin(), values.end(), bucket_traits(buckets1, BucketSize));
+ unordered_multiset_type testset2 (bucket_traits(buckets2, BucketSize));
+
+ testset2.clone_from(testset1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ //Ordering is not guarantee in the cloning so insert data in a set and test
+ std::multiset<typename ValueTraits::value_type>
+ src(testset1.begin(), testset1.end());
+ std::multiset<typename ValueTraits::value_type>
+ dst(testset2.begin(), testset2.end());
+ BOOST_TEST (src.size() == dst.size() && std::equal(src.begin(), src.end(), dst.begin()));
+ testset2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testset2.empty());
+ }
+ {
+ //Test with bigger source bucket arrays
+ typename unordered_multiset_type::bucket_type buckets1 [BucketSize*2];
+ typename unordered_multiset_type::bucket_type buckets2 [BucketSize];
+ unordered_multiset_type testset1 (values.begin(), values.end(), bucket_traits(buckets1, BucketSize*2));
+ unordered_multiset_type testset2 (bucket_traits(buckets2, BucketSize));
+
+ testset2.clone_from(testset1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ //Ordering is not guarantee in the cloning so insert data in a set and test
+ std::multiset<typename ValueTraits::value_type>
+ src(testset1.begin(), testset1.end());
+ std::multiset<typename ValueTraits::value_type>
+ dst(testset2.begin(), testset2.end());
+ BOOST_TEST (src.size() == dst.size() && std::equal(src.begin(), src.end(), dst.begin()));
+ testset2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testset2.empty());
+ }
+ {
+ //Test with smaller source bucket arrays
+ typename unordered_multiset_type::bucket_type buckets1 [BucketSize];
+ typename unordered_multiset_type::bucket_type buckets2 [BucketSize*2];
+ unordered_multiset_type testset1 (values.begin(), values.end(), bucket_traits(buckets1, BucketSize));
+ unordered_multiset_type testset2 (bucket_traits(buckets2, BucketSize*2));
+
+ testset2.clone_from(testset1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ //Ordering is not guaranteed in the cloning so insert data in a set and test
+ std::multiset<typename ValueTraits::value_type>
+ src(testset1.begin(), testset1.end());
+ std::multiset<typename ValueTraits::value_type>
+ dst(testset2.begin(), testset2.end());
+ BOOST_TEST (src.size() == dst.size() && std::equal(src.begin(), src.end(), dst.begin()));
+ testset2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testset2.empty());
+ }
+}
+
+template<class VoidPointer, bool constant_time_size, bool Incremental>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+ static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
+ std::vector<testvalue<hooks<VoidPointer> , constant_time_size> > data (6);
+ for (int i = 0; i < 6; ++i)
+ data[i].value_ = random_init[i];
+
+ test_unordered_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , true
+ , false
+ , Incremental
+ >::test_all(data);
+
+ test_unordered_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , false
+ , false
+ , Incremental
+ >::test_all(data);
+ return 0;
+ }
+};
+
+template<class VoidPointer, bool Incremental>
+class test_main_template<VoidPointer, false, Incremental>
+{
+ public:
+ int operator()()
+ {
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+ static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
+ std::vector<testvalue<hooks<VoidPointer> , false> > data (6);
+ for (int i = 0; i < 6; ++i)
+ data[i].value_ = random_init[i];
+
+ test_unordered_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , false
+ , false
+ , Incremental
+ >::test_all(data);
+
+ test_unordered_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , true
+ , false
+ , Incremental
+ >::test_all(data);
+
+ test_unordered_multiset < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , false
+ , false
+ , Incremental
+ >::test_all(data);
+
+ test_unordered_multiset < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , false
+ , true
+ , Incremental
+ >::test_all(data);
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false, true>()();
+ test_main_template<smart_ptr<void>, false, true>()();
+ test_main_template<void*, true, true>()();
+ test_main_template<smart_ptr<void>, true, true>()();
+ test_main_template<void*, false, false>()();
+ test_main_template<smart_ptr<void>, false, false>()();
+ test_main_template<void*, true, true>()();
+ test_main_template<smart_ptr<void>, true, false>()();
+ return boost::report_errors();
+}
+
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/unordered_set_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/unordered_set_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,678 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Olaf Krzikalla 2004-2006.
+// (C) Copyright Ion Gaztanaga 2006-2009.
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/detail/config_begin.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <boost/intrusive/detail/pointer_to_other.hpp>
+#include "itestvalue.hpp"
+#include "smart_ptr.hpp"
+#include "common_functors.hpp"
+#include <vector>
+#include <set>
+#include <boost/detail/lightweight_test.hpp>
+#include "test_macros.hpp"
+#include "test_container.hpp"
+
+namespace boost { namespace intrusive { namespace test {
+
+#if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+template<class T, class O1, class O2, class O3, class O4, class O5, class O6>
+#else
+template<class T, class ...Options>
+#endif
+struct is_unordered<boost::intrusive::unordered_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4, O5, O6
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = true;
+};
+
+}}}
+
+using namespace boost::intrusive;
+
+struct my_tag;
+
+template<class VoidPointer>
+struct hooks
+{
+ typedef unordered_set_base_hook<void_pointer<VoidPointer> > base_hook_type;
+ typedef unordered_set_base_hook
+ < link_mode<auto_unlink>
+ , void_pointer<VoidPointer>
+ , tag<my_tag>
+ , store_hash<true>
+ > auto_base_hook_type;
+
+ typedef unordered_set_member_hook
+ < void_pointer<VoidPointer>
+ , optimize_multikey<true>
+ > member_hook_type;
+ typedef unordered_set_member_hook
+ < link_mode<auto_unlink>, void_pointer<VoidPointer>
+ , store_hash<true>
+ , optimize_multikey<true>
+ > auto_member_hook_type;
+};
+
+static const std::size_t BucketSize = 8;
+
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+struct test_unordered_set
+{
+ typedef typename ValueTraits::value_type value_type;
+ static void test_all(std::vector<value_type>& values);
+ static void test_sort(std::vector<value_type>& values);
+ static void test_insert(std::vector<value_type>& values);
+ static void test_swap(std::vector<value_type>& values);
+ static void test_rehash(std::vector<value_type>& values, detail::true_);
+ static void test_rehash(std::vector<value_type>& values, detail::false_);
+ static void test_find(std::vector<value_type>& values);
+ static void test_impl();
+ static void test_clone(std::vector<value_type>& values);
+};
+
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_all(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+ {
+ typename unordered_set_type::bucket_type buckets [BucketSize];
+ unordered_set_type testset(bucket_traits(buckets, BucketSize));
+ testset.insert(values.begin(), values.end());
+ test::test_container(testset);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_common_unordered_and_associative_container(testset, values);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_unordered_associative_container(testset, values);
+ testset.clear();
+ testset.insert(values.begin(), values.end());
+ test::test_unique_container(testset, values);
+ }
+ test_sort(values);
+ test_insert(values);
+ test_swap(values);
+ test_rehash(values, detail::bool_<Incremental>());
+ test_find(values);
+ test_impl();
+ test_clone(values);
+}
+
+//test case due to an error in tree implementation:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::test_impl()
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+
+ std::vector<value_type> values (5);
+ for (int i = 0; i < 5; ++i)
+ values[i].value_ = i;
+
+ typename unordered_set_type::bucket_type buckets [BucketSize];
+ unordered_set_type testset(bucket_traits(buckets, BucketSize));
+ for (int i = 0; i < 5; ++i)
+ testset.insert (values[i]);
+
+ testset.erase (testset.iterator_to (values[0]));
+ testset.erase (testset.iterator_to (values[1]));
+ testset.insert (values[1]);
+ testset.erase (testset.iterator_to (values[2]));
+ testset.erase (testset.iterator_to (values[3]));
+}
+
+//test: constructor, iterator, clear, reverse_iterator, front, back, size:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_sort(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+
+ typename unordered_set_type::bucket_type buckets [BucketSize];
+ unordered_set_type testset1(values.begin(), values.end(), bucket_traits(buckets, BucketSize));
+ BOOST_TEST (5 == std::distance(testset1.begin(), testset1.end()));
+
+ if(Incremental){
+ { int init_values [] = { 4, 5, 1, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ }
+ else{
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ }
+
+ testset1.clear();
+ BOOST_TEST (testset1.empty());
+}
+
+//test: insert, const_iterator, const_reverse_iterator, erase, iterator_to:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_insert(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+
+ typename unordered_set_type::bucket_type buckets [BucketSize];
+ unordered_set_type testset(bucket_traits(buckets, BucketSize));
+ testset.insert(&values[0] + 2, &values[0] + 5);
+
+ const unordered_set_type& const_testset = testset;
+ if(Incremental)
+ {
+ { int init_values [] = { 4, 5, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ typename unordered_set_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 4);
+
+ i = testset.insert(values[0]).first;
+ BOOST_TEST (&*i == &values[0]);
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+
+ testset.erase (i);
+
+ { int init_values [] = { 5, 1, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ }
+ else{
+ { int init_values [] = { 1, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ typename unordered_set_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 1);
+
+ i = testset.insert(values[0]).first;
+ BOOST_TEST (&*i == &values[0]);
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+
+ testset.erase (i);
+
+ { int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ }
+}
+
+//test: insert (seq-version), swap, erase (seq-version), size:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_swap(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+
+ typename unordered_set_type::bucket_type buckets1 [BucketSize];
+ typename unordered_set_type::bucket_type buckets2 [BucketSize];
+ unordered_set_type testset1(&values[0], &values[0] + 2, bucket_traits(buckets1, BucketSize));
+ unordered_set_type testset2(bucket_traits(buckets2, BucketSize));
+
+ testset2.insert (&values[0] + 2, &values[0] + 6);
+ testset1.swap (testset2);
+
+ if(Incremental){
+ { int init_values [] = { 4, 5, 1, 2 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ { int init_values [] = { 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.begin() ); }
+ testset1.erase (testset1.iterator_to(values[4]), testset1.end());
+ BOOST_TEST (testset1.size() == 1);
+ BOOST_TEST (&*testset1.begin() == &values[2]);
+ }
+ else{
+ { int init_values [] = { 1, 2, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ { int init_values [] = { 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset2.begin() ); }
+ testset1.erase (testset1.iterator_to(values[5]), testset1.end());
+ BOOST_TEST (testset1.size() == 1);
+ BOOST_TEST (&*testset1.begin() == &values[3]);
+ }
+}
+
+//test: rehash:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_rehash(std::vector<typename ValueTraits::value_type>& values, detail::true_)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+ //Build a uset
+ typename unordered_set_type::bucket_type buckets1 [BucketSize];
+ typename unordered_set_type::bucket_type buckets2 [BucketSize*2];
+ unordered_set_type testset1(&values[0], &values[0] + 6, bucket_traits(buckets1, BucketSize));
+ //Test current state
+ BOOST_TEST(testset1.split_count() == BucketSize/2);
+ { int init_values [] = { 4, 5, 1, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Incremental rehash step
+ BOOST_TEST (testset1.incremental_rehash() == true);
+ BOOST_TEST(testset1.split_count() == (BucketSize/2+1));
+ { int init_values [] = { 5, 1, 2, 3, 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Rest of incremental rehashes should lead to the same sequence
+ for(std::size_t split_bucket = testset1.split_count(); split_bucket != BucketSize; ++split_bucket){
+ BOOST_TEST (testset1.incremental_rehash() == true);
+ BOOST_TEST(testset1.split_count() == (split_bucket+1));
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ }
+ //This incremental rehash should fail because we've reached the end of the bucket array
+ BOOST_TEST(testset1.incremental_rehash() == false);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //
+ //Try incremental hashing specifying a new bucket traits pointing to the same array
+ //
+ //This incremental rehash should fail because the new size is not twice the original
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets1, BucketSize)) == false);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //This incremental rehash should success because the new size is twice the original
+ //and split_count is the same as the old bucket count
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets1, BucketSize*2)) == true);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //This incremental rehash should also success because the new size is half the original
+ //and split_count is the same as the new bucket count
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets1, BucketSize)) == true);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //
+ //Try incremental hashing specifying a new bucket traits pointing to the same array
+ //
+ //This incremental rehash should fail because the new size is not twice the original
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets2, BucketSize)) == false);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //This incremental rehash should success because the new size is twice the original
+ //and split_count is the same as the old bucket count
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets2, BucketSize*2)) == true);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //This incremental rehash should also success because the new size is half the original
+ //and split_count is the same as the new bucket count
+ BOOST_TEST(testset1.incremental_rehash(bucket_traits(buckets1, BucketSize)) == true);
+ BOOST_TEST(testset1.split_count() == BucketSize);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //Full shrink rehash
+ testset1.rehash(bucket_traits(buckets1, 4));
+ BOOST_TEST (testset1.size() == values.size()-1);
+ BOOST_TEST (testset1.incremental_rehash() == false);
+ { int init_values [] = { 4, 5, 1, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Full shrink rehash again
+ testset1.rehash(bucket_traits(buckets1, 2));
+ BOOST_TEST (testset1.size() == values.size()-1);
+ BOOST_TEST (testset1.incremental_rehash() == false);
+ { int init_values [] = { 2, 4, 3, 5, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Full growing rehash
+ testset1.rehash(bucket_traits(buckets1, BucketSize));
+ BOOST_TEST (testset1.size() == values.size()-1);
+ BOOST_TEST (testset1.incremental_rehash() == false);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Incremental rehash shrinking
+ //First incremental rehashes should lead to the same sequence
+ for(std::size_t split_bucket = testset1.split_count(); split_bucket > 6; --split_bucket){
+ BOOST_TEST (testset1.incremental_rehash(false) == true);
+ BOOST_TEST(testset1.split_count() == (split_bucket-1));
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ }
+ //Incremental rehash step
+ BOOST_TEST (testset1.incremental_rehash(false) == true);
+ BOOST_TEST(testset1.split_count() == (BucketSize/2+1));
+ { int init_values [] = { 5, 1, 2, 3, 4 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //Incremental rehash step 2
+ BOOST_TEST (testset1.incremental_rehash(false) == true);
+ BOOST_TEST(testset1.split_count() == (BucketSize/2));
+ { int init_values [] = { 4, 5, 1, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+ //This incremental rehash should fail because we've reached the half of the bucket array
+ BOOST_TEST(testset1.incremental_rehash(false) == false);
+ BOOST_TEST(testset1.split_count() == BucketSize/2);
+ { int init_values [] = { 4, 5, 1, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+}
+
+//test: rehash:
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_rehash(std::vector<typename ValueTraits::value_type>& values, detail::false_)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+
+ typename unordered_set_type::bucket_type buckets1 [BucketSize];
+ typename unordered_set_type::bucket_type buckets2 [2];
+ typename unordered_set_type::bucket_type buckets3 [BucketSize*2];
+
+ unordered_set_type testset1(&values[0], &values[0] + 6, bucket_traits(buckets1, BucketSize));
+ BOOST_TEST (testset1.size() == values.size()-1);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ testset1.rehash(bucket_traits(buckets2, 2));
+ BOOST_TEST (testset1.size() == values.size()-1);
+ { int init_values [] = { 4, 2, 5, 3, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ testset1.rehash(bucket_traits(buckets3, BucketSize*2));
+ BOOST_TEST (testset1.size() == values.size()-1);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //Now rehash reducing the buckets
+ testset1.rehash(bucket_traits(buckets3, 2));
+ BOOST_TEST (testset1.size() == values.size()-1);
+ { int init_values [] = { 4, 2, 5, 3, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+
+ //Now rehash increasing the buckets
+ testset1.rehash(bucket_traits(buckets3, BucketSize*2));
+ BOOST_TEST (testset1.size() == values.size()-1);
+ { int init_values [] = { 1, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, testset1.begin() ); }
+}
+
+
+//test: find, equal_range (lower_bound, upper_bound):
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>::
+ test_find(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+
+ typename unordered_set_type::bucket_type buckets [BucketSize];
+ unordered_set_type testset (values.begin(), values.end(), bucket_traits(buckets, BucketSize));
+ typedef typename unordered_set_type::iterator iterator;
+
+ value_type cmp_val;
+ cmp_val.value_ = 2;
+ iterator i = testset.find (cmp_val);
+ BOOST_TEST (i->value_ == 2);
+ BOOST_TEST ((++i)->value_ != 2);
+ std::pair<iterator,iterator> range = testset.equal_range (cmp_val);
+
+ BOOST_TEST (range.first->value_ == 2);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 1);
+
+ cmp_val.value_ = 7;
+ BOOST_TEST (testset.find (cmp_val) == testset.end());
+}
+
+template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
+void test_unordered_set<ValueTraits, CacheBegin, CompareHash, Incremental>
+ ::test_clone(std::vector<typename ValueTraits::value_type>& values)
+{
+ typedef typename ValueTraits::value_type value_type;
+ typedef unordered_set
+ <value_type
+ , value_traits<ValueTraits>
+ , constant_time_size<value_type::constant_time_size>
+ , cache_begin<CacheBegin>
+ , compare_hash<CompareHash>
+ , incremental<Incremental>
+ > unordered_set_type;
+ typedef typename unordered_set_type::bucket_traits bucket_traits;
+ {
+ //Test with equal bucket arrays
+ typename unordered_set_type::bucket_type buckets1 [BucketSize];
+ typename unordered_set_type::bucket_type buckets2 [BucketSize];
+ unordered_set_type testset1 (values.begin(), values.end(), bucket_traits(buckets1, BucketSize));
+ unordered_set_type testset2 (bucket_traits(buckets2, BucketSize));
+
+ testset2.clone_from(testset1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ //Ordering is not guarantee in the cloning so insert data in a set and test
+ std::set<typename ValueTraits::value_type>
+ src(testset1.begin(), testset1.end());
+ std::set<typename ValueTraits::value_type>
+ dst(testset2.begin(), testset2.end());
+ BOOST_TEST (src.size() == dst.size() && std::equal(src.begin(), src.end(), dst.begin()));
+ testset2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testset2.empty());
+ }
+ {
+ //Test with bigger source bucket arrays
+ typename unordered_set_type::bucket_type buckets1 [BucketSize*2];
+ typename unordered_set_type::bucket_type buckets2 [BucketSize];
+ unordered_set_type testset1 (values.begin(), values.end(), bucket_traits(buckets1, BucketSize*2));
+ unordered_set_type testset2 (bucket_traits(buckets2, BucketSize));
+
+ testset2.clone_from(testset1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ //Ordering is not guaranteed in the cloning so insert data in a set and test
+ std::set<typename ValueTraits::value_type>
+ src(testset1.begin(), testset1.end());
+ std::set<typename ValueTraits::value_type>
+ dst(testset2.begin(), testset2.end());
+ BOOST_TEST (src.size() == dst.size() && std::equal(src.begin(), src.end(), dst.begin()));
+ testset2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testset2.empty());
+ }
+ {
+ //Test with smaller source bucket arrays
+ typename unordered_set_type::bucket_type buckets1 [BucketSize];
+ typename unordered_set_type::bucket_type buckets2 [BucketSize*2];
+ unordered_set_type testset1 (values.begin(), values.end(), bucket_traits(buckets1, BucketSize));
+ unordered_set_type testset2 (bucket_traits(buckets2, BucketSize*2));
+
+ testset2.clone_from(testset1, test::new_cloner<value_type>(), test::delete_disposer<value_type>());
+ //Ordering is not guarantee in the cloning so insert data in a set and test
+ std::set<typename ValueTraits::value_type>
+ src(testset1.begin(), testset1.end());
+ std::set<typename ValueTraits::value_type>
+ dst(testset2.begin(), testset2.end());
+ BOOST_TEST (src.size() == dst.size() && std::equal(src.begin(), src.end(), dst.begin()));
+ testset2.clear_and_dispose(test::delete_disposer<value_type>());
+ BOOST_TEST (testset2.empty());
+ }
+}
+
+template<class VoidPointer, bool constant_time_size, bool incremental>
+class test_main_template
+{
+ public:
+ int operator()()
+ {
+ typedef testvalue<hooks<VoidPointer> , constant_time_size> value_type;
+ static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
+ std::vector<testvalue<hooks<VoidPointer> , constant_time_size> > data (6);
+ for (int i = 0; i < 6; ++i)
+ data[i].value_ = random_init[i];
+
+ test_unordered_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , true
+ , false
+ , incremental
+ >::test_all(data);
+ test_unordered_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , false
+ , false
+ , incremental
+ >::test_all(data);
+
+ return 0;
+ }
+};
+
+template<class VoidPointer, bool incremental>
+class test_main_template<VoidPointer, false, incremental>
+{
+ public:
+ int operator()()
+ {
+ typedef testvalue<hooks<VoidPointer> , false> value_type;
+ static const int random_init[6] = { 3, 2, 4, 1, 5, 2 };
+ std::vector<testvalue<hooks<VoidPointer> , false> > data (6);
+ for (int i = 0; i < 6; ++i)
+ data[i].value_ = random_init[i];
+
+ test_unordered_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::base_hook_type
+ >::type
+ , true
+ , false
+ , incremental
+ >::test_all(data);
+
+ test_unordered_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::member_hook_type
+ , &value_type::node_
+ >
+ >::type
+ , false
+ , false
+ , incremental
+ >::test_all(data);
+
+ test_unordered_set < typename detail::get_base_value_traits
+ < value_type
+ , typename hooks<VoidPointer>::auto_base_hook_type
+ >::type
+ , false
+ , true
+ , incremental
+ >::test_all(data);
+
+ test_unordered_set < typename detail::get_member_value_traits
+ < value_type
+ , member_hook< value_type
+ , typename hooks<VoidPointer>::auto_member_hook_type
+ , &value_type::auto_node_
+ >
+ >::type
+ , false
+ , true
+ , incremental
+ >::test_all(data);
+ return 0;
+ }
+};
+
+int main( int, char* [] )
+{
+ test_main_template<void*, false, true>()();
+ test_main_template<smart_ptr<void>, false, true>()();
+ test_main_template<void*, true, true>()();
+ test_main_template<smart_ptr<void>, true, true>()();
+ test_main_template<void*, false, false>()();
+ test_main_template<smart_ptr<void>, false, false>()();
+ test_main_template<void*, true, true>()();
+ test_main_template<smart_ptr<void>, true, false>()();
+ return boost::report_errors();
+}
+#include <boost/intrusive/detail/config_end.hpp>
Added: sandbox/move/libs/intrusive/test/virtual_base_test.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/intrusive/test/virtual_base_test.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,85 @@
+/////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2007-2009
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/intrusive for documentation.
+//
+/////////////////////////////////////////////////////////////////////////////
+#include <boost/intrusive/list.hpp>
+#include <boost/intrusive/slist.hpp>
+#include <boost/intrusive/set.hpp>
+#include <boost/intrusive/unordered_set.hpp>
+#include <vector>
+
+using namespace boost::intrusive;
+
+struct VirtualBase
+{
+ virtual ~VirtualBase(){}
+};
+
+struct VirtualBase2
+{
+ virtual ~VirtualBase2(){}
+};
+
+struct VirtualBase3
+{
+};
+
+class NonVirtualBase
+ : public virtual VirtualBase
+ , public virtual VirtualBase2
+{
+ public:
+ int dummy[10];
+};
+
+class MyClass
+ : public NonVirtualBase
+ , public virtual VirtualBase3
+{
+ int int_;
+ public:
+ list_member_hook<> list_hook_;
+ MyClass(int i = 0)
+ : int_(i)
+ {}
+};
+
+//Define a list that will store MyClass using the public base hook
+typedef member_hook< MyClass, list_member_hook<>, &MyClass::list_hook_ > MemberHook;
+typedef list<MyClass, MemberHook> List;
+
+int main()
+{
+ typedef std::vector<MyClass>::iterator VectIt;
+ typedef std::vector<MyClass>::reverse_iterator VectRit;
+
+ //Create several MyClass objects, each one with a different value
+ std::vector<MyClass> values;
+ for(int i = 0; i < 100; ++i) values.push_back(MyClass(i));
+
+ List my_list;
+
+ //Now insert them in the reverse order
+ //in the base hook intrusive list
+ for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
+ my_list.push_front(*it);
+
+ //Now test lists
+ {
+ List::const_iterator list_it(my_list.cbegin());
+ VectRit vect_it(values.rbegin()), vect_itend(values.rend());
+
+ //Test the objects inserted in the base hook list
+ for(; vect_it != vect_itend; ++vect_it, ++list_it)
+ if(&*list_it != &*vect_it) return 1;
+ }
+
+ return 0;
+}
Added: sandbox/move/libs/move/doc/html/BOOST_COPYABLE_AND_MOVABLE.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_COPYABLE_AND_MOVABLE.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_COPYABLE_AND_MOVABLE</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_MOVABLE_BUT_NOT_COPYABLE.html" title="Macro BOOST_MOVABLE_BUT_NOT_COPYABLE">
+<link rel="next" href="BOOST_RV_REF.html" title="Macro BOOST_RV_REF">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_MOVABLE_BUT_NOT_COPYABLE.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_RV_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_COPYABLE_AND_MOVABLE"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_COPYABLE_AND_MOVABLE</span></h2>
+<p>BOOST_COPYABLE_AND_MOVABLE — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_COPYABLE_AND_MOVABLE(TYPE)</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492863"></a><h2>Description</h2>
+<p>This macro marks a type as copyable and movable. The user will need to write a move constructor/assignment and a copy assignment as explained in the documentation to fully write a copyable and movable class. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_MOVABLE_BUT_NOT_COPYABLE.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_RV_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_COPY_ASSIGN_REF.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_COPY_ASSIGN_REF.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_COPY_ASSIGN_REF</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_RV_REF.html" title="Macro BOOST_RV_REF">
+<link rel="next" href="BOOST_FWD_REF.html" title="Macro BOOST_FWD_REF">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_RV_REF.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_FWD_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_COPY_ASSIGN_REF"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_COPY_ASSIGN_REF</span></h2>
+<p>BOOST_COPY_ASSIGN_REF — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_COPY_ASSIGN_REF(TYPE)</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492934"></a><h2>Description</h2>
+<p>This macro is used to achieve portable syntax in copy assignment for classes marked as BOOST_COPYABLE_AND_MOVABLE. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_RV_REF.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_FWD_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_COPY_REF.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_COPY_REF.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_COPY_ASSIGN_REF</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_RV_REF.html" title="Macro BOOST_RV_REF">
+<link rel="next" href="BOOST_COPY_REF_2_TEMPL_ARGS.html" title="Macro BOOST_COPY_REF_2_TEMPL_ARGS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_RV_REF.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_COPY_REF_2_TEMPL_ARGS.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_COPY_ASSIGN_REF"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_COPY_ASSIGN_REF</span></h2>
+<p>BOOST_COPY_ASSIGN_REF — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_COPY_ASSIGN_REF(TYPE)</pre></div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_RV_REF.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_COPY_REF_2_TEMPL_ARGS.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_COPY_REF_2_TEMPL_ARGS.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_COPY_REF_2_TEMPL_ARGS.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_COPY_REF_2_TEMPL_ARGS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_COPY_ASSIGN_REF.html" title="Macro BOOST_COPY_ASSIGN_REF">
+<link rel="next" href="BOOST_COPY_REF_3_TEMPL_ARGS.html" title="Macro BOOST_COPY_REF_3_TEMPL_ARGS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_COPY_ASSIGN_REF.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_COPY_REF_3_TEMPL_ARGS.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_COPY_REF_2_TEMPL_ARGS"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_COPY_REF_2_TEMPL_ARGS</span></h2>
+<p>BOOST_COPY_REF_2_TEMPL_ARGS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_COPY_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)</pre></div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_COPY_ASSIGN_REF.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_COPY_REF_3_TEMPL_ARGS.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_COPY_REF_3_TEMPL_ARGS.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_COPY_REF_3_TEMPL_ARGS.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_COPY_REF_3_TEMPL_ARGS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_COPY_REF_2_TEMPL_ARGS.html" title="Macro BOOST_COPY_REF_2_TEMPL_ARGS">
+<link rel="next" href="BOOST_FWD_REF.html" title="Macro BOOST_FWD_REF">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_COPY_REF_2_TEMPL_ARGS.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_FWD_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_COPY_REF_3_TEMPL_ARGS"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_COPY_REF_3_TEMPL_ARGS</span></h2>
+<p>BOOST_COPY_REF_3_TEMPL_ARGS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_COPY_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)</pre></div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_COPY_REF_2_TEMPL_ARGS.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_FWD_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_ENABLE_MOVE_EMULATION.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_ENABLE_MOVE_EMULATION.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_ENABLE_MOVE_EMULATION</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="boost/uninitialized_copy_or_move.html" title="Function template uninitialized_copy_or_move">
+<link rel="next" href="BOOST_MOVABLE_BUT_NOT_COPYABLE.html" title="Macro BOOST_MOVABLE_BUT_NOT_COPYABLE">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/uninitialized_copy_or_move.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_MOVABLE_BUT_NOT_COPYABLE.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_ENABLE_MOVE_EMULATION"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_ENABLE_MOVE_EMULATION</span></h2>
+<p>BOOST_ENABLE_MOVE_EMULATION — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_ENABLE_MOVE_EMULATION(TYPE)</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492917"></a><h2>Description</h2>
+<p>This macro expands to a typedef named boost_move_emulation_t for compilers with rvalue references. Otherwise expands to: </p>
+<pre class="programlisting"> operator boost::rv<TYPE>&()
+ { return static_cast<boost::rv<TYPE>& >(*this); }
+</pre>
+<p> </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/uninitialized_copy_or_move.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_MOVABLE_BUT_NOT_COPYABLE.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_FWD_REF.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_FWD_REF.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,50 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_FWD_REF</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_COPY_ASSIGN_REF.html" title="Macro BOOST_COPY_ASSIGN_REF">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_COPY_ASSIGN_REF.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_FWD_REF"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_FWD_REF</span></h2>
+<p>BOOST_FWD_REF — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_FWD_REF(TYPE)</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492967"></a><h2>Description</h2>
+<p>This macro is used to implement portable perfect forwarding as explained in the documentation. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_COPY_ASSIGN_REF.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_MOVABLE_AND_COPYABLE.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_MOVABLE_AND_COPYABLE.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_COPYABLE_AND_MOVABLE</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_MOVABLE_BUT_NOT_COPYABLE.html" title="Macro BOOST_MOVABLE_BUT_NOT_COPYABLE">
+<link rel="next" href="BOOST_RV_REF.html" title="Macro BOOST_RV_REF">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_MOVABLE_BUT_NOT_COPYABLE.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_RV_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_COPYABLE_AND_MOVABLE"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_COPYABLE_AND_MOVABLE</span></h2>
+<p>BOOST_COPYABLE_AND_MOVABLE — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_COPYABLE_AND_MOVABLE(TYPE)</pre></div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_MOVABLE_BUT_NOT_COPYABLE.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_RV_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_MOVABLE_BUT_NOT_COPYABLE.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_MOVABLE_BUT_NOT_COPYABLE.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_MOVABLE_BUT_NOT_COPYABLE</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="boost/uninitialized_copy_or_move.html" title="Function template uninitialized_copy_or_move">
+<link rel="next" href="BOOST_COPYABLE_AND_MOVABLE.html" title="Macro BOOST_COPYABLE_AND_MOVABLE">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/uninitialized_copy_or_move.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_COPYABLE_AND_MOVABLE.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_MOVABLE_BUT_NOT_COPYABLE"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_MOVABLE_BUT_NOT_COPYABLE</span></h2>
+<p>BOOST_MOVABLE_BUT_NOT_COPYABLE — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492826"></a><h2>Description</h2>
+<p>This macro marks a type as movable but not copyable, disabling copy construction and assignment. The user will need to write a move constructor/assignment as explained in the documentation to fully write a movable but not copyable class. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="boost/uninitialized_copy_or_move.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_COPYABLE_AND_MOVABLE.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_RV_REF.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_RV_REF.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,51 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_RV_REF</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_COPYABLE_AND_MOVABLE.html" title="Macro BOOST_COPYABLE_AND_MOVABLE">
+<link rel="next" href="BOOST_COPY_ASSIGN_REF.html" title="Macro BOOST_COPY_ASSIGN_REF">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_COPYABLE_AND_MOVABLE.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_COPY_ASSIGN_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_RV_REF"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_RV_REF</span></h2>
+<p>BOOST_RV_REF — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_RV_REF(TYPE)</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492899"></a><h2>Description</h2>
+<p>This macro is used to achieve portable syntax in move constructors and assignments for classes marked as BOOST_COPYABLE_AND_MOVABLE or BOOST_MOVABLE_BUT_NOT_COPYABLE </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_COPYABLE_AND_MOVABLE.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_COPY_ASSIGN_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_RV_REF_2_TEMPL_ARGS.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_RV_REF_2_TEMPL_ARGS.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_RV_REF_2_TEMPL_ARGS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_ENABLE_MOVE_EMULATION.html" title="Macro BOOST_ENABLE_MOVE_EMULATION">
+<link rel="next" href="BOOST_RV_REF_3_TEMPL_ARGS.html" title="Macro BOOST_RV_REF_3_TEMPL_ARGS">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_ENABLE_MOVE_EMULATION.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_RV_REF_3_TEMPL_ARGS.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_RV_REF_2_TEMPL_ARGS"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_RV_REF_2_TEMPL_ARGS</span></h2>
+<p>BOOST_RV_REF_2_TEMPL_ARGS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_RV_REF_2_TEMPL_ARGS(TYPE, ARG1, ARG2)</pre></div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_ENABLE_MOVE_EMULATION.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_RV_REF_3_TEMPL_ARGS.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/BOOST_RV_REF_3_TEMPL_ARGS.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/BOOST_RV_REF_3_TEMPL_ARGS.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,47 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Macro BOOST_RV_REF_3_TEMPL_ARGS</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="BOOST_RV_REF_2_TEMPL_ARGS.html" title="Macro BOOST_RV_REF_2_TEMPL_ARGS">
+<link rel="next" href="BOOST_RV_REF.html" title="Macro BOOST_RV_REF">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_RV_REF_2_TEMPL_ARGS.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_RV_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="BOOST_RV_REF_3_TEMPL_ARGS"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Macro BOOST_RV_REF_3_TEMPL_ARGS</span></h2>
+<p>BOOST_RV_REF_3_TEMPL_ARGS — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">BOOST_RV_REF_3_TEMPL_ARGS(TYPE, ARG1, ARG2, ARG3)</pre></div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="BOOST_RV_REF_2_TEMPL_ARGS.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="move/reference.html#header.boost.move.move_hpp"><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="BOOST_RV_REF.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/back_move_insert_iterator.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/back_move_insert_iterator.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,84 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template back_move_insert_iterator</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_iterator.html" title="Class template move_iterator">
+<link rel="next" href="front_move_insert_iterator.html" title="Class template front_move_insert_iterator">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="front_move_insert_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.back_move_insert_iterator"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template back_move_insert_iterator</span></h2>
+<p>boost::back_move_insert_iterator — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C>
+<span class="bold"><strong>class</strong></span> back_move_insert_iterator {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> C <a name="boost.back_move_insert_iterator.container_type"></a>container_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ back_move_insert_iterator(C &);
+ back_move_insert_iterator& operator=(<span class="bold"><strong>typename</strong></span> C::reference);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">back_move_insert_iterator &</span> operator *() ;
+ <span class="type">back_move_insert_iterator &</span> operator++() ;
+ <span class="type">back_move_insert_iterator &</span> operator++(<span class="bold"><strong>int</strong></span>) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id490866"></a><h2>Description</h2>
+<p>A move insert iterator that move constructs elements at the back of a container </p>
+<div class="refsect2" lang="en">
+<a name="id490876"></a><h3>
+<a name="boost.back_move_insert_iteratorconstruct-copy-destruct"></a><code class="computeroutput">back_move_insert_iterator</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id155800-bb"></a>back_move_insert_iterator(C & x);</pre></li>
+<li><pre class="literallayout">back_move_insert_iterator& <a name="id155806-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>typename</strong></span> C::reference x);</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id490955"></a><h3>
+<a name="id156305-bb"></a><code class="computeroutput">back_move_insert_iterator</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="type">back_move_insert_iterator &</span> <a name="id156308-bb"></a><span class="bold"><strong>operator</strong></span> *() ;</pre></li>
+<li><pre class="literallayout"><span class="type">back_move_insert_iterator &</span> <a name="id156316-bb"></a><span class="bold"><strong>operator</strong></span>++() ;</pre></li>
+<li><pre class="literallayout"><span class="type">back_move_insert_iterator &</span> <a name="id155787-bb"></a><span class="bold"><strong>operator</strong></span>++(<span class="bold"><strong>int</strong></span>) ;</pre></li>
+</ol></div>
+</div>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="front_move_insert_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/back_move_inserter.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/back_move_inserter.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template back_move_inserter</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="make_move_iterator.html" title="Function template make_move_iterator">
+<link rel="next" href="front_move_inserter.html" title="Function template front_move_inserter">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="make_move_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="front_move_inserter.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.back_move_inserter"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template back_move_inserter</span></h2>
+<p>boost::back_move_inserter — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C> <span class="type">back_move_insert_iterator< C ></span> back_move_inserter(C & x);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492300"></a><h2>Description</h2>
+<p><span class="bold"><strong>Returns</strong></span>: back_move_insert_iterator<C>(x). </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="make_move_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="front_move_inserter.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/forward.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/forward.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template forward</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_id155952.html" title="Function template move">
+<link rel="next" href="make_move_iterator.html" title="Function template make_move_iterator">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_id155952.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="make_move_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.forward"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template forward</span></h2>
+<p>boost::forward — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">output_reference</span> forward(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492154"></a><h2>Description</h2>
+<p>This function provides limited form of forwarding that is usually enough for in-place construction and avoids the exponential overloading necessary for perfect forwarding in C++03.</p>
+<p>For compilers with rvalue references this function provides perfect forwarding.</p>
+<p>Otherwise: If input_reference binds to const boost::rv<T> & then it output_reference is boost::rev<T> &</p>
+<p>Else, input_reference is equal to output_reference is equal to input_reference. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_id155952.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="make_move_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/front_move_insert_iterator.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/front_move_insert_iterator.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,84 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template front_move_insert_iterator</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="back_move_insert_iterator.html" title="Class template back_move_insert_iterator">
+<link rel="next" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="back_move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_insert_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.front_move_insert_iterator"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template front_move_insert_iterator</span></h2>
+<p>boost::front_move_insert_iterator — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C>
+<span class="bold"><strong>class</strong></span> front_move_insert_iterator {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> C <a name="boost.front_move_insert_iterator.container_type"></a>container_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ front_move_insert_iterator(C &);
+ front_move_insert_iterator& operator=(<span class="bold"><strong>typename</strong></span> C::reference);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">front_move_insert_iterator &</span> operator *() ;
+ <span class="type">front_move_insert_iterator &</span> operator++() ;
+ <span class="type">front_move_insert_iterator &</span> operator++(<span class="bold"><strong>int</strong></span>) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491329"></a><h2>Description</h2>
+<p>A move insert iterator that move constructs elements int the front of a container </p>
+<div class="refsect2" lang="en">
+<a name="id491338"></a><h3>
+<a name="boost.front_move_insert_iteratorconstruct-copy-destruct"></a><code class="computeroutput">front_move_insert_iterator</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id155863-bb"></a>front_move_insert_iterator(C & x);</pre></li>
+<li><pre class="literallayout">front_move_insert_iterator& <a name="id155869-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>typename</strong></span> C::reference x);</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id491417"></a><h3>
+<a name="id155831-bb"></a><code class="computeroutput">front_move_insert_iterator</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="type">front_move_insert_iterator &</span> <a name="id155833-bb"></a><span class="bold"><strong>operator</strong></span> *() ;</pre></li>
+<li><pre class="literallayout"><span class="type">front_move_insert_iterator &</span> <a name="id155841-bb"></a><span class="bold"><strong>operator</strong></span>++() ;</pre></li>
+<li><pre class="literallayout"><span class="type">front_move_insert_iterator &</span> <a name="id155850-bb"></a><span class="bold"><strong>operator</strong></span>++(<span class="bold"><strong>int</strong></span>) ;</pre></li>
+</ol></div>
+</div>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="back_move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_insert_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/front_move_inserter.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/front_move_inserter.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template front_move_inserter</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="back_move_inserter.html" title="Function template back_move_inserter">
+<link rel="next" href="move_inserter.html" title="Function template move_inserter">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="back_move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_inserter.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.front_move_inserter"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template front_move_inserter</span></h2>
+<p>boost::front_move_inserter — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C>
+ <span class="type">front_move_insert_iterator< C ></span> front_move_inserter(C & x);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492366"></a><h2>Description</h2>
+<p><span class="bold"><strong>Returns</strong></span>: front_move_insert_iterator<C>(x). </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="back_move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_inserter.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_nothrow_move.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_nothrow_move.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_nothrow_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="is_movable.html" title="Class template is_movable">
+<link rel="next" href="move_iterator.html" title="Class template move_iterator">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="is_movable.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_nothrow_move"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_nothrow_move</span></h2>
+<p>boost::has_nothrow_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_nothrow_move : <span class="bold"><strong>public</strong></span> boost::is_movable< T > {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id489408"></a><h2>Description</h2>
+<p>For compilers with rvalue references, this traits class returns true if T && is convertible to T.</p>
+<p>For other compilers returns true if T has implemented move emulation. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="is_movable.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155896.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155896.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155909.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155909.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155896"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491510"></a><h2>Description</h2>
+<p>has_trivial_destructor_after_move<> == true_type specialization for optimizations </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155909.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155897.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155897.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155910.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155910.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155897"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491652"></a><h2>Description</h2>
+<p>has_trivial_destructor_after_move<> == true_type specialization for optimizations </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155910.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155899.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155899.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155913.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155913.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155899"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491450"></a><h2>Description</h2>
+<p>has_trivial_destructor_after_move<> == true_type specialization for optimizations </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155913.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155904.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155904.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155920.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155920.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155904"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491448"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155920.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155909.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155909.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155930.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155930.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155909"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491449"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance.</p>
+<p>By default this trais is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155930.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155910.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155910.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155931.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155931.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155910"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492020"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance.</p>
+<p>By default this trais is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155931.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155911.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155911.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155932.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155932.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155911"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492005"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance.</p>
+<p>By default this trais is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155932.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155923.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155923.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155937.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155937.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155923"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491470"></a><h2>Description</h2>
+<p>has_trivial_destructor_after_move<> == true_type specialization for optimizations </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155937.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155929.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155929.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155950.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155950.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155929"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492772"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance.</p>
+<p>By default this trais is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155950.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155930.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155930.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155952.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155952.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155930"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492035"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance.</p>
+<p>By default this trais is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155952.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155948.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155948.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155962.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155962.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155948"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491479"></a><h2>Description</h2>
+<p>has_trivial_destructor_after_move<> == true_type specialization for optimizations </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155962.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155950.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155950.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155971.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155971.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155950"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492123"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance.</p>
+<p>By default this trais is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155971.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155951.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155951.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155965.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155965.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155951"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491507"></a><h2>Description</h2>
+<p>has_trivial_destructor_after_move<> == true_type specialization for optimizations </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155965.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155953.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155953.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155974.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155974.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155953"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492127"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance.</p>
+<p>By default this trais is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155974.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155954.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/has_trivial_destructor__id155954.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Struct template has_trivial_destructor_after_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_insert_iterator.html" title="Class template move_insert_iterator">
+<link rel="next" href="move_id155976.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155976.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.has_trivial_destructor__id155954"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Struct template has_trivial_destructor_after_move</span></h2>
+<p>boost::has_trivial_destructor_after_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move {
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492329"></a><h2>Description</h2>
+<p>If this traits yields to true (has_trivial_destructor_after_move <T>value == true) menas that after moved, there is no need to call T's destructor. This optimization is used to improve containers' performance.</p>
+<p>By default this trais is true if the type has trivial destructor, every class should specialize this trait if it wants to improve performance when inserted in containers. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id155976.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/is_movable.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/is_movable.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,56 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template is_movable</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="../move/reference.html" title="Reference">
+<link rel="next" href="has_nothrow_move.html" title="Struct template has_nothrow_move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../move/reference.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="has_nothrow_move.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.is_movable"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template is_movable</span></h2>
+<p>boost::is_movable — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T>
+<span class="bold"><strong>class</strong></span> is_movable {
+<span class="bold"><strong>public</strong></span>:
+ <span class="bold"><strong>static</strong></span> <span class="type"><span class="bold"><strong>const</strong></span> <span class="bold"><strong>bool</strong></span></span> value;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id489335"></a><h2>Description</h2>
+<p>For compilers with rvalue references, this traits class returns true if BOOST_ENABLE_MOVE_EMULATION is activated.</p>
+<p>For other compilers returns true if T is convertible to boost::rv<T>& </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../move/reference.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="has_nothrow_move.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/make_move_iterator.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/make_move_iterator.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template make_move_iterator</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="forward.html" title="Function template forward">
+<link rel="next" href="back_move_inserter.html" title="Function template back_move_inserter">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="forward.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="back_move_inserter.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.make_move_iterator"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template make_move_iterator</span></h2>
+<p>boost::make_move_iterator — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> It> <span class="type">move_iterator< It ></span> make_move_iterator(<span class="bold"><strong>const</strong></span> It & it);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492235"></a><h2>Description</h2>
+<p><span class="bold"><strong>Returns</strong></span>: move_iterator<It>(i). </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="forward.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="back_move_inserter.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_backward.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_backward.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move_backward</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_id183623.html" title="Function template move">
+<link rel="next" href="uninitialized_move.html" title="Function template uninitialized_move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_id183623.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="uninitialized_move.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_backward"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move_backward</span></h2>
+<p>boost::move_backward — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move_backward(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492582"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result - (last-first),result) starting from last - 1 and proceeding to first. For each positive integer n <= (last - first), performs *(result - n) = boost::move(*(last - n)).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Returns</strong></span>: result - (last - first).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_id183623.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="uninitialized_move.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155909.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155909.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155896.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155896.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155909"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491565"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155896.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155910.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155910.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155897.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155897.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155910"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491706"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155897.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155913.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155913.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155899.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155899.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155913"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491504"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155899.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155920.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155920.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155904.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155904.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155920"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491507"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155904.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155930.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155930.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155909.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155909.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155930"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491513"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155909.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155931.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155931.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155910.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155910.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155931"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492084"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155910.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155932.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155932.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155911.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155911.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155932"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492069"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155911.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155937.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155937.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155923.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155923.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155937"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491524"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155923.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155950.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155950.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155929.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155929.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155950"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492837"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155929.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155952.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155952.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155930.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155930.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155952"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492100"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155930.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155962.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155962.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155948.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155948.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155962"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491533"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155948.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155965.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155965.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155951.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155951.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155965"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491560"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155951.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155971.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155971.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155950.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155950.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155971"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492190"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155950.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155974.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155974.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155953.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155953.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155974"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492192"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155953.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id155976.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id155976.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,52 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_trivial_destructor__id155954.html" title="Struct template has_trivial_destructor_after_move">
+<link rel="next" href="forward.html" title="Function template forward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155954.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id155976"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492396"></a><h2>Description</h2>
+<p>This function provides a way to convert a reference into a rvalue reference in compilers with rvalue reference. For other compilers converts T & into boost::rv<T> & so that move emulation is activated. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_trivial_destructor__id155954.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="forward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id156178.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id156178.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id156178"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id493229"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183580.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183580.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183580"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491957"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183581.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183581.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183581"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492097"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183583.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183583.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183583"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491895"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183590.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183590.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183590"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491899"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183601.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183601.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183601"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491905"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183602.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183602.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183602"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492476"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183604.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183604.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183604"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492460"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183607.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183607.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183607"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491916"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183623.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183623.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183623"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492491"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183632.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183632.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183632"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491926"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id183635.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id183635.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id183635"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491952"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id255937.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id255937.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id255937"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492581"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id255941.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id255941.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id255941"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492587"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id256214.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id256214.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id256214"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492790"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_id257364.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_id257364.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,55 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_inserter.html" title="Function template move_inserter">
+<link rel="next" href="move_backward.html" title="Function template move_backward">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_id257364"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move</span></h2>
+<p>boost::move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I f, I l, O result);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id494176"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: Moves elements in the range [first,last) into the range [result,result + (last - first)) starting from first and proceeding to last. For each non-negative integer n < (last-first), performs *(result + n) = boost::move (*(first + n)).</p>
+<p><span class="bold"><strong>Effects</strong></span>: result + (last - first).</p>
+<p><span class="bold"><strong>Requires</strong></span>: result shall not be in the range [first,last).</p>
+<p><span class="bold"><strong>Complexity</strong></span>: Exactly last - first move assignments. </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_backward.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_insert_iterator.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_insert_iterator.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,83 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template move_insert_iterator</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="front_move_insert_iterator.html" title="Class template front_move_insert_iterator">
+<link rel="next" href="has_trivial_destructor__id155930.html" title="Struct template has_trivial_destructor_after_move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="front_move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="has_trivial_destructor__id155930.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_insert_iterator"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template move_insert_iterator</span></h2>
+<p>boost::move_insert_iterator — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C>
+<span class="bold"><strong>class</strong></span> move_insert_iterator {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> C <a name="boost.move_insert_iterator.container_type"></a>container_type;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ move_insert_iterator(C &, <span class="bold"><strong>typename</strong></span> C::iterator);
+ move_insert_iterator& operator=(<span class="bold"><strong>typename</strong></span> C::reference);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">move_insert_iterator &</span> operator *() ;
+ <span class="type">move_insert_iterator &</span> operator++() ;
+ <span class="type">move_insert_iterator &</span> operator++(<span class="bold"><strong>int</strong></span>) ;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id491775"></a><h2>Description</h2>
+<div class="refsect2" lang="en">
+<a name="id491780"></a><h3>
+<a name="boost.move_insert_iteratorconstruct-copy-destruct"></a><code class="computeroutput">move_insert_iterator</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id155914-bb"></a>move_insert_iterator(C & x, <span class="bold"><strong>typename</strong></span> C::iterator pos);</pre></li>
+<li><pre class="literallayout">move_insert_iterator& <a name="id155924-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>typename</strong></span> C::reference x);</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id491866"></a><h3>
+<a name="id155888-bb"></a><code class="computeroutput">move_insert_iterator</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="type">move_insert_iterator &</span> <a name="id155891-bb"></a><span class="bold"><strong>operator</strong></span> *() ;</pre></li>
+<li><pre class="literallayout"><span class="type">move_insert_iterator &</span> <a name="id155897-bb"></a><span class="bold"><strong>operator</strong></span>++() ;</pre></li>
+<li><pre class="literallayout"><span class="type">move_insert_iterator &</span> <a name="id155903-bb"></a><span class="bold"><strong>operator</strong></span>++(<span class="bold"><strong>int</strong></span>) ;</pre></li>
+</ol></div>
+</div>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="front_move_insert_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="has_trivial_destructor__id155930.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_inserter.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_inserter.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template move_inserter</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="front_move_inserter.html" title="Function template front_move_inserter">
+<link rel="next" href="move_id183623.html" title="Function template move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="front_move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id183623.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_inserter"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template move_inserter</span></h2>
+<p>boost::move_inserter — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C>
+ <span class="type">move_insert_iterator< C ></span> move_inserter(C & x, <span class="bold"><strong>typename</strong></span> C::iterator it);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492429"></a><h2>Description</h2>
+<p><span class="bold"><strong>Returns</strong></span>: move_insert_iterator<C>(x, it). </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="front_move_inserter.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="move_id183623.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/move_iterator.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/move_iterator.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,109 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Class template move_iterator</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="has_nothrow_move.html" title="Struct template has_nothrow_move">
+<link rel="next" href="back_move_insert_iterator.html" title="Class template back_move_insert_iterator">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_nothrow_move.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="back_move_insert_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.move_iterator"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Class template move_iterator</span></h2>
+<p>boost::move_iterator — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> It>
+<span class="bold"><strong>class</strong></span> move_iterator {
+<span class="bold"><strong>public</strong></span>:
+ <span class="emphasis"><em>// types</em></span>
+ <span class="bold"><strong>typedef</strong></span> It <a name="boost.move_iterator.iterator_type"></a>iterator_type;
+ <span class="bold"><strong>typedef</strong></span> std::iterator_traits< iterator_type >::value_type <a name="boost.move_iterator.value_type"></a>value_type;
+ <span class="bold"><strong>typedef</strong></span> value_type && <a name="boost.move_iterator.reference"></a>reference;
+ <span class="bold"><strong>typedef</strong></span> std::iterator_traits< iterator_type >::pointer <a name="boost.move_iterator.pointer"></a>pointer;
+ <span class="bold"><strong>typedef</strong></span> std::iterator_traits< iterator_type >::difference_type <a name="boost.move_iterator.difference_type"></a>difference_type;
+ <span class="bold"><strong>typedef</strong></span> std::iterator_traits< iterator_type >::iterator_category <a name="boost.move_iterator.iterator_category"></a>iterator_category;
+
+ <span class="emphasis"><em>// construct/copy/destruct</em></span>
+ move_iterator();
+ move_iterator(It);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> U> move_iterator(<span class="bold"><strong>const</strong></span> move_iterator< U > &);
+
+ <span class="emphasis"><em>// public member functions</em></span>
+ <span class="type">iterator_type</span> base() <span class="bold"><strong>const</strong></span>;
+ <span class="type">reference</span> operator *() <span class="bold"><strong>const</strong></span>;
+ <span class="type">pointer</span> operator->() <span class="bold"><strong>const</strong></span>;
+ <span class="type">move_iterator &</span> operator++() ;
+ <span class="type">move_iterator< iterator_type ></span> operator++(<span class="bold"><strong>int</strong></span>) ;
+ <span class="type">move_iterator &</span> operator--() ;
+ <span class="type">move_iterator< iterator_type ></span> operator--(<span class="bold"><strong>int</strong></span>) ;
+ <span class="type">move_iterator< iterator_type ></span> operator+(difference_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">move_iterator &</span> operator+=(difference_type) ;
+ <span class="type">move_iterator< iterator_type ></span> operator-(difference_type) <span class="bold"><strong>const</strong></span>;
+ <span class="type">move_iterator &</span> operator-=(difference_type) ;
+ <span class="type">reference</span> operator[](difference_type) <span class="bold"><strong>const</strong></span>;
+};</pre></div>
+<div class="refsect1" lang="en">
+<a name="id490034"></a><h2>Description</h2>
+<p>Class template move_iterator is an iterator adaptor with the same behavior as the underlying iterator except that its dereference operator implicitly converts the value returned by the underlying iterator's dereference operator to an rvalue reference. Some generic algorithms can be called with move iterators to replace copying with moving. </p>
+<div class="refsect2" lang="en">
+<a name="id490047"></a><h3>
+<a name="boost.move_iteratorconstruct-copy-destruct"></a><code class="computeroutput">move_iterator</code>
+ public
+ construct/copy/destruct</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><a name="id156264-bb"></a>move_iterator();</pre></li>
+<li><pre class="literallayout"><a name="id156265-bb"></a>move_iterator(It i);</pre></li>
+<li><pre class="literallayout"><span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> U> <a name="id156271-bb"></a>move_iterator(<span class="bold"><strong>const</strong></span> move_iterator< U > & u);</pre></li>
+</ol></div>
+</div>
+<div class="refsect2" lang="en">
+<a name="id490164"></a><h3>
+<a name="id155729-bb"></a><code class="computeroutput">move_iterator</code> public member functions</h3>
+<div class="orderedlist"><ol type="1">
+<li><pre class="literallayout"><span class="type">iterator_type</span> <a name="id155732-bb"></a>base() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id155738-bb"></a><span class="bold"><strong>operator</strong></span> *() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">pointer</span> <a name="id155744-bb"></a><span class="bold"><strong>operator</strong></span>->() <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">move_iterator &</span> <a name="id155750-bb"></a><span class="bold"><strong>operator</strong></span>++() ;</pre></li>
+<li><pre class="literallayout"><span class="type">move_iterator< iterator_type ></span> <a name="id155758-bb"></a><span class="bold"><strong>operator</strong></span>++(<span class="bold"><strong>int</strong></span>) ;</pre></li>
+<li><pre class="literallayout"><span class="type">move_iterator &</span> <a name="id155771-bb"></a><span class="bold"><strong>operator</strong></span>--() ;</pre></li>
+<li><pre class="literallayout"><span class="type">move_iterator< iterator_type ></span> <a name="id155780-bb"></a><span class="bold"><strong>operator</strong></span>--(<span class="bold"><strong>int</strong></span>) ;</pre></li>
+<li><pre class="literallayout"><span class="type">move_iterator< iterator_type ></span> <a name="id183647-bb"></a><span class="bold"><strong>operator</strong></span>+(difference_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">move_iterator &</span> <a name="id183660-bb"></a><span class="bold"><strong>operator</strong></span>+=(difference_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">move_iterator< iterator_type ></span> <a name="id183673-bb"></a><span class="bold"><strong>operator</strong></span>-(difference_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+<li><pre class="literallayout"><span class="type">move_iterator &</span> <a name="id183686-bb"></a><span class="bold"><strong>operator</strong></span>-=(difference_type n) ;</pre></li>
+<li><pre class="literallayout"><span class="type">reference</span> <a name="id156253-bb"></a><span class="bold"><strong>operator</strong></span>[](difference_type n) <span class="bold"><strong>const</strong></span>;</pre></li>
+</ol></div>
+</div>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="has_nothrow_move.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="back_move_insert_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/uninitialized_copy_or_move.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/uninitialized_copy_or_move.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,58 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template uninitialized_copy_or_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="uninitialized_move.html" title="Function template uninitialized_move">
+<link rel="next" href="../BOOST_MOVABLE_BUT_NOT_COPYABLE.html" title="Macro BOOST_MOVABLE_BUT_NOT_COPYABLE">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="uninitialized_move.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="../BOOST_MOVABLE_BUT_NOT_COPYABLE.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.uninitialized_copy_or_move"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template uninitialized_copy_or_move</span></h2>
+<p>boost::uninitialized_copy_or_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> F> <span class="type">F</span> uninitialized_copy_or_move(I f, I l, F r);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492758"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: </p>
+<pre class="programlisting"> for (; first != last; ++result, ++first)
+ new (static_cast<void*>(&*result))
+ typename iterator_traits<ForwardIterator>::value_type(*first);
+</pre>
+<p><span class="bold"><strong>Returns</strong></span>: result</p>
+<p><span class="bold"><strong>Note</strong></span>: This function is provided because std::uninitialized_copy from some STL implementations is not compatible with move_iterator </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="uninitialized_move.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="../BOOST_MOVABLE_BUT_NOT_COPYABLE.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/boost/uninitialized_move.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/boost/uninitialized_move.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,57 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Function template uninitialized_move</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../move/reference.html#header.boost.move.move_hpp" title="Header <boost/move/move.hpp>">
+<link rel="prev" href="move_backward.html" title="Function template move_backward">
+<link rel="next" href="uninitialized_copy_or_move.html" title="Function template uninitialized_copy_or_move">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_backward.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="uninitialized_copy_or_move.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="refentry" lang="en">
+<a name="boost.uninitialized_move"></a><div class="titlepage"></div>
+<div class="refnamediv">
+<h2><span class="refentrytitle">Function template uninitialized_move</span></h2>
+<p>boost::uninitialized_move — </p>
+</div>
+<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
+<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis">
+<span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> F> <span class="type">F</span> uninitialized_move(I f, I l, F r);</pre></div>
+<div class="refsect1" lang="en">
+<a name="id492675"></a><h2>Description</h2>
+<p><span class="bold"><strong>Effects</strong></span>: </p>
+<pre class="programlisting"> for (; first != last; ++result, ++first)
+ new (static_cast<void*>(&*result))
+ typename iterator_traits<ForwardIterator>::value_type(boost::move(*first));
+</pre>
+<p><span class="bold"><strong>Returns</strong></span>: result </p>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_backward.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../move/reference.html#header.boost.move.move_hpp"><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="uninitialized_copy_or_move.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/index.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/index.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,86 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Chapter 1. Boost.Move</title>
+<link rel="stylesheet" href="boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="index.html" title="Chapter 1. Boost.Move">
+<link rel="next" href="move/introduction.html" title=" Introduction">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="move/introduction.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="chapter" lang="en">
+<div class="titlepage"><div>
+<div><h2 class="title">
+<a name="move"></a>Chapter 1. Boost.Move</h2></div>
+<div><div class="author"><h3 class="author">
+<span class="firstname">Ion</span> <span class="surname">Gaztañaga</span>
+</h3></div></div>
+<div><p class="copyright">Copyright © 2008 -2009 Ion Gaztañaga</p></div>
+<div><div class="legalnotice">
+<a name="id397606"></a><p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></div>
+</div></div>
+<div class="toc">
+<p><b>Table of Contents</b></p>
+<dl>
+<dt><span class="section"> Introduction</span></dt>
+<dt><span class="section"><a href="move/implementing_movable_classes.html"> Implementing copyable
+ and movable classes</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="move/implementing_movable_classes.html#move.implementing_movable_classes.copyable_and_movable_cpp0x">
+ Copyable and movable classes in C++0x</a></span></dt>
+<dt><span class="section"><a href="move/implementing_movable_classes.html#move.implementing_movable_classes.copyable_and_movable_cpp03">
+ Copyable and movable classes in portable syntax for both C++03 and C++0x compilers</a></span></dt>
+</dl></dd>
+<dt><span class="section"> Composition or inheritance</span></dt>
+<dt><span class="section"> Movable but Non-Copyable Types</span></dt>
+<dt><span class="section"> Containers and move semantics</span></dt>
+<dt><span class="section"> Constructor Forwarding</span></dt>
+<dt><span class="section"> Move iterators</span></dt>
+<dt><span class="section"> Move inserters</span></dt>
+<dt><span class="section"> Move algorithms</span></dt>
+<dt><span class="section">Reference</span></dt>
+<dd><dl><dt><span class="section">Header <boost/move/move.hpp></span></dt></dl></dd>
+</dl>
+</div>
+<div class="warning"><table border="0" summary="Warning">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../doc/html/images/warning.png"></td>
+<th align="left">Warning</th>
+</tr>
+<tr><td colspan="2" align="left" valign="top"><p>
+ This library is NOT an official Boost library
+ </p></td></tr>
+</table></div>
+<div class="important"><table border="0" summary="Important">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../doc/html/images/important.png"></td>
+<th align="left">Important</th>
+</tr>
+<tr><td colspan="2" align="left" valign="top"><p>
+ To be able to use containers of movable values you will need an special version
+ of <span class="bold"><strong>Boost.Container</strong></span> bundled with this library
+ </p></td></tr>
+</table></div>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"><p><small>Last revised: August 12, 2009 at 08:03:44 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav"><a accesskey="n" href="move/introduction.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/composition_inheritance.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/composition_inheritance.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,152 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Composition or inheritance</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="implementing_movable_classes.html" title=" Implementing copyable
+ and movable classes">
+<link rel="next" href="movable_only_classes.html" title=" Movable but Non-Copyable Types">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="implementing_movable_classes.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="movable_only_classes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.composition_inheritance"></a> Composition or inheritance</h2></div></div></div>
+<p>
+ For classes made up of other classes (via either composition or inheritance),
+ the move constructor and move assignment can be easily coded using the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span></code>
+ function:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">Base</span>
+<span class="special">{</span>
+ <span class="identifier">BOOST_COPYABLE_AND_MOVABLE</span><span class="special">(</span><span class="identifier">Base</span><span class="special">)</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">Base</span><span class="special">(){}</span>
+
+ <span class="comment">// Compiler-generated copy constructor...
+</span>
+ <span class="identifier">Base</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">Base</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{/**/}</span> <span class="comment">// Move ctor
+</span>
+ <span class="identifier">Base</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">Base</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span>
+ <span class="special">{/**/</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span> <span class="comment">// Move assign
+</span>
+ <span class="identifier">Base</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_COPY_ASSIGN_REF</span><span class="special">(</span><span class="identifier">Base</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span>
+ <span class="special">{/**/</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span> <span class="comment">// Copy assign
+</span>
+ <span class="keyword">virtual</span> <span class="identifier">Base</span> <span class="special">*</span><span class="identifier">clone</span><span class="special">()</span> <span class="keyword">const</span>
+ <span class="special">{</span> <span class="keyword">return</span> <span class="keyword">new</span> <span class="identifier">Base</span><span class="special">(*</span><span class="keyword">this</span><span class="special">);</span> <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">class</span> <span class="identifier">Member</span>
+<span class="special">{</span>
+ <span class="identifier">BOOST_COPYABLE_AND_MOVABLE</span><span class="special">(</span><span class="identifier">Member</span><span class="special">)</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">Member</span><span class="special">(){}</span>
+
+ <span class="comment">// Compiler-generated copy constructor...
+</span>
+ <span class="identifier">Member</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">Member</span><span class="special">))</span> <span class="special">{/**/}</span> <span class="comment">// Move ctor
+</span>
+ <span class="identifier">Member</span> <span class="special">&</span><span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">Member</span><span class="special">))</span> <span class="comment">// Move assign
+</span> <span class="special">{/**/</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">Member</span> <span class="special">&</span><span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_COPY_ASSIGN_REF</span><span class="special">(</span><span class="identifier">Member</span><span class="special">))</span> <span class="comment">// Copy assign
+</span> <span class="special">{/**/</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">class</span> <span class="identifier">Derived</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">Base</span>
+<span class="special">{</span>
+ <span class="identifier">BOOST_COPYABLE_AND_MOVABLE</span><span class="special">(</span><span class="identifier">Derived</span><span class="special">)</span>
+ <span class="identifier">Member</span> <span class="identifier">mem_</span><span class="special">;</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">Derived</span><span class="special">(){}</span>
+
+ <span class="comment">// Compiler-generated copy constructor...
+</span>
+ <span class="identifier">Derived</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">Derived</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span> <span class="comment">// Move ctor
+</span> <span class="special">:</span> <span class="identifier">Base</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">Base</span><span class="special">&>(</span><span class="identifier">x</span><span class="special">))),</span>
+ <span class="identifier">mem_</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">mem_</span><span class="special">))</span> <span class="special">{</span> <span class="special">}</span>
+
+ <span class="identifier">Derived</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">Derived</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span> <span class="comment">// Move assign
+</span> <span class="special">{</span>
+ <span class="identifier">Base</span><span class="special">::</span><span class="keyword">operator</span><span class="special">=(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">Base</span><span class="special">&>(</span><span class="identifier">x</span><span class="special">)));</span>
+ <span class="identifier">mem_</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">mem_</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="identifier">Derived</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_COPY_ASSIGN_REF</span><span class="special">(</span><span class="identifier">Derived</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span> <span class="comment">// Move assign
+</span> <span class="special">{</span>
+ <span class="identifier">Base</span><span class="special">::</span><span class="keyword">operator</span><span class="special">=(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">const</span> <span class="identifier">Base</span><span class="special">&>(</span><span class="identifier">x</span><span class="special">));</span>
+ <span class="identifier">mem_</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">mem_</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="comment">// ...
+</span><span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Each subobject will now be treated individually, calling move to bind to the
+ subobject's move constructors and move assignment operators. <code class="computeroutput"><span class="identifier">Member</span></code> has move operations coded (just like
+ our earlier <code class="computeroutput"><span class="identifier">clone_ptr</span></code> example)
+ which will completely avoid the tremendously more expensive copy operations:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">Derived</span> <span class="identifier">d</span><span class="special">;</span>
+<span class="identifier">Derived</span> <span class="identifier">d2</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">d</span><span class="special">));</span>
+<span class="identifier">d2</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">d</span><span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Note above that the argument x is treated as a lvalue reference. That's why
+ it is necessary to say <code class="computeroutput"><span class="identifier">move</span><span class="special">(</span><span class="identifier">x</span><span class="special">)</span></code>
+ instead of just x when passing down to the base class. This is a key safety
+ feature of move semantics designed to prevent accidently moving twice from
+ some named variable. All moves occur explicitly.
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="implementing_movable_classes.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="movable_only_classes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/construct_forwarding.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/construct_forwarding.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,179 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Constructor Forwarding</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="move_and_containers.html" title=" Containers and move semantics">
+<link rel="next" href="move_iterator.html" title=" Move iterators">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_and_containers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.construct_forwarding"></a> Constructor Forwarding</h2></div></div></div>
+<p>
+ Consider writing a generic factory function that returns an object for a newly
+ constructed generic type. Factory functions such as this are valuable for encapsulating
+ and localizing the allocation of resources. Obviously, the factory function
+ must accept exactly the same sets of arguments as the constructors of the type
+ of objects constructed:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="identifier">T</span><span class="special">*</span> <span class="identifier">factory_new</span><span class="special">()</span>
+<span class="special">{</span> <span class="keyword">return</span> <span class="keyword">new</span> <span class="identifier">T</span><span class="special">();</span> <span class="special">}</span>
+
+<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="identifier">T</span><span class="special">*</span> <span class="identifier">factory_new</span><span class="special">(</span><span class="identifier">a1</span><span class="special">)</span>
+<span class="special">{</span> <span class="keyword">return</span> <span class="keyword">new</span> <span class="identifier">T</span><span class="special">(</span><span class="identifier">a1</span><span class="special">);</span> <span class="special">}</span>
+
+<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="identifier">T</span><span class="special">*</span> <span class="identifier">factory_new</span><span class="special">(</span><span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">)</span>
+<span class="special">{</span> <span class="keyword">return</span> <span class="keyword">new</span> <span class="identifier">T</span><span class="special">(</span><span class="identifier">a1</span><span class="special">,</span> <span class="identifier">a2</span><span class="special">);</span> <span class="special">}</span>
+</pre>
+<p>
+ Unfortunately, in C++03 the much bigger issue with this approach is that the
+ N-argument case would require 2^N overloads, immediately discounting this as
+ a general solution. Fortunately, most constructors take arguments by value,
+ by const-reference or by rvalue reference. If these limitations are accepted,
+ the forwarding emulation of a N-argument case requires just N overloads. This
+ library makes this emulation easy with the help of <code class="computeroutput"><span class="identifier">BOOST_FWD_REF</span></code>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">forward</span></code>:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">move</span><span class="special">/</span><span class="identifier">move</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">iostream</span><span class="special">></span>
+
+<span class="keyword">class</span> <span class="identifier">non_movable_test</span>
+<span class="special">{</span>
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">non_movable_test</span><span class="special">()</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="string">"non_movable_test()"</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="special">}</span>
+
+ <span class="identifier">non_movable_test</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">non_movable_test</span><span class="special">&)</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="string">"non_movable_test(const non_movable_test&)"</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="special">}</span>
+
+ <span class="identifier">non_movable_test</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</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="string">"non_movable_test(int)"</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="special">}</span>
+
+ <span class="identifier">non_movable_test</span><span class="special">(</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">double</span><span class="special">)</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="string">"non_movable_test(int, double)"</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="special">}</span>
+<span class="special">};</span>
+
+<span class="keyword">class</span> <span class="identifier">movable_test</span>
+<span class="special">{</span>
+ <span class="comment">// move semantics
+</span> <span class="identifier">BOOST_COPYABLE_AND_MOVABLE</span><span class="special">(</span><span class="identifier">movable_test</span><span class="special">)</span>
+ <span class="keyword">public</span><span class="special">:</span>
+
+ <span class="identifier">movable_test</span><span class="special">()</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="string">"movable_test()"</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="special">}</span>
+
+ <span class="identifier">movable_test</span><span class="special">(</span><span class="keyword">int</span><span class="special">)</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="string">"movable_test(int)"</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="special">}</span>
+
+ <span class="identifier">movable_test</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">movable_test</span><span class="special">))</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="string">"movable_test(BOOST_RV_REF(movable_test))"</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="special">}</span>
+
+ <span class="identifier">movable_test</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">movable_test</span> <span class="special">&)</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="string">"movable_test(const movable_test &)"</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="special">}</span>
+
+ <span class="identifier">movable_test</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">movable_test</span><span class="special">),</span> <span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">movable_test</span><span class="special">))</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="string">"movable_test(BOOST_RV_REF(movable_test), BOOST_RV_REF(movable_test))"</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="special">}</span>
+
+ <span class="identifier">movable_test</span> <span class="special">&</span><span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">movable_test</span><span class="special">))</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="string">"movable_test & operator=(BOOST_RV_REF(movable_test))"</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="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">movable_test</span> <span class="special">&</span><span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_COPY_ASSIGN_REF</span><span class="special">(</span><span class="identifier">movable_test</span><span class="special">))</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="string">"movable_test & operator=(BOOST_COPY_ASSIGN_REF(movable_test))"</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="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+
+<span class="comment">//1 argument
+</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">MaybeMovable</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">MaybeRv</span><span class="special">></span>
+<span class="keyword">void</span> <span class="identifier">function_construct</span><span class="special">(</span><span class="identifier">BOOST_FWD_REF</span><span class="special">(</span><span class="identifier">MaybeRv</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span>
+<span class="special">{</span> <span class="identifier">MaybeMovable</span> <span class="identifier">m</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">forward</span><span class="special"><</span><span class="identifier">MaybeRv</span><span class="special">>(</span><span class="identifier">x</span><span class="special">));</span> <span class="special">}</span>
+
+<span class="comment">//2 argument
+</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">MaybeMovable</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">MaybeRv</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">MaybeRv2</span><span class="special">></span>
+<span class="keyword">void</span> <span class="identifier">function_construct</span><span class="special">(</span><span class="identifier">BOOST_FWD_REF</span><span class="special">(</span><span class="identifier">MaybeRv</span><span class="special">)</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">BOOST_FWD_REF</span><span class="special">(</span><span class="identifier">MaybeRv2</span><span class="special">)</span> <span class="identifier">x2</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">MaybeMovable</span> <span class="identifier">m</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">forward</span><span class="special"><</span><span class="identifier">MaybeRv</span><span class="special">>(</span><span class="identifier">x</span><span class="special">),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">forward</span><span class="special"><</span><span class="identifier">MaybeRv2</span><span class="special">>(</span><span class="identifier">x2</span><span class="special">));</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">movable_test</span> <span class="identifier">m</span><span class="special">;</span>
+ <span class="comment">//move constructor
+</span> <span class="identifier">function_construct</span><span class="special"><</span><span class="identifier">movable_test</span><span class="special">>(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">m</span><span class="special">));</span>
+ <span class="comment">//copy constructor
+</span> <span class="identifier">function_construct</span><span class="special"><</span><span class="identifier">movable_test</span><span class="special">>(</span><span class="identifier">movable_test</span><span class="special">());</span>
+ <span class="comment">//two rvalue constructor
+</span> <span class="identifier">function_construct</span><span class="special"><</span><span class="identifier">movable_test</span><span class="special">>(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">m</span><span class="special">),</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">m</span><span class="special">));</span>
+
+ <span class="identifier">non_movable_test</span> <span class="identifier">nm</span><span class="special">;</span>
+ <span class="comment">//copy constructor (non_movable_test has no move ctor.)
+</span> <span class="identifier">function_construct</span><span class="special"><</span><span class="identifier">non_movable_test</span><span class="special">>(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">nm</span><span class="special">));</span>
+ <span class="comment">//copy constructor
+</span> <span class="identifier">function_construct</span><span class="special"><</span><span class="identifier">non_movable_test</span><span class="special">>(</span><span class="identifier">nm</span><span class="special">);</span>
+ <span class="comment">//int constructor
+</span> <span class="identifier">function_construct</span><span class="special"><</span><span class="identifier">non_movable_test</span><span class="special">>(</span><span class="keyword">int</span><span class="special">(</span><span class="number">0</span><span class="special">));</span>
+ <span class="comment">//int, double constructor
+</span> <span class="identifier">function_construct</span><span class="special"><</span><span class="identifier">non_movable_test</span><span class="special">>(</span><span class="keyword">int</span><span class="special">(</span><span class="number">0</span><span class="special">),</span> <span class="keyword">double</span><span class="special">(</span><span class="number">0.0</span><span class="special">));</span>
+
+ <span class="comment">//Output is:
+</span> <span class="comment">//movable_test()
+</span> <span class="comment">//movable_test(BOOST_RV_REF(movable_test))
+</span> <span class="comment">//movable_test()
+</span> <span class="comment">//movable_test(const movable_test &)
+</span> <span class="comment">//movable_test(BOOST_RV_REF(movable_test), BOOST_RV_REF(movable_test))
+</span> <span class="comment">//non_movable_test()
+</span> <span class="comment">//non_movable_test(const non_movable_test&)
+</span> <span class="comment">//non_movable_test(const non_movable_test&)
+</span> <span class="comment">//non_movable_test(int)
+</span> <span class="comment">//non_movable_test(int, double)
+</span> <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Constructor forwarding comes handful to implement placement insertion in containers
+ with just N overloads if the implementor accepts the limitations of this type
+ of forwarding for C++03 compilers. In compilers with rvalue references perfect
+ forwarding is achieved.
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_and_containers.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/implementing_movable_classes.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/implementing_movable_classes.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,258 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Implementing copyable
+ and movable classes</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="introduction.html" title=" Introduction">
+<link rel="next" href="composition_inheritance.html" title=" Composition or inheritance">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="introduction.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="composition_inheritance.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.implementing_movable_classes"></a><a href="implementing_movable_classes.html" title=" Implementing copyable
+ and movable classes"> Implementing copyable
+ and movable classes</a></h2></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="implementing_movable_classes.html#move.implementing_movable_classes.copyable_and_movable_cpp0x">
+ Copyable and movable classes in C++0x</a></span></dt>
+<dt><span class="section"><a href="implementing_movable_classes.html#move.implementing_movable_classes.copyable_and_movable_cpp03">
+ Copyable and movable classes in portable syntax for both C++03 and C++0x compilers</a></span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="move.implementing_movable_classes.copyable_and_movable_cpp0x"></a><a href="implementing_movable_classes.html#move.implementing_movable_classes.copyable_and_movable_cpp0x" title="
+ Copyable and movable classes in C++0x">
+ Copyable and movable classes in C++0x</a></h3></div></div></div>
+<p>
+ Consider a simple handle class that owns a resource and also provides copy
+ semantics (copy constructor and assignment). For example a <code class="computeroutput"><span class="identifier">clone_ptr</span></code> might own a pointer, and call
+ <code class="computeroutput"><span class="identifier">clone</span><span class="special">()</span></code>
+ on it for copying purposes:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">clone_ptr</span>
+<span class="special">{</span>
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">;</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// construction
+</span> <span class="keyword">explicit</span> <span class="identifier">clone_ptr</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">p</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">ptr</span><span class="special">(</span><span class="identifier">p</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="comment">// destruction
+</span> <span class="special">~</span><span class="identifier">clone_ptr</span><span class="special">()</span> <span class="special">{</span> <span class="keyword">delete</span> <span class="identifier">ptr</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="comment">// copy semantics
+</span> <span class="identifier">clone_ptr</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">clone_ptr</span><span class="special">&</span> <span class="identifier">p</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">ptr</span><span class="special">(</span><span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span> <span class="special">?</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">-></span><span class="identifier">clone</span><span class="special">()</span> <span class="special">:</span> <span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">clone_ptr</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">clone_ptr</span><span class="special">&</span> <span class="identifier">p</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="keyword">this</span> <span class="special">!=</span> <span class="special">&</span><span class="identifier">p</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">T</span> <span class="special">*</span><span class="identifier">p</span> <span class="special">=</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span> <span class="special">?</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">-></span><span class="identifier">clone</span><span class="special">()</span> <span class="special">:</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">delete</span> <span class="identifier">ptr</span><span class="special">;</span>
+ <span class="identifier">ptr</span> <span class="special">=</span> <span class="identifier">p</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="comment">// move semantics
+</span> <span class="identifier">clone_ptr</span><span class="special">(</span><span class="identifier">clone_ptr</span><span class="special">&&</span> <span class="identifier">p</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">ptr</span><span class="special">(</span><span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">clone_ptr</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">clone_ptr</span><span class="special">&&</span> <span class="identifier">p</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">swap</span><span class="special">(</span><span class="identifier">ptr</span><span class="special">,</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">);</span>
+ <span class="keyword">delete</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">;</span>
+ <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="comment">// Other operations...
+</span><span class="special">};</span>
+</pre>
+<p>
+ <code class="computeroutput"><span class="identifier">clone_ptr</span></code> has expected copy
+ constructor and assignment semantics, duplicating resources when copying.
+ Note that copy constructing or assigning a <code class="computeroutput"><span class="identifier">clone_ptr</span></code>
+ is a relatively expensive operation:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">clone_ptr</span><span class="special"><</span><span class="identifier">Base</span><span class="special">></span> <span class="identifier">p1</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">Derived</span><span class="special">());</span>
+<span class="comment">// ...
+</span><span class="identifier">clone_ptr</span><span class="special"><</span><span class="identifier">Base</span><span class="special">></span> <span class="identifier">p2</span> <span class="special">=</span> <span class="identifier">p1</span><span class="special">;</span> <span class="comment">// p2 and p1 each own their own pointer
+</span></pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">clone_ptr</span></code> is code that you
+ might find in today's books on C++, except for the part marked as <code class="computeroutput"><span class="identifier">move</span> <span class="identifier">semantics</span></code>.
+ That part is implemented in terms of C++0x <code class="computeroutput"><span class="identifier">rvalue</span>
+ <span class="identifier">references</span></code>. You can find some good
+ introduction and tutorials on rvalue references in these papers:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><a href="http://www.artima.com/cppsource/rvalue.html" target="_top"><span class="emphasis"><em>A Brief
+ Introduction to Rvalue References</em></span></a></li>
+<li><a href="http://blogs.msdn.com/vcblog/archive/2009/02/03/rvalue-references-c-0x-features-in-vc10-part-2.aspx" target="_top"><span class="emphasis"><em>Rvalue
+ References: C++0x Features in VC10, Part 2</em></span></a></li>
+</ul></div>
+<p>
+ When the source of the copy is known to be an <code class="computeroutput"><span class="identifier">rvalue</span></code>
+ (e.g.: a temporary object), one can avoid the potentially expensive <code class="computeroutput"><span class="identifier">clone</span><span class="special">()</span></code>
+ operation by pilfering source's pointer (no one will notice!). The move constructor
+ above does exactly that, leaving the rvalue in a default constructed state.
+ The move assignment operator simply does the same freeing old resources.
+ </p>
+<p>
+ Now when code tries to copy an rvalue <code class="computeroutput"><span class="identifier">clone_ptr</span></code>,
+ or if that code explicitly gives permission to consider the source of the
+ copy an rvalue (using <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span></code>),
+ the operation will execute much faster.
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">clone_ptr</span><span class="special"><</span><span class="identifier">Base</span><span class="special">></span> <span class="identifier">p1</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">Derived</span><span class="special">());</span>
+<span class="comment">// ...
+</span><span class="identifier">clone_ptr</span><span class="special"><</span><span class="identifier">Base</span><span class="special">></span> <span class="identifier">p2</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">p1</span><span class="special">);</span> <span class="comment">// p2 now owns the pointer instead of p1
+</span><span class="identifier">p2</span> <span class="special">=</span> <span class="identifier">clone_ptr</span><span class="special"><</span><span class="identifier">Base</span><span class="special">>(</span><span class="keyword">new</span> <span class="identifier">Derived</span><span class="special">());</span> <span class="comment">// temporary is moved to p2
+</span><span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="move.implementing_movable_classes.copyable_and_movable_cpp03"></a><a href="implementing_movable_classes.html#move.implementing_movable_classes.copyable_and_movable_cpp03" title="
+ Copyable and movable classes in portable syntax for both C++03 and C++0x compilers">
+ Copyable and movable classes in portable syntax for both C++03 and C++0x compilers</a></h3></div></div></div>
+<p>
+ Many aspects of move semantics can be emulated for compilers not supporting
+ <code class="computeroutput"><span class="identifier">rvalue</span> <span class="identifier">references</span></code>
+ and <span class="bold"><strong>Boost.Move</strong></span> offers tools for that purpose.
+ With <span class="bold"><strong>Boost.Move</strong></span> we can write <code class="computeroutput"><span class="identifier">clone_ptr</span></code> so that it will work both in
+ compilers with rvalue references and those who conform to C++03. You just
+ need to follow these simple steps:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Put the following macro in the <span class="bold"><strong>private</strong></span>
+ section: <code class="computeroutput">BOOST_COPYABLE_AND_MOVABLE(classname)</code>
+</li>
+<li>
+ Left copy constructor as is.
+ </li>
+<li>
+ Write a copy assignment taking the parameter as <code class="computeroutput">BOOST_COPY_ASSIGN_REF(classname)</code>
+</li>
+<li>
+ Write a move constructor and a move assignment taking the parameter as
+ <code class="computeroutput">BOOST_RV_REF(classname)</code>
+</li>
+</ul></div>
+<p>
+ Let's see how are applied to <code class="computeroutput"><span class="identifier">clone_ptr</span></code>:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">clone_ptr</span>
+<span class="special">{</span>
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="comment">// Mark this class copyable and movable
+</span> <span class="identifier">BOOST_COPYABLE_AND_MOVABLE</span><span class="special">(</span><span class="identifier">clone_ptr</span><span class="special">)</span>
+ <span class="identifier">T</span><span class="special">*</span> <span class="identifier">ptr</span><span class="special">;</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="comment">// Construction
+</span> <span class="keyword">explicit</span> <span class="identifier">clone_ptr</span><span class="special">(</span><span class="identifier">T</span><span class="special">*</span> <span class="identifier">p</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">ptr</span><span class="special">(</span><span class="identifier">p</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="comment">// Destruction
+</span> <span class="special">~</span><span class="identifier">clone_ptr</span><span class="special">()</span> <span class="special">{</span> <span class="keyword">delete</span> <span class="identifier">ptr</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">clone_ptr</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">clone_ptr</span><span class="special">&</span> <span class="identifier">p</span><span class="special">)</span> <span class="comment">// Copy constructor (as usual)
+</span> <span class="special">:</span> <span class="identifier">ptr</span><span class="special">(</span><span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span> <span class="special">?</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">-></span><span class="identifier">clone</span><span class="special">()</span> <span class="special">:</span> <span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="identifier">clone_ptr</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_COPY_ASSIGN_REF</span><span class="special">(</span><span class="identifier">clone_ptr</span><span class="special">)</span> <span class="identifier">p</span><span class="special">)</span> <span class="comment">// Copy assignment
+</span> <span class="special">{</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="keyword">this</span> <span class="special">!=</span> <span class="special">&</span><span class="identifier">p</span><span class="special">){</span>
+ <span class="identifier">T</span> <span class="special">*</span><span class="identifier">p</span> <span class="special">=</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span> <span class="special">?</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">-></span><span class="identifier">clone</span><span class="special">()</span> <span class="special">:</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">delete</span> <span class="identifier">ptr</span><span class="special">;</span>
+ <span class="identifier">ptr</span> <span class="special">=</span> <span class="identifier">p</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="comment">//Move semantics...
+</span> <span class="identifier">clone_ptr</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">clone_ptr</span><span class="special">)</span> <span class="identifier">p</span><span class="special">)</span> <span class="comment">//Move constructor
+</span> <span class="special">:</span> <span class="identifier">ptr</span><span class="special">(</span><span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">clone_ptr</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">clone_ptr</span><span class="special">)</span> <span class="identifier">p</span><span class="special">)</span> <span class="comment">//Move assignment
+</span> <span class="special">{</span>
+ <span class="keyword">delete</span> <span class="identifier">ptr</span><span class="special">;</span>
+ <span class="identifier">ptr</span> <span class="special">=</span> <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span><span class="special">;</span>
+ <span class="identifier">p</span><span class="special">.</span><span class="identifier">ptr</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<p>
+ <span class="bold"><strong>Question</strong></span>: What about types that don't own
+ resources? (E.g. <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">complex</span></code>?)
+ </p>
+<p>
+ No work needs to be done in that case. The copy constructor is already optimal.
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="introduction.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="composition_inheritance.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/introduction.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/introduction.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,110 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Introduction</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="next" href="implementing_movable_classes.html" title=" Implementing copyable
+ and movable classes">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="implementing_movable_classes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.introduction"></a> Introduction</h2></div></div></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td colspan="2" align="left" valign="top">
+<p>
+ </p>
+<p>
+ The first 3 chapters are the adapted from the article <a href="http://www.artima.com/cppsource/rvalue.html" target="_top"><span class="emphasis"><em>A
+ Brief Introduction to Rvalue References</em></span></a> by Howard E. Hinnant,
+ Bjarne Stroustrup, and Bronek Kozicki
+ </p>
+<p>
+ </p>
+</td></tr>
+</table></div>
+<p>
+ Copying can be expensive. For example, for vectors <code class="computeroutput"><span class="identifier">v2</span><span class="special">=</span><span class="identifier">v1</span></code> typically
+ involves a function call, a memory allocation, and a loop. This is of course
+ acceptable where we actually need two copies of a vector, but in many cases,
+ we don't: We often copy a <code class="computeroutput"><span class="identifier">vector</span></code>
+ from one place to another, just to proceed to overwrite the old copy. Consider:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">T</span><span class="special">&</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">b</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">T</span> <span class="identifier">tmp</span><span class="special">(</span><span class="identifier">a</span><span class="special">);</span> <span class="comment">// now we have two copies of a
+</span> <span class="identifier">a</span> <span class="special">=</span> <span class="identifier">b</span><span class="special">;</span> <span class="comment">// now we have two copies of b
+</span> <span class="identifier">b</span> <span class="special">=</span> <span class="identifier">tmp</span><span class="special">;</span> <span class="comment">// now we have two copies of tmp (aka a)
+</span><span class="special">}</span>
+</pre>
+<p>
+ But, we didn't want to have any copies of a or b, we just wanted to swap them.
+ Let's try again:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> <span class="identifier">swap</span><span class="special">(</span><span class="identifier">T</span><span class="special">&</span> <span class="identifier">a</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">b</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">T</span> <span class="identifier">tmp</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">a</span><span class="special">));</span>
+ <span class="identifier">a</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">b</span><span class="special">);</span>
+ <span class="identifier">b</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">tmp</span><span class="special">);</span>
+<span class="special">}</span>
+</pre>
+<p>
+ This <code class="computeroutput"><span class="identifier">move</span><span class="special">()</span></code>
+ gives its target the value of its argument, but is not obliged to preserve
+ the value of its source. So, for a <code class="computeroutput"><span class="identifier">vector</span></code>,
+ <code class="computeroutput"><span class="identifier">move</span><span class="special">()</span></code>
+ could reasonably be expected to leave its argument as a zero-capacity vector
+ to avoid having to copy all the elements. In other words, <span class="bold"><strong>move
+ is a potentially destructive copy</strong></span>.
+ </p>
+<p>
+ In this particular case, we could have optimized swap by a specialization.
+ However, we can't specialize every function that copies a large object just
+ before it deletes or overwrites it. That would be unmanageable.
+ </p>
+<p>
+ In C++0x, move semantics are implemented with the introduction of rvalue references.
+ They allow us to implement <code class="computeroutput"><span class="identifier">move</span><span class="special">()</span></code> without verbosity or runtime overhead. <span class="bold"><strong>Boost.Move</strong></span> is a library that offers tools to implement
+ those move semantics not only in compilers with <code class="computeroutput"><span class="identifier">rvalue</span>
+ <span class="identifier">references</span></code> but also in compilers
+ conforming to C++03.
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="implementing_movable_classes.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/macros.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/macros.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,94 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> What's the magic behind these macros?</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="construct_forwarding.html" title=" Constructor Forwarding">
+<link rel="next" href="move_iterator.html" title=" Move iterators">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="construct_forwarding.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.macros"></a> What's the magic behind these macros?</h2></div></div></div>
+<p>
+ For compilers with rvalue references <code class="computeroutput"><span class="identifier">BOOST_ENABLE_MOVE_EMULATION</span><span class="special">(</span><span class="identifier">TYPE</span><span class="special">)</span></code>
+ macro is expanded to nothing and <code class="computeroutput"><span class="identifier">BOOST_RV_REF</span></code>
+ to <code class="computeroutput"><span class="identifier">TYPE</span> <span class="special">&&</span></code>
+ so we obtain exactly the same code we've presented in the beginning of this
+ chapter.
+ </p>
+<p>
+ For compilers without rvalue references, <code class="computeroutput"><span class="identifier">BOOST_ENABLE_MOVE_EMULATION</span><span class="special">(</span><span class="identifier">TYPE</span><span class="special">)</span></code>
+ is expaded to a conversion operator that will allow <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span></code> to
+ work:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">operator</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">rv</span><span class="special"><</span><span class="identifier">TYPE</span><span class="special">>&()</span>
+<span class="special">{</span> <span class="keyword">return</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rv</span><span class="special"><</span><span class="identifier">TYPE</span><span class="special">>&</span> <span class="special">>(*</span><span class="keyword">this</span><span class="special">);</span> <span class="special">}</span>
+<span class="keyword">operator</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">rv</span><span class="special"><</span><span class="identifier">TYPE</span><span class="special">>&()</span> <span class="keyword">const</span>
+<span class="special">{</span> <span class="keyword">return</span> <span class="keyword">const</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rv</span><span class="special"><</span><span class="identifier">TYPE</span><span class="special">>&</span> <span class="special">>(*</span><span class="keyword">this</span><span class="special">);</span> <span class="special">}</span>
+</pre>
+<p>
+ and <code class="computeroutput"><span class="identifier">BOOST_RV_REF</span></code> is expanded
+ to <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rv</span><span class="special"><</span><span class="identifier">TYPE</span><span class="special">></span> <span class="special">&</span></code>,
+ a non-instantiable type derived from T, and thus, it's similar to a reference
+ to that class:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">rv</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">T</span>
+<span class="special">{</span>
+ <span class="comment">//Non-instantiable...
+</span> <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">T</span> <span class="special">&</span><span class="identifier">get</span><span class="special">()</span> <span class="special">{</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ In compilers with rvalue references <code class="computeroutput"><span class="identifier">BOOST_FWD_REF</span><span class="special">(</span><span class="identifier">TYPE</span><span class="special">)</span></code>
+ expands to <code class="computeroutput"><span class="identifier">TYPE</span> <span class="special">&&</span></code>
+ and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">forward</span></code> implements perfect forwarding. Otherwise
+ <code class="computeroutput"><span class="identifier">BOOST_FWD_REF</span><span class="special">(</span><span class="identifier">TYPE</span><span class="special">)</span></code> expands
+ to <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">TYPE</span>
+ <span class="special">&</span></code> and <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">forward</span></code>
+ behaviour depends on the argument type:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ If TYPE is boost::rv<T>, then return a non-const reference <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">rv</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span> <span class="special">&</span></code>.
+ </li>
+<li>
+ Otherwise, just returns the input const reference.
+ </li>
+</ul></div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="construct_forwarding.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_iterator.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/movable_only_classes.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/movable_only_classes.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,137 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Movable but Non-Copyable Types</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="composition_inheritance.html" title=" Composition or inheritance">
+<link rel="next" href="move_and_containers.html" title=" Containers and move semantics">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="composition_inheritance.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_and_containers.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.movable_only_classes"></a> Movable but Non-Copyable Types</h2></div></div></div>
+<p>
+ Some types are not amenable to copy semantics but can still be made movable.
+ For example:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="identifier">unique_ptr</span></code> (non-shared, non-copyable
+ ownership)
+ </li>
+<li>
+ A type representing a thread of execution
+ </li>
+<li>
+ A type representing a file descriptor
+ </li>
+</ul></div>
+<p>
+ By making such types movable (though still non-copyable) their utility is tremendously
+ increased. Movable but non-copyable types can be returned by value from factory
+ functions:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="identifier">file_descriptor</span> <span class="identifier">create_file</span><span class="special">(/*</span> <span class="special">...</span> <span class="special">*/);</span>
+<span class="comment">//...
+</span><span class="identifier">file_descriptor</span> <span class="identifier">data_file</span><span class="special">;</span>
+<span class="comment">//...
+</span><span class="identifier">data_file</span> <span class="special">=</span> <span class="identifier">create_file</span><span class="special">(/*</span> <span class="special">...</span> <span class="special">*/);</span> <span class="comment">// No copies!
+</span></pre>
+<p>
+ In the above example, the underlying file handle is passed from object to object,
+ as long as the source <code class="computeroutput"><span class="identifier">file_descriptor</span></code>
+ is an rvalue. At all times, there is still only one underlying file handle,
+ and only one <code class="computeroutput"><span class="identifier">file_descriptor</span></code>
+ owns it at a time.
+ </p>
+<p>
+ To write a movable but not copyable type in portable syntax, you need to follow
+ these simple steps:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Put the following macro in the <span class="bold"><strong>private</strong></span> section:
+ <code class="computeroutput">BOOST_MOVABLE_BUT_NOT_COPYABLE(classname)</code>
+</li>
+<li>
+ Write a move constructor and a move assignment taking the parameter as <code class="computeroutput">BOOST_RV_REF(classname)</code>
+</li>
+</ul></div>
+<p>
+ Here's the definition of <code class="computeroutput"><span class="identifier">file</span> <span class="identifier">descriptor</span></code> using portable syntax:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">move</span><span class="special">/</span><span class="identifier">move</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">stdexcept</span><span class="special">></span>
+
+<span class="keyword">class</span> <span class="identifier">file_descriptor</span>
+<span class="special">{</span>
+ <span class="keyword">int</span> <span class="identifier">os_descr_</span><span class="special">;</span>
+
+ <span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">BOOST_MOVABLE_BUT_NOT_COPYABLE</span><span class="special">(</span><span class="identifier">file_descriptor</span><span class="special">)</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">explicit</span> <span class="identifier">file_descriptor</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="identifier">filename</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="comment">//Constructor
+</span> <span class="special">:</span> <span class="identifier">os_descr_</span><span class="special">(</span><span class="identifier">filename</span> <span class="special">?</span> <span class="identifier">operating_system_open_file</span><span class="special">(</span><span class="identifier">filename</span><span class="special">)</span> <span class="special">:</span> <span class="number">0</span><span class="special">)</span>
+ <span class="special">{</span> <span class="keyword">if</span><span class="special">(!</span><span class="identifier">os_descr_</span><span class="special">)</span> <span class="keyword">throw</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span><span class="special">(</span><span class="string">"file not found"</span><span class="special">);</span> <span class="special">}</span>
+
+ <span class="special">~</span><span class="identifier">file_descriptor</span><span class="special">()</span> <span class="comment">//Destructor
+</span> <span class="special">{</span> <span class="keyword">if</span><span class="special">(!</span><span class="identifier">os_descr_</span><span class="special">)</span> <span class="identifier">operating_system_close_file</span><span class="special">(</span><span class="identifier">os_descr_</span><span class="special">);</span> <span class="special">}</span>
+
+ <span class="identifier">file_descriptor</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">file_descriptor</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span> <span class="comment">// Move ctor
+</span> <span class="special">:</span> <span class="identifier">os_descr_</span><span class="special">(</span><span class="identifier">x</span><span class="special">.</span><span class="identifier">os_descr_</span><span class="special">)</span>
+ <span class="special">{</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">os_descr_</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">file_descriptor</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">file_descriptor</span><span class="special">)</span> <span class="identifier">x</span><span class="special">)</span> <span class="comment">// Move assign
+</span> <span class="special">{</span>
+ <span class="keyword">if</span><span class="special">(!</span><span class="identifier">os_descr_</span><span class="special">)</span> <span class="identifier">operating_system_close_file</span><span class="special">(</span><span class="identifier">os_descr_</span><span class="special">);</span>
+ <span class="identifier">os_descr_</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">os_descr_</span><span class="special">;</span>
+ <span class="identifier">x</span><span class="special">.</span><span class="identifier">os_descr_</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="keyword">bool</span> <span class="identifier">empty</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">os_descr_</span> <span class="special">==</span> <span class="number">0</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="composition_inheritance.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_and_containers.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/move_algorithms.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/move_algorithms.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,101 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Move algorithms</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="move_inserters.html" title=" Move inserters">
+<link rel="next" href="reference.html" title="Reference">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserters.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="reference.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.move_algorithms"></a> Move algorithms</h2></div></div></div>
+<p>
+ The standard library offers several copy-based algorithms. Some of them, like
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">copy</span></code> or <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">uninitialized_copy</span></code>
+ are basic building blocks for containers and other data structures. This library
+ offers move-based functions for those purposes:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">I</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">O</span><span class="special">></span> <span class="identifier">O</span> <span class="identifier">move</span><span class="special">(</span><span class="identifier">I</span><span class="special">,</span> <span class="identifier">I</span><span class="special">,</span> <span class="identifier">O</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">I</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">O</span><span class="special">></span> <span class="identifier">O</span> <span class="identifier">move_backward</span><span class="special">(</span><span class="identifier">I</span><span class="special">,</span> <span class="identifier">I</span><span class="special">,</span> <span class="identifier">O</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">I</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">F</span><span class="special">></span> <span class="identifier">F</span> <span class="identifier">uninitialized_move</span><span class="special">(</span><span class="identifier">I</span><span class="special">,</span> <span class="identifier">I</span><span class="special">,</span> <span class="identifier">F</span><span class="special">);</span>
+<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">I</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">F</span><span class="special">></span> <span class="identifier">F</span> <span class="identifier">uninitialized_copy_or_move</span><span class="special">(</span><span class="identifier">I</span><span class="special">,</span> <span class="identifier">I</span><span class="special">,</span> <span class="identifier">F</span><span class="special">);</span>
+</pre>
+<p>
+ The first 3 are move variations of their equivalent copy algorithms, but copy
+ assignment and copy construction are replaced with move assignment and construction.
+ The last one has the same behaviour as <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">uninitialized_copy</span></code>
+ but since several standand library implementations don't play very well with
+ <code class="computeroutput"><span class="identifier">move_iterator</span></code>s, this version
+ is a portable version for those willing to use move iterators.
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="string">"movable.hpp"</span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cassert</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">aligned_storage</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">ArraySize</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span>
+ <span class="identifier">movable</span> <span class="identifier">movable_array</span><span class="special">[</span><span class="identifier">ArraySize</span><span class="special">];</span>
+ <span class="identifier">movable</span> <span class="identifier">movable_array2</span><span class="special">[</span><span class="identifier">ArraySize</span><span class="special">];</span>
+ <span class="comment">//move
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(&</span><span class="identifier">movable_array2</span><span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">&</span><span class="identifier">movable_array2</span><span class="special">[</span><span class="identifier">ArraySize</span><span class="special">],</span> <span class="special">&</span><span class="identifier">movable_array</span><span class="special">[</span><span class="number">0</span><span class="special">]);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">movable_array2</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">movable_array</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+
+ <span class="comment">//move backward
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_backward</span><span class="special">(&</span><span class="identifier">movable_array</span><span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">&</span><span class="identifier">movable_array</span><span class="special">[</span><span class="identifier">ArraySize</span><span class="special">],</span> <span class="special">&</span><span class="identifier">movable_array2</span><span class="special">[</span><span class="identifier">ArraySize</span><span class="special">]);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">movable_array</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">movable_array2</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+
+ <span class="comment">//uninitialized_move
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">aligned_storage</span><span class="special"><</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">movable</span><span class="special">)*</span><span class="identifier">ArraySize</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment_of</span><span class="special"><</span><span class="identifier">movable</span><span class="special">>::</span><span class="identifier">value</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">storage</span><span class="special">;</span>
+ <span class="identifier">movable</span> <span class="special">*</span><span class="identifier">raw_movable</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">movable</span><span class="special">*>(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">void</span><span class="special">*>(&</span><span class="identifier">storage</span><span class="special">));</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uninitialized_move</span><span class="special">(&</span><span class="identifier">movable_array2</span><span class="special">[</span><span class="number">0</span><span class="special">],</span> <span class="special">&</span><span class="identifier">movable_array2</span><span class="special">[</span><span class="identifier">ArraySize</span><span class="special">],</span> <span class="identifier">raw_movable</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">movable_array2</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">raw_movable</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_inserters.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="reference.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/move_and_containers.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/move_and_containers.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,88 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Containers and move semantics</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="movable_only_classes.html" title=" Movable but Non-Copyable Types">
+<link rel="next" href="construct_forwarding.html" title=" Constructor Forwarding">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="movable_only_classes.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="construct_forwarding.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.move_and_containers"></a> Containers and move semantics</h2></div></div></div>
+<p>
+ Movable but non-copyable types can be safely inserted into containers and movable
+ and copyable types are more efficiently handled if those containers internally
+ use move semantics instead of copy semantics. If the container needs to "change
+ the location" of an element internally (e.g. vector reallocation) it will
+ move the element instead of copying it. <span class="bold"><strong>Boost.Container</strong></span>
+ containers are move-aware so you can write the following:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">container</span><span class="special">/</span><span class="identifier">vector</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">cassert</span><span class="special">></span>
+
+<span class="comment">//Remember: 'file_descriptor' is NOT copyable, only movable
+</span><span class="comment">//but can be returned from functions
+</span><span class="identifier">file_descriptor</span> <span class="identifier">create_file_descriptor</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="identifier">filename</span><span class="special">)</span>
+<span class="special">{</span> <span class="keyword">return</span> <span class="identifier">file_descriptor</span><span class="special">(</span><span class="identifier">filename</span><span class="special">);</span> <span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="comment">//Open a file obtaining its descriptor, the temporary
+</span> <span class="comment">//returned from 'create_file_descriptor' is moved to 'fd'.
+</span> <span class="identifier">file_descriptor</span> <span class="identifier">fd</span> <span class="special">=</span> <span class="identifier">create_file_descriptor</span><span class="special">(</span><span class="string">"filename"</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">fd</span><span class="special">.</span><span class="identifier">empty</span><span class="special">());</span>
+
+ <span class="comment">//Now move fd into a vector
+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="identifier">file_descriptor</span><span class="special">></span> <span class="identifier">v</span><span class="special">;</span>
+ <span class="identifier">v</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(</span><span class="identifier">fd</span><span class="special">));</span>
+
+ <span class="comment">//Check ownership has been transferred
+</span> <span class="identifier">assert</span><span class="special">(</span><span class="identifier">fd</span><span class="special">.</span><span class="identifier">empty</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">v</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">empty</span><span class="special">());</span>
+
+ <span class="comment">//Compilation error if uncommented since file_descriptor is not copyable
+</span> <span class="comment">//and vector copy construction requires value_type's copy constructor:
+</span> <span class="comment">//boost::container::vector<file_descriptor> v2(v);
+</span> <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="movable_only_classes.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="construct_forwarding.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/move_inserters.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/move_inserters.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,141 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Move inserters</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="move_iterator.html" title=" Move iterators">
+<link rel="next" href="move_algorithms.html" title=" Move algorithms">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_algorithms.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.move_inserters"></a> Move inserters</h2></div></div></div>
+<p>
+ Similar to standard insert iterators, it's possible to deal with move insertion
+ in the same way as writing into an array. A special kind of iterator adaptors,
+ called move insert iterators, are provided with this library. With regular
+ iterator classes,
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">while</span> <span class="special">(</span><span class="identifier">first</span> <span class="special">!=</span> <span class="identifier">last</span><span class="special">)</span> <span class="special">*</span><span class="identifier">result</span><span class="special">++</span> <span class="special">=</span> <span class="special">*</span><span class="identifier">first</span><span class="special">++;</span>
+</pre>
+<p>
+ causes a range [first,last) to be copied into a range starting with result.
+ The same code with result being an move insert iterator will move insert corresponding
+ elements into the container. This device allows all of the copying algorithms
+ in the library to work in the move insert mode instead of the regular overwrite
+ mode. This library offers 3 move insert iterators and their helper functions:
+ </p>
+<p>
+ </p>
+<pre class="programlisting"><span class="comment">// Note: C models Container
+</span><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">C</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">back_move_insert_iterator</span><span class="special">;</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">C</span><span class="special">></span>
+<span class="identifier">back_move_insert_iterator</span><span class="special"><</span><span class="identifier">C</span><span class="special">></span> <span class="identifier">back_move_inserter</span><span class="special">(</span><span class="identifier">C</span><span class="special">&</span> <span class="identifier">x</span><span class="special">);</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">C</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">front_move_insert_iterator</span><span class="special">;</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">C</span><span class="special">></span>
+<span class="identifier">front_move_insert_iterator</span><span class="special"><</span><span class="identifier">C</span><span class="special">></span> <span class="identifier">front_move_inserter</span><span class="special">(</span><span class="identifier">C</span><span class="special">&</span> <span class="identifier">x</span><span class="special">);</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">C</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">move_insert_iterator</span><span class="special">;</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">C</span><span class="special">></span>
+<span class="identifier">move_insert_iterator</span><span class="special"><</span><span class="identifier">C</span><span class="special">></span> <span class="identifier">move_inserter</span><span class="special">(</span><span class="identifier">C</span><span class="special">&</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">C</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">it</span><span class="special">);</span>
+</pre>
+<p>
+ A move insert iterator is constructed from a container and possibly one of
+ its iterators pointing to where insertion takes place if it is neither at the
+ beginning nor at the end of the container. Insert iterators satisfy the requirements
+ of output iterators. <code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code> returns the move insert iterator itself. The
+ assignment <code class="computeroutput"><span class="keyword">operator</span><span class="special">=(</span><span class="identifier">T</span><span class="special">&</span> <span class="identifier">x</span><span class="special">)</span></code> is defined on insert iterators to allow writing
+ into them, it inserts x right before where the insert iterator is pointing.
+ In other words, an <code class="computeroutput"><span class="identifier">insert</span> <span class="identifier">iterator</span></code> is like a cursor pointing into the
+ container where the insertion takes place. <code class="computeroutput"><span class="identifier">back_move_iterator</span></code>
+ move inserts elements at the end of a container, <code class="computeroutput"><span class="identifier">front_insert_iterator</span></code>
+ move inserts elements at the beginning of a container, and <code class="computeroutput"><span class="identifier">move_insert_iterator</span></code>
+ move inserts elements where the iterator points to in a container. <code class="computeroutput"><span class="identifier">back_move_inserter</span></code>, <code class="computeroutput"><span class="identifier">front_move_inserter</span></code>,
+ and <code class="computeroutput"><span class="identifier">move_inserter</span></code> are three
+ functions making the insert iterators out of a container. Here's an example
+ of how to use them:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">container</span><span class="special">/</span><span class="identifier">list</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="string">"movable.hpp"</span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cassert</span><span class="special">></span>
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">;</span>
+
+<span class="keyword">typedef</span> <span class="identifier">list</span><span class="special"><</span><span class="identifier">movable</span><span class="special">></span> <span class="identifier">list_t</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">list_t</span><span class="special">::</span><span class="identifier">iterator</span> <span class="identifier">l_iterator</span><span class="special">;</span>
+
+<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">MoveInsertIterator</span><span class="special">></span>
+<span class="keyword">void</span> <span class="identifier">test_move_inserter</span><span class="special">(</span><span class="identifier">list_t</span> <span class="special">&</span><span class="identifier">l2</span><span class="special">,</span> <span class="identifier">MoveInsertIterator</span> <span class="identifier">mit</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="comment">//Create a list with 10 default constructed objects
+</span> <span class="identifier">list</span><span class="special"><</span><span class="identifier">movable</span><span class="special">></span> <span class="identifier">l</span><span class="special">(</span><span class="number">10</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">l</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()-></span><span class="identifier">moved</span><span class="special">());</span>
+ <span class="identifier">l2</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
+
+ <span class="comment">//Move construct
+</span> <span class="keyword">for</span><span class="special">(</span><span class="identifier">l_iterator</span> <span class="identifier">itbeg</span> <span class="special">=</span> <span class="identifier">l</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">itend</span> <span class="special">=</span> <span class="identifier">l</span><span class="special">.</span><span class="identifier">end</span><span class="special">();</span> <span class="identifier">itbeg</span> <span class="special">!=</span> <span class="identifier">itend</span><span class="special">;</span> <span class="special">++</span><span class="identifier">itbeg</span><span class="special">){</span>
+ <span class="special">*</span><span class="identifier">mit</span> <span class="special">=</span> <span class="special">*</span><span class="identifier">itbeg</span><span class="special">;</span>
+ <span class="special">}</span>
+ <span class="comment">//Check size and status
+</span> <span class="identifier">assert</span><span class="special">(</span><span class="identifier">l2</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">l</span><span class="special">.</span><span class="identifier">size</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">l</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()-></span><span class="identifier">moved</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">l2</span><span class="special">.</span><span class="identifier">begin</span><span class="special">()-></span><span class="identifier">moved</span><span class="special">());</span>
+<span class="special">}</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">list_t</span> <span class="identifier">l2</span><span class="special">;</span>
+ <span class="identifier">test_move_inserter</span><span class="special">(</span><span class="identifier">l2</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">back_move_inserter</span><span class="special">(</span><span class="identifier">l2</span><span class="special">));</span>
+ <span class="identifier">test_move_inserter</span><span class="special">(</span><span class="identifier">l2</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">front_move_inserter</span><span class="special">(</span><span class="identifier">l2</span><span class="special">));</span>
+ <span class="identifier">test_move_inserter</span><span class="special">(</span><span class="identifier">l2</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">move_inserter</span><span class="special">(</span><span class="identifier">l2</span><span class="special">,</span> <span class="identifier">l2</span><span class="special">.</span><span class="identifier">end</span><span class="special">()));</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_iterator.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_algorithms.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/move_iterator.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/move_iterator.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,136 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title> Move iterators</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="construct_forwarding.html" title=" Constructor Forwarding">
+<link rel="next" href="move_inserters.html" title=" Move inserters">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="construct_forwarding.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_inserters.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.move_iterator"></a> Move iterators</h2></div></div></div>
+<p>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">Iterator</span><span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">move_iterator</span><span class="special">;</span>
+
+<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">It</span><span class="special">></span>
+<span class="identifier">move_iterator</span><span class="special"><</span><span class="identifier">It</span><span class="special">></span> <span class="identifier">make_move_iterator</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">It</span> <span class="special">&</span><span class="identifier">it</span><span class="special">);</span>
+</pre>
+<p>
+ <code class="computeroutput">move_iterator</code> is an iterator
+ adaptor with the same behavior as the underlying iterator except that its dereference
+ operator implicitly converts the value returned by the underlying iterator's
+ dereference operator to an rvalue reference: <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">move</span><span class="special">(*</span><span class="identifier">underlying_iterator</span><span class="special">)</span></code>
+ It is a read-once iterator, but can have up to random access traversal characteristics.
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">move_iterator</span></code> is very useful
+ because some generic algorithms and container insertion functions can be called
+ with move iterators to replace copying with moving. For example:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="comment">//header file "movable.hpp"
+</span><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">move</span><span class="special">/</span><span class="identifier">move</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+
+<span class="comment">//A movable class
+</span><span class="keyword">class</span> <span class="identifier">movable</span>
+<span class="special">{</span>
+ <span class="identifier">BOOST_MOVABLE_BUT_NOT_COPYABLE</span><span class="special">(</span><span class="identifier">movable</span><span class="special">)</span>
+ <span class="keyword">int</span> <span class="identifier">value_</span><span class="special">;</span>
+
+ <span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">movable</span><span class="special">()</span> <span class="special">:</span> <span class="identifier">value_</span><span class="special">(</span><span class="number">1</span><span class="special">){}</span>
+
+ <span class="comment">//Move constructor and assignment
+</span> <span class="identifier">movable</span><span class="special">(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">movable</span><span class="special">)</span> <span class="identifier">m</span><span class="special">)</span>
+ <span class="special">{</span> <span class="identifier">value_</span> <span class="special">=</span> <span class="identifier">m</span><span class="special">.</span><span class="identifier">value_</span><span class="special">;</span> <span class="identifier">m</span><span class="special">.</span><span class="identifier">value_</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="identifier">movable</span> <span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="identifier">BOOST_RV_REF</span><span class="special">(</span><span class="identifier">movable</span><span class="special">)</span> <span class="identifier">m</span><span class="special">)</span>
+ <span class="special">{</span> <span class="identifier">value_</span> <span class="special">=</span> <span class="identifier">m</span><span class="special">.</span><span class="identifier">value_</span><span class="special">;</span> <span class="identifier">m</span><span class="special">.</span><span class="identifier">value_</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;</span> <span class="special">}</span>
+
+ <span class="keyword">bool</span> <span class="identifier">moved</span><span class="special">()</span> <span class="keyword">const</span> <span class="comment">//Observer
+</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">value_</span> <span class="special">==</span> <span class="number">0</span><span class="special">;</span> <span class="special">}</span>
+<span class="special">};</span>
+
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ <code class="computeroutput"><span class="identifier">movable</span></code> objects can be moved
+ from one container to another using move iterators and insertion and assignment
+ operations.w
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">container</span><span class="special">/</span><span class="identifier">vector</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="string">"movable.hpp"</span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cassert</span><span class="special">></span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">container</span><span class="special">;</span>
+
+ <span class="comment">//Create a vector with 10 default constructed objects
+</span> <span class="identifier">vector</span><span class="special"><</span><span class="identifier">movable</span><span class="special">></span> <span class="identifier">v</span><span class="special">(</span><span class="number">10</span><span class="special">);</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">v</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+
+ <span class="comment">//Move construct all elements in v into v2
+</span> <span class="identifier">vector</span><span class="special"><</span><span class="identifier">movable</span><span class="special">></span> <span class="identifier">v2</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_move_iterator</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">begin</span><span class="special">())</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_move_iterator</span><span class="special">(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">end</span><span class="special">()));</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">v</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">v2</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+
+ <span class="comment">//Now move assign all elements from in v2 back into v
+</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">assign</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_move_iterator</span><span class="special">(</span><span class="identifier">v2</span><span class="special">.</span><span class="identifier">begin</span><span class="special">())</span>
+ <span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_move_iterator</span><span class="special">(</span><span class="identifier">v2</span><span class="special">.</span><span class="identifier">end</span><span class="special">()));</span>
+ <span class="identifier">assert</span><span class="special">(</span><span class="identifier">v2</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+ <span class="identifier">assert</span><span class="special">(!</span><span class="identifier">v</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">moved</span><span class="special">());</span>
+
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="construct_forwarding.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="move_inserters.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: sandbox/move/libs/move/doc/html/move/reference.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/doc/html/move/reference.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,78 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>Reference</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.67.0">
+<link rel="start" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="up" href="../index.html" title="Chapter 1. Boost.Move">
+<link rel="prev" href="move_algorithms.html" title=" Move algorithms">
+<link rel="next" href="../boost/is_movable.html" title="Class template is_movable">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_algorithms.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="../boost/is_movable.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="move.reference"></a>Reference</h2></div></div></div>
+<div class="toc"><dl><dt><span class="section">Header <boost/move/move.hpp></span></dt></dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="header.boost.move.move_hpp"></a>Header <boost/move/move.hpp></h3></div></div></div>
+<pre class="synopsis">
+
+BOOST_MOVABLE_BUT_NOT_COPYABLE(TYPE)
+BOOST_COPYABLE_AND_MOVABLE(TYPE)
+BOOST_RV_REF(TYPE)
+BOOST_COPY_ASSIGN_REF(TYPE)
+BOOST_FWD_REF(TYPE)</pre>
+<pre class="synopsis"><span class="bold"><strong>namespace</strong></span> boost {
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="bold"><strong>class</strong></span> is_movable;
+
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="bold"><strong>struct</strong></span> has_nothrow_move;
+
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> It> <span class="bold"><strong>class</strong></span> move_iterator;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C> <span class="bold"><strong>class</strong></span> back_move_insert_iterator;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C> <span class="bold"><strong>class</strong></span> front_move_insert_iterator;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C> <span class="bold"><strong>class</strong></span> move_insert_iterator;
+
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="bold"><strong>struct</strong></span> has_trivial_destructor_after_move;
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">rvalue_reference</span> move(input_reference);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> T> <span class="type">output_reference</span> forward(input_reference);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> It> <span class="type">move_iterator< It ></span> make_move_iterator(<span class="bold"><strong>const</strong></span> It &);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C> <span class="type">back_move_insert_iterator< C ></span> back_move_inserter(C &);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C>
+ <span class="type">front_move_insert_iterator< C ></span> front_move_inserter(C &);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> C>
+ <span class="type">move_insert_iterator< C ></span> move_inserter(C &, <span class="bold"><strong>typename</strong></span> C::iterator);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move(I, I, O);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> O> <span class="type">O</span> move_backward(I, I, O);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> F> <span class="type">F</span> uninitialized_move(I, I, F);
+ <span class="bold"><strong>template</strong></span><<span class="bold"><strong>typename</strong></span> I, <span class="bold"><strong>typename</strong></span> F> <span class="type">F</span> uninitialized_copy_or_move(I, I, F);
+}</pre>
+</div>
+</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 © 2008 -2009 Ion Gaztañaga<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="move_algorithms.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.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="../boost/is_movable.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/move/libs/move/doc/move.qbk
==============================================================================
--- sandbox/move/libs/move/doc/move.qbk (original)
+++ sandbox/move/libs/move/doc/move.qbk 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -75,10 +75,12 @@
[endsect]
-[section:implementing_movable_classes Implementing movable classes]
+[section:implementing_movable_classes Implementing copyable and movable classes]
[import ../example/doc_clone_ptr.cpp]
+[section:copyable_and_movable_cpp0x Copyable and movable classes in C++0x]
+
Consider a simple handle class that owns a resource and also provides copy semantics
(copy constructor and assignment). For example a `clone_ptr` might own a pointer, and call
`clone()` on it for copying purposes:
@@ -150,38 +152,38 @@
[move_clone_ptr]
-Many aspects of move semantics can be emulated for compilers not supporting `rvalue references`
-and [*Boost.Move] offers tools for that purpose. With [*Boost.Move] we can write code that
-will work both in compilers with rvalue references and those who conform to C++03:
+[endsect]
-[clone_ptr_def]
+[section:copyable_and_movable_cpp03 Copyable and movable classes in portable syntax for both C++03 and C++0x compilers]
-For compilers with rvalue references `BOOST_ENABLE_MOVE_EMULATION(TYPE)` macro is expanded to nothing
-and `BOOST_RV_REF` to `TYPE &&` so we obtain exactly the same code we've presented in the beginning
-of this chapter.
+Many aspects of move semantics can be emulated for compilers not supporting `rvalue references`
+and [*Boost.Move] offers tools for that purpose. With [*Boost.Move] we can write `clone_ptr`
+so that it will work both in compilers with rvalue references and those who conform to C++03.
+You just need to follow these simple steps:
+
+* Put the following macro in the [*private] section:
+ [macroref BOOST_COPYABLE_AND_MOVABLE BOOST_COPYABLE_AND_MOVABLE(classname)]
+* Left copy constructor as is.
+* Write a copy assignment taking the parameter as
+ [macroref BOOST_COPY_ASSIGN_REF BOOST_COPY_ASSIGN_REF(classname)]
+* Write a move constructor and a move assignment taking the parameter as
+ [macroref BOOST_RV_REF BOOST_RV_REF(classname)]
-For compilers without rvalue references, `BOOST_ENABLE_MOVE_EMULATION(TYPE)` is expaded to a
-conversion operator that will allow `boost::move` to work:
+Let's see how are applied to `clone_ptr`:
-[c++]
+[clone_ptr_def]
+
+[endsect]
- operator boost::rv<TYPE>&()
- { return static_cast<boost::rv<TYPE>& >(*this); }
+[*Question]: What about types that don't own resources? (E.g. `std::complex`?)
-and `BOOST_RV_REF` is expanded to `boost::rv<TYPE> &`, a non-instantiable type derived from T, and
-thus, it's similar to a reference to that class:
+No work needs to be done in that case. The copy constructor is already optimal.
-[c++]
+[endsect]
- template <class T>
- class rv : public T
- {
- //Non-instantiable...
- public:
- T &get() { return *this; }
- };
+[section:composition_inheritance Composition or inheritance]
-For classes made up of other classes (via either containment or inheritance), the move constructor
+For classes made up of other classes (via either composition or inheritance), the move constructor
and move assignment can be easily coded using the `boost::move` function:
[clone_ptr_base_derived]
@@ -198,10 +200,6 @@
semantics designed to prevent accidently moving twice from some named variable. All moves occur
explicitly.
-[*Question]: What about types that don't own resources? (E.g. `std::complex`?)
-
-No work needs to be done in that case. The copy constructor is already optimal.
-
[endsect]
[section:movable_only_classes Movable but Non-Copyable Types]
@@ -219,21 +217,25 @@
file_descriptor create_file(/* ... */);
//...
- file_descriptor data_file = create_file(/* ... */); // No copies!
+ file_descriptor data_file;
+ //...
+ data_file = create_file(/* ... */); // No copies!
In the above example, the underlying file handle is passed from object to object, as long
as the source `file_descriptor` is an rvalue. At all times, there is still only one underlying file
-handle, and only one `file_descriptor` owns it at a time. Here's the definition of `file descriptor`:
+handle, and only one `file_descriptor` owns it at a time.
-[import ../example/doc_file_descriptor.cpp]
-[file_descriptor_def]
+To write a movable but not copyable type in portable syntax, you need to follow these simple steps:
-Movable but non-copyable types can also safely be put into containers if those containers
-are aware of move semantics. If the container needs to "copy" an element internally
-(e.g. vector reallocation) it will move the element instead of copying it.
-[*Boost.Container] containers are move-aware:
+* Put the following macro in the [*private] section:
+ [macroref BOOST_MOVABLE_BUT_NOT_COPYABLE BOOST_MOVABLE_BUT_NOT_COPYABLE(classname)]
+* Write a move constructor and a move assignment taking the parameter as
+ [macroref BOOST_RV_REF BOOST_RV_REF(classname)]
-[file_descriptor_example]
+Here's the definition of `file descriptor` using portable syntax:
+
+[import ../example/doc_file_descriptor.cpp]
+[file_descriptor_def]
[/
/Many standard algorithms benefit from moving elements of the sequence as opposed to
@@ -264,6 +266,19 @@
[endsect]
+[section:move_and_containers Containers and move semantics]
+
+Movable but non-copyable types can be safely inserted into containers and
+movable and copyable types are more efficiently handled if those containers
+internally use move semantics instead of copy semantics.
+If the container needs to "change the location" of an element
+internally (e.g. vector reallocation) it will move the element instead of copying it.
+[*Boost.Container] containers are move-aware so you can write the following:
+
+[file_descriptor_example]
+
+[endsect]
+
[section:construct_forwarding Constructor Forwarding]
Consider writing a generic factory function that returns an object for a newly
@@ -292,14 +307,6 @@
[import ../example/doc_construct_forward.cpp]
[construct_forward_example]
-In compilers wit rvalue references `BOOST_FWD_REF(TYPE)` expands to `TYPE &&` and
-`boost::forward` implements perfect forwarding. Otherwise
-`BOOST_FWD_REF(TYPE)` expands to `const TYPE &` and `boost::forward`
-behaviour depends on the argument type:
-
-* If TYPE is boost::rv<T>, then return a non-const reference `boost::rv<T> &`.
-* Otherwise, just returns the input const reference.
-
Constructor forwarding comes handful to implement placement insertion in containers with
just N overloads if the implementor accepts the limitations of this type of forwarding for
C++03 compilers. In compilers with rvalue references perfect forwarding is achieved.
Modified: sandbox/move/libs/move/example/doc_clone_ptr.cpp
==============================================================================
--- sandbox/move/libs/move/example/doc_clone_ptr.cpp (original)
+++ sandbox/move/libs/move/example/doc_clone_ptr.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -9,23 +9,24 @@
//
//////////////////////////////////////////////////////////////////////////////
#include <boost/move/move.hpp>
-#include <utility>
//[clone_ptr_base_derived
class Base
{
- public:
- // Compiler-generated copy constructor and assignment
+ BOOST_COPYABLE_AND_MOVABLE(Base)
+ public:
Base(){}
- // move semantics
- BOOST_ENABLE_MOVE_EMULATION(Base)
+ // Compiler-generated copy constructor...
Base(BOOST_RV_REF(Base) x) {/**/} // Move ctor
Base& operator=(BOOST_RV_REF(Base) x)
{/**/ return *this;} // Move assign
+
+ Base& operator=(BOOST_COPY_ASSIGN_REF(Base) x)
+ {/**/ return *this;} // Copy assign
virtual Base *clone() const
{ return new Base(*this); }
@@ -33,31 +34,31 @@
class Member
{
+ BOOST_COPYABLE_AND_MOVABLE(Member)
+
public:
Member(){}
- // Compiler-generated copy constructor and assignment
-
- // move semantics
- BOOST_ENABLE_MOVE_EMULATION(Member)
+ // Compiler-generated copy constructor...
Member(BOOST_RV_REF(Member)) {/**/} // Move ctor
Member &operator=(BOOST_RV_REF(Member)) // Move assign
{/**/ return *this; }
+
+ Member &operator=(BOOST_COPY_ASSIGN_REF(Member)) // Copy assign
+ {/**/ return *this; }
};
class Derived : public Base
{
+ BOOST_COPYABLE_AND_MOVABLE(Derived)
Member mem_;
public:
- // Compiler-generated copy constructor and assignment
-
Derived(){}
- // move semantics
- BOOST_ENABLE_MOVE_EMULATION(Derived)
+ // Compiler-generated copy constructor...
Derived(BOOST_RV_REF(Derived) x) // Move ctor
: Base(boost::move(static_cast<Base&>(x))),
@@ -69,6 +70,13 @@
mem_ = boost::move(x.mem_);
return *this;
}
+
+ Derived& operator=(BOOST_COPY_ASSIGN_REF(Derived) x) // Move assign
+ {
+ Base::operator=(static_cast<const Base&>(x));
+ mem_ = x.mem_;
+ return *this;
+ }
// ...
};
//]
@@ -77,25 +85,24 @@
template <class T>
class clone_ptr
{
- //<-
private:
+ // Mark this class copyable and movable
+ BOOST_COPYABLE_AND_MOVABLE(clone_ptr)
T* ptr;
public:
- // construction
+ // Construction
explicit clone_ptr(T* p = 0) : ptr(p) {}
- // destruction
+ // Destruction
~clone_ptr() { delete ptr; }
-
- // copy semantics
- clone_ptr(const clone_ptr& p)
+
+ clone_ptr(const clone_ptr& p) // Copy constructor (as usual)
: ptr(p.ptr ? p.ptr->clone() : 0) {}
- clone_ptr& operator=(const clone_ptr& p)
+ clone_ptr& operator=(BOOST_COPY_ASSIGN_REF(clone_ptr) p) // Copy assignment
{
- if (this != &p)
- {
+ if (this != &p){
T *p = p.ptr ? p.ptr->clone() : 0;
delete ptr;
ptr = p;
@@ -103,19 +110,14 @@
return *this;
}
- //->
- // Same as before ...
-
- // move semantics
- BOOST_ENABLE_MOVE_EMULATION(clone_ptr)
-
- clone_ptr(BOOST_RV_REF(clone_ptr) p)
+ //Move semantics...
+ clone_ptr(BOOST_RV_REF(clone_ptr) p) //Move constructor
: ptr(p.ptr) { p.ptr = 0; }
- clone_ptr& operator=(BOOST_RV_REF(clone_ptr) p)
+ clone_ptr& operator=(BOOST_RV_REF(clone_ptr) p) //Move assignment
{
- std::swap(ptr, p.ptr);
- delete p.ptr;
+ delete ptr;
+ ptr = p.ptr;
p.ptr = 0;
return *this;
}
@@ -136,6 +138,7 @@
clone_ptr<Base> p1(new Derived());
// ...
clone_ptr<Base> p2 = boost::move(p1); // p2 now owns the pointer instead of p1
+ p2 = clone_ptr<Base>(new Derived()); // temporary is moved to p2
}
//]
//[clone_ptr_move_derived
Modified: sandbox/move/libs/move/example/doc_construct_forward.cpp
==============================================================================
--- sandbox/move/libs/move/example/doc_construct_forward.cpp (original)
+++ sandbox/move/libs/move/example/doc_construct_forward.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -31,8 +31,9 @@
class movable_test
{
+ // move semantics
+ BOOST_COPYABLE_AND_MOVABLE(movable_test)
public:
- BOOST_ENABLE_MOVE_EMULATION(movable_test)
movable_test()
{ std::cout << "movable_test()" << std::endl; }
@@ -48,6 +49,14 @@
movable_test(BOOST_RV_REF(movable_test), BOOST_RV_REF(movable_test))
{ std::cout << "movable_test(BOOST_RV_REF(movable_test), BOOST_RV_REF(movable_test))" << std::endl; }
+
+ movable_test &operator=(BOOST_RV_REF(movable_test))
+ { std::cout << "movable_test & operator=(BOOST_RV_REF(movable_test))" << std::endl;
+ return *this; }
+
+ movable_test &operator=(BOOST_COPY_ASSIGN_REF(movable_test))
+ { std::cout << "movable_test & operator=(BOOST_COPY_ASSIGN_REF(movable_test))" << std::endl;
+ return *this; }
};
//1 argument
Modified: sandbox/move/libs/move/example/doc_file_descriptor.cpp
==============================================================================
--- sandbox/move/libs/move/example/doc_file_descriptor.cpp (original)
+++ sandbox/move/libs/move/example/doc_file_descriptor.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -1,6 +1,6 @@
//////////////////////////////////////////////////////////////////////////////
//
-// (C) Copyright Ion Gaztanaga 2009.
+// (C) Copyright Ion Gaztanaga 2008-2009.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
@@ -27,20 +27,17 @@
//->
int os_descr_;
- file_descriptor(file_descriptor &);
- file_descriptor & operator=(file_descriptor &);
+ private:
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(file_descriptor)
public:
- explicit file_descriptor(const char *filename = 0)
+ explicit file_descriptor(const char *filename = 0) //Constructor
: os_descr_(filename ? operating_system_open_file(filename) : 0)
{ if(!os_descr_) throw std::runtime_error("file not found"); }
- ~file_descriptor()
+ ~file_descriptor() //Destructor
{ if(!os_descr_) operating_system_close_file(os_descr_); }
- // move semantics
- BOOST_ENABLE_MOVE_EMULATION(file_descriptor)
-
file_descriptor(BOOST_RV_REF(file_descriptor) x) // Move ctor
: os_descr_(x.os_descr_)
{ x.os_descr_ = 0; }
@@ -62,17 +59,19 @@
#include <boost/container/vector.hpp>
#include <cassert>
+//Remember: 'file_descriptor' is NOT copyable, but it
+//can be returned from functions thanks to move semantics
file_descriptor create_file_descriptor(const char *filename)
{ return file_descriptor(filename); }
int main()
{
- //Open a file obtaining its descriptor. The file_descriptor
- //can be returned from factory functions without any copy
+ //Open a file obtaining its descriptor, the temporary
+ //returned from 'create_file_descriptor' is moved to 'fd'.
file_descriptor fd = create_file_descriptor("filename");
assert(!fd.empty());
- //Move into a vector
+ //Now move fd into a vector
boost::container::vector<file_descriptor> v;
v.push_back(boost::move(fd));
@@ -80,7 +79,8 @@
assert(fd.empty());
assert(!v[0].empty());
- //Compilation error if uncommented, file_descriptor is not copyable:
+ //Compilation error if uncommented since file_descriptor is not copyable
+ //and vector copy construction requires value_type's copy constructor:
//boost::container::vector<file_descriptor> v2(v);
return 0;
}
Modified: sandbox/move/libs/move/example/movable.hpp
==============================================================================
--- sandbox/move/libs/move/example/movable.hpp (original)
+++ sandbox/move/libs/move/example/movable.hpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -18,15 +18,10 @@
//A movable class
class movable
{
- //Non-copyable
- movable(movable &);
- movable & operator=(movable &);
-
+ BOOST_MOVABLE_BUT_NOT_COPYABLE(movable)
int value_;
public:
- BOOST_ENABLE_MOVE_EMULATION(movable)
-
movable() : value_(1){}
//Move constructor and assignment
Added: sandbox/move/libs/move/index.html
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/index.html 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,14 @@
+<!--
+Copyright 2008-2009 Ion Gaztanaga
+Distributed under the Boost Software License, Version 1.0. (See accompanying
+file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+-->
+<html>
+<head>
+<meta http-equiv="refresh" content="0; URL=.doc/html/move.html">
+</head>
+<body>
+Automatic redirection failed, please go to
+./doc/html/container.html
+</body>
+</html>
Added: sandbox/move/libs/move/proj/vc7ide/copy_move_optimization.vcproj
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/proj/vc7ide/copy_move_optimization.vcproj 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="copy_move_optimization_test"
+ ProjectGUID="{C8AD2618-79EB-8612-42FE-2A3AC9667A13}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="../../Bin/Win32/Debug"
+ IntermediateDirectory="Debug/copy_move_optimization_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ DisableLanguageExtensions="FALSE"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/copy_move_optimization_test_d.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/copy_move_optimization_test.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ FixedBaseAddress="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="../../Bin/Win32/Release"
+ IntermediateDirectory="Release/copy_move_optimization_test"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../../.."
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;BOOST_DATE_TIME_NO_LIB"
+ RuntimeLibrary="2"
+ TreatWChar_tAsBuiltInType="TRUE"
+ ForceConformanceInForLoopScope="FALSE"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="winmm.lib"
+ OutputFile="$(OutDir)/copy_move_optimization_test.exe"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="../../../../stage/lib"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{818563C3-6640-0A65-55CB-202E5BAD7FAF}">
+ <File
+ RelativePath="..\..\test\copy_move_optimization.cpp">
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/move/libs/move/test/copy_move_optimization.cpp
==============================================================================
--- (empty file)
+++ sandbox/move/libs/move/test/copy_move_optimization.cpp 2009-08-12 04:41:03 EDT (Wed, 12 Aug 2009)
@@ -0,0 +1,93 @@
+//We need to declare:
+//
+//2 conversions: rv<T> & and const rv<T> &
+//1 rv<T> & constructor: move constructor
+//1 const rv<T> & constructor: copy constructor
+//1 T & constructor: copy constructor
+//
+//Optimization:
+//Since RVO is better than move-construction,
+//avoid copy constructor overloading.
+#include <boost/move/move.hpp>
+#include <iostream>
+
+bool moved = false;
+
+class obj
+{
+ BOOST_COPYABLE_AND_MOVABLE(obj)
+ public:
+
+ obj()
+ {
+ std::cout << "constructing obj" << "\n";
+ }
+
+ ~obj()
+ {}
+
+ obj(BOOST_COPY_ASSIGN_REF(obj) trule)
+ {
+ std::cout << "copy construct from const obj" << "\n";
+ }
+
+ // copy construct from movable object (non-const rvalue, explicitly moved lvalue)
+ obj(BOOST_RV_REF(obj) trule)
+ {
+ std::cout << "move construct from movable rvalue" << "\n";
+ }
+
+ obj& operator =(BOOST_COPY_ASSIGN_REF(obj) trule)
+ {
+ std::cout << "copy assign from const obj" << "\n";
+ return *this;
+ }
+
+ obj& operator =(BOOST_RV_REF(obj) trule)
+ {
+ std::cout << "move assign from movable rvalue" << "\n";
+ return *this;
+ }
+};
+
+
+obj rvalue_func() { return obj(); }
+const obj const_rvalue_func() { return obj(); }
+obj& lvalue_func() { static obj o; return o; }
+const obj& const_lvalue_func() { static obj o; return o; }
+
+int main()
+{
+ {
+ obj o1(rvalue_func());
+ obj o2 = const_rvalue_func();
+ obj o3 = lvalue_func();
+ obj o4 = const_lvalue_func();
+ // can't explicitly move temporaries
+ //obj o5 = boost::move(rvalue_func());
+ obj o6 = boost::move(const_rvalue_func());
+ obj o7 = boost::move(lvalue_func());
+ obj o8 = boost::move(const_lvalue_func());
+
+ obj o;
+ o = rvalue_func();
+ o = const_rvalue_func();
+ o = lvalue_func();
+ o = const_lvalue_func();
+ // can't explicitly move temporaries
+ //o = boost::move(rvalue_func());
+ o = boost::move(const_rvalue_func());
+ o = boost::move(lvalue_func());
+ o = boost::move(const_lvalue_func());
+ }
+
+ return 0;
+}
+
+//We need to declare:
+//
+//2 conversions: rv<T> & and const rv<T> &
+//1 rv<T> & constructor: move constructor
+//1 const rv<T> & constructor: copy constructor
+//1 T & constructor: copy constructor
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk