From 664d8ba073d5437446b150b4bb70d21156ba676b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Tue, 30 Aug 2011 12:53:03 +0000 Subject: [PATCH] Updated documentation and tests to Boost.Container [SVN r74156] --- doc/move.qbk | 7 +++---- example/doc_file_descriptor.cpp | 6 +++--- example/doc_move_inserter.cpp | 4 ++-- example/doc_move_iterator.cpp | 4 ++-- test/back_move_inserter.cpp | 14 +++++++------- test/move_algorithm.cpp | 8 ++++---- test/move_iterator.cpp | 8 ++++---- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/doc/move.qbk b/doc/move.qbk index 1558d35..1275a56 100644 --- a/doc/move.qbk +++ b/doc/move.qbk @@ -18,12 +18,11 @@ ] ] -[important To be able to use containers of movable-only values you will need to use containers supporting move sematantics, - like [*Boost.Interprocess] containers] +[important To be able to use containers of movable-only values you will need to use containers +supporting move semantics, like [*Boost.Container] containers] [note Tested compilers: MSVC-7.1, 8.0, 9.0, GCC 4.3-MinGW in C++03 and C++0x modes, Intel 10.1] - [section:what_is_boost_move What is Boost.Move?] Rvalue references are a major C++0x feature, enabling move semantics for C++ values. However, we @@ -285,7 +284,7 @@ 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.Interprocess] containers are move-aware so you can write the following: +[*Boost.Container] containers are move-aware so you can write the following: [file_descriptor_example] diff --git a/example/doc_file_descriptor.cpp b/example/doc_file_descriptor.cpp index 0691ebb..6d008d3 100644 --- a/example/doc_file_descriptor.cpp +++ b/example/doc_file_descriptor.cpp @@ -56,7 +56,7 @@ class file_descriptor //] //[file_descriptor_example -#include +#include #include //Remember: 'file_descriptor' is NOT copyable, but it @@ -72,7 +72,7 @@ int main() assert(!fd.empty()); //Now move fd into a vector - boost::interprocess::vector v; + boost::container::vector v; v.push_back(boost::move(fd)); //Check ownership has been transferred @@ -81,7 +81,7 @@ int main() //Compilation error if uncommented since file_descriptor is not copyable //and vector copy construction requires value_type's copy constructor: - //boost::interprocess::vector v2(v); + //boost::container::vector v2(v); return 0; } //] diff --git a/example/doc_move_inserter.cpp b/example/doc_move_inserter.cpp index 547cc82..1e0b9dc 100644 --- a/example/doc_move_inserter.cpp +++ b/example/doc_move_inserter.cpp @@ -10,11 +10,11 @@ ////////////////////////////////////////////////////////////////////////////// //[move_inserter_example -#include +#include #include "movable.hpp" #include -using namespace ::boost::interprocess; +using namespace ::boost::container; typedef list list_t; typedef list_t::iterator l_iterator; diff --git a/example/doc_move_iterator.cpp b/example/doc_move_iterator.cpp index d48b93f..0e7cc51 100644 --- a/example/doc_move_iterator.cpp +++ b/example/doc_move_iterator.cpp @@ -10,13 +10,13 @@ ////////////////////////////////////////////////////////////////////////////// //[move_iterator_example -#include +#include #include "movable.hpp" #include int main() { - using namespace ::boost::interprocess; + using namespace ::boost::container; //Create a vector with 10 default constructed objects vector v(10); diff --git a/test/back_move_inserter.cpp b/test/back_move_inserter.cpp index 27d28f4..ca4720b 100644 --- a/test/back_move_inserter.cpp +++ b/test/back_move_inserter.cpp @@ -9,9 +9,9 @@ // ////////////////////////////////////////////////////////////////////////////// #include -#include -#include -#include +#include +#include +#include #include "../example/movable.hpp" template @@ -46,15 +46,15 @@ int move_test() int main() { - namespace bi = ::boost::interprocess; + namespace bc = ::boost::container; - if(move_test< bi::vector >()){ + if(move_test< bc::vector >()){ return 1; } - if(move_test< bi::list >()){ + if(move_test< bc::list >()){ return 1; } - if(move_test< bi::stable_vector >()){ + if(move_test< bc::stable_vector >()){ return 1; } return 0; diff --git a/test/move_algorithm.cpp b/test/move_algorithm.cpp index 86db155..0568f7c 100644 --- a/test/move_algorithm.cpp +++ b/test/move_algorithm.cpp @@ -9,15 +9,15 @@ // ////////////////////////////////////////////////////////////////////////////// #include -#include +#include #include "../example/movable.hpp" int main() { - namespace bi = ::boost::interprocess; + namespace bc = ::boost::container; //Default construct 10 movable objects - bi::vector v(10); - bi::vector v2(10); + bc::vector v(10); + bc::vector v2(10); //Move to v2 boost::move(v.begin(), v.end(), v2.begin()); diff --git a/test/move_iterator.cpp b/test/move_iterator.cpp index 05a524b..10cc2bd 100644 --- a/test/move_iterator.cpp +++ b/test/move_iterator.cpp @@ -10,14 +10,14 @@ ////////////////////////////////////////////////////////////////////////////// #include -#include +#include #include "../example/movable.hpp" int main() { - namespace bi = ::boost::interprocess; + namespace bc = ::boost::container; //Default construct 10 movable objects - bi::vector v(10); + bc::vector v(10); //Test default constructed value if(v[0].moved()){ @@ -25,7 +25,7 @@ int main() } //Move values - bi::vector v2 + bc::vector v2 (boost::make_move_iterator(v.begin()), boost::make_move_iterator(v.end())); //Test values have been moved