Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79561 - in branches/release/libs: interprocess interprocess/doc interprocess/proj/vc7ide interprocess/test intrusive intrusive/doc intrusive/example intrusive/perf intrusive/proj/vc7ide intrusive/test move move/doc move/test
From: igaztanaga_at_[hidden]
Date: 2012-07-16 05:08:43


Author: igaztanaga
Date: 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
New Revision: 79561
URL: http://svn.boost.org/trac/boost/changeset/79561

Log:
Merged from trunk
Properties modified:
   branches/release/libs/interprocess/ (props changed)
   branches/release/libs/intrusive/ (props changed)
   branches/release/libs/move/ (props changed)
Text files modified:
   branches/release/libs/interprocess/doc/Jamfile.v2 | 4
   branches/release/libs/interprocess/doc/interprocess.qbk | 8 +++
   branches/release/libs/interprocess/proj/vc7ide/mapped_file_test.vcproj | 3
   branches/release/libs/interprocess/test/condition_test_template.hpp | 7 ++
   branches/release/libs/interprocess/test/file_mapping_test.cpp | 7 ++
   branches/release/libs/interprocess/test/get_process_id_name.hpp | 22 ++++++++
   branches/release/libs/interprocess/test/intermodule_singleton_test.cpp | 71 ++++++++++++++++++++------
   branches/release/libs/interprocess/test/mutex_test.cpp | 6 +-
   branches/release/libs/interprocess/test/mutex_test_template.hpp | 76 +++++++---------------------
   branches/release/libs/interprocess/test/mutex_timeout_test.cpp | 4
   branches/release/libs/interprocess/test/named_creation_template.hpp | 48 ++++++++++++++++++
   branches/release/libs/interprocess/test/named_mutex_test.cpp | 67 +------------------------
   branches/release/libs/interprocess/test/named_recursive_mutex_test.cpp | 68 +------------------------
   branches/release/libs/interprocess/test/named_semaphore_test.cpp | 83 ++++++++++++-------------------
   branches/release/libs/interprocess/test/named_upgradable_mutex_test.cpp | 8 +-
   branches/release/libs/interprocess/test/recursive_mutex_test.cpp | 6 +-
   branches/release/libs/interprocess/test/semaphore_test.cpp | 2
   branches/release/libs/interprocess/test/sharable_mutex_test_template.hpp | 99 +++++++++++---------------------------
   branches/release/libs/interprocess/test/shared_memory_mapping_test.cpp | 6 +
   branches/release/libs/interprocess/test/upgradable_mutex_test.cpp | 4
   branches/release/libs/interprocess/test/util.hpp | 5 +
   branches/release/libs/interprocess/test/windows_shared_memory_mapping_test.cpp | 8 +++
   branches/release/libs/intrusive/doc/Jamfile.v2 | 12 ++--
   branches/release/libs/intrusive/doc/intrusive.qbk | 103 +++++++++++++++++++++++----------------
   branches/release/libs/intrusive/example/Jamfile.v2 | 2
   branches/release/libs/intrusive/example/doc_advanced_value_traits.cpp | 12 ++--
   branches/release/libs/intrusive/example/doc_advanced_value_traits2.cpp | 12 ++--
   branches/release/libs/intrusive/example/doc_any_hook.cpp | 2
   branches/release/libs/intrusive/example/doc_assoc_optimized_code.cpp | 6 +-
   branches/release/libs/intrusive/example/doc_auto_unlink.cpp | 2
   branches/release/libs/intrusive/example/doc_avl_set.cpp | 4
   branches/release/libs/intrusive/example/doc_avltree_algorithms.cpp | 18 +++---
   branches/release/libs/intrusive/example/doc_bucket_traits.cpp | 2
   branches/release/libs/intrusive/example/doc_clone_from.cpp | 2
   branches/release/libs/intrusive/example/doc_entity.cpp | 4
   branches/release/libs/intrusive/example/doc_erasing_and_disposing.cpp | 2
   branches/release/libs/intrusive/example/doc_external_value_traits.cpp | 2
   branches/release/libs/intrusive/example/doc_function_hooks.cpp | 2
   branches/release/libs/intrusive/example/doc_how_to_use.cpp | 2
   branches/release/libs/intrusive/example/doc_iterator_from_value.cpp | 2
   branches/release/libs/intrusive/example/doc_list.cpp | 2
   branches/release/libs/intrusive/example/doc_list_algorithms.cpp | 10 +-
   branches/release/libs/intrusive/example/doc_offset_ptr.cpp | 2
   branches/release/libs/intrusive/example/doc_positional_insertion.cpp | 2
   branches/release/libs/intrusive/example/doc_rbtree_algorithms.cpp | 18 +++---
   branches/release/libs/intrusive/example/doc_recursive.cpp | 2
   branches/release/libs/intrusive/example/doc_recursive_member.cpp | 2
   branches/release/libs/intrusive/example/doc_set.cpp | 4
   branches/release/libs/intrusive/example/doc_sg_set.cpp | 4
   branches/release/libs/intrusive/example/doc_slist.cpp | 2
   branches/release/libs/intrusive/example/doc_slist_algorithms.cpp | 6 +-
   branches/release/libs/intrusive/example/doc_splay_algorithms.cpp | 16 +++---
   branches/release/libs/intrusive/example/doc_splay_set.cpp | 4
   branches/release/libs/intrusive/example/doc_splaytree_algorithms.cpp | 16 +++---
   branches/release/libs/intrusive/example/doc_stateful_value_traits.cpp | 2
   branches/release/libs/intrusive/example/doc_treap_algorithms.cpp | 16 +++---
   branches/release/libs/intrusive/example/doc_treap_set.cpp | 4
   branches/release/libs/intrusive/example/doc_unordered_set.cpp | 2
   branches/release/libs/intrusive/example/doc_value_traits.cpp | 10 +-
   branches/release/libs/intrusive/example/doc_window.cpp | 2
   branches/release/libs/intrusive/perf/Jamfile.v2 | 2
   branches/release/libs/intrusive/perf/perf_list.cpp | 2
   branches/release/libs/intrusive/proj/vc7ide/to-do.txt | 5 +
   branches/release/libs/intrusive/test/any_test.cpp | 2
   branches/release/libs/intrusive/test/avl_multiset_test.cpp | 2
   branches/release/libs/intrusive/test/avl_set_test.cpp | 2
   branches/release/libs/intrusive/test/common_functors.hpp | 2
   branches/release/libs/intrusive/test/custom_bucket_traits_test.cpp | 2
   branches/release/libs/intrusive/test/default_hook_test.cpp | 2
   branches/release/libs/intrusive/test/external_value_traits_test.cpp | 2
   branches/release/libs/intrusive/test/function_hook_test.cpp | 2
   branches/release/libs/intrusive/test/generic_assoc_test.hpp | 36 ++++++++++++-
   branches/release/libs/intrusive/test/generic_multiset_test.hpp | 96 +++++++++++++++++++++++++++++-------
   branches/release/libs/intrusive/test/generic_set_test.hpp | 97 ++++++++++++++++++++++++++++++-------
   branches/release/libs/intrusive/test/has_member_function_callable_with.cpp | 16 +++---
   branches/release/libs/intrusive/test/itestvalue.hpp | 6 +-
   branches/release/libs/intrusive/test/list_test.cpp | 6 +-
   branches/release/libs/intrusive/test/make_functions_test.cpp | 2
   branches/release/libs/intrusive/test/multiset_test.cpp | 2
   branches/release/libs/intrusive/test/pointer_traits_test.cpp | 2
   branches/release/libs/intrusive/test/recursive_test.cpp | 4
   branches/release/libs/intrusive/test/set_test.cpp | 2
   branches/release/libs/intrusive/test/sg_multiset_test.cpp | 2
   branches/release/libs/intrusive/test/sg_set_test.cpp | 2
   branches/release/libs/intrusive/test/slist_test.cpp | 16 +++---
   branches/release/libs/intrusive/test/smart_ptr.hpp | 86 ++++++--------------------------
   branches/release/libs/intrusive/test/splay_multiset_test.cpp | 19 ++++++
   branches/release/libs/intrusive/test/splay_set_test.cpp | 18 ++++++
   branches/release/libs/intrusive/test/stateful_value_traits_test.cpp | 2
   branches/release/libs/intrusive/test/test_container.hpp | 4
   branches/release/libs/intrusive/test/test_macros.hpp | 2
   branches/release/libs/intrusive/test/treap_multiset_test.cpp | 2
   branches/release/libs/intrusive/test/treap_set_test.cpp | 2
   branches/release/libs/intrusive/test/unordered_multiset_test.cpp | 16 +++---
   branches/release/libs/intrusive/test/unordered_set_test.cpp | 16 +++---
   branches/release/libs/intrusive/test/virtual_base_test.cpp | 4
   branches/release/libs/move/doc/move.qbk | 8 +++
   branches/release/libs/move/test/back_move_inserter.cpp | 59 +++++++++++++--------
   98 files changed, 790 insertions(+), 691 deletions(-)

Modified: branches/release/libs/interprocess/doc/Jamfile.v2
==============================================================================
--- branches/release/libs/interprocess/doc/Jamfile.v2 (original)
+++ branches/release/libs/interprocess/doc/Jamfile.v2 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -90,5 +90,5 @@
 
    ;
 
-install pdfinstall : standalone/<format>pdf : <location>. <name>interprocess.pdf <install-type>PDF <format>pdf ;
-explicit pdfinstall ;
+install pdf-install : standalone : <location>. <name>interprocess.pdf <install-type>PDF <format>pdf ;
+

Modified: branches/release/libs/interprocess/doc/interprocess.qbk
==============================================================================
--- branches/release/libs/interprocess/doc/interprocess.qbk (original)
+++ branches/release/libs/interprocess/doc/interprocess.qbk 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -6615,6 +6615,14 @@
 
 [section:release_notes Release Notes]
 
+[section:release_notes_boost_1_51_00 Boost 1.51 Release]
+
+* Synchronous and asynchronous flushing for `mapped_region::flush`.
+* Source & ABI breaking: Removed `get_offset` method from `mapped_region` as
+ it has no practical utility and `m_offset` member was not for anything else.
+
+[endsect]
+
 [section:release_notes_boost_1_50_00 Boost 1.50 Release]
 
 * Fixed bugs

Modified: branches/release/libs/interprocess/proj/vc7ide/mapped_file_test.vcproj
==============================================================================
--- branches/release/libs/interprocess/proj/vc7ide/mapped_file_test.vcproj (original)
+++ branches/release/libs/interprocess/proj/vc7ide/mapped_file_test.vcproj 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -34,8 +34,9 @@
                                 Name="VCCustomBuildTool"/>
                         <Tool
                                 Name="VCLinkerTool"
+ AdditionalOptions="/fixed:no"
                                 AdditionalDependencies="winmm.lib"
- OutputFile="$(OutDir)/fully_mapped_file_test_d.exe"
+ OutputFile="$(OutDir)/mapped_file_test_d.exe"
                                 LinkIncremental="1"
                                 AdditionalLibraryDirectories="../../../../stage/lib"
                                 GenerateDebugInformation="TRUE"

Modified: branches/release/libs/interprocess/test/condition_test_template.hpp
==============================================================================
--- branches/release/libs/interprocess/test/condition_test_template.hpp (original)
+++ branches/release/libs/interprocess/test/condition_test_template.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -28,6 +28,7 @@
 #include <boost/thread/thread.hpp>
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 #include <boost/thread/xtime.hpp>
+#include <boost/version.hpp>
 #include <iostream>
 
 namespace boost{
@@ -47,8 +48,14 @@
     const int NANOSECONDS_PER_MILLISECOND = 1000000;
 
     boost::xtime xt;
+
+ #if BOOST_VERSION >= 105100 //TIME_UTC is a macro in C11, breaking change in Boost.Thread
     int ret = boost::xtime_get(&xt, boost::TIME_UTC_);
     BOOST_INTERPROCES_CHECK(ret == static_cast<int>(boost::TIME_UTC_));(void)ret;
+ #else
+ int ret = boost::xtime_get(&xt, boost::TIME_UTC);
+ BOOST_INTERPROCES_CHECK(ret == static_cast<int>(boost::TIME_UTC));(void)ret;
+ #endif
     nsecs += xt.nsec;
     msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
     secs += msecs / MILLISECONDS_PER_SECOND;

Modified: branches/release/libs/interprocess/test/file_mapping_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/file_mapping_test.cpp (original)
+++ branches/release/libs/interprocess/test/file_mapping_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -76,6 +76,13 @@
             ;++i){
             *filler++ = static_cast<unsigned char>(i);
          }
+ if(!region.flush(0, 0, false)){
+ return 1;
+ }
+
+ if(!region2.flush(0, 0, true)){
+ return 1;
+ }
       }
 
       //See if the pattern is correct in the file

Modified: branches/release/libs/interprocess/test/get_process_id_name.hpp
==============================================================================
--- branches/release/libs/interprocess/test/get_process_id_name.hpp (original)
+++ branches/release/libs/interprocess/test/get_process_id_name.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -27,6 +27,13 @@
    str = sstr.str().c_str();
 }
 
+inline void get_process_id_ptr_name(std::string &str, const void *ptr)
+{
+ std::stringstream sstr;
+ sstr << "process_" << boost::interprocess::ipcdetail::get_current_process_id() << "_" << ptr << std::ends;
+ str = sstr.str().c_str();
+}
+
 inline const char *get_process_id_name()
 {
    static std::string str;
@@ -34,6 +41,13 @@
    return str.c_str();
 }
 
+inline const char *get_process_id_ptr_name(void *ptr)
+{
+ static std::string str;
+ get_process_id_ptr_name(str, ptr);
+ return str.c_str();
+}
+
 inline const char *add_to_process_id_name(const char *name)
 {
    static std::string str;
@@ -42,6 +56,14 @@
    return str.c_str();
 }
 
+inline const char *add_to_process_id_ptr_name(const char *name, void *ptr)
+{
+ static std::string str;
+ get_process_id_ptr_name(str, ptr);
+ str += name;
+ return str.c_str();
+}
+
 } //namespace test{
 } //namespace interprocess{
 } //namespace boost{

Modified: branches/release/libs/interprocess/test/intermodule_singleton_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/intermodule_singleton_test.cpp (original)
+++ branches/release/libs/interprocess/test/intermodule_singleton_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -18,17 +18,17 @@
    public:
    MyClass()
    {
- std::cout << "Constructor\n";
+ std::cout << "MyClass()\n" << std::endl;
    }
 
    void shout() const
    {
- std::cout << "Shout\n";
+ std::cout << "Shout\n" << std::endl;
    }
 
    ~MyClass()
    {
- std::cout << "Destructor\n";
+ std::cout << "~MyClass()\n" << std::endl;
    }
 };
 
@@ -101,6 +101,7 @@
    Logger()
    {
       ++constructed_times;
+ std::cout << "Logger(),tag:" << typeid(Tag).name() << "(construct #" << constructed_times << ")\n" << std::endl;
    }
 
    void log_it()
@@ -109,6 +110,7 @@
    ~Logger()
    {
       ++destroyed_times;
+ std::cout << "~Logger(),tag:" << typeid(Tag).name() << "(destroy #" << destroyed_times << ")\n" << std::endl;
    }
 
    static unsigned int constructed_times;
@@ -130,13 +132,18 @@
 {
    public:
    LogUser()
- {}
+ {
+ std::cout << "LogUser(),tag:" << typeid(LogSingleton).name() << "\n" << std::endl;
+ }
 
    void function_using_log()
    { LogSingleton::get().log_it(); }
 
    ~LogUser()
- { LogSingleton::get().log_it(); }
+ {
+ std::cout << "~LogUser(),tag:" << typeid(LogSingleton).name() << "\n" << std::endl;
+ LogSingleton::get().log_it();
+ }
 };
 
 //A class that tests the correct
@@ -147,7 +154,9 @@
 {
    public:
    LogPhoenixTester()
- {}
+ {
+ std::cout << "LogPhoenixTester(), tag: " << typeid(Tag).name() << "\n" << std::endl;
+ }
 
    void dummy()
    {}
@@ -157,12 +166,24 @@
       //Test Phoenix singleton was correctly executed:
       //created and destroyed two times
       //This test will be executed after main ends
+ std::cout << "~LogPhoenixTester(), tag: " << typeid(Tag).name() << "\n" << std::endl;
       if(Logger<Tag>::constructed_times != Logger<Tag>::destroyed_times ||
          Logger<Tag>::constructed_times != 2)
       {
- std::string s("LogPhoenixTester failed for tag ");
- s += typeid(Tag).name();
- throw std::runtime_error(s.c_str());
+ std::stringstream sstr;
+ sstr << "LogPhoenixTester failed for tag ";
+ sstr << typeid(Tag).name();
+ sstr << "\n";
+ if(Logger<Tag>::constructed_times != 2){
+ sstr << "Logger<Tag>::constructed_times != 2\n";
+ sstr << "(";
+ sstr << Logger<Tag>::constructed_times << ")\n";
+ }
+ else{
+ sstr << "Logger<Tag>::constructed_times != Logger<Tag>::destroyed_times\n";
+ sstr << "(" << Logger<Tag>::constructed_times << " vs. " << Logger<Tag>::destroyed_times << ")\n";
+ }
+ throw std::runtime_error(sstr.str().c_str());
       }
    }
 };
@@ -176,15 +197,18 @@
 {
    public:
    LogDeadReferenceUser()
- {}
+ {
+ std::cout << "LogDeadReferenceUser(), LogSingleton: " << typeid(LogSingleton).name() << "\n" << std::endl;
+ }
 
    void function_using_log()
    { LogSingleton::get().log_it(); }
 
    ~LogDeadReferenceUser()
    {
+ std::cout << "~LogDeadReferenceUser(), LogSingleton: " << typeid(LogSingleton).name() << "\n" << std::endl;
       //Make sure the exception is thrown as we are
- //try to use a dead non-phoenix singleton
+ //trying to use a dead non-phoenix singleton
       try{
          LogSingleton::get().log_it();
          std::string s("LogDeadReferenceUser failed for LogSingleton ");
@@ -254,30 +278,43 @@
    return 0;
 }
 
+//reduce name length
+template<typename C, bool LazyInit = true, bool Phoenix = true>
+class port_singleton
+ : public ipcdetail::portable_intermodule_singleton<C, LazyInit, Phoenix>
+{};
+
+#ifdef BOOST_INTERPROCESS_WINDOWS
+template<typename C, bool LazyInit = true, bool Phoenix = true>
+class win_singleton
+ : public ipcdetail::windows_intermodule_singleton< C, LazyInit, Phoenix>
+{};
+#endif
+
 int main ()
 {
- if(0 != intermodule_singleton_test<ipcdetail::portable_intermodule_singleton>()){
+ if(0 != intermodule_singleton_test<port_singleton>()){
       return 1;
    }
 
    #ifdef BOOST_INTERPROCESS_WINDOWS
- if(0 != intermodule_singleton_test<ipcdetail::windows_intermodule_singleton>()){
+ if(0 != intermodule_singleton_test<win_singleton>()){
       return 1;
    }
    #endif
 
    //Phoenix singletons are tested after main ends,
    //LogPhoenixTester does the work
- phoenix_singleton_test<ipcdetail::portable_intermodule_singleton>();
+ phoenix_singleton_test<port_singleton>();
    #ifdef BOOST_INTERPROCESS_WINDOWS
- phoenix_singleton_test<ipcdetail::windows_intermodule_singleton>();
+ phoenix_singleton_test<win_singleton>();
    #endif
 
    //Dead reference singletons are tested after main ends,
    //LogDeadReferenceUser does the work
- dead_reference_singleton_test<ipcdetail::portable_intermodule_singleton>();
+ dead_reference_singleton_test<port_singleton>();
    #ifdef BOOST_INTERPROCESS_WINDOWS
- dead_reference_singleton_test<ipcdetail::windows_intermodule_singleton>();
+ dead_reference_singleton_test<win_singleton>();
    #endif
 
    return 0;

Modified: branches/release/libs/interprocess/test/mutex_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/mutex_test.cpp (original)
+++ branches/release/libs/interprocess/test/mutex_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -24,13 +24,13 @@
 
    #if defined(BOOST_INTERPROCESS_WINDOWS)
       test::test_all_lock<ipcdetail::windows_mutex>();
- test::test_all_mutex<true, ipcdetail::windows_mutex>();
+ test::test_all_mutex<ipcdetail::windows_mutex>();
       test::test_all_lock<ipcdetail::spin_mutex>();
- test::test_all_mutex<true, ipcdetail::spin_mutex>();
+ test::test_all_mutex<ipcdetail::spin_mutex>();
    #endif
 
    test::test_all_lock<interprocess_mutex>();
- test::test_all_mutex<true, interprocess_mutex>();
+ test::test_all_mutex<interprocess_mutex>();
    return 0;
 }
 

Modified: branches/release/libs/interprocess/test/mutex_test_template.hpp
==============================================================================
--- branches/release/libs/interprocess/test/mutex_test_template.hpp (original)
+++ branches/release/libs/interprocess/test/mutex_test_template.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -228,33 +228,24 @@
    }
 }
 
-template<bool SameObject, typename M>
+template<typename M>
 void test_mutex_lock()
 {
    shared_val = 0;
   
- M m1, m2;
- M *pm1, *pm2;
-
- if(SameObject){
- pm1 = pm2 = &m1;
- }
- else{
- pm1 = &m1;
- pm2 = &m2;
- }
+ M mtx;
 
    data<M> d1(1);
    data<M> d2(2);
 
    // Locker one launches, holds the lock for 2*BaseSeconds seconds.
- boost::thread tm1(thread_adapter<M>(&lock_and_sleep, &d1, *pm1));
+ boost::thread tm1(thread_adapter<M>(&lock_and_sleep, &d1, mtx));
 
    //Wait 1*BaseSeconds
    boost::thread::sleep(xsecs(1*BaseSeconds));
 
    // Locker two launches, but it won't hold the lock for 2*BaseSeconds seconds.
- boost::thread tm2(thread_adapter<M>(&lock_and_sleep, &d2, *pm2));
+ boost::thread tm2(thread_adapter<M>(&lock_and_sleep, &d2, mtx));
 
    //Wait completion
    tm1.join();
@@ -265,21 +256,12 @@
    BOOST_INTERPROCES_CHECK(d2.m_value == 2);
 }
 
-template<bool SameObject, typename M>
+template<typename M>
 void test_mutex_lock_timeout()
 {
    shared_val = 0;
   
- M m1, m2;
- M *pm1, *pm2;
-
- if(SameObject){
- pm1 = pm2 = &m1;
- }
- else{
- pm1 = &m1;
- pm2 = &m2;
- }
+ M mtx;
 
    int wait_time_s = BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS / 1000;
    if (wait_time_s == 0 )
@@ -289,13 +271,13 @@
    data<M> d2(2, wait_time_s * 2);
 
    // Locker one launches, and holds the lock for wait_time_s * 2 seconds.
- boost::thread tm1(thread_adapter<M>(&lock_and_sleep, &d1, *pm1));
+ boost::thread tm1(thread_adapter<M>(&lock_and_sleep, &d1, mtx));
 
    //Wait 1*BaseSeconds
    boost::thread::sleep(xsecs(wait_time_s));
 
    // Locker two launches, and attempts to hold the lock for wait_time_s * 2 seconds.
- boost::thread tm2(thread_adapter<M>(&lock_and_catch_errors, &d2, *pm2));
+ boost::thread tm2(thread_adapter<M>(&lock_and_catch_errors, &d2, mtx));
 
    //Wait completion
    tm1.join();
@@ -308,33 +290,24 @@
    BOOST_INTERPROCES_CHECK(d2.m_error == boost::interprocess::timeout_when_locking_error);
 }
 
-template<bool SameObject, typename M>
+template<typename M>
 void test_mutex_try_lock()
 {
    shared_val = 0;
 
- M m1, m2;
- M *pm1, *pm2;
-
- if(SameObject){
- pm1 = pm2 = &m1;
- }
- else{
- pm1 = &m1;
- pm2 = &m2;
- }
+ M mtx;
 
    data<M> d1(1);
    data<M> d2(2);
 
    // Locker one launches, holds the lock for 2*BaseSeconds seconds.
- boost::thread tm1(thread_adapter<M>(&try_lock_and_sleep, &d1, *pm1));
+ boost::thread tm1(thread_adapter<M>(&try_lock_and_sleep, &d1, mtx));
 
    //Wait 1*BaseSeconds
    boost::thread::sleep(xsecs(1*BaseSeconds));
 
    // Locker two launches, but it should fail acquiring the lock
- boost::thread tm2(thread_adapter<M>(&try_lock_and_sleep, &d2, *pm2));
+ boost::thread tm2(thread_adapter<M>(&try_lock_and_sleep, &d2, mtx));
 
    //Wait completion
    tm1.join();
@@ -344,34 +317,25 @@
    BOOST_INTERPROCES_CHECK(d2.m_value == -1);
 }
 
-template<bool SameObject, typename M>
+template<typename M>
 void test_mutex_timed_lock()
 
 {
    shared_val = 0;
 
- M m1, m2;
- M *pm1, *pm2;
-
- if(SameObject){
- pm1 = pm2 = &m1;
- }
- else{
- pm1 = &m1;
- pm2 = &m2;
- }
+ M mtx, m2;
 
    data<M> d1(1, 2*BaseSeconds);
    data<M> d2(2, 2*BaseSeconds);
 
    // Locker one launches, holds the lock for 2*BaseSeconds seconds.
- boost::thread tm1(thread_adapter<M>(&timed_lock_and_sleep, &d1, *pm1));
+ boost::thread tm1(thread_adapter<M>(&timed_lock_and_sleep, &d1, mtx));
 
    //Wait 1*BaseSeconds
    boost::thread::sleep(xsecs(1*BaseSeconds));
 
    // Locker two launches, holds the lock for 2*BaseSeconds seconds.
- boost::thread tm2(thread_adapter<M>(&timed_lock_and_sleep, &d2, *pm2));
+ boost::thread tm2(thread_adapter<M>(&timed_lock_and_sleep, &d2, mtx));
 
    //Wait completion
    tm1.join();
@@ -402,15 +366,15 @@
    test_recursive_lock<M>()();
 }
 
-template<bool SameObject, typename M>
+template<typename M>
 void test_all_mutex()
 {
    std::cout << "test_mutex_lock<" << typeid(M).name() << ">" << std::endl;
- test_mutex_lock<SameObject, M>();
+ test_mutex_lock<M>();
    std::cout << "test_mutex_try_lock<" << typeid(M).name() << ">" << std::endl;
- test_mutex_try_lock<SameObject, M>();
+ test_mutex_try_lock<M>();
    std::cout << "test_mutex_timed_lock<" << typeid(M).name() << ">" << std::endl;
- test_mutex_timed_lock<SameObject, M>();
+ test_mutex_timed_lock<M>();
 }
 
 }}} //namespace boost { namespace interprocess { namespace test {

Modified: branches/release/libs/interprocess/test/mutex_timeout_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/mutex_timeout_test.cpp (original)
+++ branches/release/libs/interprocess/test/mutex_timeout_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -21,8 +21,8 @@
 int main ()
 {
    using namespace boost::interprocess;
- test::test_mutex_lock_timeout<true, interprocess_mutex>();
- test::test_mutex_lock_timeout<true, interprocess_recursive_mutex>();
+ test::test_mutex_lock_timeout<interprocess_mutex>();
+ test::test_mutex_lock_timeout<interprocess_recursive_mutex>();
 
    return 0;
 }

Modified: branches/release/libs/interprocess/test/named_creation_template.hpp
==============================================================================
--- branches/release/libs/interprocess/test/named_creation_template.hpp (original)
+++ branches/release/libs/interprocess/test/named_creation_template.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -14,6 +14,7 @@
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/exceptions.hpp>
 #include "boost_interprocess_check.hpp"
+#include "get_process_id_name.hpp"
 #include <iostream>
 #include <typeinfo>
 #include <boost/interprocess/creation_tags.hpp>
@@ -77,6 +78,53 @@
    dont_create_and_open<NamedResource>();
 }
 
+template<class NamedSync>
+class named_sync_wrapper
+ : public NamedSync
+{
+ public:
+ named_sync_wrapper()
+ : NamedSync(open_or_create, test::get_process_id_ptr_name(this))
+ {}
+
+ ~named_sync_wrapper()
+ {
+ NamedSync::remove(test::get_process_id_ptr_name(this));
+ }
+};
+
+template<class NamedSync>
+struct named_sync_deleter
+{
+ ~named_sync_deleter()
+ { NamedSync::remove(test::get_process_id_name()); }
+};
+
+
+//This wrapper is necessary to have a common constructor
+//in generic named_creation_template functions
+template<class NamedSync>
+class named_sync_creation_test_wrapper
+ : public test::named_sync_deleter<NamedSync>, public NamedSync
+{
+ public:
+ named_sync_creation_test_wrapper(create_only_t)
+ : NamedSync(create_only, test::get_process_id_name())
+ {}
+
+ named_sync_creation_test_wrapper(open_only_t)
+ : NamedSync(open_only, test::get_process_id_name())
+ {}
+
+ named_sync_creation_test_wrapper(open_or_create_t)
+ : NamedSync(open_or_create, test::get_process_id_name())
+ {}
+
+ ~named_sync_creation_test_wrapper()
+ {}
+};
+
+
 }}} //namespace boost { namespace interprocess { namespace test {
 
 #include <boost/interprocess/detail/config_end.hpp>

Modified: branches/release/libs/interprocess/test/named_mutex_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/named_mutex_test.cpp (original)
+++ branches/release/libs/interprocess/test/named_mutex_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -14,78 +14,17 @@
 #include "mutex_test_template.hpp"
 #include "named_creation_template.hpp"
 #include <string>
-#include "get_process_id_name.hpp"
 #include <boost/interprocess/detail/interprocess_tester.hpp>
 
 using namespace boost::interprocess;
 
-struct mutex_deleter
-{
- ~mutex_deleter()
- { named_mutex::remove(test::get_process_id_name()); }
-};
-
-//This wrapper is necessary to have a default constructor
-//in generic mutex_test_template functions
-class named_mutex_lock_test_wrapper
- : public named_mutex
-{
- public:
- named_mutex_lock_test_wrapper()
- : named_mutex(open_or_create, test::get_process_id_name())
- { ++count_; }
-
- ~named_mutex_lock_test_wrapper()
- {
- if(--count_){
- ipcdetail::interprocess_tester::
- dont_close_on_destruction(static_cast<named_mutex&>(*this));
- }
- }
-
- static int count_;
-};
-
-int named_mutex_lock_test_wrapper::count_ = 0;
-
-//This wrapper is necessary to have a common constructor
-//in generic named_creation_template functions
-class named_mutex_creation_test_wrapper
- : public mutex_deleter, public named_mutex
-{
- public:
- named_mutex_creation_test_wrapper(create_only_t)
- : named_mutex(create_only, test::get_process_id_name())
- { ++count_; }
-
- named_mutex_creation_test_wrapper(open_only_t)
- : named_mutex(open_only, test::get_process_id_name())
- { ++count_; }
-
- named_mutex_creation_test_wrapper(open_or_create_t)
- : named_mutex(open_or_create, test::get_process_id_name())
- { ++count_; }
-
- ~named_mutex_creation_test_wrapper()
- {
- if(--count_){
- ipcdetail::interprocess_tester::
- dont_close_on_destruction(static_cast<named_mutex&>(*this));
- }
- }
-
- static int count_;
-};
-
-int named_mutex_creation_test_wrapper::count_ = 0;
-
 int main ()
 {
    try{
       named_mutex::remove(test::get_process_id_name());
- test::test_named_creation<named_mutex_creation_test_wrapper>();
- test::test_all_lock<named_mutex_lock_test_wrapper>();
- test::test_all_mutex<false, named_mutex_lock_test_wrapper>();
+ test::test_named_creation< test::named_sync_creation_test_wrapper<named_mutex> >();
+ test::test_all_lock< test::named_sync_wrapper<named_mutex> >();
+ test::test_all_mutex<test::named_sync_wrapper<named_mutex> >();
    }
    catch(std::exception &ex){
       named_mutex::remove(test::get_process_id_name());

Modified: branches/release/libs/interprocess/test/named_recursive_mutex_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/named_recursive_mutex_test.cpp (original)
+++ branches/release/libs/interprocess/test/named_recursive_mutex_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -19,74 +19,14 @@
 
 using namespace boost::interprocess;
 
-struct mutex_deleter
-{
- ~mutex_deleter()
- { named_recursive_mutex::remove(test::get_process_id_name()); }
-};
-
-//This wrapper is necessary to have a default constructor
-//in generic mutex_test_template functions
-class named_recursive_mutex_lock_test_wrapper
- : public named_recursive_mutex
-{
- public:
- named_recursive_mutex_lock_test_wrapper()
- : named_recursive_mutex(open_or_create, test::get_process_id_name())
- { ++count_; }
-
- ~named_recursive_mutex_lock_test_wrapper()
- {
- if(--count_){
- ipcdetail::interprocess_tester::
- dont_close_on_destruction(static_cast<named_recursive_mutex&>(*this));
- }
- }
-
- static int count_;
-};
-
-int named_recursive_mutex_lock_test_wrapper::count_ = 0;
-
-//This wrapper is necessary to have a common constructor
-//in generic named_creation_template functions
-class named_mutex_creation_test_wrapper
- : public mutex_deleter, public named_recursive_mutex
-{
- public:
- named_mutex_creation_test_wrapper(create_only_t)
- : named_recursive_mutex(create_only, test::get_process_id_name())
- { ++count_; }
-
- named_mutex_creation_test_wrapper(open_only_t)
- : named_recursive_mutex(open_only, test::get_process_id_name())
- { ++count_; }
-
- named_mutex_creation_test_wrapper(open_or_create_t)
- : named_recursive_mutex(open_or_create, test::get_process_id_name())
- { ++count_; }
-
- ~named_mutex_creation_test_wrapper()
- {
- if(--count_){
- ipcdetail::interprocess_tester::
- dont_close_on_destruction(static_cast<named_recursive_mutex&>(*this));
- }
- }
-
- static int count_;
-};
-
-int named_mutex_creation_test_wrapper::count_ = 0;
-
 int main ()
 {
    try{
       named_recursive_mutex::remove(test::get_process_id_name());
- test::test_named_creation<named_mutex_creation_test_wrapper>();
- test::test_all_lock<named_recursive_mutex_lock_test_wrapper>();
- test::test_all_mutex<false, named_recursive_mutex_lock_test_wrapper>();
- test::test_all_recursive_lock<named_recursive_mutex_lock_test_wrapper>();
+ test::test_named_creation< test::named_sync_creation_test_wrapper<named_recursive_mutex> >();
+ test::test_all_lock< test::named_sync_wrapper<named_recursive_mutex> >();
+ test::test_all_mutex<test::named_sync_wrapper<named_recursive_mutex> >();
+ test::test_all_recursive_lock<test::named_sync_wrapper<named_recursive_mutex> >();
    }
    catch(std::exception &ex){
       named_recursive_mutex::remove(test::get_process_id_name());

Modified: branches/release/libs/interprocess/test/named_semaphore_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/named_semaphore_test.cpp (original)
+++ branches/release/libs/interprocess/test/named_semaphore_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -24,41 +24,27 @@
 static const std::size_t RecSemCount = 100;
 static const char * SemName = test::get_process_id_name();
 
-struct semaphore_deleter
-{
- ~semaphore_deleter()
- { named_semaphore::remove(SemName); }
-};
-
 //This wrapper is necessary to plug this class
-//in named creation tests and interprocess_mutex tests
-class named_semaphore_test_wrapper
- : public semaphore_deleter, public named_semaphore
+//in lock tests
+class lock_test_wrapper
+ : public named_semaphore
 {
    public:
- named_semaphore_test_wrapper()
- : named_semaphore(open_or_create, SemName, SemCount)
- { ++count_; }
-
- named_semaphore_test_wrapper(create_only_t)
- : named_semaphore(create_only, SemName, SemCount)
- { ++count_; }
-
- named_semaphore_test_wrapper(open_only_t)
- : named_semaphore(open_only, SemName)
- { ++count_; }
-
- named_semaphore_test_wrapper(open_or_create_t)
- : named_semaphore(open_or_create, SemName, SemCount)
- { ++count_; }
 
- ~named_semaphore_test_wrapper()
- {
- if(--count_){
- ipcdetail::interprocess_tester::
- dont_close_on_destruction(static_cast<named_semaphore&>(*this));
- }
- }
+ lock_test_wrapper(create_only_t, const char *name, unsigned int count = 1)
+ : named_semaphore(create_only, name, count)
+ {}
+
+ lock_test_wrapper(open_only_t, const char *name)
+ : named_semaphore(open_only, name)
+ {}
+
+ lock_test_wrapper(open_or_create_t, const char *name, unsigned int count = 1)
+ : named_semaphore(open_or_create, name, count)
+ {}
+
+ ~lock_test_wrapper()
+ {}
 
    void lock()
    { this->wait(); }
@@ -71,31 +57,26 @@
 
    void unlock()
    { this->post(); }
-
- protected:
- named_semaphore_test_wrapper(int initial_count)
- : named_semaphore(create_only, SemName, initial_count)
- {}
-
- static int count_;
 };
 
-int named_semaphore_test_wrapper::count_ = 0;
-
 //This wrapper is necessary to plug this class
 //in recursive tests
-class recursive_named_semaphore_test_wrapper
- : public named_semaphore_test_wrapper
+class recursive_test_wrapper
+ : public lock_test_wrapper
 {
    public:
- recursive_named_semaphore_test_wrapper()
- : named_semaphore_test_wrapper(RecSemCount)
+ recursive_test_wrapper(create_only_t, const char *name)
+ : lock_test_wrapper(create_only, name, RecSemCount)
    {}
 
- static int count_;
-};
+ recursive_test_wrapper(open_only_t, const char *name)
+ : lock_test_wrapper(open_only, name)
+ {}
 
-int recursive_named_semaphore_test_wrapper::count_ = 0;
+ recursive_test_wrapper(open_or_create_t, const char *name)
+ : lock_test_wrapper(open_or_create, name, RecSemCount)
+ {}
+};
 
 bool test_named_semaphore_specific()
 {
@@ -125,10 +106,10 @@
 {
    try{
       named_semaphore::remove(SemName);
- test::test_named_creation<named_semaphore_test_wrapper>();
- test::test_all_lock<named_semaphore_test_wrapper>();
- test::test_all_recursive_lock<recursive_named_semaphore_test_wrapper>();
- test::test_all_mutex<false, named_semaphore_test_wrapper>();
+ test::test_named_creation< test::named_sync_creation_test_wrapper<lock_test_wrapper> >();
+ test::test_all_lock< test::named_sync_wrapper<lock_test_wrapper> >();
+ test::test_all_mutex<test::named_sync_wrapper<lock_test_wrapper> >();
+ test::test_all_recursive_lock<test::named_sync_wrapper<recursive_test_wrapper> >();
       test_named_semaphore_specific();
    }
    catch(std::exception &ex){

Modified: branches/release/libs/interprocess/test/named_upgradable_mutex_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/named_upgradable_mutex_test.cpp (original)
+++ branches/release/libs/interprocess/test/named_upgradable_mutex_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -86,10 +86,10 @@
 {
    try{
       named_upgradable_mutex::remove(test::get_process_id_name());
- test::test_named_creation<named_upgradable_mutex_creation_test_wrapper>();
- test::test_all_lock<named_upgradable_mutex_lock_test_wrapper>();
- test::test_all_mutex<true, named_upgradable_mutex_lock_test_wrapper>();
- test::test_all_sharable_mutex<true, named_upgradable_mutex_lock_test_wrapper>();
+ test::test_named_creation< test::named_sync_creation_test_wrapper<named_upgradable_mutex> >();
+ test::test_all_lock< test::named_sync_wrapper<named_upgradable_mutex> >();
+ test::test_all_mutex<test::named_sync_wrapper<named_upgradable_mutex> >();
+ test::test_all_sharable_mutex<test::named_sync_wrapper<named_upgradable_mutex> >();
    }
    catch(std::exception &ex){
       named_upgradable_mutex::remove(test::get_process_id_name());

Modified: branches/release/libs/interprocess/test/recursive_mutex_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/recursive_mutex_test.cpp (original)
+++ branches/release/libs/interprocess/test/recursive_mutex_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -24,16 +24,16 @@
    #if defined(BOOST_INTERPROCESS_WINDOWS)
       //
       test::test_all_lock<ipcdetail::windows_recursive_mutex>();
- test::test_all_mutex<true, ipcdetail::windows_recursive_mutex>();
+ test::test_all_mutex<ipcdetail::windows_recursive_mutex>();
       test::test_all_recursive_lock<ipcdetail::windows_recursive_mutex>();
       //
       test::test_all_lock<ipcdetail::spin_recursive_mutex>();
- test::test_all_mutex<true, ipcdetail::spin_recursive_mutex>();
+ test::test_all_mutex<ipcdetail::spin_recursive_mutex>();
       test::test_all_recursive_lock<ipcdetail::spin_recursive_mutex>();
    #endif
    //
    test::test_all_lock<interprocess_recursive_mutex>();
- test::test_all_mutex<true, interprocess_recursive_mutex>();
+ test::test_all_mutex<interprocess_recursive_mutex>();
    test::test_all_recursive_lock<interprocess_recursive_mutex>();
 
    return 0;

Modified: branches/release/libs/interprocess/test/semaphore_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/semaphore_test.cpp (original)
+++ branches/release/libs/interprocess/test/semaphore_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -63,7 +63,7 @@
 
    test::test_all_lock<semaphore_test_wrapper>();
    test::test_all_recursive_lock<recursive_semaphore_test_wrapper>();
- test::test_all_mutex<true, semaphore_test_wrapper>();
+ test::test_all_mutex<semaphore_test_wrapper>();
    return 0;
 }
 

Modified: branches/release/libs/interprocess/test/sharable_mutex_test_template.hpp
==============================================================================
--- branches/release/libs/interprocess/test/sharable_mutex_test_template.hpp (original)
+++ branches/release/libs/interprocess/test/sharable_mutex_test_template.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -111,41 +111,30 @@
    }
 }
 
-template<bool SameObject, typename SM>
+template<typename SM>
 void test_plain_sharable_mutex()
 {
    {
       shared_val = 0;
- SM m1, m2, m3, m4;
- SM *pm1, *pm2, *pm3, *pm4;
-
- if(SameObject){
- pm1 = pm2 = pm3 = pm4 = &m1;
- }
- else{
- pm1 = &m1;
- pm2 = &m2;
- pm3 = &m3;
- pm4 = &m4;
- }
+ SM mtx;
       data<SM> s1(1);
       data<SM> s2(2);
       data<SM> e1(1);
       data<SM> e2(2);
 
       // Writer one launches, holds the lock for 3*BaseSeconds seconds.
- boost::thread tw1(thread_adapter<SM>(plain_exclusive, &e1, *pm1));
+ boost::thread tw1(thread_adapter<SM>(plain_exclusive, &e1, mtx));
 
       // Writer two launches, tries to grab the lock, "clearly"
       // after Writer one will already be holding it.
       boost::thread::sleep(xsecs(1*BaseSeconds));
- boost::thread tw2(thread_adapter<SM>(plain_exclusive, &e2, *pm2));
+ boost::thread tw2(thread_adapter<SM>(plain_exclusive, &e2, mtx));
 
       // Reader one launches, "clearly" after writer two, and "clearly"
       // while writer 1 still holds the lock
       boost::thread::sleep(xsecs(1*BaseSeconds));
- boost::thread thr1(thread_adapter<SM>(plain_shared,&s1, *pm3));
- boost::thread thr2(thread_adapter<SM>(plain_shared,&s2, *pm4));
+ boost::thread thr1(thread_adapter<SM>(plain_shared,&s1, mtx));
+ boost::thread thr2(thread_adapter<SM>(plain_shared,&s2, mtx));
 
       thr2.join();
       thr1.join();
@@ -160,33 +149,23 @@
 
    {
       shared_val = 0;
- SM m1, m2, m3, m4;
- SM *pm1, *pm2, *pm3, *pm4;
+ SM mtx;
 
- if(SameObject){
- pm1 = pm2 = pm3 = pm4 = &m1;
- }
- else{
- pm1 = &m1;
- pm2 = &m2;
- pm3 = &m3;
- pm4 = &m4;
- }
       data<SM> s1(1, 3);
       data<SM> s2(2, 3);
       data<SM> e1(1);
       data<SM> e2(2);
 
       //We launch 2 readers, that will block for 3*BaseTime seconds
- boost::thread thr1(thread_adapter<SM>(plain_shared,&s1,*pm1));
- boost::thread thr2(thread_adapter<SM>(plain_shared,&s2,*pm2));
+ boost::thread thr1(thread_adapter<SM>(plain_shared,&s1, mtx));
+ boost::thread thr2(thread_adapter<SM>(plain_shared,&s2, mtx));
 
       //Make sure they try to hold the sharable lock
       boost::thread::sleep(xsecs(1*BaseSeconds));
 
       // We launch two writers, that should block until the readers end
- boost::thread tw1(thread_adapter<SM>(plain_exclusive,&e1,*pm3));
- boost::thread tw2(thread_adapter<SM>(plain_exclusive,&e2,*pm4));
+ boost::thread tw1(thread_adapter<SM>(plain_exclusive,&e1, mtx));
+ boost::thread tw2(thread_adapter<SM>(plain_exclusive,&e2, mtx));
 
       thr2.join();
       thr1.join();
@@ -201,20 +180,11 @@
    }
 }
 
-template<bool SameObject, typename SM>
+template<typename SM>
 void test_try_sharable_mutex()
 {
- SM m1, m2, m3;
- SM *pm1, *pm2, *pm3;
+ SM mtx;
 
- if(SameObject){
- pm1 = pm2 = pm3 = &m1;
- }
- else{
- pm1 = &m1;
- pm2 = &m2;
- pm3 = &m3;
- }
    data<SM> s1(1);
    data<SM> e1(2);
    data<SM> e2(3);
@@ -225,15 +195,15 @@
 
    // Writer one launches, holds the lock for 3*BaseSeconds seconds.
 
- boost::thread tw1(thread_adapter<SM>(try_exclusive,&e1,*pm1));
+ boost::thread tw1(thread_adapter<SM>(try_exclusive,&e1,mtx));
 
    // Reader one launches, "clearly" after writer #1 holds the lock
    // and before it releases the lock.
    boost::thread::sleep(xsecs(1*BaseSeconds));
- boost::thread thr1(thread_adapter<SM>(try_shared,&s1,*pm2));
+ boost::thread thr1(thread_adapter<SM>(try_shared,&s1,mtx));
 
    // Writer two launches in the same timeframe.
- boost::thread tw2(thread_adapter<SM>(try_exclusive,&e2,*pm3));
+ boost::thread tw2(thread_adapter<SM>(try_exclusive,&e2,mtx));
 
    tw2.join();
    thr1.join();
@@ -244,21 +214,10 @@
    BOOST_INTERPROCES_CHECK(e2.m_value == -1); // Try would return w/o waiting
 }
 
-template<bool SameObject, typename SM>
+template<typename SM>
 void test_timed_sharable_mutex()
 {
- SM m1, m2, m3, m4;
- SM *pm1, *pm2, *pm3, *pm4;
-
- if(SameObject){
- pm1 = pm2 = pm3 = pm4 = &m1;
- }
- else{
- pm1 = &m1;
- pm2 = &m2;
- pm3 = &m3;
- pm4 = &m4;
- }
+ SM mtx;
    data<SM> s1(1,1*BaseSeconds);
    data<SM> s2(2,3*BaseSeconds);
    data<SM> e1(3,3*BaseSeconds);
@@ -269,21 +228,21 @@
    shared_val = 0;
 
    // Writer one will hold the lock for 3*BaseSeconds seconds.
- boost::thread tw1(thread_adapter<SM>(timed_exclusive,&e1,*pm1));
+ boost::thread tw1(thread_adapter<SM>(timed_exclusive,&e1,mtx));
 
    boost::thread::sleep(xsecs(1*BaseSeconds));
    // Writer two will "clearly" try for the lock after the readers
    // have tried for it. Writer will wait up 1*BaseSeconds seconds for the lock.
    // This write will fail.
- boost::thread tw2(thread_adapter<SM>(timed_exclusive,&e2,*pm2));
+ boost::thread tw2(thread_adapter<SM>(timed_exclusive,&e2,mtx));
 
    // Readers one and two will "clearly" try for the lock after writer
    // one already holds it. 1st reader will wait 1*BaseSeconds seconds, and will fail
    // to get the lock. 2nd reader will wait 3*BaseSeconds seconds, and will get
    // the lock.
 
- boost::thread thr1(thread_adapter<SM>(timed_shared,&s1,*pm3));
- boost::thread thr2(thread_adapter<SM>(timed_shared,&s2,*pm4));
+ boost::thread thr1(thread_adapter<SM>(timed_shared,&s1,mtx));
+ boost::thread thr2(thread_adapter<SM>(timed_shared,&s2,mtx));
 
    tw1.join();
    thr1.join();
@@ -296,17 +255,17 @@
    BOOST_INTERPROCES_CHECK(e2.m_value == -1);
 }
 
-template<bool SameObject, typename SM>
+template<typename SM>
 void test_all_sharable_mutex()
 {
- std::cout << "test_plain_sharable_mutex<" << SameObject << ", " << typeid(SM).name() << ">" << std::endl;
- test_plain_sharable_mutex<SameObject, SM>();
+ std::cout << "test_plain_sharable_mutex<" << typeid(SM).name() << ">" << std::endl;
+ test_plain_sharable_mutex<SM>();
 
- std::cout << "test_try_sharable_mutex<" << SameObject << ", " << typeid(SM).name() << ">" << std::endl;
- test_try_sharable_mutex<SameObject, SM>();
+ std::cout << "test_try_sharable_mutex<" << typeid(SM).name() << ">" << std::endl;
+ test_try_sharable_mutex<SM>();
 
- std::cout << "test_timed_sharable_mutex<" << SameObject << ", " << typeid(SM).name() << ">" << std::endl;
- test_timed_sharable_mutex<SameObject, SM>();
+ std::cout << "test_timed_sharable_mutex<" << typeid(SM).name() << ">" << std::endl;
+ test_timed_sharable_mutex<SM>();
 }
 
 

Modified: branches/release/libs/interprocess/test/shared_memory_mapping_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/shared_memory_mapping_test.cpp (original)
+++ branches/release/libs/interprocess/test/shared_memory_mapping_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -73,7 +73,11 @@
             ;++i){
             *filler++ = static_cast<unsigned char>(i);
          }
- if(!region.flush()){
+ if(!region.flush(0, 0, false)){
+ return 1;
+ }
+
+ if(!region2.flush(0, 0, true)){
             return 1;
          }
       }

Modified: branches/release/libs/interprocess/test/upgradable_mutex_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/upgradable_mutex_test.cpp (original)
+++ branches/release/libs/interprocess/test/upgradable_mutex_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -23,8 +23,8 @@
    using namespace boost::interprocess;
 
    test::test_all_lock<interprocess_upgradable_mutex>();
- test::test_all_mutex<true, interprocess_upgradable_mutex>();
- test::test_all_sharable_mutex<true, interprocess_upgradable_mutex>();
+ test::test_all_mutex<interprocess_upgradable_mutex>();
+ test::test_all_sharable_mutex<interprocess_upgradable_mutex>();
 
    //Test lock transition
    {

Modified: branches/release/libs/interprocess/test/util.hpp
==============================================================================
--- branches/release/libs/interprocess/test/util.hpp (original)
+++ branches/release/libs/interprocess/test/util.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -30,6 +30,7 @@
 #include <boost/date_time/posix_time/posix_time_types.hpp>
 #include <algorithm>
 #include <iostream>
+#include <boost/version.hpp>
 
 namespace boost {
 namespace interprocess {
@@ -63,7 +64,11 @@
 boost::xtime xsecs(int secs)
 {
    boost::xtime ret;
+ #if BOOST_VERSION >= 105100 //TIME_UTC is a macro in C11, breaking change in Boost.Thread
    boost::xtime_get(&ret, boost::TIME_UTC_);
+ #else
+ boost::xtime_get(&ret, boost::TIME_UTC);
+ #endif
    ret.sec += secs;
    return ret;
 }

Modified: branches/release/libs/interprocess/test/windows_shared_memory_mapping_test.cpp
==============================================================================
--- branches/release/libs/interprocess/test/windows_shared_memory_mapping_test.cpp (original)
+++ branches/release/libs/interprocess/test/windows_shared_memory_mapping_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -9,6 +9,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
 #include <boost/interprocess/detail/config_begin.hpp>
+#include <boost/interprocess/detail/workaround.hpp>
 
 #ifdef BOOST_INTERPROCESS_WINDOWS
 
@@ -61,6 +62,13 @@
                ;++i){
                *filler++ = static_cast<unsigned char>(i);
             }
+ if(!region.flush(0, 0, false)){
+ return 1;
+ }
+
+ if(!region2.flush(0, 0, true)){
+ return 1;
+ }
          }
 
          //See if the pattern is correct in the file using two mapped regions

Modified: branches/release/libs/intrusive/doc/Jamfile.v2
==============================================================================
--- branches/release/libs/intrusive/doc/Jamfile.v2 (original)
+++ branches/release/libs/intrusive/doc/Jamfile.v2 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -49,7 +49,7 @@
 xml intrusive : intrusive.qbk
               :
                  <include>../../../tools/auto_index/include
- ;
+ ;
 
 boostbook standalone
    :
@@ -62,21 +62,21 @@
         <dependency>autodoc
 
         # Build requirements go here:
-
+
         # <auto-index>on (or off) one turns on (or off) indexing:
         <auto-index>on
-
+
         # Turns on (or off) auto-index-verbose for diagnostic info.
         # This is highly recommended until you have got all the many details correct!
         <auto-index-verbose>on
-
+
         # Choose the indexing method (separately for html and PDF) - see manual.
         # Choose indexing method for PDFs:
         <format>pdf:<auto-index-internal>off
-
+
         # Choose indexing method for html:
         <format>html:<auto-index-internal>on
-
+
         # Set the name of the script file to use (index.idx is popular):
         <auto-index-script>$(here)/index.idx
         # Commands in the script file should all use RELATIVE PATHS

Modified: branches/release/libs/intrusive/doc/intrusive.qbk
==============================================================================
--- branches/release/libs/intrusive/doc/intrusive.qbk (original)
+++ branches/release/libs/intrusive/doc/intrusive.qbk 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,5 +1,5 @@
 [/
- / Copyright (c) 2006-2011 Ion Gaztanaga
+ / Copyright (c) 2006-2012 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)
@@ -8,7 +8,7 @@
 [library Boost.Intrusive
     [quickbook 1.4]
     [authors [Krzikalla, Olaf], [Gaztanaga, Ion]]
- [copyright 2005 Olaf Krzikalla, 2006-2011 Ion Gaztanaga]
+ [copyright 2005 Olaf Krzikalla, 2006-2012 Ion Gaztanaga]
     [id intrusive]
     [dirname intrusive]
     [purpose Intrusive containers]
@@ -262,7 +262,7 @@
    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:
+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
@@ -323,7 +323,7 @@
    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
+* [*`size_type<class SizeType>`]: Specifies an unsigned 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.
@@ -340,28 +340,33 @@
 
    typedef list<Foo> FooList;
 
-Example of a intrusive list with non constant-time size that will store Foo objects:
+Example of an 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):
+Remember that the user must specify the base hook in the container declaration
+if the base hook has no default tag, because that usually means that the type
+has more than one base hook, and a container shall know which hook will be
+using:
 
 [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
+ struct my_tag1;
+ struct my_tag2;
+
+ typedef list_base_hook< tag<my_tag> > BaseHook;
+ typedef list_base_hook< tag<my_tag2> > BaseHook2;
+ class Foo : public BaseHook, public BaseHook2
    { /**/ };
 
- typedef list< Foo, base_hook<BaseHook> > FooList;
+ typedef list< Foo, base_hook<BaseHook> > FooList;
+ typedef list< Foo, base_hook<BaseHook2> > FooList2;
 
 Once the list is defined, we can use it:
 
@@ -400,7 +405,7 @@
    class Foo
    {
       public:
- list_member_hook<> hook_;
+ list_member_hook<> hook_;
       //...
    };
 
@@ -448,7 +453,7 @@
 
 * 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.
 
@@ -508,11 +513,11 @@
 
 [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
+ basic operations that can be applied to a group of `node`s. 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.]]
+[[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. A Hook encapsulates a `node`]]
 [[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.]]
@@ -543,7 +548,7 @@
    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
+ 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.
@@ -584,12 +589,12 @@
 
 Apart from that, [*Boost.Intrusive] offers additional features:
 
-* [*Safe mode hooks]: Hook constructor initializes the internal data to a well-known
+* [*Safe mode hooks]: Hook constructor initializes the internal `node` 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.
+ container using that hook. When erasing an element from the container, the container
+ puts the `node` of 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
@@ -734,7 +739,7 @@
 auto-unlink hook's value_traits, you will get a static assertion:
 
 [c++]
-
+
    #include <boost/intrusive/list.hpp>
 
    using boost::intrusive;
@@ -2169,7 +2174,7 @@
 
    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.
@@ -2178,7 +2183,7 @@
    `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.
@@ -2315,11 +2320,11 @@
 
 Not every smart pointer is compatible with [*Boost.Intrusive]:
 
- * It must be compatible with C++11 [@http://en.cppreference.com/w/cpp/memory/pointer_traits `std::pointer_traits`]
- requirements. [*Boost.Intrusive] uses its own [classref boost::intrusive::pointer_traits pointer_traits]
- class to implement those features in both C++11 and C++03 compilers.
- * 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.
+* It must be compatible with C++11 [@http://en.cppreference.com/w/cpp/memory/pointer_traits `std::pointer_traits`]
+ requirements. [*Boost.Intrusive] uses its own [classref boost::intrusive::pointer_traits pointer_traits]
+ class to implement those features in both C++11 and C++03 compilers.
+* 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 will be implemented as a recursive call to
 `operator->()` until the function returns a raw pointer.
@@ -2431,7 +2436,7 @@
    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'
+ the needed interface. As an example, here is a class that implements operations
    to manage a group of nodes forming a circular singly linked list:
 
 [c++]
@@ -2484,18 +2489,18 @@
       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_; }
+ { 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; }
+ { n->next_ = next; }
    };
 
 
@@ -2584,7 +2589,7 @@
    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.
+ 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
@@ -3111,23 +3116,23 @@
 * [*['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::intrusive::pointer_traits` (portable implementation of C++11
    `std::pointer_traits`) or `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>`.
-
+
 * [*['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:
@@ -3188,13 +3193,13 @@
 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:
@@ -3373,7 +3378,7 @@
 
    //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
@@ -3824,6 +3829,18 @@
 
 [section:release_notes Release Notes]
 
+[section:release_notes_boost_1_51_00 Boost 1.51 Release]
+
+* Fixed bugs
+ [@https://svn.boost.org/trac/boost/ticket/6841 #6841],
+ [@https://svn.boost.org/trac/boost/ticket/6907 #6907],
+ [@https://svn.boost.org/trac/boost/ticket/6922 #6922],
+ [@https://svn.boost.org/trac/boost/ticket/7033 #7033],
+
+* Added `bounded_range` function to trees.
+
+[endsect]
+
 [section:release_notes_boost_1_49_00 Boost 1.49 Release]
 
 * Fixed bugs

Modified: branches/release/libs/intrusive/example/Jamfile.v2
==============================================================================
--- branches/release/libs/intrusive/example/Jamfile.v2 (original)
+++ branches/release/libs/intrusive/example/Jamfile.v2 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 # Boost Intrusive Library Example Jamfile
 
-# (C) Copyright Ion Gaztanaga 2006-2007.
+# (C) Copyright Ion Gaztanaga 2006-2012.
 # 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)

Modified: branches/release/libs/intrusive/example/doc_advanced_value_traits.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_advanced_value_traits.cpp (original)
+++ branches/release/libs/intrusive/example/doc_advanced_value_traits.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -26,7 +26,7 @@
 class base_1{};
 class base_2{};
 
-struct value_1 : public base_1, public simple_node
+struct value_1 : public base_1, public simple_node
 { int id_; };
 
 struct value_2 : public base_1, public base_2, public simple_node
@@ -38,10 +38,10 @@
    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; }
+ 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

Modified: branches/release/libs/intrusive/example/doc_advanced_value_traits2.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_advanced_value_traits2.cpp (original)
+++ branches/release/libs/intrusive/example/doc_advanced_value_traits2.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -26,17 +26,17 @@
    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; }
+ 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
+struct value_1 : public base_1, public simple_node
 {
    int id_;
    simple_node node_;

Modified: branches/release/libs/intrusive/example/doc_any_hook.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_any_hook.cpp (original)
+++ branches/release/libs/intrusive/example/doc_any_hook.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2008
+// (C) Copyright Ion Gaztanaga 2008-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_assoc_optimized_code.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_assoc_optimized_code.cpp (original)
+++ branches/release/libs/intrusive/example/doc_assoc_optimized_code.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -20,7 +20,7 @@
 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;
@@ -31,7 +31,7 @@
 {
    std::string key_;
    // Other members...
-
+
    public:
    Expensive(const char *key)
       : key_(key)

Modified: branches/release/libs/intrusive/example/doc_auto_unlink.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_auto_unlink.cpp (original)
+++ branches/release/libs/intrusive/example/doc_auto_unlink.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_avl_set.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_avl_set.cpp (original)
+++ branches/release/libs/intrusive/example/doc_avl_set.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -55,7 +55,7 @@
 
    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

Modified: branches/release/libs/intrusive/example/doc_avltree_algorithms.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_avltree_algorithms.cpp (original)
+++ branches/release/libs/intrusive/example/doc_avltree_algorithms.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -32,13 +32,13 @@
    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 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; }
@@ -72,7 +72,7 @@
 
    //Now go to the next node
    n = algo::next_node(n);
- assert(n == &three);
+ assert(n == &three);
 
    //Erase a node just using a pointer to it
    algo::unlink(&two);

Modified: branches/release/libs/intrusive/example/doc_bucket_traits.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_bucket_traits.cpp (original)
+++ branches/release/libs/intrusive/example/doc_bucket_traits.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_clone_from.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_clone_from.cpp (original)
+++ branches/release/libs/intrusive/example/doc_clone_from.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_entity.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_entity.cpp (original)
+++ branches/release/libs/intrusive/example/doc_entity.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -45,7 +45,7 @@
 {
    // entity's destructor removes itself from the global list implicitly
    while (!global_list.empty())
- delete &global_list.front();
+ delete &global_list.front();
 }
 
 int main()

Modified: branches/release/libs/intrusive/example/doc_erasing_and_disposing.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_erasing_and_disposing.cpp (original)
+++ branches/release/libs/intrusive/example/doc_erasing_and_disposing.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_external_value_traits.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_external_value_traits.cpp (original)
+++ branches/release/libs/intrusive/example/doc_external_value_traits.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_function_hooks.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_function_hooks.cpp (original)
+++ branches/release/libs/intrusive/example/doc_function_hooks.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2010-2010
+// (C) Copyright Ion Gaztanaga 2010-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_how_to_use.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_how_to_use.cpp (original)
+++ branches/release/libs/intrusive/example/doc_how_to_use.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_iterator_from_value.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_iterator_from_value.cpp (original)
+++ branches/release/libs/intrusive/example/doc_iterator_from_value.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_list.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_list.cpp (original)
+++ branches/release/libs/intrusive/example/doc_list.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_list_algorithms.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_list_algorithms.cpp (original)
+++ branches/release/libs/intrusive/example/doc_list_algorithms.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -25,10 +25,10 @@
    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; }
+ 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()

Modified: branches/release/libs/intrusive/example/doc_offset_ptr.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_offset_ptr.cpp (original)
+++ branches/release/libs/intrusive/example/doc_offset_ptr.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2011
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_positional_insertion.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_positional_insertion.cpp (original)
+++ branches/release/libs/intrusive/example/doc_positional_insertion.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2009-2009
+// (C) Copyright Ion Gaztanaga 2009-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_rbtree_algorithms.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_rbtree_algorithms.cpp (original)
+++ branches/release/libs/intrusive/example/doc_rbtree_algorithms.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -31,13 +31,13 @@
    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 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); }
@@ -70,7 +70,7 @@
 
    //Now go to the next node
    n = algo::next_node(n);
- assert(n == &three);
+ assert(n == &three);
 
    //Erase a node just using a pointer to it
    algo::unlink(&two);

Modified: branches/release/libs/intrusive/example/doc_recursive.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_recursive.cpp (original)
+++ branches/release/libs/intrusive/example/doc_recursive.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_recursive_member.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_recursive_member.cpp (original)
+++ branches/release/libs/intrusive/example/doc_recursive_member.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2010-2010
+// (C) Copyright Ion Gaztanaga 2010-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_set.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_set.cpp (original)
+++ branches/release/libs/intrusive/example/doc_set.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -55,7 +55,7 @@
 
    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

Modified: branches/release/libs/intrusive/example/doc_sg_set.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_sg_set.cpp (original)
+++ branches/release/libs/intrusive/example/doc_sg_set.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -56,7 +56,7 @@
 
    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);

Modified: branches/release/libs/intrusive/example/doc_slist.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_slist.cpp (original)
+++ branches/release/libs/intrusive/example/doc_slist.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_slist_algorithms.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_slist_algorithms.cpp (original)
+++ branches/release/libs/intrusive/example/doc_slist_algorithms.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -25,8 +25,8 @@
    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_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()

Modified: branches/release/libs/intrusive/example/doc_splay_algorithms.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_splay_algorithms.cpp (original)
+++ branches/release/libs/intrusive/example/doc_splay_algorithms.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -31,12 +31,12 @@
    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; }
+ 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
@@ -66,7 +66,7 @@
 
    //Now go to the next node
    n = algo::next_node(n);
- assert(n == &three);
+ assert(n == &three);
 
    //Erase a node just using a pointer to it
    algo::unlink(&two);

Modified: branches/release/libs/intrusive/example/doc_splay_set.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_splay_set.cpp (original)
+++ branches/release/libs/intrusive/example/doc_splay_set.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -20,7 +20,7 @@
 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_;
 

Modified: branches/release/libs/intrusive/example/doc_splaytree_algorithms.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_splaytree_algorithms.cpp (original)
+++ branches/release/libs/intrusive/example/doc_splaytree_algorithms.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -30,12 +30,12 @@
    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; }
+ 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
@@ -65,7 +65,7 @@
 
    //Now go to the next node
    n = algo::next_node(n);
- assert(n == &three);
+ assert(n == &three);
 
    //Erase a node just using a pointer to it
    algo::unlink(&two);

Modified: branches/release/libs/intrusive/example/doc_stateful_value_traits.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_stateful_value_traits.cpp (original)
+++ branches/release/libs/intrusive/example/doc_stateful_value_traits.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_treap_algorithms.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_treap_algorithms.cpp (original)
+++ branches/release/libs/intrusive/example/doc_treap_algorithms.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -31,12 +31,12 @@
    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; }
+ 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
@@ -66,7 +66,7 @@
 
    //Now go to the next node
    n = algo::next_node(n);
- assert(n == &three);
+ assert(n == &three);
 
    //Erase a node just using a pointer to it
    algo::unlink(&two, node_ptr_priority());

Modified: branches/release/libs/intrusive/example/doc_treap_set.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_treap_set.cpp (original)
+++ branches/release/libs/intrusive/example/doc_treap_set.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -70,7 +70,7 @@
 
    BaseSet baseset;
    MemberMultiset membermultiset;
-
+
    //Now insert them in the sets
    for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
       baseset.insert(*it);

Modified: branches/release/libs/intrusive/example/doc_unordered_set.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_unordered_set.cpp (original)
+++ branches/release/libs/intrusive/example/doc_unordered_set.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/example/doc_value_traits.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_value_traits.cpp (original)
+++ branches/release/libs/intrusive/example/doc_value_traits.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -39,10 +39,10 @@
    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; }
+ 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,

Modified: branches/release/libs/intrusive/example/doc_window.cpp
==============================================================================
--- branches/release/libs/intrusive/example/doc_window.cpp (original)
+++ branches/release/libs/intrusive/example/doc_window.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/perf/Jamfile.v2
==============================================================================
--- branches/release/libs/intrusive/perf/Jamfile.v2 (original)
+++ branches/release/libs/intrusive/perf/Jamfile.v2 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 # Boost Intrusive Library Performance test Jamfile
 
-# (C) Copyright Ion Gaztanaga 2006-2007.
+# (C) Copyright Ion Gaztanaga 2006-2012.
 # 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)

Modified: branches/release/libs/intrusive/perf/perf_list.cpp
==============================================================================
--- branches/release/libs/intrusive/perf/perf_list.cpp (original)
+++ branches/release/libs/intrusive/perf/perf_list.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/proj/vc7ide/to-do.txt
==============================================================================
--- branches/release/libs/intrusive/proj/vc7ide/to-do.txt (original)
+++ branches/release/libs/intrusive/proj/vc7ide/to-do.txt 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -18,6 +18,8 @@
 -> Take all pointers by const reference to optimize shared memory pointers
 -> Return pointers by const reference if node traits return them by const reference to optimize shared memory pointers
 -> Detect call signatures by has_member_function_callable_with instead of exact match to allow taking by const reference
+-> Optimize operations taking const_node_pointer using template parameters and SFINAE to allow node_ptr
+
 
 
 The article explains it quite well: Linear Hashing The cost of hash table expansion is spread out across each hash table insertion operation, as opposed to being incurred all at once. Linear hashing is therefore well suited for interactive applications.
@@ -31,3 +33,4 @@
 Now, intrusive containers don't allocate memory at all, so incremental rehashing must be trigered by the user using
 "incremental_rehash(bool)" (use an additional bucket, that is, incremental rehash) and "incremental_rehash(bucket_traits)" (to update the new bucket array with an array that should be twice/half the size of the previous one). I admit that this is not explained at all with an example, so I will note this issue in my to do list.
 
+Review throwing conditions in trees. Searches say nothrow, but if comparison throws the function will throw.
\ No newline at end of file

Modified: branches/release/libs/intrusive/test/any_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/any_test.cpp (original)
+++ branches/release/libs/intrusive/test/any_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/avl_multiset_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/avl_multiset_test.cpp (original)
+++ branches/release/libs/intrusive/test/avl_multiset_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/avl_set_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/avl_set_test.cpp (original)
+++ branches/release/libs/intrusive/test/avl_set_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/common_functors.hpp
==============================================================================
--- branches/release/libs/intrusive/test/common_functors.hpp (original)
+++ branches/release/libs/intrusive/test/common_functors.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/custom_bucket_traits_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/custom_bucket_traits_test.cpp (original)
+++ branches/release/libs/intrusive/test/custom_bucket_traits_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/default_hook_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/default_hook_test.cpp (original)
+++ branches/release/libs/intrusive/test/default_hook_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/external_value_traits_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/external_value_traits_test.cpp (original)
+++ branches/release/libs/intrusive/test/external_value_traits_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/function_hook_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/function_hook_test.cpp (original)
+++ branches/release/libs/intrusive/test/function_hook_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2010-2010
+// (C) Copyright Ion Gaztanaga 2010-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/generic_assoc_test.hpp
==============================================================================
--- branches/release/libs/intrusive/test/generic_assoc_test.hpp (original)
+++ branches/release/libs/intrusive/test/generic_assoc_test.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -41,6 +41,36 @@
    static const bool value = false;
 };
 
+template<class T>
+struct has_const_searches
+{
+ static const bool value = true;
+};
+
+template<class T, bool = has_const_searches<T>::value>
+struct search_const_iterator
+{
+ typedef typename T::const_iterator type;
+};
+
+template<class T>
+struct search_const_iterator<T, false>
+{
+ typedef typename T::iterator type;
+};
+
+template<class T, bool = has_const_searches<T>::value>
+struct search_const_container
+{
+ typedef const T type;
+};
+
+template<class T>
+struct search_const_container<T, false>
+{
+ typedef T type;
+};
+
 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
 {
@@ -134,7 +164,7 @@
       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){
@@ -396,7 +426,7 @@
    {
       assoc_type testset;
       typedef typename std::vector<value_type>::iterator vec_iterator;
-
+
       for(vec_iterator it(--values.end()); true; --it){
          testset.push_front(*it);
        if(it == values.begin()){

Modified: branches/release/libs/intrusive/test/generic_multiset_test.hpp
==============================================================================
--- branches/release/libs/intrusive/test/generic_multiset_test.hpp (original)
+++ branches/release/libs/intrusive/test/generic_multiset_test.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -92,7 +92,7 @@
    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]));
 }
@@ -127,8 +127,8 @@
 
    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)
@@ -165,7 +165,7 @@
 
    { 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>
@@ -191,7 +191,7 @@
    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>
@@ -205,21 +205,79 @@
       , constant_time_size<value_type::constant_time_size>
>::type multiset_type;
    multiset_type testset (values.begin(), values.end());
- typedef typename multiset_type::iterator iterator;
+ typedef typename multiset_type::iterator iterator;
+ typedef typename multiset_type::const_iterator const_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);
+ {
+ 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());
+ cmp_val.value_ = 7;
+ BOOST_TEST (testset.find (cmp_val) == testset.end());
+ }
+ { //1, 2, 2, 3, 4, 5
+ typename search_const_container<multiset_type>::type &const_testset = testset;
+ std::pair<iterator,iterator> range;
+ std::pair<typename search_const_iterator<multiset_type>::type
+ ,typename search_const_iterator<multiset_type>::type> const_range;
+ value_type cmp_val_lower, cmp_val_upper;
+ {
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 2;
+ //left-closed, right-closed
+ std::pair<iterator,iterator> range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
+ BOOST_TEST (range.first->value_ == 1);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 3);
+ }
+ {
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 2;
+ const_range = const_testset.bounded_range (cmp_val_lower, cmp_val_upper, true, false);
+ BOOST_TEST (const_range.first->value_ == 1);
+ BOOST_TEST (const_range.second->value_ == 2);
+ BOOST_TEST (std::distance (const_range.first, const_range.second) == 1);
+
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 3;
+ range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, false);
+ BOOST_TEST (range.first->value_ == 1);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 3);
+ }
+ {
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 2;
+ const_range = const_testset.bounded_range (cmp_val_lower, cmp_val_upper, false, true);
+ BOOST_TEST (const_range.first->value_ == 2);
+ BOOST_TEST (const_range.second->value_ == 3);
+ BOOST_TEST (std::distance (const_range.first, const_range.second) == 2);
+ }
+ {
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 2;
+ range = testset.bounded_range (cmp_val_lower, cmp_val_upper, false, false);
+ BOOST_TEST (range.first->value_ == 2);
+ BOOST_TEST (range.second->value_ == 2);
+ BOOST_TEST (std::distance (range.first, range.second) == 0);
+ }
+ {
+ cmp_val_lower.value_ = 5;
+ cmp_val_upper.value_ = 6;
+ const_range = const_testset.bounded_range (cmp_val_lower, cmp_val_upper, true, false);
+ BOOST_TEST (const_range.first->value_ == 5);
+ BOOST_TEST (const_range.second == const_testset.end());
+ BOOST_TEST (std::distance (const_range.first, const_range.second) == 1);
+ }
+ }
 }
 
 }}} //namespace boost::intrusive::test

Modified: branches/release/libs/intrusive/test/generic_set_test.hpp
==============================================================================
--- branches/release/libs/intrusive/test/generic_set_test.hpp (original)
+++ branches/release/libs/intrusive/test/generic_set_test.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -103,7 +103,7 @@
    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]));
 }
@@ -137,8 +137,8 @@
       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)
@@ -263,9 +263,9 @@
    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):
+//test: find, equal_range (lower_bound, upper_bound), bounded_range:
 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)
 {
@@ -276,21 +276,80 @@
       , constant_time_size<value_type::constant_time_size>
>::type set_type;
    set_type testset (values.begin(), values.end());
- typedef typename set_type::iterator iterator;
+ typedef typename set_type::iterator iterator;
+ typedef typename set_type::const_iterator const_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);
+ {
+ 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());
+ cmp_val.value_ = 7;
+ BOOST_TEST (testset.find (cmp_val) == testset.end());
+ }
+
+ {
+ typename search_const_container<set_type>::type &const_testset = testset;
+ std::pair<iterator,iterator> range;
+ std::pair<typename search_const_iterator<set_type>::type
+ ,typename search_const_iterator<set_type>::type> const_range;
+ value_type cmp_val_lower, cmp_val_upper;
+ {
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 2;
+ //left-closed, right-closed
+ std::pair<iterator,iterator> range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
+ BOOST_TEST (range.first->value_ == 1);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 2);
+ }
+ {
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 2;
+ const_range = const_testset.bounded_range (cmp_val_lower, cmp_val_upper, true, false);
+ BOOST_TEST (const_range.first->value_ == 1);
+ BOOST_TEST (const_range.second->value_ == 2);
+ BOOST_TEST (std::distance (const_range.first, const_range.second) == 1);
+
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 3;
+ range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, false);
+ BOOST_TEST (range.first->value_ == 1);
+ BOOST_TEST (range.second->value_ == 3);
+ BOOST_TEST (std::distance (range.first, range.second) == 2);
+ }
+ {
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 2;
+ const_range = const_testset.bounded_range (cmp_val_lower, cmp_val_upper, false, true);
+ BOOST_TEST (const_range.first->value_ == 2);
+ BOOST_TEST (const_range.second->value_ == 3);
+ BOOST_TEST (std::distance (const_range.first, const_range.second) == 1);
+ }
+ {
+ cmp_val_lower.value_ = 1;
+ cmp_val_upper.value_ = 2;
+ range = testset.bounded_range (cmp_val_lower, cmp_val_upper, false, false);
+ BOOST_TEST (range.first->value_ == 2);
+ BOOST_TEST (range.second->value_ == 2);
+ BOOST_TEST (std::distance (range.first, range.second) == 0);
+ }
+ {
+ cmp_val_lower.value_ = 5;
+ cmp_val_upper.value_ = 6;
+ const_range = const_testset.bounded_range (cmp_val_lower, cmp_val_upper, true, false);
+ BOOST_TEST (const_range.first->value_ == 5);
+ BOOST_TEST (const_range.second == const_testset.end());
+ BOOST_TEST (std::distance (const_range.first, const_range.second) == 1);
+ }
+ }
 }
 
 }}} //namespace boost::intrusive::test

Modified: branches/release/libs/intrusive/test/has_member_function_callable_with.cpp
==============================================================================
--- branches/release/libs/intrusive/test/has_member_function_callable_with.cpp (original)
+++ branches/release/libs/intrusive/test/has_member_function_callable_with.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost
 // Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 //
@@ -31,14 +31,14 @@
    private_type const &operator,(int) const;
 };
 
-typedef char yes_type;
+typedef char yes_type;
 struct no_type{ char dummy[2]; };
 
 template<typename T>
 no_type is_private_type(T const &);
 yes_type is_private_type(private_type const &);
 
-}}}}
+}}}}
 
 
 namespace boost{
@@ -123,7 +123,7 @@
 
             template <class U>
             static has_member_function_callable_with::no_type Test(...);
-
+
             static const bool value
                = sizeof(Test< Fun >(0)) == sizeof(has_member_function_callable_with::yes_type);
          };
@@ -186,7 +186,7 @@
                                  );
    };
 
- }}}
+ }}}
 
    namespace boost{
    namespace intrusive{
@@ -216,7 +216,7 @@
                                        )
                                  );
    };
- }}}
+ }}}
 
    namespace boost{
    namespace intrusive{
@@ -308,7 +308,7 @@
 
       template <class U>
       static has_member_function_callable_with::no_type Test(...);
-
+
       static const bool value = sizeof(Test< Fun >(0))
                            == sizeof(has_member_function_callable_with::yes_type);
    };
@@ -460,7 +460,7 @@
    (void)check5;
    (void)check6;
    (void)check7;
- }
+ }
 
    return 0;
 

Modified: branches/release/libs/intrusive/test/itestvalue.hpp
==============================================================================
--- branches/release/libs/intrusive/test/itestvalue.hpp (original)
+++ branches/release/libs/intrusive/test/itestvalue.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -141,7 +141,7 @@
          return v1.value_ < v2.value_;
       else
          return v2.value_ & 1;
- }
+ }
 };
 
 struct is_even
@@ -149,7 +149,7 @@
    template<class Hooks, bool constant_time_size>
    bool operator()
       (const testvalue<Hooks, constant_time_size>& v1) const
- { return (v1.value_ & 1) == 0; }
+ { return (v1.value_ & 1) == 0; }
 };
 /*
 struct int_testvalue_comp

Modified: branches/release/libs/intrusive/test/list_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/list_test.cpp (original)
+++ branches/release/libs/intrusive/test/list_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -114,7 +114,7 @@
 
    testlist.pop_front();
    BOOST_TEST (testlist.empty());
-}
+}
 
 
 //test: constructor, iterator, reverse_iterator, sort, reverse:
@@ -196,7 +196,7 @@
    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>

Modified: branches/release/libs/intrusive/test/make_functions_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/make_functions_test.cpp (original)
+++ branches/release/libs/intrusive/test/make_functions_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/multiset_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/multiset_test.cpp (original)
+++ branches/release/libs/intrusive/test/multiset_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/pointer_traits_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/pointer_traits_test.cpp (original)
+++ branches/release/libs/intrusive/test/pointer_traits_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 //////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2011-2011. Distributed under the Boost
+// (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the 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: branches/release/libs/intrusive/test/recursive_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/recursive_test.cpp (original)
+++ branches/release/libs/intrusive/test/recursive_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2010
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -49,7 +49,7 @@
    list< Foo, base_hook<ListBaseHook> > list_; list_.clear();
    slist< Foo, base_hook<SListBaseHook> > slist_; slist_.clear();
    set< Foo, base_hook<SetBaseHook> > set_; set_.clear();
-
+
    USet::bucket_type buckets[1];
    USet unordered_set_(USet::bucket_traits(buckets, 1)); unordered_set_.clear();
 }

Modified: branches/release/libs/intrusive/test/set_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/set_test.cpp (original)
+++ branches/release/libs/intrusive/test/set_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/sg_multiset_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/sg_multiset_test.cpp (original)
+++ branches/release/libs/intrusive/test/sg_multiset_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/sg_set_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/sg_set_test.cpp (original)
+++ branches/release/libs/intrusive/test/sg_set_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/slist_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/slist_test.cpp (original)
+++ branches/release/libs/intrusive/test/slist_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -106,7 +106,7 @@
> 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]);
@@ -114,11 +114,11 @@
    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());
 }
@@ -241,8 +241,8 @@
    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>
@@ -374,7 +374,7 @@
          testlist.clear();
       }
    }
-}
+}
 
 //test: insert_after (seq-version), swap, splice_after:
 template<class ValueTraits, bool Linear, bool CacheLast>
@@ -476,7 +476,7 @@
       { int init_values [] = { 1 };
          TEST_INTRUSIVE_SEQUENCE( init_values, testlist1.begin() ); }
    }
-}
+}
 
 template<class ValueTraits, bool Linear, bool CacheLast>
 void test_slist<ValueTraits, Linear, CacheLast>

Modified: branches/release/libs/intrusive/test/smart_ptr.hpp
==============================================================================
--- branches/release/libs/intrusive/test/smart_ptr.hpp (original)
+++ branches/release/libs/intrusive/test/smart_ptr.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -113,18 +113,6 @@
       : m_ptr(0)
    {}
 
-/*
- //!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)
@@ -139,52 +127,20 @@
    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.m_ptr))
- {}
 
- //!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.m_ptr))
- {}
-
- //!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.m_ptr))
- {}
-
- //!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.m_ptr))
- {}
-
- //!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
+ pointer operator->() const
    { return m_ptr; }
 
    //!Dereferencing operator, if it is a null smart_ptr behavior
    //! is undefined. Never throws.
- reference operator* () const
+ reference operator* () const
    { return *m_ptr; }
 
    //!Indexing operator. Never throws.
- reference operator[](std::ptrdiff_t idx) const
+ reference operator[](std::ptrdiff_t idx) const
    { return m_ptr[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; }
@@ -196,7 +152,7 @@
    { m_ptr = pt.m_ptr; return *this; }
 
    //!smart_ptr + std::ptrdiff_t. Never throws.
- smart_ptr operator+ (std::ptrdiff_t offset) const
+ smart_ptr operator+ (std::ptrdiff_t offset) const
    { smart_ptr s; s.m_ptr = m_ptr + offset; return s; }
 
    //!smart_ptr - std::ptrdiff_t. Never throws.
@@ -228,21 +184,13 @@
    { smart_ptr temp(*this); --*this; return temp; }
 
    //!safe bool conversion operator. Never throws.
- operator unspecified_bool_type() const
+ operator unspecified_bool_type() const
    { return m_ptr? &self_t::unspecified_bool_type_func : 0; }
 
    //!Not operator. Not needed in theory, but improves portability.
    //!Never throws.
    bool operator! () const
    { return m_ptr == 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.
@@ -293,12 +241,12 @@
    (std::basic_istream<E, T> & os, smart_ptr<Y> & p)
 { Y * tmp; return os >> tmp; p = tmp; }
 
-//!std::ptrdiff_t + smart_ptr
+//!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
+//!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.operator->()- pt2.operator->(); }
@@ -307,7 +255,7 @@
 template<class T>
 inline void swap (smart_ptr<T> &pt,
                   smart_ptr<T> &pt2)
-{
+{
    typename smart_ptr<T>::value_type *ptr = pt.operator->();
    pt = pt2;
    pt2 = ptr;
@@ -317,32 +265,32 @@
 template<class T, class U>
 inline smart_ptr<T>
    static_pointer_cast(const smart_ptr<U> & r)
-{
- return smart_ptr<T>(r, detail::static_cast_tag());
+{
+ 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());
+{
+ 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());
+ (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());
+{
+ return smart_ptr<T>(r, detail::reinterpret_cast_tag());
 }
 
 } //namespace intrusive {

Modified: branches/release/libs/intrusive/test/splay_multiset_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/splay_multiset_test.cpp (original)
+++ branches/release/libs/intrusive/test/splay_multiset_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -68,6 +68,23 @@
    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_const_searches<boost::intrusive::splay_multiset<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = false;
+};
+
+
 }}}
 
 using namespace boost::intrusive;

Modified: branches/release/libs/intrusive/test/splay_set_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/splay_set_test.cpp (original)
+++ branches/release/libs/intrusive/test/splay_set_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007.
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -65,6 +65,22 @@
    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_const_searches<boost::intrusive::splay_set<T,
+ #if !defined (BOOST_INTRUSIVE_VARIADIC_TEMPLATES)
+ O1, O2, O3, O4
+ #else
+ Options...
+ #endif
+> >
+{
+ static const bool value = false;
+};
+
 }}}
 
 using namespace boost::intrusive;

Modified: branches/release/libs/intrusive/test/stateful_value_traits_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/stateful_value_traits_test.cpp (original)
+++ branches/release/libs/intrusive/test/stateful_value_traits_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/test_container.hpp
==============================================================================
--- branches/release/libs/intrusive/test/test_container.hpp (original)
+++ branches/release/libs/intrusive/test/test_container.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2011
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -247,7 +247,7 @@
       {
          BOOST_TEST( c.find(*di) != c.end() );
       }
-
+
       typename Data::const_iterator db = d.begin();
       typename Data::const_iterator da = db++;
 

Modified: branches/release/libs/intrusive/test/test_macros.hpp
==============================================================================
--- branches/release/libs/intrusive/test/test_macros.hpp (original)
+++ branches/release/libs/intrusive/test/test_macros.hpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009
+// (C) Copyright Ion Gaztanaga 2006-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/treap_multiset_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/treap_multiset_test.cpp (original)
+++ branches/release/libs/intrusive/test/treap_multiset_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/treap_set_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/treap_set_test.cpp (original)
+++ branches/release/libs/intrusive/test/treap_set_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at

Modified: branches/release/libs/intrusive/test/unordered_multiset_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/unordered_multiset_test.cpp (original)
+++ branches/release/libs/intrusive/test/unordered_multiset_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -157,7 +157,7 @@
    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]));
 }
@@ -194,7 +194,7 @@
    }
    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>
@@ -231,7 +231,7 @@
 
          i = testset.insert (values[0]);
          BOOST_TEST (&*i == &values[0]);
-
+
          i = testset.iterator_to (values[2]);
          BOOST_TEST (&*i == &values[2]);
          testset.erase(i);
@@ -275,7 +275,7 @@
 
          i = testset.insert (values[0]);
          BOOST_TEST (&*i == &values[0]);
-
+
          i = testset.iterator_to (values[2]);
          BOOST_TEST (&*i == &values[2]);
          testset.erase(i);
@@ -442,7 +442,7 @@
       // BOOST_TEST (&testset1.front() == &values[3]);
       BOOST_TEST (&*testset1.begin() == &values[3]);
    }
-}
+}
 
 
 
@@ -651,7 +651,7 @@
    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>
@@ -682,7 +682,7 @@
    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);

Modified: branches/release/libs/intrusive/test/unordered_set_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/unordered_set_test.cpp (original)
+++ branches/release/libs/intrusive/test/unordered_set_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 //
 // (C) Copyright Olaf Krzikalla 2004-2006.
-// (C) Copyright Ion Gaztanaga 2006-2009.
+// (C) Copyright Ion Gaztanaga 2006-2012.
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -188,11 +188,11 @@
       { 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>::
@@ -251,7 +251,7 @@
       { 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>
@@ -299,7 +299,7 @@
       BOOST_TEST (testset1.size() == 1);
       BOOST_TEST (&*testset1.begin() == &values[3]);
    }
-}
+}
 
 //test: rehash:
 template<class ValueTraits, bool CacheBegin, bool CompareHash, bool Incremental>
@@ -507,7 +507,7 @@
    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):
@@ -538,7 +538,7 @@
    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);

Modified: branches/release/libs/intrusive/test/virtual_base_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/virtual_base_test.cpp (original)
+++ branches/release/libs/intrusive/test/virtual_base_test.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -1,6 +1,6 @@
 /////////////////////////////////////////////////////////////////////////////
 //
-// (C) Copyright Ion Gaztanaga 2007-2009
+// (C) Copyright Ion Gaztanaga 2007-2012
 //
 // Distributed under the Boost Software License, Version 1.0.
 // (See accompanying file LICENSE_1_0.txt or copy at
@@ -78,7 +78,7 @@
 
       //Test the objects inserted in the base hook list
       for(; vect_it != vect_itend; ++vect_it, ++list_it)
- if(&*list_it != &*vect_it)
+ if(&*list_it != &*vect_it)
             return 1;
    }
 

Modified: branches/release/libs/move/doc/move.qbk
==============================================================================
--- branches/release/libs/move/doc/move.qbk (original)
+++ branches/release/libs/move/doc/move.qbk 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -787,6 +787,14 @@
 
 [section:release_notes Release Notes]
 
+[section:release_notes_boost_1_51_00 Boost 1.51 Release]
+
+* Fixed bugs
+ [@https://svn.boost.org/trac/boost/ticket/7095 #7095],
+ [@https://svn.boost.org/trac/boost/ticket/7031 #7031].
+
+[endsect]
+
 [section:release_notes_boost_1_49_00 Boost 1.49 Release]
 
 * Fixed bugs

Modified: branches/release/libs/move/test/back_move_inserter.cpp
==============================================================================
--- branches/release/libs/move/test/back_move_inserter.cpp (original)
+++ branches/release/libs/move/test/back_move_inserter.cpp 2012-07-16 05:08:27 EDT (Mon, 16 Jul 2012)
@@ -17,29 +17,42 @@
 template<class Container>
 int move_test()
 {
- //Default construct 10 movable objects
- Container v(10);
-
- //Test default constructed value
- if(v.begin()->moved()){
- return 1;
- }
-
- //Move values
- Container v2;
- std::copy(v.begin(), v.end(), boost::back_move_inserter(v2));
-
- //Test values have been moved
- if(!v.begin()->moved()){
- return 1;
- }
-
- if(v2.size() != 10){
- return 1;
- }
-
- if(v2.begin()->moved()){
- return 1;
+ bool use_move_iterator = false;
+ bool done = false;
+ while(!done){
+ //Default construct 10 movable objects
+ Container v(10);
+
+ //Test default constructed value
+ if(v.begin()->moved()){
+ return 1;
+ }
+
+ //Move values
+ Container v2;
+ if(use_move_iterator){
+ ::boost::copy_or_move( boost::make_move_iterator(v.begin())
+ , boost::make_move_iterator(v.end())
+ , boost::back_move_inserter(v2));
+ }
+ else{
+ std::copy(v.begin(), v.end(), boost::back_move_inserter(v2));
+ }
+
+ //Test values have been moved
+ if(!v.begin()->moved()){
+ return 1;
+ }
+
+ if(v2.size() != 10){
+ return 1;
+ }
+
+ if(v2.begin()->moved()){
+ return 1;
+ }
+ done = use_move_iterator;
+ use_move_iterator = true;
    }
    return 0;
 }


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