From 0653ca2678e68d0710e411d714dfdf8a4e5cdd71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Sat, 23 Jun 2007 13:09:46 +0000 Subject: [PATCH] no message [SVN r38076] --- doc/intrusive.qbk | 112 +++++--- example/Jamfile.v2 | 4 +- example/doc_clone_from.cpp | 8 +- ...ying.cpp => doc_erasing_and_disposing.cpp} | 16 +- example/doc_rbtree_algorithms.cpp | 1 + perf/perf_list.cpp | 12 +- .../vc7ide/_intrusivelib/_intrusivelib.vcproj | 6 + proj/vc7ide/list/list.vcproj | 266 +++++++++--------- .../unordered_multiset.vcproj | 263 ++++++++--------- test/Jamfile.v2 | 2 +- test/common_functors.hpp | 2 +- test/list_test.cpp | 35 +-- test/multiset_test.cpp | 8 +- test/set_test.cpp | 7 +- test/slist_test.cpp | 6 +- test/test_container.hpp | 2 +- test/unordered_multiset_test.cpp | 17 +- test/unordered_set_test.cpp | 15 +- 18 files changed, 412 insertions(+), 370 deletions(-) rename example/{doc_erasing_and_destroying.cpp => doc_erasing_and_disposing.cpp} (79%) diff --git a/doc/intrusive.qbk b/doc/intrusive.qbk index e2d1452..2165789 100644 --- a/doc/intrusive.qbk +++ b/doc/intrusive.qbk @@ -1,6 +1,6 @@ -[library Intrusive +[library Boost.Intrusive [quickbook 1.3] - [version 2007-05-03] + [version 2007-06-23] [authors [Krzikalla, Olaf], [Gaztañaga, Ion]] [copyright 2005 Olaf Krzikalla, 2006-2007 Ion Gaztañaga] [purpose Intrusive containers] @@ -17,7 +17,7 @@ [*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] +that offer [link boost_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 @@ -172,7 +172,7 @@ Intrusive containers have also downsides: 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 they rather the origina object +* In intrusive containers you don't store a copy of an object, [*but they 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 @@ -183,14 +183,14 @@ Intrusive containers have also downsides: * 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 destroyed before is erased from the container. + 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 have 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. + [link boost_intrusive.clone_from Cloning [*Boost.Intrusive] containers] section for more information. * Analyzing thread-safety of a program that uses containers is harder with intrusive containers, becuase the container might be modified indirectly without an explicitly call to a container member. @@ -214,18 +214,12 @@ Intrusive containers have also downsides: ] For a performance comparison between Intrusive and Non-intrusive containers see -[link intrusive.performance Performance] section. +[link boost_intrusive.performance Performance] section. [endsect] [endsect] -[/ -[section:quick_guide Quick guide for the impatient] - -[endsect] -] - [section:usage How to use Boost.Intrusive] If you plan to use a class in an intrusive container, you have to make some decisions @@ -265,11 +259,11 @@ three template arguments: * The second template argument controls the linking policy. [*Boost.Intrusive] currently supports 3 policies: `normal_link`, `safe_link`, `auto_unlink`. More about these in the sections - [link intrusive.safe_hook Safe hooks] and [link intrusive.auto_unlink_hooks Auto-unlink hooks] + [link boost_intrusive.safe_hook Safe hooks] and [link boost_intrusive.auto_unlink_hooks Auto-unlink hooks] * The third template argument 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] + More about this in the section titled [link boost_intrusive.using_smart_pointers Using smart pointers with Boost.Intrusive containers] Example: @@ -413,10 +407,10 @@ Even if the interface of [classref boost::intrusive::list list] is similar to 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, +* When the container gets disposed before the object, the object is not disposed, so you have to be careful to avoid resource leaks. -* When the object is destroyed before the container, your program is likely to crash, +* When the object is disposed before the container, your program is likely to crash, because the container contains a pointer to an non-existing object. [endsect] @@ -556,6 +550,8 @@ Apart from that, [*Boost.Intrusive] offers additional features: [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: @@ -585,12 +581,28 @@ If the object is not actually inserted in a container, the hook is the default state and if it's inserted in a container, the hook is not in the default state. -[*Note:] All assertions raised by [*Boost-Intrusive] hooks and containers, 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`. +[endsect] -(to-do example!!) +[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 for all the libraries, so the user might +want to redefine safe-mode assertions without modifying `BOOST_ASSERT`. This can +be achieved redefining the following macros: + +* `BOOST_INTRUSIVE_SAFE_MODE_CONTAINER_INSERTION_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_MODE_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, it will be defaulted to `BOOST_ASSERT`. + +[endsect] [endsect] @@ -608,7 +620,7 @@ implemented using `BOOST_ASSERT`, which can be configured by the user. See These hooks have exactly the same size overhead as their analogue non auto-unlinking hooks, but they have a restriction: they can only be used with -[link intrusive.presenting_containers non-constant time containers]. +[link boost_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. @@ -989,7 +1001,7 @@ equality functor for those values: Each hashed container needs [*its own bucket array]. 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 +disposed [*after] the container using it is disposed, otherwise, the result is undefined. [section:unordered_set_unordered_multiset_performance unordered_set and unordered_multiset performance notes] @@ -1217,7 +1229,7 @@ For more information about advanced lookup and insertion functions see [endsect] -[section:erasing_and_destroying Erasing and destroying values from Boost.Intrusive containers] +[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 @@ -1237,20 +1249,27 @@ object that will be called after the element has been erased from the container. [c++] - template - void remove_and_destroy_if(Pred pred, Destroyer destroyer) + template + void remove_and_dispose_if(Pred pred, Disposer disposer) -This function can be used to efficiently remove and destroy elements. `remove_and_destroy_if` -will call "destroyer" function object for every removed element. [classref boost::intrusive::list list] offers -more functions taking a destroyer function object as argument, like `erase_and_destroy`, `clear_and_destroy`, -`remove_and_destroy`... Let's see an small example: +With this function the user can efficiently remove and destroy elements if the disposer +function destroys an object: `remove_and_dispose_if` +will call "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`... -[import ../example/doc_erasing_and_destroying.cpp] -[doc_erasing_and_destroying] +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 an small example: -All [*Boost.Intrusive] containers offer these "erase + destroy" additional members for all functions +[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] @@ -1269,8 +1288,8 @@ Apart from the container to be cloned, `clone_from` takes two function objects a [c++] - template - void clone_from(const list &src, Cloner cloner, Destroyer destroyer); + template + void clone_from(const list &src, Cloner cloner, Disposer disposer); This function will make `*this` a clone of `src`. Let's explain the arguments: @@ -1278,14 +1297,14 @@ This function will make `*this` a clone of `src`. Let's explain the arguments: * 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 destroy `value_type` objects. It's used first - to empty the container before cloning and to erase the elements if an exception is thrown. +* 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 clears and destroys all the elements from *this using the destroyer function object. +* First clears and disposes all the elements from *this using the disposer function object. * After that 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 destroyed using the destroyer 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's an example of `clone_from`: @@ -1575,7 +1594,7 @@ before explaining the customization options of [*Boost.Intrusive]. [section:node_algorithms Node algorithms with custom NodeTraits] -As explained in the [link intrusive.concepts Concepts] section, [*Boost.Intrusive] +As explained in the [link boost_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 @@ -1756,7 +1775,7 @@ For a complete rbtree of functions see [section:value_traits Containers with custom ValueTraits] -As explained in the [link intrusive.concepts Concepts] section, [*Boost.Intrusive] +As explained in the [link boost_intrusive.concepts Concepts] section, [*Boost.Intrusive] containers are templatized using a `ValueTraits` parameter. This parameter 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, @@ -1800,7 +1819,7 @@ Let's explain each type and function: * ['node_traits]: The node configuration that it's needed by node algorithms. These node traits and algorithms are - described in the previous chapter: [link intrusive.node_algorithms Nodes Algorithms]. + described in the previous chapter: [link boost_intrusive.node_algorithms Nodes Algorithms]. * If my_value_traits is meant to be used with [classref boost::intrusive::slist slist], `node_traits` should follow @@ -2012,7 +2031,7 @@ to have more than one hook per user type opens the possibility to implement mult containers on top of [*Boost.Intrusive]. [*Boost.Intrusive] containers implement advanced functions taking function objects -as arguments (`clone_from`, `erase_and_destroy`, `insert_check`...). These +as arguments (`clone_from`, `erase_and_dispose`, `insert_check`...). These functions come handy when implementing non-intrusive containers (for example, STL-like containers) on top of intrusive containers. @@ -2397,7 +2416,8 @@ all the objects to be inserted in intrusive containers in containers like `std:: * Intel 9.1/WinXP * GCC 4.1.2/Linux * Codewarrior 9.4/WinXP -* GCC 3.4.3 Solaris 11 +* GCC 3.4.3/Solaris 11 +* GCC 4.0/Mac Os 10.4.1 [endsect] @@ -2428,7 +2448,7 @@ helpful discussions. [endsect] -[xinclude intrusive_doxygen.boostbook] +[xinclude intrusive_doxygen.xml] [section:license_notices License notices] diff --git a/example/Jamfile.v2 b/example/Jamfile.v2 index 140fd77..75ef95a 100644 --- a/example/Jamfile.v2 +++ b/example/Jamfile.v2 @@ -1,4 +1,4 @@ -# Boost Intrusive Library Documentation test Jamfile +# Boost Intrusive Library Example Jamfile # (C) Copyright Ion Gaztaņaga 2006-2007. # Use, modification and distribution are subject to the @@ -31,4 +31,4 @@ rule test_all return $(all_rules) ; } -test-suite intrusive_doc : [ test_all r ] ; \ No newline at end of file +test-suite intrusive_example : [ test_all r ] : multi ; \ No newline at end of file diff --git a/example/doc_clone_from.cpp b/example/doc_clone_from.cpp index c1351c1..e1da728 100644 --- a/example/doc_clone_from.cpp +++ b/example/doc_clone_from.cpp @@ -38,8 +38,8 @@ class new_cloner { return new my_class(clone_this); } }; -//The destroyer object function -class delete_destroyer +//The disposer object function +class delete_disposer { public: void operator()(my_class *delete_this) @@ -61,7 +61,7 @@ int main() //Now clone "list" using "new" and "delete" object functions my_class_list cloned_list; - cloned_list.clone_from(list, new_cloner(), delete_destroyer()); + cloned_list.clone_from(list, new_cloner(), delete_disposer()); //Test that both are equal if(cloned_list != list){ @@ -72,7 +72,7 @@ int main() } //Don't forget to free the memory from the second list - cloned_list.clear_and_destroy(delete_destroyer()); + cloned_list.clear_and_dispose(delete_disposer()); return 0; } //] diff --git a/example/doc_erasing_and_destroying.cpp b/example/doc_erasing_and_disposing.cpp similarity index 79% rename from example/doc_erasing_and_destroying.cpp rename to example/doc_erasing_and_disposing.cpp index a6759e0..171c517 100644 --- a/example/doc_erasing_and_destroying.cpp +++ b/example/doc_erasing_and_disposing.cpp @@ -9,7 +9,7 @@ // See http://www.boost.org/libs/intrusive for documentation. // ///////////////////////////////////////////////////////////////////////////// -//[doc_erasing_and_destroying +//[doc_erasing_and_disposing #include //A class that can be inserted in an intrusive list @@ -36,8 +36,8 @@ class is_even { return 0 == (c.int_ % 2); } }; -//The destroyer object function -class delete_destroyer +//The disposer object function +class delete_disposer { public: void operator()(my_class *delete_this) @@ -57,17 +57,17 @@ int main() list.push_back(*new my_class(i)); } - //Now use remove_and_destroy_if to erase and delete the objects - list.remove_and_destroy_if(is_even(), delete_destroyer()); + //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_destroy(delete_destroyer()); + list.clear_and_dispose(delete_disposer()); throw; } - //Destroy remaining elements - list.erase_and_destroy(list.begin(), list.end(), delete_destroyer()); + //Dispose remaining elements + list.erase_and_dispose(list.begin(), list.end(), delete_disposer()); return 0; } //] diff --git a/example/doc_rbtree_algorithms.cpp b/example/doc_rbtree_algorithms.cpp index d51d26d..7867668 100644 --- a/example/doc_rbtree_algorithms.cpp +++ b/example/doc_rbtree_algorithms.cpp @@ -79,4 +79,5 @@ int main() algo::erase(&header, n); return 0; } + //] diff --git a/perf/perf_list.cpp b/perf/perf_list.cpp index 6118eb3..2f542bb 100644 --- a/perf/perf_list.cpp +++ b/perf/perf_list.cpp @@ -93,7 +93,7 @@ void test_intrusive_list_push_back() 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 + //Elements are disposed in vector's destructor //] } ptime tend = microsec_clock::universal_time(); @@ -111,7 +111,7 @@ void test_std_list_push_back() 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 + //Elements unlinked and disposed in stdlist's destructor //] } ptime tend = microsec_clock::universal_time(); @@ -132,8 +132,8 @@ void test_compact_std_ptrlist_push_back() 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 + //Pointers to elements unlinked and disposed in stdptrlist's destructor + //Elements disposed in vector's destructor //] } ptime tend = microsec_clock::universal_time(); @@ -155,8 +155,8 @@ void test_disperse_std_ptrlist_push_back() 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 + //Pointers to elements unlinked and disposed in stdptrlist's destructor + //Elements unlinked and disposed in stdlist's destructor //] } ptime tend = microsec_clock::universal_time(); diff --git a/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj b/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj index 1635d52..881e363 100644 --- a/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj +++ b/proj/vc7ide/_intrusivelib/_intrusivelib.vcproj @@ -159,6 +159,9 @@ + + @@ -174,6 +177,9 @@ + + diff --git a/proj/vc7ide/list/list.vcproj b/proj/vc7ide/list/list.vcproj index 5c7c5d4..62f4492 100644 --- a/proj/vc7ide/list/list.vcproj +++ b/proj/vc7ide/list/list.vcproj @@ -1,135 +1,137 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ProjectType="Visual C++" + Version="7.10" + Name="list" + ProjectGUID="{977B61B4-9968-497C-9F0B-24A8145473B8}" + RootNamespace="list" + Keyword="Win32Proj"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj b/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj index 1730eb9..6017680 100644 --- a/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj +++ b/proj/vc7ide/unordered_multiset/unordered_multiset.vcproj @@ -1,134 +1,135 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ProjectType="Visual C++" + Version="7.10" + Name="unordered_multiset" + ProjectGUID="{9101EE76-BB6C-2C91-F4B7-A9F3B9490279}" + Keyword="Win32Proj"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index c30b404..827bc6e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -31,4 +31,4 @@ rule test_all return $(all_rules) ; } -test-suite intrusive_test : [ test_all r ] ; +test-suite intrusive_test : [ test_all r ] : multi ; diff --git a/test/common_functors.hpp b/test/common_functors.hpp index 7097f38..3476b22 100644 --- a/test/common_functors.hpp +++ b/test/common_functors.hpp @@ -19,7 +19,7 @@ namespace boost { namespace intrusive { namespace test { -class delete_destroyer +class delete_disposer { public: template diff --git a/test/list_test.cpp b/test/list_test.cpp index 096c0a1..1042159 100644 --- a/test/list_test.cpp +++ b/test/list_test.cpp @@ -10,6 +10,8 @@ // See http://www.boost.org/libs/intrusive for documentation. // ///////////////////////////////////////////////////////////////////////////// + +#include #include #include #include "itestvalue.hpp" @@ -269,9 +271,9 @@ void test_list list_type testlist1 (&values[0], &values[0] + values.size()); list_type testlist2; - testlist2.clone_from(testlist1, test::new_cloner(), test::delete_destroyer()); + testlist2.clone_from(testlist1, test::new_cloner(), test::delete_disposer()); BOOST_TEST (testlist2 == testlist1); - testlist2.clear_and_destroy(test::delete_destroyer()); + testlist2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testlist2.empty()); } @@ -321,23 +323,23 @@ class test_main_template return 0; } }; -/* + //Explicit instantiations of non-counted classes -template class boost::intrusive::list; -template class boost::intrusive::list; -template class boost::intrusive::list; -template class boost::intrusive::list; -template class boost::intrusive::list; -template class boost::intrusive::list; -template class boost::intrusive::list; -template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; //Explicit instantiation of counted classes -template class boost::intrusive::list; -template class boost::intrusive::list; -template class boost::intrusive::list; -template class boost::intrusive::list; -*/ +//template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; +//template class boost::intrusive::list; + int main( int, char* [] ) { test_main_template()(); @@ -346,3 +348,4 @@ int main( int, char* [] ) test_main_template, true>()(); return boost::report_errors(); } +#include diff --git a/test/multiset_test.cpp b/test/multiset_test.cpp index 517b672..c919008 100644 --- a/test/multiset_test.cpp +++ b/test/multiset_test.cpp @@ -10,7 +10,7 @@ // See http://www.boost.org/libs/intrusive for documentation. // ///////////////////////////////////////////////////////////////////////////// - +#include #include #include #include "itestvalue.hpp" @@ -201,9 +201,9 @@ void test_multiset multiset_type testmultiset1 (&values[0], &values[0] + values.size()); multiset_type testmultiset2; - testmultiset2.clone_from(testmultiset1, test::new_cloner(), test::delete_destroyer()); + testmultiset2.clone_from(testmultiset1, test::new_cloner(), test::delete_disposer()); BOOST_TEST (testmultiset2 == testmultiset1); - testmultiset2.clear_and_destroy(test::delete_destroyer()); + testmultiset2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testmultiset2.empty()); } @@ -293,4 +293,4 @@ int main( int, char* [] ) return boost::report_errors(); } - +#include diff --git a/test/set_test.cpp b/test/set_test.cpp index f9d2393..39d35eb 100644 --- a/test/set_test.cpp +++ b/test/set_test.cpp @@ -10,7 +10,7 @@ // See http://www.boost.org/libs/intrusive for documentation. // ///////////////////////////////////////////////////////////////////////////// - +#include #include #include #include "itestvalue.hpp" @@ -204,9 +204,9 @@ void test_set set_type testset1 (&values[0], &values[0] + values.size()); set_type testset2; - testset2.clone_from(testset1, test::new_cloner(), test::delete_destroyer()); + testset2.clone_from(testset1, test::new_cloner(), test::delete_disposer()); BOOST_TEST (testset2 == testset1); - testset2.clear_and_destroy(test::delete_destroyer()); + testset2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testset2.empty()); } @@ -295,3 +295,4 @@ int main( int, char* [] ) test_main_template, true>()(); return boost::report_errors(); } +#include diff --git a/test/slist_test.cpp b/test/slist_test.cpp index 440176d..dfc9d78 100644 --- a/test/slist_test.cpp +++ b/test/slist_test.cpp @@ -10,6 +10,7 @@ // See http://www.boost.org/libs/intrusive for documentation. // ///////////////////////////////////////////////////////////////////////////// +#include #include #include #include "itestvalue.hpp" @@ -302,9 +303,9 @@ void test_slist list_type testlist1 (&values[0], &values[0] + values.size()); list_type testlist2; - testlist2.clone_from(testlist1, test::new_cloner(), test::delete_destroyer()); + testlist2.clone_from(testlist1, test::new_cloner(), test::delete_disposer()); BOOST_TEST (testlist2 == testlist1); - testlist2.clear_and_destroy(test::delete_destroyer()); + testlist2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testlist2.empty()); } @@ -379,3 +380,4 @@ int main(int, char* []) test_main_template, true>()(); return boost::report_errors(); } +#include diff --git a/test/test_container.hpp b/test/test_container.hpp index f905ea8..834baaa 100644 --- a/test/test_container.hpp +++ b/test/test_container.hpp @@ -38,7 +38,7 @@ Semantics of an expression is defined only where it differs from, or is not defi Move constructor X(a) X().size() == a.size(). X() contains a copy of each of a's elements. Move constructor X b(a); b.size() == a.size(). b contains a copy of each of a's elements. Move Assignment operator b = a b.size() == a.size(). b contains a copy of each of a's elements. -Destructor a.~X() Each of a's elements is destroyed, and memory allocated for them (if any) is deallocated. +Destructor a.~X() Each of a's elements is disposed, and memory allocated for them (if any) is deallocated. Beginning of range a.begin() Returns an iterator pointing to the first element in the container. [7] a.begin() is either dereferenceable or past-the-end. It is past-the-end if and only if a.size() == 0. End of range a.end() Returns an iterator pointing one past the last element in the container. a.end() is past-the-end. Size a.size() Returns the size of the container, that is, its number of elements. [8] a.size() >= 0 && a.size() <= max_size() diff --git a/test/unordered_multiset_test.cpp b/test/unordered_multiset_test.cpp index 4b6e94b..d35981a 100644 --- a/test/unordered_multiset_test.cpp +++ b/test/unordered_multiset_test.cpp @@ -11,6 +11,7 @@ // ///////////////////////////////////////////////////////////////////////////// +#include #include #include #include "itestvalue.hpp" @@ -281,14 +282,14 @@ void test_unordered_multiset unordered_multiset_type testset1 (buckets1, BucketSize, values.begin(), values.end()); unordered_multiset_type testset2 (buckets2, BucketSize); - testset2.clone_from(testset1, test::new_cloner(), test::delete_destroyer()); + testset2.clone_from(testset1, test::new_cloner(), test::delete_disposer()); //Ordering is not guarantee in the cloning so insert data in a set and test std::multiset src(testset1.begin(), testset1.end()); std::multiset dst(testset2.begin(), testset2.end()); BOOST_TEST (src == dst); - testset2.clear_and_destroy(test::delete_destroyer()); + testset2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testset2.empty()); } { @@ -298,14 +299,14 @@ void test_unordered_multiset unordered_multiset_type testset1 (buckets1, BucketSize*2, values.begin(), values.end()); unordered_multiset_type testset2 (buckets2, BucketSize); - testset2.clone_from(testset1, test::new_cloner(), test::delete_destroyer()); + testset2.clone_from(testset1, test::new_cloner(), test::delete_disposer()); //Ordering is not guarantee in the cloning so insert data in a set and test std::multiset src(testset1.begin(), testset1.end()); std::multiset dst(testset2.begin(), testset2.end()); BOOST_TEST (src == dst); - testset2.clear_and_destroy(test::delete_destroyer()); + testset2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testset2.empty()); } { @@ -315,14 +316,14 @@ void test_unordered_multiset unordered_multiset_type testset1 (buckets1, BucketSize, values.begin(), values.end()); unordered_multiset_type testset2 (buckets2, BucketSize*2); - testset2.clone_from(testset1, test::new_cloner(), test::delete_destroyer()); + testset2.clone_from(testset1, test::new_cloner(), test::delete_disposer()); //Ordering is not guarantee in the cloning so insert data in a set and test std::multiset src(testset1.begin(), testset1.end()); std::multiset dst(testset2.begin(), testset2.end()); BOOST_TEST (src == dst); - testset2.clear_and_destroy(test::delete_destroyer()); + testset2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testset2.empty()); } } @@ -375,6 +376,7 @@ class test_main_template return 0; } }; + /* //Explicit instantiations of non-counted classes template class boost::intrusive::unordered_multiset @@ -428,6 +430,7 @@ template class boost::intrusive::unordered_multiset , boost::hash , std::equal_to, true>; */ + int main( int, char* [] ) { test_main_template()(); @@ -436,3 +439,5 @@ int main( int, char* [] ) test_main_template, true>()(); return boost::report_errors(); } + +#include diff --git a/test/unordered_set_test.cpp b/test/unordered_set_test.cpp index c59f16d..a3c6ca5 100644 --- a/test/unordered_set_test.cpp +++ b/test/unordered_set_test.cpp @@ -10,7 +10,7 @@ // See http://www.boost.org/libs/intrusive for documentation. // ///////////////////////////////////////////////////////////////////////////// - +#include #include #include #include "itestvalue.hpp" @@ -257,14 +257,14 @@ void test_unordered_set unordered_set_type testset1 (buckets1, BucketSize, values.begin(), values.end()); unordered_set_type testset2 (buckets2, BucketSize); - testset2.clone_from(testset1, test::new_cloner(), test::delete_destroyer()); + testset2.clone_from(testset1, test::new_cloner(), test::delete_disposer()); //Ordering is not guarantee in the cloning so insert data in a set and test std::set src(testset1.begin(), testset1.end()); std::set dst(testset2.begin(), testset2.end()); BOOST_TEST (src == dst ); - testset2.clear_and_destroy(test::delete_destroyer()); + testset2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testset2.empty()); } { @@ -274,14 +274,14 @@ void test_unordered_set unordered_set_type testset1 (buckets1, BucketSize*2, values.begin(), values.end()); unordered_set_type testset2 (buckets2, BucketSize); - testset2.clone_from(testset1, test::new_cloner(), test::delete_destroyer()); + testset2.clone_from(testset1, test::new_cloner(), test::delete_disposer()); //Ordering is not guarantee in the cloning so insert data in a set and test std::set src(testset1.begin(), testset1.end()); std::set dst(testset2.begin(), testset2.end()); BOOST_TEST (src == dst ); - testset2.clear_and_destroy(test::delete_destroyer()); + testset2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testset2.empty()); } { @@ -291,14 +291,14 @@ void test_unordered_set unordered_set_type testset1 (buckets1, BucketSize, values.begin(), values.end()); unordered_set_type testset2 (buckets2, BucketSize*2); - testset2.clone_from(testset1, test::new_cloner(), test::delete_destroyer()); + testset2.clone_from(testset1, test::new_cloner(), test::delete_disposer()); //Ordering is not guarantee in the cloning so insert data in a set and test std::set src(testset1.begin(), testset1.end()); std::set dst(testset2.begin(), testset2.end()); BOOST_TEST (src == dst ); - testset2.clear_and_destroy(test::delete_destroyer()); + testset2.clear_and_dispose(test::delete_disposer()); BOOST_TEST (testset2.empty()); } } @@ -411,3 +411,4 @@ int main( int, char* [] ) test_main_template, true>()(); return boost::report_errors(); } +#include